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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
228,400 | tightenco/laravel-elm | src/Elm.php | Elm.make | public function make($app_name, $flags = [])
{
ob_start(); ?>
<div id="<?= $app_name ?>"></div>
<script>
window.addEventListener('load', function () {
<?php if (!empty($flags)) : ?>
Elm.<?= $app_name ?>.embed(
document.getElementById('<?= $ap... | php | public function make($app_name, $flags = [])
{
ob_start(); ?>
<div id="<?= $app_name ?>"></div>
<script>
window.addEventListener('load', function () {
<?php if (!empty($flags)) : ?>
Elm.<?= $app_name ?>.embed(
document.getElementById('<?= $ap... | [
"public",
"function",
"make",
"(",
"$",
"app_name",
",",
"$",
"flags",
"=",
"[",
"]",
")",
"{",
"ob_start",
"(",
")",
";",
"?>\n\n <div id=\"<?=",
"$",
"app_name",
"?>\"></div>\n\n <script>\n window.addEventListener('load', function () {\n <?... | Bind the given array of variables to the elm program,
render the script include,
and return the html. | [
"Bind",
"the",
"given",
"array",
"of",
"variables",
"to",
"the",
"elm",
"program",
"render",
"the",
"script",
"include",
"and",
"return",
"the",
"html",
"."
] | b1b1a8c0ab799178ef0f7e4e5e8d38e2c94eb671 | https://github.com/tightenco/laravel-elm/blob/b1b1a8c0ab799178ef0f7e4e5e8d38e2c94eb671/src/Elm.php#L16-L38 |
228,401 | antaresproject/core | src/components/console/src/Schedule.php | Schedule.rejectCommand | public function rejectCommand($command)
{
$binary = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));
if (defined('HHVM_VERSION')) {
$binary .= ' --php';
}
if (defined('ARTISAN_BINARY')) {
$artisan = ProcessUtils::escapeArgument(ARTISAN_BI... | php | public function rejectCommand($command)
{
$binary = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));
if (defined('HHVM_VERSION')) {
$binary .= ' --php';
}
if (defined('ARTISAN_BINARY')) {
$artisan = ProcessUtils::escapeArgument(ARTISAN_BI... | [
"public",
"function",
"rejectCommand",
"(",
"$",
"command",
")",
"{",
"$",
"binary",
"=",
"ProcessUtils",
"::",
"escapeArgument",
"(",
"(",
"new",
"PhpExecutableFinder",
")",
"->",
"find",
"(",
"false",
")",
")",
";",
"if",
"(",
"defined",
"(",
"'HHVM_VERS... | reject Artisan command
@param string $command
@return \Illuminate\Console\Scheduling\Event | [
"reject",
"Artisan",
"command"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/console/src/Schedule.php#L37-L50 |
228,402 | antaresproject/core | src/components/extension/src/Config/SettingsFormBuilder.php | SettingsFormBuilder.build | public function build(ExtensionModel $model, SettingsFormContract $settingsForm, SettingsContract $settings)
{
return $this->formFactory->make(function(FormGrid $form) use($model, $settingsForm, $settings) {
$url = route(area() . '.modules.viewer.configuration.update', ['id' => $model->g... | php | public function build(ExtensionModel $model, SettingsFormContract $settingsForm, SettingsContract $settings)
{
return $this->formFactory->make(function(FormGrid $form) use($model, $settingsForm, $settings) {
$url = route(area() . '.modules.viewer.configuration.update', ['id' => $model->g... | [
"public",
"function",
"build",
"(",
"ExtensionModel",
"$",
"model",
",",
"SettingsFormContract",
"$",
"settingsForm",
",",
"SettingsContract",
"$",
"settings",
")",
"{",
"return",
"$",
"this",
"->",
"formFactory",
"->",
"make",
"(",
"function",
"(",
"FormGrid",
... | Builds the form for the given extension model and its settings.
@param ExtensionModel $model
@param SettingsFormContract $settingsForm
@param SettingsContract $settings
@return \Antares\Contracts\Html\Builder | [
"Builds",
"the",
"form",
"for",
"the",
"given",
"extension",
"model",
"and",
"its",
"settings",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/Config/SettingsFormBuilder.php#L39-L61 |
228,403 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.beforeTable | protected function beforeTable()
{
$hasMassActions = $this->hasMassActions();
$filters = $this->filterAdapter->getFilters();
$hasColumnFilter = $this->hasColumnFilter();
$params = [];
if (!$hasMassActions and ! $this->searchable and empty($this->selects) and ... | php | protected function beforeTable()
{
$hasMassActions = $this->hasMassActions();
$filters = $this->filterAdapter->getFilters();
$hasColumnFilter = $this->hasColumnFilter();
$params = [];
if (!$hasMassActions and ! $this->searchable and empty($this->selects) and ... | [
"protected",
"function",
"beforeTable",
"(",
")",
"{",
"$",
"hasMassActions",
"=",
"$",
"this",
"->",
"hasMassActions",
"(",
")",
";",
"$",
"filters",
"=",
"$",
"this",
"->",
"filterAdapter",
"->",
"getFilters",
"(",
")",
";",
"$",
"hasColumnFilter",
"=",
... | triggers before table
@return string | [
"triggers",
"before",
"table"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L495-L543 |
228,404 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.addRightCtrls | public function addRightCtrls($rightCtrls = null)
{
if (!is_string($rightCtrls)) {
return $this;
}
$this->rightCtrls = $rightCtrls;
return $this;
} | php | public function addRightCtrls($rightCtrls = null)
{
if (!is_string($rightCtrls)) {
return $this;
}
$this->rightCtrls = $rightCtrls;
return $this;
} | [
"public",
"function",
"addRightCtrls",
"(",
"$",
"rightCtrls",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"rightCtrls",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->",
"rightCtrls",
"=",
"$",
"rightCtrls",
";",
"... | Adds right ctrls container
@param String $rightCtrls
@return $this | [
"Adds",
"right",
"ctrls",
"container"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L551-L558 |
228,405 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.getColumnFilterAdapter | protected function getColumnFilterAdapter()
{
if (is_null($this->columnFilterAdapter)) {
$this->columnFilterAdapter = app(ColumnFilterAdapter::class, [$this->collection, get_class($this->datatable)]);
}
return $this->columnFilterAdapter;
} | php | protected function getColumnFilterAdapter()
{
if (is_null($this->columnFilterAdapter)) {
$this->columnFilterAdapter = app(ColumnFilterAdapter::class, [$this->collection, get_class($this->datatable)]);
}
return $this->columnFilterAdapter;
} | [
"protected",
"function",
"getColumnFilterAdapter",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"columnFilterAdapter",
")",
")",
"{",
"$",
"this",
"->",
"columnFilterAdapter",
"=",
"app",
"(",
"ColumnFilterAdapter",
"::",
"class",
",",
"[",
"... | Gets colum filter adapter instance
@return ColumnFilterAdapter | [
"Gets",
"colum",
"filter",
"adapter",
"instance"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L586-L592 |
228,406 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.setDeferedData | public function setDeferedData()
{
if (request()->has('search')) {
return $this;
}
$totalItemsCount = $this->datatable->count();
$this->deferredData = $this->datatable->ajax()->getData()->data; // dubluje zapytania sql
$filters = $this->datatable->g... | php | public function setDeferedData()
{
if (request()->has('search')) {
return $this;
}
$totalItemsCount = $this->datatable->count();
$this->deferredData = $this->datatable->ajax()->getData()->data; // dubluje zapytania sql
$filters = $this->datatable->g... | [
"public",
"function",
"setDeferedData",
"(",
")",
"{",
"if",
"(",
"request",
"(",
")",
"->",
"has",
"(",
"'search'",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"totalItemsCount",
"=",
"$",
"this",
"->",
"datatable",
"->",
"count",
"(",
")",... | defered data setter
@return $this | [
"defered",
"data",
"setter"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L641-L661 |
228,407 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.containerAttributes | public function containerAttributes(array $attributes = []): Builder
{
foreach ($this->containerAttributes as $name => $value) {
if (is_null($param = array_get($attributes, $name))) {
continue;
}
array_set($this->containerAttributes, $name, $value . ' ' . ... | php | public function containerAttributes(array $attributes = []): Builder
{
foreach ($this->containerAttributes as $name => $value) {
if (is_null($param = array_get($attributes, $name))) {
continue;
}
array_set($this->containerAttributes, $name, $value . ' ' . ... | [
"public",
"function",
"containerAttributes",
"(",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"Builder",
"{",
"foreach",
"(",
"$",
"this",
"->",
"containerAttributes",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
... | Container attributes setter
@param array $attributes
@return $this | [
"Container",
"attributes",
"setter"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L779-L788 |
228,408 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.tableAttributes | public function tableAttributes(array $attributes = array()): Builder
{
array_set($attributes, 'id', array_get($attributes, 'id') . str_random(3));
$this->tableAttributes = array_merge($this->tableAttributes, $attributes);
return $this;
} | php | public function tableAttributes(array $attributes = array()): Builder
{
array_set($attributes, 'id', array_get($attributes, 'id') . str_random(3));
$this->tableAttributes = array_merge($this->tableAttributes, $attributes);
return $this;
} | [
"public",
"function",
"tableAttributes",
"(",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
":",
"Builder",
"{",
"array_set",
"(",
"$",
"attributes",
",",
"'id'",
",",
"array_get",
"(",
"$",
"attributes",
",",
"'id'",
")",
".",
"str_random",
"... | Table attributes setter
@param array $attributes
@return $this | [
"Table",
"attributes",
"setter"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L796-L801 |
228,409 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.addColumn | public function addColumn(array $attributes)
{
$query = $this->getQuery();
$orders = $query instanceof \Illuminate\Database\Eloquent\Builder ? $query->getQuery()->orders : null;
if (!isset($this->attributes['order']) and ! is_null($query) and ! is_null($orders)) {
foreach ($orde... | php | public function addColumn(array $attributes)
{
$query = $this->getQuery();
$orders = $query instanceof \Illuminate\Database\Eloquent\Builder ? $query->getQuery()->orders : null;
if (!isset($this->attributes['order']) and ! is_null($query) and ! is_null($orders)) {
foreach ($orde... | [
"public",
"function",
"addColumn",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getQuery",
"(",
")",
";",
"$",
"orders",
"=",
"$",
"query",
"instanceof",
"\\",
"Illuminate",
"\\",
"Database",
"\\",
"Eloquent",
"\\",
... | Add a column in collection using attributes.
@param array $attributes
@return $this | [
"Add",
"a",
"column",
"in",
"collection",
"using",
"attributes",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L809-L830 |
228,410 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.addMassAction | public function addMassAction($name, Expression $massAction)
{
$model = $this->getQuery()->getModel();
$this->massActions = array_merge($this->massActions, (array)
//event('datatables:' . uri() . ':before.massactions.action.' . $name, [$this->massActions, $model], true)
... | php | public function addMassAction($name, Expression $massAction)
{
$model = $this->getQuery()->getModel();
$this->massActions = array_merge($this->massActions, (array)
//event('datatables:' . uri() . ':before.massactions.action.' . $name, [$this->massActions, $model], true)
... | [
"public",
"function",
"addMassAction",
"(",
"$",
"name",
",",
"Expression",
"$",
"massAction",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getQuery",
"(",
")",
"->",
"getModel",
"(",
")",
";",
"$",
"this",
"->",
"massActions",
"=",
"array_merge",
... | appends mass actions to mass actions container
@param Expression $massAction
@return \Antares\Datatables\Html\Builder | [
"appends",
"mass",
"actions",
"to",
"mass",
"actions",
"container"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L872-L889 |
228,411 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.setDataTable | public function setDataTable($datatable)
{
$this->setQuery($datatable->query());
$this->datatable = $datatable;
return $this;
} | php | public function setDataTable($datatable)
{
$this->setQuery($datatable->query());
$this->datatable = $datatable;
return $this;
} | [
"public",
"function",
"setDataTable",
"(",
"$",
"datatable",
")",
"{",
"$",
"this",
"->",
"setQuery",
"(",
"$",
"datatable",
"->",
"query",
"(",
")",
")",
";",
"$",
"this",
"->",
"datatable",
"=",
"$",
"datatable",
";",
"return",
"$",
"this",
";",
"}... | Defered data setter
@param type $datatable
@return \Antares\Datatables\Html\Builder | [
"Defered",
"data",
"setter"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L938-L943 |
228,412 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.addGroupSelect | public function addGroupSelect($options, $columnIndex = 0, $defaultSelected = null, array $attributes = [])
{
$orderAdapter = app(OrderAdapter::class)->setClassname(get_class($this->datatable));
if (($order = $orderAdapter->getSelected()) !== false) {
$this->parameters([
... | php | public function addGroupSelect($options, $columnIndex = 0, $defaultSelected = null, array $attributes = [])
{
$orderAdapter = app(OrderAdapter::class)->setClassname(get_class($this->datatable));
if (($order = $orderAdapter->getSelected()) !== false) {
$this->parameters([
... | [
"public",
"function",
"addGroupSelect",
"(",
"$",
"options",
",",
"$",
"columnIndex",
"=",
"0",
",",
"$",
"defaultSelected",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"orderAdapter",
"=",
"app",
"(",
"OrderAdapter",
"::"... | Add additional table selects
@param String $html
@return \Antares\Datatables\Html\Builder | [
"Add",
"additional",
"table",
"selects"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L951-L981 |
228,413 | antaresproject/core | src/ui/components/datatables/src/Html/Builder.php | Builder.parameters | public function parameters(array $attributes = [])
{
if (!is_null($defaultOrder = array_get($attributes, 'order'))) {
$orderAdapter = app(OrderAdapter::class)->setClassname(get_class($this->datatable));
if (($order = $orderAdapter->getSelected()) !== false) {
// $attr... | php | public function parameters(array $attributes = [])
{
if (!is_null($defaultOrder = array_get($attributes, 'order'))) {
$orderAdapter = app(OrderAdapter::class)->setClassname(get_class($this->datatable));
if (($order = $orderAdapter->getSelected()) !== false) {
// $attr... | [
"public",
"function",
"parameters",
"(",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"defaultOrder",
"=",
"array_get",
"(",
"$",
"attributes",
",",
"'order'",
")",
")",
")",
"{",
"$",
"orderAdapter",
"=",
... | Configure DataTable's parameters.
@param array $attributes
@return $this | [
"Configure",
"DataTable",
"s",
"parameters",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Html/Builder.php#L989-L1004 |
228,414 | antaresproject/core | src/foundation/src/Http/Resolver/ModuleNamespaceResolver.php | ModuleNamespaceResolver.resolve | public function resolve($matches = [])
{
if (!isset($this->route['controller'])) {
return false;
}
list($controller,) = explode('@', $this->route['controller']);
$fileName = (new ReflectionClass($controller))->getFileName();
$rootPath = substr($fileName, 0, strr... | php | public function resolve($matches = [])
{
if (!isset($this->route['controller'])) {
return false;
}
list($controller,) = explode('@', $this->route['controller']);
$fileName = (new ReflectionClass($controller))->getFileName();
$rootPath = substr($fileName, 0, strr... | [
"public",
"function",
"resolve",
"(",
"$",
"matches",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"route",
"[",
"'controller'",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"list",
"(",
"$",
"controller",
",",
")... | module namespace resolver
@param array $matches
@return String
@throws RuntimeException | [
"module",
"namespace",
"resolver"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Http/Resolver/ModuleNamespaceResolver.php#L107-L127 |
228,415 | antaresproject/core | src/foundation/src/Http/Resolver/ModuleNamespaceResolver.php | ModuleNamespaceResolver.getClear | public function getClear()
{
$return = str_replace(self::$namespacePrefix . '/', '', $this->name);
$exists = array_where(self::$core, function($key) use($return) {
return $return == $key;
});
if (!empty($exists)) {
return self::$registeredForCore;
}
... | php | public function getClear()
{
$return = str_replace(self::$namespacePrefix . '/', '', $this->name);
$exists = array_where(self::$core, function($key) use($return) {
return $return == $key;
});
if (!empty($exists)) {
return self::$registeredForCore;
}
... | [
"public",
"function",
"getClear",
"(",
")",
"{",
"$",
"return",
"=",
"str_replace",
"(",
"self",
"::",
"$",
"namespacePrefix",
".",
"'/'",
",",
"''",
",",
"$",
"this",
"->",
"name",
")",
";",
"$",
"exists",
"=",
"array_where",
"(",
"self",
"::",
"$",... | cleared namespace of module
@return String | [
"cleared",
"namespace",
"of",
"module"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Http/Resolver/ModuleNamespaceResolver.php#L134-L150 |
228,416 | antaresproject/core | src/foundation/src/Http/Resolver/ModuleNamespaceResolver.php | ModuleNamespaceResolver.getController | public function getController($matches = [])
{
if (!isset($this->route['controller'])) {
return false;
}
$controller = $this->route['controller'];
preg_match("/.+?(?=Controllers)(.*)@/", $controller, $matches);
if (!isset($matches[1])) {
return false;... | php | public function getController($matches = [])
{
if (!isset($this->route['controller'])) {
return false;
}
$controller = $this->route['controller'];
preg_match("/.+?(?=Controllers)(.*)@/", $controller, $matches);
if (!isset($matches[1])) {
return false;... | [
"public",
"function",
"getController",
"(",
"$",
"matches",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"route",
"[",
"'controller'",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"controller",
"=",
"$",
"this"... | resolver controller name from route
@param array $matches
@return boolean|String | [
"resolver",
"controller",
"name",
"from",
"route"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Http/Resolver/ModuleNamespaceResolver.php#L177-L189 |
228,417 | lawoole/framework | src/Homer/Calling/Invokers/ConcreteInvoker.php | ConcreteInvoker.getConcrete | public function getConcrete()
{
if ($this->instance) {
return $this->instance;
}
if (is_object($this->concrete) || $this->concrete instanceof Closure) {
$instance = $this->concrete;
} else {
$instance = $this->context->getContainer()->make($this->... | php | public function getConcrete()
{
if ($this->instance) {
return $this->instance;
}
if (is_object($this->concrete) || $this->concrete instanceof Closure) {
$instance = $this->concrete;
} else {
$instance = $this->context->getContainer()->make($this->... | [
"public",
"function",
"getConcrete",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"instance",
")",
"{",
"return",
"$",
"this",
"->",
"instance",
";",
"}",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"concrete",
")",
"||",
"$",
"this",
"->",
"co... | Get the concrete instance.
@return object|\Closure | [
"Get",
"the",
"concrete",
"instance",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/Invokers/ConcreteInvoker.php#L92-L109 |
228,418 | pxgamer/torrent-parser-php | src/Traits/Parser.php | Parser.xml2array | private static function xml2array(\SimpleXMLElement $xml)
{
$arr = [];
if ($xml) {
foreach ($xml->children() as $r) {
$t = [];
if (!is_null($r) && count($r->children()) == 0) {
$arr[$r->getName()] = strval($r);
} else {... | php | private static function xml2array(\SimpleXMLElement $xml)
{
$arr = [];
if ($xml) {
foreach ($xml->children() as $r) {
$t = [];
if (!is_null($r) && count($r->children()) == 0) {
$arr[$r->getName()] = strval($r);
} else {... | [
"private",
"static",
"function",
"xml2array",
"(",
"\\",
"SimpleXMLElement",
"$",
"xml",
")",
"{",
"$",
"arr",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"xml",
")",
"{",
"foreach",
"(",
"$",
"xml",
"->",
"children",
"(",
")",
"as",
"$",
"r",
")",
"{",
... | Convert a SimpleXMLElement to an array
@param \SimpleXMLElement $xml
@return array | [
"Convert",
"a",
"SimpleXMLElement",
"to",
"an",
"array"
] | 7ad4d44b4701d54630ba775525bd2bd36ee448bb | https://github.com/pxgamer/torrent-parser-php/blob/7ad4d44b4701d54630ba775525bd2bd36ee448bb/src/Traits/Parser.php#L16-L32 |
228,419 | antaresproject/core | src/ui/components/datatables/src/Request.php | Request.searchableColumnIndex | public function searchableColumnIndex()
{
$searchable = [];
for ($i = 0, $c = count($this->get('columns')); $i < $c; $i++) {
if ($this->isColumnSearchable($i, false)) {
$searchable[] = $i;
}
}
return $searchable;
} | php | public function searchableColumnIndex()
{
$searchable = [];
for ($i = 0, $c = count($this->get('columns')); $i < $c; $i++) {
if ($this->isColumnSearchable($i, false)) {
$searchable[] = $i;
}
}
return $searchable;
} | [
"public",
"function",
"searchableColumnIndex",
"(",
")",
"{",
"$",
"searchable",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"c",
"=",
"count",
"(",
"$",
"this",
"->",
"get",
"(",
"'columns'",
")",
")",
";",
"$",
"i",
"<",
"$"... | Get searchable column indexes
@return array | [
"Get",
"searchable",
"column",
"indexes"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Request.php#L40-L50 |
228,420 | antaresproject/core | src/ui/components/datatables/src/Request.php | Request.isSearchable | public function isSearchable()
{
if (request()->has('inline_search')) {
$this->replace([
'start' => 0,
'length' => 25,
'search' => request()->get('inline_search')
]);
}
$search = (array) $this->get('search');
re... | php | public function isSearchable()
{
if (request()->has('inline_search')) {
$this->replace([
'start' => 0,
'length' => 25,
'search' => request()->get('inline_search')
]);
}
$search = (array) $this->get('search');
re... | [
"public",
"function",
"isSearchable",
"(",
")",
"{",
"if",
"(",
"request",
"(",
")",
"->",
"has",
"(",
"'inline_search'",
")",
")",
"{",
"$",
"this",
"->",
"replace",
"(",
"[",
"'start'",
"=>",
"0",
",",
"'length'",
"=>",
"25",
",",
"'search'",
"=>",... | Check if Datatables is searchable.
@return bool | [
"Check",
"if",
"Datatables",
"is",
"searchable",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Request.php#L85-L96 |
228,421 | gggeek/ggwebservices | lib/xmlrpc/xmlrpc.inc.php | xmlrpc_client.setCredentials | function setCredentials($u, $p, $t=1)
{
$this->username=$u;
$this->password=$p;
$this->authtype=$t;
} | php | function setCredentials($u, $p, $t=1)
{
$this->username=$u;
$this->password=$p;
$this->authtype=$t;
} | [
"function",
"setCredentials",
"(",
"$",
"u",
",",
"$",
"p",
",",
"$",
"t",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"username",
"=",
"$",
"u",
";",
"$",
"this",
"->",
"password",
"=",
"$",
"p",
";",
"$",
"this",
"->",
"authtype",
"=",
"$",
"t",... | Add some http BASIC AUTH credentials, used by the client to authenticate
@param string $u username
@param string $p password
@param integer $t auth type. See curl_setopt man page for supported auth types. Defaults to CURLAUTH_BASIC (basic auth)
@access public | [
"Add",
"some",
"http",
"BASIC",
"AUTH",
"credentials",
"used",
"by",
"the",
"client",
"to",
"authenticate"
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/lib/xmlrpc/xmlrpc.inc.php#L966-L971 |
228,422 | gggeek/ggwebservices | lib/xmlrpc/xmlrpc.inc.php | xmlrpc_client.& | function& send($msg, $timeout=0, $method='')
{
// if user deos not specify http protocol, use native method of this client
// (i.e. method set during call to constructor)
if($method == '')
{
$method = $this->method;
}
if(is_array($msg))
{
// $msg is an array of xmlrpcmsg's
... | php | function& send($msg, $timeout=0, $method='')
{
// if user deos not specify http protocol, use native method of this client
// (i.e. method set during call to constructor)
if($method == '')
{
$method = $this->method;
}
if(is_array($msg))
{
// $msg is an array of xmlrpcmsg's
... | [
"function",
"&",
"send",
"(",
"$",
"msg",
",",
"$",
"timeout",
"=",
"0",
",",
"$",
"method",
"=",
"''",
")",
"{",
"// if user deos not specify http protocol, use native method of this client\r",
"// (i.e. method set during call to constructor)\r",
"if",
"(",
"$",
"metho... | Send an xmlrpc request
@param mixed $msg The message object, or an array of messages for using multicall, or the complete xml representation of a request
@param integer $timeout Connection timeout, in seconds, If unspecified, a platform specific timeout will apply
@param string $method if left unspecified, the http pro... | [
"Send",
"an",
"xmlrpc",
"request"
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/lib/xmlrpc/xmlrpc.inc.php#L1151-L1242 |
228,423 | gggeek/ggwebservices | lib/xmlrpc/xmlrpc.inc.php | xmlrpcresp.serialize | function serialize($charset_encoding='')
{
if ($charset_encoding != '')
$this->content_type = 'text/xml; charset=' . $charset_encoding;
else
$this->content_type = 'text/xml';
if ($GLOBALS['xmlrpc_null_apache_encoding'])
{
$result = "<methodResponse xmlns:ex=\"".$GLOBALS['xmlrpc_null_ap... | php | function serialize($charset_encoding='')
{
if ($charset_encoding != '')
$this->content_type = 'text/xml; charset=' . $charset_encoding;
else
$this->content_type = 'text/xml';
if ($GLOBALS['xmlrpc_null_apache_encoding'])
{
$result = "<methodResponse xmlns:ex=\"".$GLOBALS['xmlrpc_null_ap... | [
"function",
"serialize",
"(",
"$",
"charset_encoding",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"charset_encoding",
"!=",
"''",
")",
"$",
"this",
"->",
"content_type",
"=",
"'text/xml; charset='",
".",
"$",
"charset_encoding",
";",
"else",
"$",
"this",
"->",
"... | Returns xml representation of the response. XML prologue not included
@param string $charset_encoding the charset to be used for serialization. if null, US-ASCII is assumed
@return string the xml representation of the response
@access public | [
"Returns",
"xml",
"representation",
"of",
"the",
"response",
".",
"XML",
"prologue",
"not",
"included"
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/lib/xmlrpc/xmlrpc.inc.php#L2076-L2126 |
228,424 | gggeek/ggwebservices | lib/xmlrpc/xmlrpc.inc.php | xmlrpcmsg.addParam | function addParam($par)
{
// add check: do not add to self params which are not xmlrpcvals
if(is_object($par) && is_a($par, 'xmlrpcval'))
{
$this->params[]=$par;
return true;
}
else
{
return false;
}
} | php | function addParam($par)
{
// add check: do not add to self params which are not xmlrpcvals
if(is_object($par) && is_a($par, 'xmlrpcval'))
{
$this->params[]=$par;
return true;
}
else
{
return false;
}
} | [
"function",
"addParam",
"(",
"$",
"par",
")",
"{",
"// add check: do not add to self params which are not xmlrpcvals\r",
"if",
"(",
"is_object",
"(",
"$",
"par",
")",
"&&",
"is_a",
"(",
"$",
"par",
",",
"'xmlrpcval'",
")",
")",
"{",
"$",
"this",
"->",
"params"... | Add a parameter to the list of parameters to be used upon method invocation
@param xmlrpcval $par
@return boolean false on failure
@access public | [
"Add",
"a",
"parameter",
"to",
"the",
"list",
"of",
"parameters",
"to",
"be",
"used",
"upon",
"method",
"invocation"
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/lib/xmlrpc/xmlrpc.inc.php#L2239-L2251 |
228,425 | gggeek/ggwebservices | lib/xmlrpc/xmlrpc.inc.php | xmlrpcval.serialize | function serialize($charset_encoding='')
{
// add check? slower, but helps to avoid recursion in serializing broken xmlrpcvals...
//if (is_object($o) && (get_class($o) == 'xmlrpcval' || is_subclass_of($o, 'xmlrpcval')))
//{
reset($this->me);
list($typ, $val) = each($this->me);
return '<val... | php | function serialize($charset_encoding='')
{
// add check? slower, but helps to avoid recursion in serializing broken xmlrpcvals...
//if (is_object($o) && (get_class($o) == 'xmlrpcval' || is_subclass_of($o, 'xmlrpcval')))
//{
reset($this->me);
list($typ, $val) = each($this->me);
return '<val... | [
"function",
"serialize",
"(",
"$",
"charset_encoding",
"=",
"''",
")",
"{",
"// add check? slower, but helps to avoid recursion in serializing broken xmlrpcvals...\r",
"//if (is_object($o) && (get_class($o) == 'xmlrpcval' || is_subclass_of($o, 'xmlrpcval')))\r",
"//{\r",
"reset",
"(",
"$... | Returns xml representation of the value. XML prologue not included
@param string $charset_encoding the charset to be used for serialization. if null, US-ASCII is assumed
@return string
@access public | [
"Returns",
"xml",
"representation",
"of",
"the",
"value",
".",
"XML",
"prologue",
"not",
"included"
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/lib/xmlrpc/xmlrpc.inc.php#L3082-L3091 |
228,426 | gggeek/ggwebservices | lib/xmlrpc/xmlrpc.inc.php | xmlrpcval.getval | function getval()
{
// UNSTABLE
reset($this->me);
list($a,$b)=each($this->me);
// contributed by I Sofer, 2001-03-24
// add support for nested arrays to scalarval
// i've created a new method here, so as to
// preserve back compatibility
if(is_array($b))
{
@reset($b);
... | php | function getval()
{
// UNSTABLE
reset($this->me);
list($a,$b)=each($this->me);
// contributed by I Sofer, 2001-03-24
// add support for nested arrays to scalarval
// i've created a new method here, so as to
// preserve back compatibility
if(is_array($b))
{
@reset($b);
... | [
"function",
"getval",
"(",
")",
"{",
"// UNSTABLE\r",
"reset",
"(",
"$",
"this",
"->",
"me",
")",
";",
"list",
"(",
"$",
"a",
",",
"$",
"b",
")",
"=",
"each",
"(",
"$",
"this",
"->",
"me",
")",
";",
"// contributed by I Sofer, 2001-03-24\r",
"// add su... | for a long long time. Shall we remove it for 2.0? | [
"for",
"a",
"long",
"long",
"time",
".",
"Shall",
"we",
"remove",
"it",
"for",
"2",
".",
"0?"
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/lib/xmlrpc/xmlrpc.inc.php#L3151-L3187 |
228,427 | gggeek/ggwebservices | lib/xmlrpc/xmlrpc.inc.php | xmlrpcval.scalarval | function scalarval()
{
reset($this->me);
list(,$b)=each($this->me);
return $b;
} | php | function scalarval()
{
reset($this->me);
list(,$b)=each($this->me);
return $b;
} | [
"function",
"scalarval",
"(",
")",
"{",
"reset",
"(",
"$",
"this",
"->",
"me",
")",
";",
"list",
"(",
",",
"$",
"b",
")",
"=",
"each",
"(",
"$",
"this",
"->",
"me",
")",
";",
"return",
"$",
"b",
";",
"}"
] | Returns the value of a scalar xmlrpcval
@return mixed
@access public | [
"Returns",
"the",
"value",
"of",
"a",
"scalar",
"xmlrpcval"
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/lib/xmlrpc/xmlrpc.inc.php#L3194-L3199 |
228,428 | gggeek/ggwebservices | lib/xmlrpc/xmlrpc.inc.php | xmlrpcval.scalartyp | function scalartyp()
{
reset($this->me);
list($a,)=each($this->me);
if($a==$GLOBALS['xmlrpcI4'])
{
$a=$GLOBALS['xmlrpcInt'];
}
return $a;
} | php | function scalartyp()
{
reset($this->me);
list($a,)=each($this->me);
if($a==$GLOBALS['xmlrpcI4'])
{
$a=$GLOBALS['xmlrpcInt'];
}
return $a;
} | [
"function",
"scalartyp",
"(",
")",
"{",
"reset",
"(",
"$",
"this",
"->",
"me",
")",
";",
"list",
"(",
"$",
"a",
",",
")",
"=",
"each",
"(",
"$",
"this",
"->",
"me",
")",
";",
"if",
"(",
"$",
"a",
"==",
"$",
"GLOBALS",
"[",
"'xmlrpcI4'",
"]",
... | Returns the type of the xmlrpcval.
For integers, 'int' is always returned in place of 'i4'
@return string
@access public | [
"Returns",
"the",
"type",
"of",
"the",
"xmlrpcval",
".",
"For",
"integers",
"int",
"is",
"always",
"returned",
"in",
"place",
"of",
"i4"
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/lib/xmlrpc/xmlrpc.inc.php#L3207-L3216 |
228,429 | coincheckjp/coincheck-php | lib/Coincheck/Leverage.php | Leverage.positions | public function positions($params = array())
{
$arr = $params;
$rawResponse = $this->client->request('get', 'api/exchange/leverage/positions', $arr);
return $rawResponse;
} | php | public function positions($params = array())
{
$arr = $params;
$rawResponse = $this->client->request('get', 'api/exchange/leverage/positions', $arr);
return $rawResponse;
} | [
"public",
"function",
"positions",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"arr",
"=",
"$",
"params",
";",
"$",
"rawResponse",
"=",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'get'",
",",
"'api/exchange/leverage/positions'",
"... | Get a leverage positions list.
@param mixed
@return Json Array | [
"Get",
"a",
"leverage",
"positions",
"list",
"."
] | 5991003cb0ae827697888aeebd0aea0267fad7fa | https://github.com/coincheckjp/coincheck-php/blob/5991003cb0ae827697888aeebd0aea0267fad7fa/lib/Coincheck/Leverage.php#L21-L26 |
228,430 | antaresproject/core | src/ui/components/templates/src/Repository/Repository.php | Repository.save | public function save($name, $attributes = [])
{
if (auth()->guest()) {
return;
}
$params = [
'uid' => auth()->user()->id,
'brand_id' => brand_id(),
'resource' => uri(),
'name' => snake_case($name),
'dat... | php | public function save($name, $attributes = [])
{
if (auth()->guest()) {
return;
}
$params = [
'uid' => auth()->user()->id,
'brand_id' => brand_id(),
'resource' => uri(),
'name' => snake_case($name),
'dat... | [
"public",
"function",
"save",
"(",
"$",
"name",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"auth",
"(",
")",
"->",
"guest",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"params",
"=",
"[",
"'uid'",
"=>",
"auth",
"(",
")",
"->... | Saves ui component
@param String $name
@param array $attributes
@return WidgetParams | [
"Saves",
"ui",
"component"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Repository/Repository.php#L72-L90 |
228,431 | antaresproject/core | src/ui/components/templates/src/Repository/Repository.php | Repository.getComponentId | protected function getComponentId($name)
{
$where = [
'name' => $name,
'type_id' => app(ComponentTypes::class)->newInstance()->getDefault()->id
];
$exists = $this->makeModel()->where($where)->first();
if (!is_null($exists)) {
return $exists->id... | php | protected function getComponentId($name)
{
$where = [
'name' => $name,
'type_id' => app(ComponentTypes::class)->newInstance()->getDefault()->id
];
$exists = $this->makeModel()->where($where)->first();
if (!is_null($exists)) {
return $exists->id... | [
"protected",
"function",
"getComponentId",
"(",
"$",
"name",
")",
"{",
"$",
"where",
"=",
"[",
"'name'",
"=>",
"$",
"name",
",",
"'type_id'",
"=>",
"app",
"(",
"ComponentTypes",
"::",
"class",
")",
"->",
"newInstance",
"(",
")",
"->",
"getDefault",
"(",
... | Gets existing ui component id or add new
@param String $name
@return mixed | [
"Gets",
"existing",
"ui",
"component",
"id",
"or",
"add",
"new"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Repository/Repository.php#L98-L111 |
228,432 | antaresproject/core | src/ui/components/templates/src/Repository/Repository.php | Repository.findAllByResourceAndNames | public function findAllByResourceAndNames($resource, array $params)
{
$where = $this->getWhere(['resource' => $resource]);
$model = $this->makeModel()->getModel()->widgetParams()->getModel()->newQuery();
return $model->where($where)->whereIn('name', $params)->get()->toArray();
} | php | public function findAllByResourceAndNames($resource, array $params)
{
$where = $this->getWhere(['resource' => $resource]);
$model = $this->makeModel()->getModel()->widgetParams()->getModel()->newQuery();
return $model->where($where)->whereIn('name', $params)->get()->toArray();
} | [
"public",
"function",
"findAllByResourceAndNames",
"(",
"$",
"resource",
",",
"array",
"$",
"params",
")",
"{",
"$",
"where",
"=",
"$",
"this",
"->",
"getWhere",
"(",
"[",
"'resource'",
"=>",
"$",
"resource",
"]",
")",
";",
"$",
"model",
"=",
"$",
"thi... | Finds all ui components by resource and additional params
@param String $resource
@param array $params
@return array | [
"Finds",
"all",
"ui",
"components",
"by",
"resource",
"and",
"additional",
"params"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Repository/Repository.php#L144-L149 |
228,433 | antaresproject/core | src/ui/components/templates/src/Repository/Repository.php | Repository.findByParams | protected function findByParams($where)
{
$model = $this->makeModel()->getModel()->widgetParams()->getModel()->newQuery();
return $model->where($where)->get()->toArray();
} | php | protected function findByParams($where)
{
$model = $this->makeModel()->getModel()->widgetParams()->getModel()->newQuery();
return $model->where($where)->get()->toArray();
} | [
"protected",
"function",
"findByParams",
"(",
"$",
"where",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"makeModel",
"(",
")",
"->",
"getModel",
"(",
")",
"->",
"widgetParams",
"(",
")",
"->",
"getModel",
"(",
")",
"->",
"newQuery",
"(",
")",
";"... | Find items by params
@param array $where
@return array | [
"Find",
"items",
"by",
"params"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Repository/Repository.php#L157-L161 |
228,434 | antaresproject/core | src/ui/components/templates/src/Repository/Repository.php | Repository.saveEntity | public function saveEntity(Model $model)
{
$cacheKey = $this->cacheKey($model->toArray());
$this->cache->forget($cacheKey);
return $model->save();
} | php | public function saveEntity(Model $model)
{
$cacheKey = $this->cacheKey($model->toArray());
$this->cache->forget($cacheKey);
return $model->save();
} | [
"public",
"function",
"saveEntity",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"this",
"->",
"cacheKey",
"(",
"$",
"model",
"->",
"toArray",
"(",
")",
")",
";",
"$",
"this",
"->",
"cache",
"->",
"forget",
"(",
"$",
"cacheKey",
... | Saves single entity
@param Model $model
@return boolean | [
"Saves",
"single",
"entity"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Repository/Repository.php#L213-L218 |
228,435 | antaresproject/core | src/ui/components/templates/src/Repository/Repository.php | Repository.cacheKey | protected function cacheKey(array $params = [])
{
$prefix = config('antares/ui-components::cache');
$required = ['resource', 'uid', 'brand_id', 'name'];
if (count(array_only($params, $required)) != count($required)) {
return $prefix;
}
$ordered = [];
for... | php | protected function cacheKey(array $params = [])
{
$prefix = config('antares/ui-components::cache');
$required = ['resource', 'uid', 'brand_id', 'name'];
if (count(array_only($params, $required)) != count($required)) {
return $prefix;
}
$ordered = [];
for... | [
"protected",
"function",
"cacheKey",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"prefix",
"=",
"config",
"(",
"'antares/ui-components::cache'",
")",
";",
"$",
"required",
"=",
"[",
"'resource'",
",",
"'uid'",
",",
"'brand_id'",
",",
"'name'... | Creates cache key
@param array $params
@return type | [
"Creates",
"cache",
"key"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Repository/Repository.php#L226-L238 |
228,436 | antaresproject/core | src/ui/components/templates/src/Repository/Repository.php | Repository.load | public function load()
{
if (auth()->guest()) {
return new Collection();
}
return ComponentParams::withoutGlobalScopes()
->select(['tbl_widgets_params.id', 'tbl_widgets_params.wid', 'tbl_widgets_params.resource', 'tbl_widgets_params.name', 'tbl_widgets_par... | php | public function load()
{
if (auth()->guest()) {
return new Collection();
}
return ComponentParams::withoutGlobalScopes()
->select(['tbl_widgets_params.id', 'tbl_widgets_params.wid', 'tbl_widgets_params.resource', 'tbl_widgets_params.name', 'tbl_widgets_par... | [
"public",
"function",
"load",
"(",
")",
"{",
"if",
"(",
"auth",
"(",
")",
"->",
"guest",
"(",
")",
")",
"{",
"return",
"new",
"Collection",
"(",
")",
";",
"}",
"return",
"ComponentParams",
"::",
"withoutGlobalScopes",
"(",
")",
"->",
"select",
"(",
"... | Loads all ui components
@return \Illuminate\Support\Collection | [
"Loads",
"all",
"ui",
"components"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Repository/Repository.php#L245-L255 |
228,437 | antaresproject/core | src/components/support/src/Providers/Traits/PackageProviderTrait.php | PackageProviderTrait.addViewComponent | public function addViewComponent($package, $namespace, $path)
{
$files = $this->app->make('files');
$view = $this->app->make('view');
foreach ($this->getAppViewPaths($package) as $appView) {
if ($files->isDirectory($appView)) {
$view->addNamespace($namespace, $ap... | php | public function addViewComponent($package, $namespace, $path)
{
$files = $this->app->make('files');
$view = $this->app->make('view');
foreach ($this->getAppViewPaths($package) as $appView) {
if ($files->isDirectory($appView)) {
$view->addNamespace($namespace, $ap... | [
"public",
"function",
"addViewComponent",
"(",
"$",
"package",
",",
"$",
"namespace",
",",
"$",
"path",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'files'",
")",
";",
"$",
"view",
"=",
"$",
"this",
"->",
"app",
"->",... | Register the package's view component namespaces.
@param string $package
@param string $namespace
@param string $path
@return void | [
"Register",
"the",
"package",
"s",
"view",
"component",
"namespaces",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/support/src/Providers/Traits/PackageProviderTrait.php#L70-L81 |
228,438 | lawoole/framework | src/WebSocket/WebSocketServerSocketHandler.php | WebSocketServerSocketHandler.onMessage | public function onMessage($server, $serverSocket, $frame)
{
$id = $frame->fd;
if (isset($this->connections[$id])) {
$this->fireMessageEvent(
$this->connections[$id]['handler'],
$this->connections[$id]['connection'],
$frame
);
... | php | public function onMessage($server, $serverSocket, $frame)
{
$id = $frame->fd;
if (isset($this->connections[$id])) {
$this->fireMessageEvent(
$this->connections[$id]['handler'],
$this->connections[$id]['connection'],
$frame
);
... | [
"public",
"function",
"onMessage",
"(",
"$",
"server",
",",
"$",
"serverSocket",
",",
"$",
"frame",
")",
"{",
"$",
"id",
"=",
"$",
"frame",
"->",
"fd",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"connections",
"[",
"$",
"id",
"]",
")",
")",... | Called when the server receive a WebSocket message frame.
@param \Lawoole\Server\Server $server
@param \Lawoole\Server\ServerSockets\ServerSocket $serverSocket
@param \Swoole\WebSocket\Frame $frame | [
"Called",
"when",
"the",
"server",
"receive",
"a",
"WebSocket",
"message",
"frame",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/WebSocket/WebSocketServerSocketHandler.php#L58-L69 |
228,439 | lawoole/framework | src/WebSocket/WebSocketServerSocketHandler.php | WebSocketServerSocketHandler.onClose | public function onClose($server, $serverSocket, $id)
{
if (isset($this->connections[$id])) {
$this->fireCloseEvent(
$this->connections[$id]['handler'],
$this->connections[$id]['connection']
);
unset($this->connections[$id]);
}
... | php | public function onClose($server, $serverSocket, $id)
{
if (isset($this->connections[$id])) {
$this->fireCloseEvent(
$this->connections[$id]['handler'],
$this->connections[$id]['connection']
);
unset($this->connections[$id]);
}
... | [
"public",
"function",
"onClose",
"(",
"$",
"server",
",",
"$",
"serverSocket",
",",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"connections",
"[",
"$",
"id",
"]",
")",
")",
"{",
"$",
"this",
"->",
"fireCloseEvent",
"(",
"$",
... | Called when a connection has been closed.
@param \Lawoole\Server\Server $server
@param \Lawoole\Server\ServerSockets\ServerSocket $serverSocket
@param int $id | [
"Called",
"when",
"a",
"connection",
"has",
"been",
"closed",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/WebSocket/WebSocketServerSocketHandler.php#L78-L88 |
228,440 | lawoole/framework | src/WebSocket/WebSocketServerSocketHandler.php | WebSocketServerSocketHandler.acceptConnection | protected function acceptConnection($server, $request, $httpRequest, $handler)
{
$id = $request->fd;
$connection = $this->createWebSocketConnection($server, $id);
$this->fireOpenEvent($handler, $connection, $httpRequest);
$this->connections[$id] = compact('connection', 'handler');... | php | protected function acceptConnection($server, $request, $httpRequest, $handler)
{
$id = $request->fd;
$connection = $this->createWebSocketConnection($server, $id);
$this->fireOpenEvent($handler, $connection, $httpRequest);
$this->connections[$id] = compact('connection', 'handler');... | [
"protected",
"function",
"acceptConnection",
"(",
"$",
"server",
",",
"$",
"request",
",",
"$",
"httpRequest",
",",
"$",
"handler",
")",
"{",
"$",
"id",
"=",
"$",
"request",
"->",
"fd",
";",
"$",
"connection",
"=",
"$",
"this",
"->",
"createWebSocketConn... | Accept the web socket connection.
@param \Lawoole\Server\Server $server
@param \Swoole\Http\Request $request
@param \Illuminate\Http\Request $httpRequest
@param \Lawoole\Contracts\WebSocket\WebSocketHandler $handler | [
"Accept",
"the",
"web",
"socket",
"connection",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/WebSocket/WebSocketServerSocketHandler.php#L112-L121 |
228,441 | lawoole/framework | src/WebSocket/WebSocketServerSocketHandler.php | WebSocketServerSocketHandler.fireMessageEvent | protected function fireMessageEvent($handler, $connection, $frame)
{
$isBinary = $frame->opcode == WEBSOCKET_OPCODE_BINARY;
$this->fireWebSocketHandler($handler, 'onMessage', $connection, $isBinary, $frame->data);
} | php | protected function fireMessageEvent($handler, $connection, $frame)
{
$isBinary = $frame->opcode == WEBSOCKET_OPCODE_BINARY;
$this->fireWebSocketHandler($handler, 'onMessage', $connection, $isBinary, $frame->data);
} | [
"protected",
"function",
"fireMessageEvent",
"(",
"$",
"handler",
",",
"$",
"connection",
",",
"$",
"frame",
")",
"{",
"$",
"isBinary",
"=",
"$",
"frame",
"->",
"opcode",
"==",
"WEBSOCKET_OPCODE_BINARY",
";",
"$",
"this",
"->",
"fireWebSocketHandler",
"(",
"... | Fire the message received event.
@param \Lawoole\Contracts\WebSocket\WebSocketHandler $handler
@param \Lawoole\Contracts\WebSocket\Connection $connection
@param \Swoole\WebSocket\Frame $frame | [
"Fire",
"the",
"message",
"received",
"event",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/WebSocket/WebSocketServerSocketHandler.php#L155-L160 |
228,442 | lawoole/framework | src/WebSocket/WebSocketServerSocketHandler.php | WebSocketServerSocketHandler.fireWebSocketHandler | protected function fireWebSocketHandler($handler, $method, ...$arguments)
{
if ($handler == null) {
return;
}
try {
call_user_func([$handler, $method], ...$arguments);
} catch (Exception $e) {
$this->reportException($e);
} catch (Throwable... | php | protected function fireWebSocketHandler($handler, $method, ...$arguments)
{
if ($handler == null) {
return;
}
try {
call_user_func([$handler, $method], ...$arguments);
} catch (Exception $e) {
$this->reportException($e);
} catch (Throwable... | [
"protected",
"function",
"fireWebSocketHandler",
"(",
"$",
"handler",
",",
"$",
"method",
",",
"...",
"$",
"arguments",
")",
"{",
"if",
"(",
"$",
"handler",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"call_user_func",
"(",
"[",
"$",
"handl... | Send the event to the handler.
@param \Lawoole\Contracts\WebSocket\WebSocketHandler $handler
@param string $method
@param array $arguments | [
"Send",
"the",
"event",
"to",
"the",
"handler",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/WebSocket/WebSocketServerSocketHandler.php#L180-L193 |
228,443 | antaresproject/core | src/components/html/src/Form/BootstrapThreePresenter.php | BootstrapThreePresenter.file | public function file(FieldContract $field)
{
$attributes = $this->html->decorate($field->get('attributes'), ['class' => 'form-control']);
return $this->form->file($field->get('name'), $attributes);
} | php | public function file(FieldContract $field)
{
$attributes = $this->html->decorate($field->get('attributes'), ['class' => 'form-control']);
return $this->form->file($field->get('name'), $attributes);
} | [
"public",
"function",
"file",
"(",
"FieldContract",
"$",
"field",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"html",
"->",
"decorate",
"(",
"$",
"field",
"->",
"get",
"(",
"'attributes'",
")",
",",
"[",
"'class'",
"=>",
"'form-control'",
"]",
... | File template.
@param \Antares\Contracts\Html\Form\Field $field
@return string | [
"File",
"template",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Form/BootstrapThreePresenter.php#L118-L122 |
228,444 | antaresproject/core | src/components/html/src/Form/BootstrapThreePresenter.php | BootstrapThreePresenter.input | public function input(FieldContract $field)
{
$attributes = $field->get('attributes');
if (isset($attributes['field'])) {
unset($attributes['field']);
}
$decoratedAttributes = $this->html->decorate($attributes);
return $this->form->input($field->get('type'), $... | php | public function input(FieldContract $field)
{
$attributes = $field->get('attributes');
if (isset($attributes['field'])) {
unset($attributes['field']);
}
$decoratedAttributes = $this->html->decorate($attributes);
return $this->form->input($field->get('type'), $... | [
"public",
"function",
"input",
"(",
"FieldContract",
"$",
"field",
")",
"{",
"$",
"attributes",
"=",
"$",
"field",
"->",
"get",
"(",
"'attributes'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"attributes",
"[",
"'field'",
"]",
")",
")",
"{",
"unset",
"(... | Input template.
@param \Antares\Contracts\Html\Form\Field $field
@return string | [
"Input",
"template",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Form/BootstrapThreePresenter.php#L131-L143 |
228,445 | antaresproject/core | src/foundation/src/Http/Presenters/DropzoneTrait.php | DropzoneTrait.getValidationRules | protected function getValidationRules($inputName, $validator)
{
$validator->onUpload();
$rules = $validator->getValidationRules();
$attributes = [];
foreach ($rules[$inputName] as $rule) {
if (strpos($rule, ':') !== FALSE) {
list($rulename, $value) = ... | php | protected function getValidationRules($inputName, $validator)
{
$validator->onUpload();
$rules = $validator->getValidationRules();
$attributes = [];
foreach ($rules[$inputName] as $rule) {
if (strpos($rule, ':') !== FALSE) {
list($rulename, $value) = ... | [
"protected",
"function",
"getValidationRules",
"(",
"$",
"inputName",
",",
"$",
"validator",
")",
"{",
"$",
"validator",
"->",
"onUpload",
"(",
")",
";",
"$",
"rules",
"=",
"$",
"validator",
"->",
"getValidationRules",
"(",
")",
";",
"$",
"attributes",
"="... | getting dropzone validation rules from validator
@param \Illuminate\Support\Facades\Validator $validator
@return array | [
"getting",
"dropzone",
"validation",
"rules",
"from",
"validator"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Http/Presenters/DropzoneTrait.php#L35-L61 |
228,446 | expressodev/laravel-codeigniter-db | src/CodeIgniterConnection.php | CodeIgniterConnection.getDefaultQueryGrammar | protected function getDefaultQueryGrammar()
{
$driver = $this->ci->db->dbdriver;
switch ($driver) {
case 'mysql':
case 'mysqli':
if (class_exists('\Illuminate\Database\Query\Grammars\MySqlGrammar')) {
return $this->withTablePrefix(new \Illu... | php | protected function getDefaultQueryGrammar()
{
$driver = $this->ci->db->dbdriver;
switch ($driver) {
case 'mysql':
case 'mysqli':
if (class_exists('\Illuminate\Database\Query\Grammars\MySqlGrammar')) {
return $this->withTablePrefix(new \Illu... | [
"protected",
"function",
"getDefaultQueryGrammar",
"(",
")",
"{",
"$",
"driver",
"=",
"$",
"this",
"->",
"ci",
"->",
"db",
"->",
"dbdriver",
";",
"switch",
"(",
"$",
"driver",
")",
"{",
"case",
"'mysql'",
":",
"case",
"'mysqli'",
":",
"if",
"(",
"class... | Get the default query grammar instance.
@return \Illuminate\Database\Grammar | [
"Get",
"the",
"default",
"query",
"grammar",
"instance",
"."
] | c97a2fa1e93431df7abbd452128377af84cc9627 | https://github.com/expressodev/laravel-codeigniter-db/blob/c97a2fa1e93431df7abbd452128377af84cc9627/src/CodeIgniterConnection.php#L31-L45 |
228,447 | expressodev/laravel-codeigniter-db | src/CodeIgniterConnection.php | CodeIgniterConnection.getDefaultSchemaGrammar | protected function getDefaultSchemaGrammar()
{
$driver = $this->ci->db->dbdriver;
switch ($driver) {
case 'mysql':
case 'mysqli':
return $this->withTablePrefix(new \Illuminate\Database\Schema\Grammars\MySqlGrammar);
}
throw new \InvalidArgumen... | php | protected function getDefaultSchemaGrammar()
{
$driver = $this->ci->db->dbdriver;
switch ($driver) {
case 'mysql':
case 'mysqli':
return $this->withTablePrefix(new \Illuminate\Database\Schema\Grammars\MySqlGrammar);
}
throw new \InvalidArgumen... | [
"protected",
"function",
"getDefaultSchemaGrammar",
"(",
")",
"{",
"$",
"driver",
"=",
"$",
"this",
"->",
"ci",
"->",
"db",
"->",
"dbdriver",
";",
"switch",
"(",
"$",
"driver",
")",
"{",
"case",
"'mysql'",
":",
"case",
"'mysqli'",
":",
"return",
"$",
"... | Get the default schema grammar instance.
@return \Illuminate\Database\Grammar | [
"Get",
"the",
"default",
"schema",
"grammar",
"instance",
"."
] | c97a2fa1e93431df7abbd452128377af84cc9627 | https://github.com/expressodev/laravel-codeigniter-db/blob/c97a2fa1e93431df7abbd452128377af84cc9627/src/CodeIgniterConnection.php#L52-L62 |
228,448 | expressodev/laravel-codeigniter-db | src/CodeIgniterConnection.php | CodeIgniterConnection.fetchResult | public function fetchResult($result)
{
$fetchMode = $this->fetchMode;
switch ($fetchMode) {
case PDO::FETCH_ASSOC:
return $result->result_array();
case PDO::FETCH_OBJ:
return $result->result();
}
throw new \BadMethodCallExcepti... | php | public function fetchResult($result)
{
$fetchMode = $this->fetchMode;
switch ($fetchMode) {
case PDO::FETCH_ASSOC:
return $result->result_array();
case PDO::FETCH_OBJ:
return $result->result();
}
throw new \BadMethodCallExcepti... | [
"public",
"function",
"fetchResult",
"(",
"$",
"result",
")",
"{",
"$",
"fetchMode",
"=",
"$",
"this",
"->",
"fetchMode",
";",
"switch",
"(",
"$",
"fetchMode",
")",
"{",
"case",
"PDO",
"::",
"FETCH_ASSOC",
":",
"return",
"$",
"result",
"->",
"result_arra... | Fetch a CodeIgniter result set as an array or object, emulating current PDO fetch mode
@param object $result
@return mixed | [
"Fetch",
"a",
"CodeIgniter",
"result",
"set",
"as",
"an",
"array",
"or",
"object",
"emulating",
"current",
"PDO",
"fetch",
"mode"
] | c97a2fa1e93431df7abbd452128377af84cc9627 | https://github.com/expressodev/laravel-codeigniter-db/blob/c97a2fa1e93431df7abbd452128377af84cc9627/src/CodeIgniterConnection.php#L123-L134 |
228,449 | antaresproject/core | src/utils/helpers/ResponseHelper.php | ResponseHelper.make | public static function make(string $type, string $message, string $url = null) : ResponseHelper {
return new static($type, $message, $url);
} | php | public static function make(string $type, string $message, string $url = null) : ResponseHelper {
return new static($type, $message, $url);
} | [
"public",
"static",
"function",
"make",
"(",
"string",
"$",
"type",
",",
"string",
"$",
"message",
",",
"string",
"$",
"url",
"=",
"null",
")",
":",
"ResponseHelper",
"{",
"return",
"new",
"static",
"(",
"$",
"type",
",",
"$",
"message",
",",
"$",
"u... | Creates a response.
@param string $type
@param string $message
@param string $url (optional)
@return ResponseHelper | [
"Creates",
"a",
"response",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/helpers/ResponseHelper.php#L53-L55 |
228,450 | antaresproject/core | src/utils/helpers/ResponseHelper.php | ResponseHelper.notify | public function notify() : ResponseHelper {
$this->notified = true;
app('antares.messages')->add($this->type, $this->message);
return $this;
} | php | public function notify() : ResponseHelper {
$this->notified = true;
app('antares.messages')->add($this->type, $this->message);
return $this;
} | [
"public",
"function",
"notify",
"(",
")",
":",
"ResponseHelper",
"{",
"$",
"this",
"->",
"notified",
"=",
"true",
";",
"app",
"(",
"'antares.messages'",
")",
"->",
"add",
"(",
"$",
"this",
"->",
"type",
",",
"$",
"this",
"->",
"message",
")",
";",
"r... | Send the message to the session flash.
@return ResponseHelper | [
"Send",
"the",
"message",
"to",
"the",
"session",
"flash",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/helpers/ResponseHelper.php#L138-L144 |
228,451 | antaresproject/core | src/utils/helpers/ResponseHelper.php | ResponseHelper.redirect | public function redirect() : RedirectResponse {
if( ! $this->notified) {
$this->notify();
}
$url = $this->url ?: app(UrlGenerator::class)->previous();
return response()->redirectTo($url);
} | php | public function redirect() : RedirectResponse {
if( ! $this->notified) {
$this->notify();
}
$url = $this->url ?: app(UrlGenerator::class)->previous();
return response()->redirectTo($url);
} | [
"public",
"function",
"redirect",
"(",
")",
":",
"RedirectResponse",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"notified",
")",
"{",
"$",
"this",
"->",
"notify",
"(",
")",
";",
"}",
"$",
"url",
"=",
"$",
"this",
"->",
"url",
"?",
":",
"app",
"(",
... | Returns redirect response with notification.
@return RedirectResponse | [
"Returns",
"redirect",
"response",
"with",
"notification",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/helpers/ResponseHelper.php#L151-L159 |
228,452 | antaresproject/core | src/utils/helpers/ResponseHelper.php | ResponseHelper.resolve | public function resolve(Request $request) : Response {
if($request->expectsJson()) {
return $this->json();
}
return $this->redirect();
} | php | public function resolve(Request $request) : Response {
if($request->expectsJson()) {
return $this->json();
}
return $this->redirect();
} | [
"public",
"function",
"resolve",
"(",
"Request",
"$",
"request",
")",
":",
"Response",
"{",
"if",
"(",
"$",
"request",
"->",
"expectsJson",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"json",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"r... | Returns dedicated response based on the given request.
@param Request $request
@return Response | [
"Returns",
"dedicated",
"response",
"based",
"on",
"the",
"given",
"request",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/helpers/ResponseHelper.php#L167-L173 |
228,453 | antaresproject/core | src/components/area/src/AreaManager.php | AreaManager.hasAreaInUri | public function hasAreaInUri(): bool
{
$segment = $this->request->segment(1);
$area = $segment ? $this->getById($segment) : null;
return !!$area;
} | php | public function hasAreaInUri(): bool
{
$segment = $this->request->segment(1);
$area = $segment ? $this->getById($segment) : null;
return !!$area;
} | [
"public",
"function",
"hasAreaInUri",
"(",
")",
":",
"bool",
"{",
"$",
"segment",
"=",
"$",
"this",
"->",
"request",
"->",
"segment",
"(",
"1",
")",
";",
"$",
"area",
"=",
"$",
"segment",
"?",
"$",
"this",
"->",
"getById",
"(",
"$",
"segment",
")",... | Checks if the route has area.
@return bool | [
"Checks",
"if",
"the",
"route",
"has",
"area",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/area/src/AreaManager.php#L133-L139 |
228,454 | antaresproject/core | src/components/area/src/AreaManager.php | AreaManager.getCurrentArea | public function getCurrentArea(): AreaContract
{
$segment = $this->request->segment(1);
$area = $segment ? $this->getById($segment) : null;
if (!$area && $this->auth->check()) {
$user = $this->auth->user();
$areas = $user->getArea();
if (is_array($ar... | php | public function getCurrentArea(): AreaContract
{
$segment = $this->request->segment(1);
$area = $segment ? $this->getById($segment) : null;
if (!$area && $this->auth->check()) {
$user = $this->auth->user();
$areas = $user->getArea();
if (is_array($ar... | [
"public",
"function",
"getCurrentArea",
"(",
")",
":",
"AreaContract",
"{",
"$",
"segment",
"=",
"$",
"this",
"->",
"request",
"->",
"segment",
"(",
"1",
")",
";",
"$",
"area",
"=",
"$",
"segment",
"?",
"$",
"this",
"->",
"getById",
"(",
"$",
"segmen... | Gets an area object based on the current authentication and URI.
@return AreaContract | [
"Gets",
"an",
"area",
"object",
"based",
"on",
"the",
"current",
"authentication",
"and",
"URI",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/area/src/AreaManager.php#L146-L163 |
228,455 | antaresproject/core | src/components/area/src/AreaManager.php | AreaManager.getFrontendAreas | public function getFrontendAreas(): AreasCollection
{
$areas = (array) Arr::get($this->config, 'routes.frontend', self::$fallbackFrontendRoutes);
$collection = new AreasCollection();
foreach ($areas as $areaId) {
$area = $this->areas->getById($areaId);
if ($are... | php | public function getFrontendAreas(): AreasCollection
{
$areas = (array) Arr::get($this->config, 'routes.frontend', self::$fallbackFrontendRoutes);
$collection = new AreasCollection();
foreach ($areas as $areaId) {
$area = $this->areas->getById($areaId);
if ($are... | [
"public",
"function",
"getFrontendAreas",
"(",
")",
":",
"AreasCollection",
"{",
"$",
"areas",
"=",
"(",
"array",
")",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"config",
",",
"'routes.frontend'",
",",
"self",
"::",
"$",
"fallbackFrontendRoutes",
")",
";... | Returns collection of frontend areas.
@return AreasCollection | [
"Returns",
"collection",
"of",
"frontend",
"areas",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/area/src/AreaManager.php#L170-L183 |
228,456 | antaresproject/core | src/components/area/src/AreaManager.php | AreaManager.getBackendAreas | public function getBackendAreas(): AreasCollection
{
$areas = (array) Arr::get($this->config, 'routes.backend', self::$fallbackBackendRoutes);
$collection = new AreasCollection();
foreach ($areas as $areaId) {
$area = $this->areas->getById($areaId);
if ($area) ... | php | public function getBackendAreas(): AreasCollection
{
$areas = (array) Arr::get($this->config, 'routes.backend', self::$fallbackBackendRoutes);
$collection = new AreasCollection();
foreach ($areas as $areaId) {
$area = $this->areas->getById($areaId);
if ($area) ... | [
"public",
"function",
"getBackendAreas",
"(",
")",
":",
"AreasCollection",
"{",
"$",
"areas",
"=",
"(",
"array",
")",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"config",
",",
"'routes.backend'",
",",
"self",
"::",
"$",
"fallbackBackendRoutes",
")",
";",
... | Returns collection of backend areas.
@return AreasCollection | [
"Returns",
"collection",
"of",
"backend",
"areas",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/area/src/AreaManager.php#L190-L204 |
228,457 | antaresproject/core | src/components/area/src/AreaManager.php | AreaManager.getByIdOrDefault | public function getByIdOrDefault(string $id): AreaContract
{
$area = $this->getById($id);
return $area ?: $this->getDefault();
} | php | public function getByIdOrDefault(string $id): AreaContract
{
$area = $this->getById($id);
return $area ?: $this->getDefault();
} | [
"public",
"function",
"getByIdOrDefault",
"(",
"string",
"$",
"id",
")",
":",
"AreaContract",
"{",
"$",
"area",
"=",
"$",
"this",
"->",
"getById",
"(",
"$",
"id",
")",
";",
"return",
"$",
"area",
"?",
":",
"$",
"this",
"->",
"getDefault",
"(",
")",
... | Returns an area object based on ID. Default area returns if not found the desired one.
@param string $id
@return AreaContract | [
"Returns",
"an",
"area",
"object",
"based",
"on",
"ID",
".",
"Default",
"area",
"returns",
"if",
"not",
"found",
"the",
"desired",
"one",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/area/src/AreaManager.php#L253-L258 |
228,458 | gggeek/ggwebservices | classes/ggwebservicesresponse.php | ggWebservicesResponse.decodeStreamCommon | protected function decodeStreamCommon( $request, $stream, $headers=false, $cookies=array(), $statuscode="200" )
{
$this->Cookies = $cookies;
$this->Headers = $headers;
$this->StatusCode = $statuscode;
$this->ContentType = '';
$this->Charset = '';
if ( isset( $headers[... | php | protected function decodeStreamCommon( $request, $stream, $headers=false, $cookies=array(), $statuscode="200" )
{
$this->Cookies = $cookies;
$this->Headers = $headers;
$this->StatusCode = $statuscode;
$this->ContentType = '';
$this->Charset = '';
if ( isset( $headers[... | [
"protected",
"function",
"decodeStreamCommon",
"(",
"$",
"request",
",",
"$",
"stream",
",",
"$",
"headers",
"=",
"false",
",",
"$",
"cookies",
"=",
"array",
"(",
")",
",",
"$",
"statuscode",
"=",
"\"200\"",
")",
"{",
"$",
"this",
"->",
"Cookies",
"=",... | Sets internal members from http data, resets response to be not faulty.
We make this code available here instead of in decodeStream, to force child classes them to write their own handlers
@param $request
@param $stream
@param bool $headers
@param array $cookies
@param string $statuscode | [
"Sets",
"internal",
"members",
"from",
"http",
"data",
"resets",
"response",
"to",
"be",
"not",
"faulty",
".",
"We",
"make",
"this",
"code",
"available",
"here",
"instead",
"of",
"in",
"decodeStream",
"to",
"force",
"child",
"classes",
"them",
"to",
"write",... | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggwebservicesresponse.php#L198-L213 |
228,459 | antaresproject/core | src/components/auth/src/Authorization/Fluent.php | Fluent.exist | public function exist($id)
{
is_string($id) && $id = $this->getSlugFromName($id);
return isset($this->items[$id]);
} | php | public function exist($id)
{
is_string($id) && $id = $this->getSlugFromName($id);
return isset($this->items[$id]);
} | [
"public",
"function",
"exist",
"(",
"$",
"id",
")",
"{",
"is_string",
"(",
"$",
"id",
")",
"&&",
"$",
"id",
"=",
"$",
"this",
"->",
"getSlugFromName",
"(",
"$",
"id",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"$",
"id",
... | Check if an id is set in the collection.
@param int $id
@return bool | [
"Check",
"if",
"an",
"id",
"is",
"set",
"in",
"the",
"collection",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/auth/src/Authorization/Fluent.php#L172-L177 |
228,460 | antaresproject/core | src/components/auth/src/Authorization/Fluent.php | Fluent.remove | public function remove($key)
{
if (is_null($key)) {
throw new InvalidArgumentException("Can't add NULL {$this->name}.");
}
if (!is_null($id = $this->search($key))) {
unset($this->items[$id]);
return true;
}
return false;
} | php | public function remove($key)
{
if (is_null($key)) {
throw new InvalidArgumentException("Can't add NULL {$this->name}.");
}
if (!is_null($id = $this->search($key))) {
unset($this->items[$id]);
return true;
}
return false;
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Can't add NULL {$this->name}.\"",
")",
";",
"}",
"if",
"(",
"!",
"is_null",
"(",
"$",
"id... | Remove a key from collection.
@param string $key
@return bool
@throws \InvalidArgumentException | [
"Remove",
"a",
"key",
"from",
"collection",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/auth/src/Authorization/Fluent.php#L249-L261 |
228,461 | antaresproject/core | src/components/auth/src/Authorization/Fluent.php | Fluent.getSlugFromName | protected function getSlugFromName($name)
{
if( array_key_exists($name, self::$sluggedNames) ) {
return self::$sluggedNames[$name];
}
return self::$sluggedNames[$name] = trim(Str::slug($name, '-'));
} | php | protected function getSlugFromName($name)
{
if( array_key_exists($name, self::$sluggedNames) ) {
return self::$sluggedNames[$name];
}
return self::$sluggedNames[$name] = trim(Str::slug($name, '-'));
} | [
"protected",
"function",
"getSlugFromName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"self",
"::",
"$",
"sluggedNames",
")",
")",
"{",
"return",
"self",
"::",
"$",
"sluggedNames",
"[",
"$",
"name",
"]",
";",
"}"... | Get slug name.
@param string $name
@return string | [
"Get",
"slug",
"name",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/auth/src/Authorization/Fluent.php#L309-L316 |
228,462 | antaresproject/core | src/ui/components/templates/src/Model/Components.php | Components.save | public function save(array $options = array())
{
try {
DB::transaction(function() use($options) {
$this->fill($options);
parent::save();
});
return true;
} catch (Exception $e) {
Log::emergency($e);
return ... | php | public function save(array $options = array())
{
try {
DB::transaction(function() use($options) {
$this->fill($options);
parent::save();
});
return true;
} catch (Exception $e) {
Log::emergency($e);
return ... | [
"public",
"function",
"save",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"try",
"{",
"DB",
"::",
"transaction",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"fill",
"(",
"$",
"options",
... | try to save widget
@param array $options
@return boolean | [
"try",
"to",
"save",
"widget"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Model/Components.php#L78-L92 |
228,463 | FlorianWolters/PHP-Component-Core-StringUtils | src/main/php/WordUtils.php | WordUtils.abbreviate | public static function abbreviate(
$inputString,
$lowerLimit,
$upperLimit = -1,
$append = StringUtils::EMPTY_STR
) {
if (true === StringUtils::isEmpty($inputString)) {
return $inputString;
}
$length = StringUtils::length($inputString);
//... | php | public static function abbreviate(
$inputString,
$lowerLimit,
$upperLimit = -1,
$append = StringUtils::EMPTY_STR
) {
if (true === StringUtils::isEmpty($inputString)) {
return $inputString;
}
$length = StringUtils::length($inputString);
//... | [
"public",
"static",
"function",
"abbreviate",
"(",
"$",
"inputString",
",",
"$",
"lowerLimit",
",",
"$",
"upperLimit",
"=",
"-",
"1",
",",
"$",
"append",
"=",
"StringUtils",
"::",
"EMPTY_STR",
")",
"{",
"if",
"(",
"true",
"===",
"StringUtils",
"::",
"isE... | Abbreviates a string nicely.
This method searches for the first space after the lower limit and
abbreviates the `string` there. It will also append any `string` passed
as a parameter to the end of the `string`.
The upper limit can be specified to forcibly abbreviate a `string`.
@param string $inputString The `strin... | [
"Abbreviates",
"a",
"string",
"nicely",
"."
] | 3b5e8762031cf66d6441ee98772fae4be0f5d0aa | https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/WordUtils.php#L73-L121 |
228,464 | FlorianWolters/PHP-Component-Core-StringUtils | src/main/php/WordUtils.php | WordUtils.capitalizeFully | public static function capitalizeFully($inputString)
{
$inputStringLower = StringUtils::lowerCase($inputString);
$result = self::capitalize($inputStringLower);
return $result;
} | php | public static function capitalizeFully($inputString)
{
$inputStringLower = StringUtils::lowerCase($inputString);
$result = self::capitalize($inputStringLower);
return $result;
} | [
"public",
"static",
"function",
"capitalizeFully",
"(",
"$",
"inputString",
")",
"{",
"$",
"inputStringLower",
"=",
"StringUtils",
"::",
"lowerCase",
"(",
"$",
"inputString",
")",
";",
"$",
"result",
"=",
"self",
"::",
"capitalize",
"(",
"$",
"inputStringLower... | Converts all the whitespace separated words in a `string` into
capitalized words, that is each word is made up of a titlecase character
and then a series of lowercase characters.
A `null` input `string` returns `null`.
Capitalization uses the Unicode title case, normally equivalent to upper
case.
WordUtils::capitaliz... | [
"Converts",
"all",
"the",
"whitespace",
"separated",
"words",
"in",
"a",
"string",
"into",
"capitalized",
"words",
"that",
"is",
"each",
"word",
"is",
"made",
"up",
"of",
"a",
"titlecase",
"character",
"and",
"then",
"a",
"series",
"of",
"lowercase",
"charac... | 3b5e8762031cf66d6441ee98772fae4be0f5d0aa | https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/WordUtils.php#L171-L177 |
228,465 | FlorianWolters/PHP-Component-Core-StringUtils | src/main/php/WordUtils.php | WordUtils.uncapitalize | public static function uncapitalize($inputString)
{
$func = function (array $matches) {
return StringUtils::lowerCase($matches[0]);
};
return \preg_replace_callback(
'~\b\w~',
$func,
$inputString
);
} | php | public static function uncapitalize($inputString)
{
$func = function (array $matches) {
return StringUtils::lowerCase($matches[0]);
};
return \preg_replace_callback(
'~\b\w~',
$func,
$inputString
);
} | [
"public",
"static",
"function",
"uncapitalize",
"(",
"$",
"inputString",
")",
"{",
"$",
"func",
"=",
"function",
"(",
"array",
"$",
"matches",
")",
"{",
"return",
"StringUtils",
"::",
"lowerCase",
"(",
"$",
"matches",
"[",
"0",
"]",
")",
";",
"}",
";",... | Uncapitalizes all the whitespace separated words in a `string`.
Only the first letter of each word is changed. A `null` input `string`
returns `null`.
WordUtils::uncapitalize(null); // null
WordUtils::uncapitalize(''); // ''
WordUtils::uncapitalize('I Am FINE'); // 'i am fINE'
@param string $inputStr... | [
"Uncapitalizes",
"all",
"the",
"whitespace",
"separated",
"words",
"in",
"a",
"string",
"."
] | 3b5e8762031cf66d6441ee98772fae4be0f5d0aa | https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/WordUtils.php#L195-L206 |
228,466 | FlorianWolters/PHP-Component-Core-StringUtils | src/main/php/WordUtils.php | WordUtils.initials | public static function initials($inputString, array $delimiters = null)
{
if (true === StringUtils::isEmpty($inputString)) {
return $inputString;
}
if ((null !== $delimiters) && (0 === \count($delimiters))) {
return StringUtils::EMPTY_STR;
}
$inputSt... | php | public static function initials($inputString, array $delimiters = null)
{
if (true === StringUtils::isEmpty($inputString)) {
return $inputString;
}
if ((null !== $delimiters) && (0 === \count($delimiters))) {
return StringUtils::EMPTY_STR;
}
$inputSt... | [
"public",
"static",
"function",
"initials",
"(",
"$",
"inputString",
",",
"array",
"$",
"delimiters",
"=",
"null",
")",
"{",
"if",
"(",
"true",
"===",
"StringUtils",
"::",
"isEmpty",
"(",
"$",
"inputString",
")",
")",
"{",
"return",
"$",
"inputString",
"... | Extracts the initial letters from each word in the `string`.
The first letter of the string and all first letters after the defined
delimiters are returned as a new string. Their case is not changed.
If the delimiters array is `null`, then Whitespace is used.
A `null` input `string` returns `null`.
An empty delimiter... | [
"Extracts",
"the",
"initial",
"letters",
"from",
"each",
"word",
"in",
"the",
"string",
"."
] | 3b5e8762031cf66d6441ee98772fae4be0f5d0aa | https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/WordUtils.php#L231-L258 |
228,467 | FlorianWolters/PHP-Component-Core-StringUtils | src/main/php/WordUtils.php | WordUtils.isDelimiter | private static function isDelimiter($char, array $delimiters = null)
{
if (null === $delimiters) {
return \ctype_space($char);
}
foreach ($delimiters as $delimiter) {
if ($char === $delimiter) {
return true;
}
}
return fal... | php | private static function isDelimiter($char, array $delimiters = null)
{
if (null === $delimiters) {
return \ctype_space($char);
}
foreach ($delimiters as $delimiter) {
if ($char === $delimiter) {
return true;
}
}
return fal... | [
"private",
"static",
"function",
"isDelimiter",
"(",
"$",
"char",
",",
"array",
"$",
"delimiters",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"delimiters",
")",
"{",
"return",
"\\",
"ctype_space",
"(",
"$",
"char",
")",
";",
"}",
"foreach",
... | Checks whether the specified string is a delimiter.
@param string $char The string to check.
@param array|null $delimiters The delimiters.
@return boolean `true` if it is a delimiter; `false` otherwise. | [
"Checks",
"whether",
"the",
"specified",
"string",
"is",
"a",
"delimiter",
"."
] | 3b5e8762031cf66d6441ee98772fae4be0f5d0aa | https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/WordUtils.php#L268-L281 |
228,468 | FlorianWolters/PHP-Component-Core-StringUtils | src/main/php/WordUtils.php | WordUtils.swapCase | public static function swapCase($inputString)
{
if (true === StringUtils::isEmpty($inputString)) {
return $inputString;
}
$buffer = \str_split($inputString);
$length = \count($buffer);
for ($i = 0; $i < $length; ++$i) {
$char = $buffer[$i];
... | php | public static function swapCase($inputString)
{
if (true === StringUtils::isEmpty($inputString)) {
return $inputString;
}
$buffer = \str_split($inputString);
$length = \count($buffer);
for ($i = 0; $i < $length; ++$i) {
$char = $buffer[$i];
... | [
"public",
"static",
"function",
"swapCase",
"(",
"$",
"inputString",
")",
"{",
"if",
"(",
"true",
"===",
"StringUtils",
"::",
"isEmpty",
"(",
"$",
"inputString",
")",
")",
"{",
"return",
"$",
"inputString",
";",
"}",
"$",
"buffer",
"=",
"\\",
"str_split"... | Swaps the case of a `string` using a word based algorithm.
* Upper case character converts to Lower case
* Lower case character converts to Upper case
A `null` input `string` returns `null`.
WordUtils::swapCase(null); // null
WordUtils::swapCase(''); // ''
WordUtils::swapCase('The dog... | [
"Swaps",
"the",
"case",
"of",
"a",
"string",
"using",
"a",
"word",
"based",
"algorithm",
"."
] | 3b5e8762031cf66d6441ee98772fae4be0f5d0aa | https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/WordUtils.php#L300-L320 |
228,469 | FlorianWolters/PHP-Component-Core-StringUtils | src/main/php/WordUtils.php | WordUtils.wrap | public static function wrap(
$inputString,
$wrapLength,
$newLineInsertion = null,
$wrapLongWords = false
) {
if (null === $inputString) {
return null;
}
if (null === $newLineInsertion) {
$newLineInsertion = \PHP_EOL;
}
... | php | public static function wrap(
$inputString,
$wrapLength,
$newLineInsertion = null,
$wrapLongWords = false
) {
if (null === $inputString) {
return null;
}
if (null === $newLineInsertion) {
$newLineInsertion = \PHP_EOL;
}
... | [
"public",
"static",
"function",
"wrap",
"(",
"$",
"inputString",
",",
"$",
"wrapLength",
",",
"$",
"newLineInsertion",
"=",
"null",
",",
"$",
"wrapLongWords",
"=",
"false",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"inputString",
")",
"{",
"return",
"null... | Wraps a single line of text, identifying words by `' '`.
Leading spaces on a new line are stripped. Trailing spaces are not
stripped.
WordUtils::wrap(null, null, null, null); // null
WordUtils::wrap('', null, null, null); // ''
@param string $inputString The `string` to be word wrapped.
@param integer $wrapLeng... | [
"Wraps",
"a",
"single",
"line",
"of",
"text",
"identifying",
"words",
"by",
"."
] | 3b5e8762031cf66d6441ee98772fae4be0f5d0aa | https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/WordUtils.php#L346-L379 |
228,470 | coincheckjp/coincheck-php | lib/Coincheck/Deposit.php | Deposit.all | public function all($params = array())
{
$arr = array(
"currency" => $params["currency"]
);
$rawResponse = $this->client->request('get', 'api/deposit_money', $arr);
return $rawResponse;
} | php | public function all($params = array())
{
$arr = array(
"currency" => $params["currency"]
);
$rawResponse = $this->client->request('get', 'api/deposit_money', $arr);
return $rawResponse;
} | [
"public",
"function",
"all",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"arr",
"=",
"array",
"(",
"\"currency\"",
"=>",
"$",
"params",
"[",
"\"currency\"",
"]",
")",
";",
"$",
"rawResponse",
"=",
"$",
"this",
"->",
"client",
"->",
"... | You Get Deposit history
@param mixed
@return Json Array | [
"You",
"Get",
"Deposit",
"history"
] | 5991003cb0ae827697888aeebd0aea0267fad7fa | https://github.com/coincheckjp/coincheck-php/blob/5991003cb0ae827697888aeebd0aea0267fad7fa/lib/Coincheck/Deposit.php#L20-L27 |
228,471 | coincheckjp/coincheck-php | lib/Coincheck/Deposit.php | Deposit.fast | public function fast($params = array())
{
$arr = array(
"id" => $params["id"]
);
$rawResponse = $this->client->request('post', 'api/deposit_money/' . $arr["id"] . "/fast", $arr);
return $rawResponse;
} | php | public function fast($params = array())
{
$arr = array(
"id" => $params["id"]
);
$rawResponse = $this->client->request('post', 'api/deposit_money/' . $arr["id"] . "/fast", $arr);
return $rawResponse;
} | [
"public",
"function",
"fast",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"arr",
"=",
"array",
"(",
"\"id\"",
"=>",
"$",
"params",
"[",
"\"id\"",
"]",
")",
";",
"$",
"rawResponse",
"=",
"$",
"this",
"->",
"client",
"->",
"request",
... | Deposit Bitcoin Faster
@param mixed
@return Json Array | [
"Deposit",
"Bitcoin",
"Faster"
] | 5991003cb0ae827697888aeebd0aea0267fad7fa | https://github.com/coincheckjp/coincheck-php/blob/5991003cb0ae827697888aeebd0aea0267fad7fa/lib/Coincheck/Deposit.php#L35-L42 |
228,472 | joomla-framework/google-api | src/Embed/Analytics.php | Analytics.deleteCall | public function deleteCall($index = null)
{
$calls = $this->listCalls();
if ($index === null)
{
$index = \count($calls) - 1;
}
$call = $calls[$index];
unset($calls[$index]);
$calls = array_values($calls);
$this->setOption('calls', $calls);
return $call;
} | php | public function deleteCall($index = null)
{
$calls = $this->listCalls();
if ($index === null)
{
$index = \count($calls) - 1;
}
$call = $calls[$index];
unset($calls[$index]);
$calls = array_values($calls);
$this->setOption('calls', $calls);
return $call;
} | [
"public",
"function",
"deleteCall",
"(",
"$",
"index",
"=",
"null",
")",
"{",
"$",
"calls",
"=",
"$",
"this",
"->",
"listCalls",
"(",
")",
";",
"if",
"(",
"$",
"index",
"===",
"null",
")",
"{",
"$",
"index",
"=",
"\\",
"count",
"(",
"$",
"calls",... | Delete a call from the stack
@param integer $index Index of call to delete (defaults to last added call)
@return array The deleted call
@since 1.0 | [
"Delete",
"a",
"call",
"from",
"the",
"stack"
] | c78f06cfaba3f0dfc3ce411a335b417a5f0ee904 | https://github.com/joomla-framework/google-api/blob/c78f06cfaba3f0dfc3ce411a335b417a5f0ee904/src/Embed/Analytics.php#L132-L147 |
228,473 | antaresproject/core | src/components/auth/src/Authorization/Authorization.php | Authorization.attach | public function attach(Provider $memory = null)
{
if ($this->attached() && $memory !== $this->memory) {
//throw new RuntimeException("Unable to assign multiple Antares\Memory instance.");
}
if (!is_null($memory)) {
$this->setMemoryProvider($memory);
$thi... | php | public function attach(Provider $memory = null)
{
if ($this->attached() && $memory !== $this->memory) {
//throw new RuntimeException("Unable to assign multiple Antares\Memory instance.");
}
if (!is_null($memory)) {
$this->setMemoryProvider($memory);
$thi... | [
"public",
"function",
"attach",
"(",
"Provider",
"$",
"memory",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attached",
"(",
")",
"&&",
"$",
"memory",
"!==",
"$",
"this",
"->",
"memory",
")",
"{",
"//throw new RuntimeException(\"Unable to assign mul... | Bind current ACL instance with a Memory instance.
@param \Antares\Contracts\Memory\Provider $memory
@return void
@throws \RuntimeException if $memory has been attached. | [
"Bind",
"current",
"ACL",
"instance",
"with",
"a",
"Memory",
"instance",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/auth/src/Authorization/Authorization.php#L71-L82 |
228,474 | antaresproject/core | src/components/auth/src/Authorization/Authorization.php | Authorization.initiate | protected function initiate()
{
$name = $this->name;
$data = ['acl' => [], 'actions' => [], 'roles' => []];
$data = array_merge($data, $this->memory->get("acl_{$name}", []));
if (empty($data['roles'])) {
$roles = $this->memory->get('acl_antares.roles');
... | php | protected function initiate()
{
$name = $this->name;
$data = ['acl' => [], 'actions' => [], 'roles' => []];
$data = array_merge($data, $this->memory->get("acl_{$name}", []));
if (empty($data['roles'])) {
$roles = $this->memory->get('acl_antares.roles');
... | [
"protected",
"function",
"initiate",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"name",
";",
"$",
"data",
"=",
"[",
"'acl'",
"=>",
"[",
"]",
",",
"'actions'",
"=>",
"[",
"]",
",",
"'roles'",
"=>",
"[",
"]",
"]",
";",
"$",
"data",
"=",
... | Initiate acl data from memory.
@return void | [
"Initiate",
"acl",
"data",
"from",
"memory",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/auth/src/Authorization/Authorization.php#L89-L106 |
228,475 | antaresproject/core | src/components/auth/src/Authorization/Authorization.php | Authorization.save | public function save($descriptions = null, $categories = null)
{
if ($this->attached()) {
$name = $this->name;
$this->memory->put("acl_{$name}", [
'acl' => $this->acl,
'actions' => $this->actions->get(),
'roles' => ... | php | public function save($descriptions = null, $categories = null)
{
if ($this->attached()) {
$name = $this->name;
$this->memory->put("acl_{$name}", [
'acl' => $this->acl,
'actions' => $this->actions->get(),
'roles' => ... | [
"public",
"function",
"save",
"(",
"$",
"descriptions",
"=",
"null",
",",
"$",
"categories",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attached",
"(",
")",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"name",
";",
"$",
"this",
"->",... | Saves authorization changes
@return \Antares\Authorization\Authorization | [
"Saves",
"authorization",
"changes"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/auth/src/Authorization/Authorization.php#L218-L231 |
228,476 | antaresproject/core | src/utils/security/src/Scope/AccessScope.php | AccessScope.apply | public function apply(Builder $builder, Model $model)
{
$column = $this->getPolicyColumn($model);
if (is_null($column) && get_class($model) !== \Antares\Model\User::class) {
return;
}
if (!auth()->user()) {
return;
}
$id = auth()->user()... | php | public function apply(Builder $builder, Model $model)
{
$column = $this->getPolicyColumn($model);
if (is_null($column) && get_class($model) !== \Antares\Model\User::class) {
return;
}
if (!auth()->user()) {
return;
}
$id = auth()->user()... | [
"public",
"function",
"apply",
"(",
"Builder",
"$",
"builder",
",",
"Model",
"$",
"model",
")",
"{",
"$",
"column",
"=",
"$",
"this",
"->",
"getPolicyColumn",
"(",
"$",
"model",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"column",
")",
"&&",
"get_clas... | apply active logs global scope
@param Builder $builder
@param Model $model | [
"apply",
"active",
"logs",
"global",
"scope"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/security/src/Scope/AccessScope.php#L48-L76 |
228,477 | antaresproject/core | src/utils/security/src/Scope/AccessScope.php | AccessScope.getPolicyColumn | protected function getPolicyColumn(Model $model)
{
$connection = $model->getConnection();
$table = $connection->getTablePrefix() . $model->getTable();
$schema = $connection->getDoctrineSchemaManager($table);
$columns = Cache::remember('keys_' . $table, 30, function() use... | php | protected function getPolicyColumn(Model $model)
{
$connection = $model->getConnection();
$table = $connection->getTablePrefix() . $model->getTable();
$schema = $connection->getDoctrineSchemaManager($table);
$columns = Cache::remember('keys_' . $table, 30, function() use... | [
"protected",
"function",
"getPolicyColumn",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"connection",
"=",
"$",
"model",
"->",
"getConnection",
"(",
")",
";",
"$",
"table",
"=",
"$",
"connection",
"->",
"getTablePrefix",
"(",
")",
".",
"$",
"model",
"->",... | get column name which can be used as user connector
@param Model $model
@return String | [
"get",
"column",
"name",
"which",
"can",
"be",
"used",
"as",
"user",
"connector"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/security/src/Scope/AccessScope.php#L84-L112 |
228,478 | antaresproject/core | src/components/publisher/src/AssetManager.php | AssetManager.foundation | public function foundation()
{
$path = rtrim($this->app->make('path.base'), '/') . '/src/core/foundation/resources/public';
if (!$this->app->make('files')->isDirectory($path)) {
return false;
}
try {
return $this->publish('antares/foundation', $path);
... | php | public function foundation()
{
$path = rtrim($this->app->make('path.base'), '/') . '/src/core/foundation/resources/public';
if (!$this->app->make('files')->isDirectory($path)) {
return false;
}
try {
return $this->publish('antares/foundation', $path);
... | [
"public",
"function",
"foundation",
"(",
")",
"{",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'path.base'",
")",
",",
"'/'",
")",
".",
"'/src/core/foundation/resources/public'",
";",
"if",
"(",
"!",
"$",
"this",
"->",
... | Migrate Antares.
@return mixed
@throws FilePermissionException | [
"Migrate",
"Antares",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/publisher/src/AssetManager.php#L105-L119 |
228,479 | antaresproject/core | src/components/publisher/src/AssetManager.php | AssetManager.delete | public function delete($name)
{
$path = public_path() . DIRECTORY_SEPARATOR . 'packages' . DIRECTORY_SEPARATOR . $name;
if (!$this->app->make('files')->isDirectory($path)) {
return false;
}
try {
return $this->publisher->delete($path);
} catch (Except... | php | public function delete($name)
{
$path = public_path() . DIRECTORY_SEPARATOR . 'packages' . DIRECTORY_SEPARATOR . $name;
if (!$this->app->make('files')->isDirectory($path)) {
return false;
}
try {
return $this->publisher->delete($path);
} catch (Except... | [
"public",
"function",
"delete",
"(",
"$",
"name",
")",
"{",
"$",
"path",
"=",
"public_path",
"(",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"'packages'",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"name",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"app",
"->",
"ma... | deletes published extension asset
@param String $name
@return boolean
@throws Exception | [
"deletes",
"published",
"extension",
"asset"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/publisher/src/AssetManager.php#L148-L161 |
228,480 | antaresproject/core | src/components/model/src/Traits/MetableTrait.php | MetableTrait.getMetaAttribute | public function getMetaAttribute($value)
{
$meta = [];
if (! is_null($value)) {
$meta = json_decode($value, true);
}
return new Meta($meta);
} | php | public function getMetaAttribute($value)
{
$meta = [];
if (! is_null($value)) {
$meta = json_decode($value, true);
}
return new Meta($meta);
} | [
"public",
"function",
"getMetaAttribute",
"(",
"$",
"value",
")",
"{",
"$",
"meta",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"$",
"meta",
"=",
"json_decode",
"(",
"$",
"value",
",",
"true",
")",
";",
"}",
... | `meta` field accessor.
@param mixed $value
@return \Antares\Model\Value\Meta | [
"meta",
"field",
"accessor",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/model/src/Traits/MetableTrait.php#L35-L44 |
228,481 | antaresproject/core | src/foundation/src/Foundation.php | Foundation.createAdminMenu | protected function createAdminMenu()
{
$config = config('menu');
$events = $this->app->make('events');
foreach ($config as $event => $ordered) {
foreach ($ordered as $name => $value) {
if (is_numeric($name)) {
$events->listen($event, $value);
... | php | protected function createAdminMenu()
{
$config = config('menu');
$events = $this->app->make('events');
foreach ($config as $event => $ordered) {
foreach ($ordered as $name => $value) {
if (is_numeric($name)) {
$events->listen($event, $value);
... | [
"protected",
"function",
"createAdminMenu",
"(",
")",
"{",
"$",
"config",
"=",
"config",
"(",
"'menu'",
")",
";",
"$",
"events",
"=",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'events'",
")",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"event"... | Create Administration Menu for Antares.
@return void | [
"Create",
"Administration",
"Menu",
"for",
"Antares",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Foundation.php#L199-L213 |
228,482 | antaresproject/core | src/components/extension/src/SettingsFormResolver.php | SettingsFormResolver.tryGetSettingsForm | public function tryGetSettingsForm(ExtensionContract $extension) : SettingsFormContract {
$className = $extension->getRootNamespace() . self::$formClassName;
if( ! class_exists($className) ) {
throw new InvalidArgumentException('The provided class name [' . $className . '] does not exist.')... | php | public function tryGetSettingsForm(ExtensionContract $extension) : SettingsFormContract {
$className = $extension->getRootNamespace() . self::$formClassName;
if( ! class_exists($className) ) {
throw new InvalidArgumentException('The provided class name [' . $className . '] does not exist.')... | [
"public",
"function",
"tryGetSettingsForm",
"(",
"ExtensionContract",
"$",
"extension",
")",
":",
"SettingsFormContract",
"{",
"$",
"className",
"=",
"$",
"extension",
"->",
"getRootNamespace",
"(",
")",
".",
"self",
"::",
"$",
"formClassName",
";",
"if",
"(",
... | Returns the instance of settings form by the given extension.
@param ExtensionContract $extension
@return SettingsFormContract
@throws InvalidArgumentException
@throws DomainException | [
"Returns",
"the",
"instance",
"of",
"settings",
"form",
"by",
"the",
"given",
"extension",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/SettingsFormResolver.php#L57-L71 |
228,483 | antaresproject/core | src/ui/components/templates/src/TemplateFinder.php | TemplateFinder.parseThemeNameFromPath | protected function parseThemeNameFromPath($path)
{
$path = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);
$path = explode(DIRECTORY_SEPARATOR, $path);
return array_pop($path);
} | php | protected function parseThemeNameFromPath($path)
{
$path = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);
$path = explode(DIRECTORY_SEPARATOR, $path);
return array_pop($path);
} | [
"protected",
"function",
"parseThemeNameFromPath",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"[",
"'\\\\'",
",",
"'/'",
"]",
",",
"DIRECTORY_SEPARATOR",
",",
"$",
"path",
")",
";",
"$",
"path",
"=",
"explode",
"(",
"DIRECTORY_SEPARA... | Gets folder name from full path.
@param String $path
@return String | [
"Gets",
"folder",
"name",
"from",
"full",
"path",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/TemplateFinder.php#L86-L92 |
228,484 | antaresproject/core | src/components/memory/src/MemoryManager.php | MemoryManager.createSessionDriver | protected function createSessionDriver($name)
{
$config = Arr::get($this->config, "session.{$name}", []);
return $this->createProvider(new Session($name, $config));
} | php | protected function createSessionDriver($name)
{
$config = Arr::get($this->config, "session.{$name}", []);
return $this->createProvider(new Session($name, $config));
} | [
"protected",
"function",
"createSessionDriver",
"(",
"$",
"name",
")",
"{",
"$",
"config",
"=",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"config",
",",
"\"session.{$name}\"",
",",
"[",
"]",
")",
";",
"return",
"$",
"this",
"->",
"createProvider",
"(",... | Create Session driver.
@param string $name
@return \Antares\Contracts\Memory\Provider | [
"Create",
"Session",
"driver",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/MemoryManager.php#L82-L86 |
228,485 | antaresproject/core | src/components/memory/src/MemoryManager.php | MemoryManager.createRegistryDriver | protected function createRegistryDriver($name)
{
$config = Arr::get($this->config, "registry.{$name}", []);
$cache = $this->getCacheRepository($config);
return $this->createProvider(Registry::getInstance($name, $config, $this->app, $cache));
} | php | protected function createRegistryDriver($name)
{
$config = Arr::get($this->config, "registry.{$name}", []);
$cache = $this->getCacheRepository($config);
return $this->createProvider(Registry::getInstance($name, $config, $this->app, $cache));
} | [
"protected",
"function",
"createRegistryDriver",
"(",
"$",
"name",
")",
"{",
"$",
"config",
"=",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"config",
",",
"\"registry.{$name}\"",
",",
"[",
"]",
")",
";",
"$",
"cache",
"=",
"$",
"this",
"->",
"getCache... | Create Registry driver.
@param string $name
@return \Antares\Contracts\Memory\Provider | [
"Create",
"Registry",
"driver",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/MemoryManager.php#L121-L127 |
228,486 | antaresproject/core | src/components/memory/src/MemoryManager.php | MemoryManager.createComponentDriver | protected function createComponentDriver($name)
{
$config = Arr::get($this->config, "component.{$name}", []);
$cache = $this->getCacheRepository($config);
return $this->createProvider(new Component($name, $config, $this->app, $cache));
} | php | protected function createComponentDriver($name)
{
$config = Arr::get($this->config, "component.{$name}", []);
$cache = $this->getCacheRepository($config);
return $this->createProvider(new Component($name, $config, $this->app, $cache));
} | [
"protected",
"function",
"createComponentDriver",
"(",
"$",
"name",
")",
"{",
"$",
"config",
"=",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"config",
",",
"\"component.{$name}\"",
",",
"[",
"]",
")",
";",
"$",
"cache",
"=",
"$",
"this",
"->",
"getCac... | Create Component driver.
@param string $name
@return \Antares\Contracts\Memory\Provider | [
"Create",
"Component",
"driver",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/MemoryManager.php#L134-L139 |
228,487 | antaresproject/core | src/components/memory/src/MemoryManager.php | MemoryManager.createPrimaryDriver | protected function createPrimaryDriver($name)
{
$config = Arr::get($this->config, "primary", []);
$cache = $this->getCacheRepository($config);
return $this->createProvider(new Handlers\Primary($name, $config, $this->app, $cache));
} | php | protected function createPrimaryDriver($name)
{
$config = Arr::get($this->config, "primary", []);
$cache = $this->getCacheRepository($config);
return $this->createProvider(new Handlers\Primary($name, $config, $this->app, $cache));
} | [
"protected",
"function",
"createPrimaryDriver",
"(",
"$",
"name",
")",
"{",
"$",
"config",
"=",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"config",
",",
"\"primary\"",
",",
"[",
"]",
")",
";",
"$",
"cache",
"=",
"$",
"this",
"->",
"getCacheRepository... | Create Primary driver.
@param string $name
@return \Antares\Contracts\Memory\Provider | [
"Create",
"Primary",
"driver",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/MemoryManager.php#L146-L152 |
228,488 | 24aitor/Localizer | src/Builder.php | Builder.allowedLanguages | public static function allowedLanguages()
{
if (config('localizer.allowed_langs')) {
return self::addNames(array_merge(config('localizer.allowed_langs'), [config('localizer.default_lang')]));
} else {
return self::addNames([config('localizer.default_lang')]);
}
} | php | public static function allowedLanguages()
{
if (config('localizer.allowed_langs')) {
return self::addNames(array_merge(config('localizer.allowed_langs'), [config('localizer.default_lang')]));
} else {
return self::addNames([config('localizer.default_lang')]);
}
} | [
"public",
"static",
"function",
"allowedLanguages",
"(",
")",
"{",
"if",
"(",
"config",
"(",
"'localizer.allowed_langs'",
")",
")",
"{",
"return",
"self",
"::",
"addNames",
"(",
"array_merge",
"(",
"config",
"(",
"'localizer.allowed_langs'",
")",
",",
"[",
"co... | Get all allowed languages.
@return array | [
"Get",
"all",
"allowed",
"languages",
"."
] | 3f234dfeab1030119148ece01f61d79dba27ac67 | https://github.com/24aitor/Localizer/blob/3f234dfeab1030119148ece01f61d79dba27ac67/src/Builder.php#L14-L21 |
228,489 | 24aitor/Localizer | src/Builder.php | Builder.getCode | public static function getCode($name = 'default')
{
if ($name == 'default') {
$name = self::getLanguage();
}
return self::addCodes([$name])[$name];
} | php | public static function getCode($name = 'default')
{
if ($name == 'default') {
$name = self::getLanguage();
}
return self::addCodes([$name])[$name];
} | [
"public",
"static",
"function",
"getCode",
"(",
"$",
"name",
"=",
"'default'",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"'default'",
")",
"{",
"$",
"name",
"=",
"self",
"::",
"getLanguage",
"(",
")",
";",
"}",
"return",
"self",
"::",
"addCodes",
"(",
... | Returns the current language code.
@return string | [
"Returns",
"the",
"current",
"language",
"code",
"."
] | 3f234dfeab1030119148ece01f61d79dba27ac67 | https://github.com/24aitor/Localizer/blob/3f234dfeab1030119148ece01f61d79dba27ac67/src/Builder.php#L122-L129 |
228,490 | 24aitor/Localizer | src/Builder.php | Builder.getLanguage | public static function getLanguage($code = 'default')
{
if ($code == 'default') {
$code = App::getLocale();
}
return self::addNames([$code])[$code];
} | php | public static function getLanguage($code = 'default')
{
if ($code == 'default') {
$code = App::getLocale();
}
return self::addNames([$code])[$code];
} | [
"public",
"static",
"function",
"getLanguage",
"(",
"$",
"code",
"=",
"'default'",
")",
"{",
"if",
"(",
"$",
"code",
"==",
"'default'",
")",
"{",
"$",
"code",
"=",
"App",
"::",
"getLocale",
"(",
")",
";",
"}",
"return",
"self",
"::",
"addNames",
"(",... | Returns the language name.
@return string | [
"Returns",
"the",
"language",
"name",
"."
] | 3f234dfeab1030119148ece01f61d79dba27ac67 | https://github.com/24aitor/Localizer/blob/3f234dfeab1030119148ece01f61d79dba27ac67/src/Builder.php#L136-L143 |
228,491 | antaresproject/core | src/components/html/src/Form/FormBuilder.php | FormBuilder.clientSubmit | protected function clientSubmit($buttons)
{
if (empty($buttons)) {
return false;
}
$scripts = false;
foreach ($buttons as $button) {
if (array_get($button instanceof AbstractType ? $button->getAttributes() : $button->attributes, 'type') !== 'submit' or array_g... | php | protected function clientSubmit($buttons)
{
if (empty($buttons)) {
return false;
}
$scripts = false;
foreach ($buttons as $button) {
if (array_get($button instanceof AbstractType ? $button->getAttributes() : $button->attributes, 'type') !== 'submit' or array_g... | [
"protected",
"function",
"clientSubmit",
"(",
"$",
"buttons",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"buttons",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"scripts",
"=",
"false",
";",
"foreach",
"(",
"$",
"buttons",
"as",
"$",
"button",
")",
... | Whether form can be submited by Ctrl+Enter
@param array $buttons
@return boolean | [
"Whether",
"form",
"can",
"be",
"submited",
"by",
"Ctrl",
"+",
"Enter"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Form/FormBuilder.php#L176-L202 |
228,492 | antaresproject/core | src/components/html/src/Form/FormBuilder.php | FormBuilder.addHiddenKey | protected function addHiddenKey(GridContract $grid)
{
$fieldsets = $grid->fieldsets();
if ($fieldsets->isEmpty()) {
return false;
}
$name = $fieldsets->first()->name;
$name instanceof Closure and $name = sprintf('fieldset-%d', $fieldsets->count());
$... | php | protected function addHiddenKey(GridContract $grid)
{
$fieldsets = $grid->fieldsets();
if ($fieldsets->isEmpty()) {
return false;
}
$name = $fieldsets->first()->name;
$name instanceof Closure and $name = sprintf('fieldset-%d', $fieldsets->count());
$... | [
"protected",
"function",
"addHiddenKey",
"(",
"GridContract",
"$",
"grid",
")",
"{",
"$",
"fieldsets",
"=",
"$",
"grid",
"->",
"fieldsets",
"(",
")",
";",
"if",
"(",
"$",
"fieldsets",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
... | append hidden key with resource info
@param GridContract $grid
@return boolean | [
"append",
"hidden",
"key",
"with",
"resource",
"info"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Form/FormBuilder.php#L210-L225 |
228,493 | antaresproject/core | src/components/html/src/Form/FormBuilder.php | FormBuilder.setCustomFieldsValidator | public function setCustomFieldsValidator($on, $event, array $attributes = array())
{
$this->customFieldsValidator[$on] = [$event => $attributes];
return $this;
} | php | public function setCustomFieldsValidator($on, $event, array $attributes = array())
{
$this->customFieldsValidator[$on] = [$event => $attributes];
return $this;
} | [
"public",
"function",
"setCustomFieldsValidator",
"(",
"$",
"on",
",",
"$",
"event",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"customFieldsValidator",
"[",
"$",
"on",
"]",
"=",
"[",
"$",
"event",
"=>",
"$",
... | custom fields validator setter
@param String $on
@param String $event
@param array $attributes
@return \Antares\Html\Form\FormBuilder | [
"custom",
"fields",
"validator",
"setter"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Form/FormBuilder.php#L245-L249 |
228,494 | antaresproject/core | src/components/html/src/Form/FormBuilder.php | FormBuilder.isValid | public function isValid($sendHeaders = true)
{
app(\Antares\Html\Adapter\CustomfieldAdapter::class)->adapt($this->grid);
$decryptedKey = is_null($key = Input::get('key')) ? null : Crypt::decrypt($key);
if ($this->grid->ajaxable !== false && !$this->container->make('antares.reques... | php | public function isValid($sendHeaders = true)
{
app(\Antares\Html\Adapter\CustomfieldAdapter::class)->adapt($this->grid);
$decryptedKey = is_null($key = Input::get('key')) ? null : Crypt::decrypt($key);
if ($this->grid->ajaxable !== false && !$this->container->make('antares.reques... | [
"public",
"function",
"isValid",
"(",
"$",
"sendHeaders",
"=",
"true",
")",
"{",
"app",
"(",
"\\",
"Antares",
"\\",
"Html",
"\\",
"Adapter",
"\\",
"CustomfieldAdapter",
"::",
"class",
")",
"->",
"adapt",
"(",
"$",
"this",
"->",
"grid",
")",
";",
"$",
... | does the form is valid
@return mixed | [
"does",
"the",
"form",
"is",
"valid"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Form/FormBuilder.php#L256-L281 |
228,495 | antaresproject/core | src/components/html/src/Form/FormBuilder.php | FormBuilder.rules | protected function rules(Collection $fieldsets)
{
$grid = $this->grid;
if (!empty($grid->rules)) {
$controls = [];
foreach ($fieldsets as $fieldset) {
foreach ($fieldset->controls() as $control) {
array_push(
$co... | php | protected function rules(Collection $fieldsets)
{
$grid = $this->grid;
if (!empty($grid->rules)) {
$controls = [];
foreach ($fieldsets as $fieldset) {
foreach ($fieldset->controls() as $control) {
array_push(
$co... | [
"protected",
"function",
"rules",
"(",
"Collection",
"$",
"fieldsets",
")",
"{",
"$",
"grid",
"=",
"$",
"this",
"->",
"grid",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"grid",
"->",
"rules",
")",
")",
"{",
"$",
"controls",
"=",
"[",
"]",
";",
"fore... | verify rules settings depends on controls visibility
@param Collection $fieldsets | [
"verify",
"rules",
"settings",
"depends",
"on",
"controls",
"visibility"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Form/FormBuilder.php#L298-L313 |
228,496 | antaresproject/core | src/components/html/src/Form/FormBuilder.php | FormBuilder.getData | public function getData()
{
$fieldsets = $this->grid->fieldsets;
$controls = [];
foreach ($fieldsets as $fieldset) {
foreach ($fieldset->controls() as $control) {
array_push($controls, $control->name);
}
}
$keys = $this->resolveWithMul... | php | public function getData()
{
$fieldsets = $this->grid->fieldsets;
$controls = [];
foreach ($fieldsets as $fieldset) {
foreach ($fieldset->controls() as $control) {
array_push($controls, $control->name);
}
}
$keys = $this->resolveWithMul... | [
"public",
"function",
"getData",
"(",
")",
"{",
"$",
"fieldsets",
"=",
"$",
"this",
"->",
"grid",
"->",
"fieldsets",
";",
"$",
"controls",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"fieldsets",
"as",
"$",
"fieldset",
")",
"{",
"foreach",
"(",
"$",
"... | gets data from post by form controls
@return array | [
"gets",
"data",
"from",
"post",
"by",
"form",
"controls"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Form/FormBuilder.php#L320-L331 |
228,497 | antaresproject/core | src/components/html/src/Form/FormBuilder.php | FormBuilder.resolveWithMultiples | protected function resolveWithMultiples(array $controlKeys = array())
{
$return = [];
foreach ($controlKeys as $key) {
preg_match_all("/\[[^\]]*\]/", $key, $matches);
if (isset($matches[0])) {
$key = str_replace(is_array($matches[0]) ? implode('', $matches[0])... | php | protected function resolveWithMultiples(array $controlKeys = array())
{
$return = [];
foreach ($controlKeys as $key) {
preg_match_all("/\[[^\]]*\]/", $key, $matches);
if (isset($matches[0])) {
$key = str_replace(is_array($matches[0]) ? implode('', $matches[0])... | [
"protected",
"function",
"resolveWithMultiples",
"(",
"array",
"$",
"controlKeys",
"=",
"array",
"(",
")",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"controlKeys",
"as",
"$",
"key",
")",
"{",
"preg_match_all",
"(",
"\"/\\[[^\\]]*\\]... | resolve form keys with multiple fields
@param array $controlKeys
@return array | [
"resolve",
"form",
"keys",
"with",
"multiple",
"fields"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Form/FormBuilder.php#L339-L350 |
228,498 | antaresproject/core | src/components/notifier/src/Adapter/FastSmsAdapter.php | FastSmsAdapter.validate | protected function validate()
{
$result = $this->request($action = 'CheckCredits');
if ((int) $result <= 0) {
throw new Exception($this->config['codes']['-100']);
}
return $result;
} | php | protected function validate()
{
$result = $this->request($action = 'CheckCredits');
if ((int) $result <= 0) {
throw new Exception($this->config['codes']['-100']);
}
return $result;
} | [
"protected",
"function",
"validate",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",
"$",
"action",
"=",
"'CheckCredits'",
")",
";",
"if",
"(",
"(",
"int",
")",
"$",
"result",
"<=",
"0",
")",
"{",
"throw",
"new",
"Exception",
... | Validates whether connection to gateway is established
@return mixed
@throws Exception | [
"Validates",
"whether",
"connection",
"to",
"gateway",
"is",
"established"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/notifier/src/Adapter/FastSmsAdapter.php#L97-L104 |
228,499 | antaresproject/core | src/components/notifier/src/Adapter/FastSmsAdapter.php | FastSmsAdapter.request | protected function request($action = '', array $params = [])
{
$params['Token'] = $this->config['api']['token'];
if ($action !== '') {
$params['Action'] = $action;
}
$query = http_build_query($params);
$url = $this->config['api']['url'];
$ch = curl_in... | php | protected function request($action = '', array $params = [])
{
$params['Token'] = $this->config['api']['token'];
if ($action !== '') {
$params['Action'] = $action;
}
$query = http_build_query($params);
$url = $this->config['api']['url'];
$ch = curl_in... | [
"protected",
"function",
"request",
"(",
"$",
"action",
"=",
"''",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"[",
"'Token'",
"]",
"=",
"$",
"this",
"->",
"config",
"[",
"'api'",
"]",
"[",
"'token'",
"]",
";",
"if",
"(",... | Creates request to sms gateway
@param String $action
@param array $params
@return mixed
@throws Exception | [
"Creates",
"request",
"to",
"sms",
"gateway"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/notifier/src/Adapter/FastSmsAdapter.php#L114-L147 |
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.