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,200 | tomwalder/php-appengine-search | src/Search/Query.php | Query.sort | public function sort($str_field, $str_direction = self::DESC)
{
$this->arr_sorts[] = [$str_field, $str_direction];
return $this;
} | php | public function sort($str_field, $str_direction = self::DESC)
{
$this->arr_sorts[] = [$str_field, $str_direction];
return $this;
} | [
"public",
"function",
"sort",
"(",
"$",
"str_field",
",",
"$",
"str_direction",
"=",
"self",
"::",
"DESC",
")",
"{",
"$",
"this",
"->",
"arr_sorts",
"[",
"]",
"=",
"[",
"$",
"str_field",
",",
"$",
"str_direction",
"]",
";",
"return",
"$",
"this",
";"... | Sort results by a field in ASCending order
@param $str_field
@param string $str_direction
@return $this | [
"Sort",
"results",
"by",
"a",
"field",
"in",
"ASCending",
"order"
] | e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba | https://github.com/tomwalder/php-appengine-search/blob/e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba/src/Search/Query.php#L167-L171 |
228,201 | antaresproject/core | src/ui/components/templates/src/Traits/DispatchableTrait.php | DispatchableTrait.finish | public function finish()
{
if (isset($this->components)) {
foreach ($this->components as $name => $options) {
$this->dispatcher->finish($name, $options);
}
}
$this->components = new Collection();
return $this;
} | php | public function finish()
{
if (isset($this->components)) {
foreach ($this->components as $name => $options) {
$this->dispatcher->finish($name, $options);
}
}
$this->components = new Collection();
return $this;
} | [
"public",
"function",
"finish",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"components",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"components",
"as",
"$",
"name",
"=>",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"dispatch... | Shutdown all extensions.
@return $this | [
"Shutdown",
"all",
"extensions",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Traits/DispatchableTrait.php#L50-L61 |
228,202 | antaresproject/core | src/utils/form/src/Controls/AbstractType.php | AbstractType.findErrors | protected function findErrors()
{
$session = session();
if (!$session->has('errors') || !$session->get('errors')->hasBag('default')) {
return;
}
/** @var MessageBag $messageBag */
$messageBag = session()->get('errors')->getBag('default');
if (isset($messag... | php | protected function findErrors()
{
$session = session();
if (!$session->has('errors') || !$session->get('errors')->hasBag('default')) {
return;
}
/** @var MessageBag $messageBag */
$messageBag = session()->get('errors')->getBag('default');
if (isset($messag... | [
"protected",
"function",
"findErrors",
"(",
")",
"{",
"$",
"session",
"=",
"session",
"(",
")",
";",
"if",
"(",
"!",
"$",
"session",
"->",
"has",
"(",
"'errors'",
")",
"||",
"!",
"$",
"session",
"->",
"get",
"(",
"'errors'",
")",
"->",
"hasBag",
"(... | lookup for validation errors for this control | [
"lookup",
"for",
"validation",
"errors",
"for",
"this",
"control"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/form/src/Controls/AbstractType.php#L296-L309 |
228,203 | antaresproject/core | src/utils/form/src/Controls/AbstractType.php | AbstractType.render | protected function render()
{
$this->findErrors();
if (!$this->label instanceof AbstractLabel) {
$this->setLabel(new Label(ucfirst(str_replace('_', ' ', $this->name))));
}
if (!$this->decorator instanceof AbstractDecorator) {
$this->setDecorator((new HorizontalD... | php | protected function render()
{
$this->findErrors();
if (!$this->label instanceof AbstractLabel) {
$this->setLabel(new Label(ucfirst(str_replace('_', ' ', $this->name))));
}
if (!$this->decorator instanceof AbstractDecorator) {
$this->setDecorator((new HorizontalD... | [
"protected",
"function",
"render",
"(",
")",
"{",
"$",
"this",
"->",
"findErrors",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"label",
"instanceof",
"AbstractLabel",
")",
"{",
"$",
"this",
"->",
"setLabel",
"(",
"new",
"Label",
"(",
"ucfirst",
... | Render control to html
@return string | [
"Render",
"control",
"to",
"html"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/form/src/Controls/AbstractType.php#L350-L362 |
228,204 | lawoole/framework | src/Homer/Transport/Whisper/WhisperServerSocketHandler.php | WhisperServerSocketHandler.checkReceivedDataMagic | protected function checkReceivedDataMagic($data)
{
if (! Str::startsWith($data, self::MAGIC_HEADER)) {
throw new TransportException('Receive data with error bytes.', TransportException::REMOTE);
}
} | php | protected function checkReceivedDataMagic($data)
{
if (! Str::startsWith($data, self::MAGIC_HEADER)) {
throw new TransportException('Receive data with error bytes.', TransportException::REMOTE);
}
} | [
"protected",
"function",
"checkReceivedDataMagic",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"Str",
"::",
"startsWith",
"(",
"$",
"data",
",",
"self",
"::",
"MAGIC_HEADER",
")",
")",
"{",
"throw",
"new",
"TransportException",
"(",
"'Receive data with error b... | Check the data just received.
@param string $data | [
"Check",
"the",
"data",
"just",
"received",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Transport/Whisper/WhisperServerSocketHandler.php#L65-L70 |
228,205 | antaresproject/core | src/ui/components/templates/src/Service/Service.php | Service.findOne | public function findOne($attributes, $uri)
{
$where = [
'resource' => $uri,
'name' => snake_case(array_get($attributes, 'name'))
];
$components = $this->components->filter(function($item) use($where) {
return $item->resource == array_get($where, '... | php | public function findOne($attributes, $uri)
{
$where = [
'resource' => $uri,
'name' => snake_case(array_get($attributes, 'name'))
];
$components = $this->components->filter(function($item) use($where) {
return $item->resource == array_get($where, '... | [
"public",
"function",
"findOne",
"(",
"$",
"attributes",
",",
"$",
"uri",
")",
"{",
"$",
"where",
"=",
"[",
"'resource'",
"=>",
"$",
"uri",
",",
"'name'",
"=>",
"snake_case",
"(",
"array_get",
"(",
"$",
"attributes",
",",
"'name'",
")",
")",
"]",
";"... | Finds ui component details
@param array $attributes
@param String $uri
@return array | [
"Finds",
"ui",
"component",
"details"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Service/Service.php#L52-L66 |
228,206 | robgridley/flysystem-smb | src/SmbAdapter.php | SmbAdapter.recursiveCreateDir | protected function recursiveCreateDir($path)
{
if ($this->isDirectory($path)) {
return;
}
$directories = explode($this->pathSeparator, $path);
if (count($directories) > 1) {
$parentDirectories = array_splice($directories, 0, count($directories) - 1);
... | php | protected function recursiveCreateDir($path)
{
if ($this->isDirectory($path)) {
return;
}
$directories = explode($this->pathSeparator, $path);
if (count($directories) > 1) {
$parentDirectories = array_splice($directories, 0, count($directories) - 1);
... | [
"protected",
"function",
"recursiveCreateDir",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDirectory",
"(",
"$",
"path",
")",
")",
"{",
"return",
";",
"}",
"$",
"directories",
"=",
"explode",
"(",
"$",
"this",
"->",
"pathSeparator",
",... | Recursively create directories.
@param $path | [
"Recursively",
"create",
"directories",
"."
] | 91927ceb5ace080973bc2df226c18a8d2086de20 | https://github.com/robgridley/flysystem-smb/blob/91927ceb5ace080973bc2df226c18a8d2086de20/src/SmbAdapter.php#L202-L217 |
228,207 | robgridley/flysystem-smb | src/SmbAdapter.php | SmbAdapter.has | public function has($path)
{
$location = $this->applyPathPrefix($path);
try {
$this->share->stat($location);
} catch (NotFoundException $e) {
return false;
}
return true;
} | php | public function has($path)
{
$location = $this->applyPathPrefix($path);
try {
$this->share->stat($location);
} catch (NotFoundException $e) {
return false;
}
return true;
} | [
"public",
"function",
"has",
"(",
"$",
"path",
")",
"{",
"$",
"location",
"=",
"$",
"this",
"->",
"applyPathPrefix",
"(",
"$",
"path",
")",
";",
"try",
"{",
"$",
"this",
"->",
"share",
"->",
"stat",
"(",
"$",
"location",
")",
";",
"}",
"catch",
"... | Determine if a file or directory exists.
@param string $path
@return bool | [
"Determine",
"if",
"a",
"file",
"or",
"directory",
"exists",
"."
] | 91927ceb5ace080973bc2df226c18a8d2086de20 | https://github.com/robgridley/flysystem-smb/blob/91927ceb5ace080973bc2df226c18a8d2086de20/src/SmbAdapter.php#L225-L236 |
228,208 | robgridley/flysystem-smb | src/SmbAdapter.php | SmbAdapter.getMetadata | public function getMetadata($path)
{
$location = $this->applyPathPrefix($path);
try {
$file = $this->share->stat($location);
} catch (NotFoundException $e) {
return false;
}
return $this->normalizeFileInfo($file);
} | php | public function getMetadata($path)
{
$location = $this->applyPathPrefix($path);
try {
$file = $this->share->stat($location);
} catch (NotFoundException $e) {
return false;
}
return $this->normalizeFileInfo($file);
} | [
"public",
"function",
"getMetadata",
"(",
"$",
"path",
")",
"{",
"$",
"location",
"=",
"$",
"this",
"->",
"applyPathPrefix",
"(",
"$",
"path",
")",
";",
"try",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"share",
"->",
"stat",
"(",
"$",
"location",
"... | Get all of the metadata for a file or directory.
@param string $path
@return array|false | [
"Get",
"all",
"of",
"the",
"metadata",
"for",
"a",
"file",
"or",
"directory",
"."
] | 91927ceb5ace080973bc2df226c18a8d2086de20 | https://github.com/robgridley/flysystem-smb/blob/91927ceb5ace080973bc2df226c18a8d2086de20/src/SmbAdapter.php#L322-L333 |
228,209 | robgridley/flysystem-smb | src/SmbAdapter.php | SmbAdapter.getMimetype | public function getMimetype($path)
{
$metadata = $this->read($path);
if ($metadata === false) {
return false;
}
$metadata['mimetype'] = Util::guessMimeType($path, $metadata['contents']);
return $metadata;
} | php | public function getMimetype($path)
{
$metadata = $this->read($path);
if ($metadata === false) {
return false;
}
$metadata['mimetype'] = Util::guessMimeType($path, $metadata['contents']);
return $metadata;
} | [
"public",
"function",
"getMimetype",
"(",
"$",
"path",
")",
"{",
"$",
"metadata",
"=",
"$",
"this",
"->",
"read",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"metadata",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"$",
"metadata",
"[",
... | Get the MIME type of a file.
@param string $path
@return array|false | [
"Get",
"the",
"MIME",
"type",
"of",
"a",
"file",
"."
] | 91927ceb5ace080973bc2df226c18a8d2086de20 | https://github.com/robgridley/flysystem-smb/blob/91927ceb5ace080973bc2df226c18a8d2086de20/src/SmbAdapter.php#L352-L363 |
228,210 | robgridley/flysystem-smb | src/SmbAdapter.php | SmbAdapter.deleteContents | protected function deleteContents($path)
{
$contents = $this->listContents($path, true);
foreach (array_reverse($contents) as $object) {
$location = $this->applyPathPrefix($object['path']);
if ($object['type'] === 'dir') {
$this->share->rmdir($location);
... | php | protected function deleteContents($path)
{
$contents = $this->listContents($path, true);
foreach (array_reverse($contents) as $object) {
$location = $this->applyPathPrefix($object['path']);
if ($object['type'] === 'dir') {
$this->share->rmdir($location);
... | [
"protected",
"function",
"deleteContents",
"(",
"$",
"path",
")",
"{",
"$",
"contents",
"=",
"$",
"this",
"->",
"listContents",
"(",
"$",
"path",
",",
"true",
")",
";",
"foreach",
"(",
"array_reverse",
"(",
"$",
"contents",
")",
"as",
"$",
"object",
")... | Delete the contents of a directory.
@param string $path | [
"Delete",
"the",
"contents",
"of",
"a",
"directory",
"."
] | 91927ceb5ace080973bc2df226c18a8d2086de20 | https://github.com/robgridley/flysystem-smb/blob/91927ceb5ace080973bc2df226c18a8d2086de20/src/SmbAdapter.php#L415-L428 |
228,211 | robgridley/flysystem-smb | src/SmbAdapter.php | SmbAdapter.isDirectory | protected function isDirectory($path)
{
$location = $this->applyPathPrefix($path);
if (empty($location)) {
return true;
}
try {
$file = $this->share->stat($location);
} catch (NotFoundException $e) {
return false;
}
retur... | php | protected function isDirectory($path)
{
$location = $this->applyPathPrefix($path);
if (empty($location)) {
return true;
}
try {
$file = $this->share->stat($location);
} catch (NotFoundException $e) {
return false;
}
retur... | [
"protected",
"function",
"isDirectory",
"(",
"$",
"path",
")",
"{",
"$",
"location",
"=",
"$",
"this",
"->",
"applyPathPrefix",
"(",
"$",
"path",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"location",
")",
")",
"{",
"return",
"true",
";",
"}",
"try",
... | Determine if the specified path is a directory.
@param string $path
@return bool | [
"Determine",
"if",
"the",
"specified",
"path",
"is",
"a",
"directory",
"."
] | 91927ceb5ace080973bc2df226c18a8d2086de20 | https://github.com/robgridley/flysystem-smb/blob/91927ceb5ace080973bc2df226c18a8d2086de20/src/SmbAdapter.php#L436-L451 |
228,212 | antaresproject/core | src/components/html/src/Control/RemoteSelect.php | RemoteSelect.render | public function render()
{
$params = isset($this->params['attributes']) ? $this->params['attributes'] : $this->params;
$id = !isset($params['id']) ? $params['name'] . '-' . str_random(4) : $params['id'];
$script = $this->script($id, $params);
$attributes = app('html')... | php | public function render()
{
$params = isset($this->params['attributes']) ? $this->params['attributes'] : $this->params;
$id = !isset($params['id']) ? $params['name'] . '-' . str_random(4) : $params['id'];
$script = $this->script($id, $params);
$attributes = app('html')... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"params",
"=",
"isset",
"(",
"$",
"this",
"->",
"params",
"[",
"'attributes'",
"]",
")",
"?",
"$",
"this",
"->",
"params",
"[",
"'attributes'",
"]",
":",
"$",
"this",
"->",
"params",
";",
"$",
"id... | renders infinity select control
@return \Illuminate\View\View | [
"renders",
"infinity",
"select",
"control"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Control/RemoteSelect.php#L48-L67 |
228,213 | antaresproject/core | src/components/html/src/Control/RemoteSelect.php | RemoteSelect.script | protected function script($id, $params)
{
$handler = $this->handler = 'handler' . str_random(4);
$options = array_replace_recursive($this->defaults()['pluginOptions'], $params['pluginOptions']);
$decorated = JavaScriptDecorator::decorate($options);
return $this->init(... | php | protected function script($id, $params)
{
$handler = $this->handler = 'handler' . str_random(4);
$options = array_replace_recursive($this->defaults()['pluginOptions'], $params['pluginOptions']);
$decorated = JavaScriptDecorator::decorate($options);
return $this->init(... | [
"protected",
"function",
"script",
"(",
"$",
"id",
",",
"$",
"params",
")",
"{",
"$",
"handler",
"=",
"$",
"this",
"->",
"handler",
"=",
"'handler'",
".",
"str_random",
"(",
"4",
")",
";",
"$",
"options",
"=",
"array_replace_recursive",
"(",
"$",
"this... | creates javascript select scripts
@param type $id
@return type | [
"creates",
"javascript",
"select",
"scripts"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Control/RemoteSelect.php#L75-L81 |
228,214 | antaresproject/core | src/components/html/src/Control/RemoteSelect.php | RemoteSelect.defaults | protected function defaults()
{
return [
'options' => ['placeholder' => 'Search for a repo ...'],
'pluginOptions' => [
'allowClear' => true,
'minimumInputLength' => 0,
'minimumResultsForSearch' => 'Infinity',
... | php | protected function defaults()
{
return [
'options' => ['placeholder' => 'Search for a repo ...'],
'pluginOptions' => [
'allowClear' => true,
'minimumInputLength' => 0,
'minimumResultsForSearch' => 'Infinity',
... | [
"protected",
"function",
"defaults",
"(",
")",
"{",
"return",
"[",
"'options'",
"=>",
"[",
"'placeholder'",
"=>",
"'Search for a repo ...'",
"]",
",",
"'pluginOptions'",
"=>",
"[",
"'allowClear'",
"=>",
"true",
",",
"'minimumInputLength'",
"=>",
"0",
",",
"'mini... | default plugin properties
@return array | [
"default",
"plugin",
"properties"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Control/RemoteSelect.php#L88-L108 |
228,215 | antaresproject/core | src/foundation/src/Http/Datatables/Extensions.php | Extensions.getButtonLink | protected function getButtonLink(ExtensionContract $extension, string $action, string $icon): string
{
$actionUrl = URL::route(area() . '.modules.' . $action, [
'vendor' => $extension->getVendorName(),
'name' => $extension->getPackageName(),
'csr... | php | protected function getButtonLink(ExtensionContract $extension, string $action, string $icon): string
{
$actionUrl = URL::route(area() . '.modules.' . $action, [
'vendor' => $extension->getVendorName(),
'name' => $extension->getPackageName(),
'csr... | [
"protected",
"function",
"getButtonLink",
"(",
"ExtensionContract",
"$",
"extension",
",",
"string",
"$",
"action",
",",
"string",
"$",
"icon",
")",
":",
"string",
"{",
"$",
"actionUrl",
"=",
"URL",
"::",
"route",
"(",
"area",
"(",
")",
".",
"'.modules.'",... | Returns buttons for each row.
@param ExtensionContract $extension
@param string $action
@param string $icon
@return string | [
"Returns",
"buttons",
"for",
"each",
"row",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Http/Datatables/Extensions.php#L239-L274 |
228,216 | antaresproject/core | src/foundation/src/Http/Datatables/Extensions.php | Extensions.getStatusColumn | protected function getStatusColumn(): Closure
{
return function(ExtensionContract $extension) {
switch ($extension->getStatus()) {
case ExtensionContract::STATUS_ACTIVATED:
return '<span class="label-basic label-basic--success">' . trans('antares/foundation::l... | php | protected function getStatusColumn(): Closure
{
return function(ExtensionContract $extension) {
switch ($extension->getStatus()) {
case ExtensionContract::STATUS_ACTIVATED:
return '<span class="label-basic label-basic--success">' . trans('antares/foundation::l... | [
"protected",
"function",
"getStatusColumn",
"(",
")",
":",
"Closure",
"{",
"return",
"function",
"(",
"ExtensionContract",
"$",
"extension",
")",
"{",
"switch",
"(",
"$",
"extension",
"->",
"getStatus",
"(",
")",
")",
"{",
"case",
"ExtensionContract",
"::",
... | Returns status column.
@return Closure | [
"Returns",
"status",
"column",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Http/Datatables/Extensions.php#L313-L328 |
228,217 | antaresproject/core | src/foundation/src/Http/Datatables/Extensions.php | Extensions.getNameColumn | protected function getNameColumn(): Closure
{
return function(ExtensionContract $package) {
$name = $package->getFriendlyName();
$url = $package->getPackage()->getHomepage();
if ($url) {
return (string) HTML::link($url, $name, [
... | php | protected function getNameColumn(): Closure
{
return function(ExtensionContract $package) {
$name = $package->getFriendlyName();
$url = $package->getPackage()->getHomepage();
if ($url) {
return (string) HTML::link($url, $name, [
... | [
"protected",
"function",
"getNameColumn",
"(",
")",
":",
"Closure",
"{",
"return",
"function",
"(",
"ExtensionContract",
"$",
"package",
")",
"{",
"$",
"name",
"=",
"$",
"package",
"->",
"getFriendlyName",
"(",
")",
";",
"$",
"url",
"=",
"$",
"package",
... | Returns name column.
@return Closure | [
"Returns",
"name",
"column",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Http/Datatables/Extensions.php#L347-L361 |
228,218 | antaresproject/core | src/foundation/src/Http/Datatables/Extensions.php | Extensions.getAuthorsColumn | protected function getAuthorsColumn(): Closure
{
return function(ExtensionContract $extension) {
$authors = array_map(function(array $author) {
if (array_key_exists('email', $author)) {
return (string) HTML::mailto($author['email'], $author['name']);
... | php | protected function getAuthorsColumn(): Closure
{
return function(ExtensionContract $extension) {
$authors = array_map(function(array $author) {
if (array_key_exists('email', $author)) {
return (string) HTML::mailto($author['email'], $author['name']);
... | [
"protected",
"function",
"getAuthorsColumn",
"(",
")",
":",
"Closure",
"{",
"return",
"function",
"(",
"ExtensionContract",
"$",
"extension",
")",
"{",
"$",
"authors",
"=",
"array_map",
"(",
"function",
"(",
"array",
"$",
"author",
")",
"{",
"if",
"(",
"ar... | Returns authors column.
@return Closure | [
"Returns",
"authors",
"column",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Http/Datatables/Extensions.php#L392-L411 |
228,219 | lawoole/framework | src/WebSocket/WebSocketConnection.php | WebSocketConnection.push | public function push($data, $finish = true, $binary = false)
{
return $this->server->push(
$this->id, $data, $binary ? WEBSOCKET_OPCODE_BINARY : WEBSOCKET_OPCODE_TEXT, $finish
);
} | php | public function push($data, $finish = true, $binary = false)
{
return $this->server->push(
$this->id, $data, $binary ? WEBSOCKET_OPCODE_BINARY : WEBSOCKET_OPCODE_TEXT, $finish
);
} | [
"public",
"function",
"push",
"(",
"$",
"data",
",",
"$",
"finish",
"=",
"true",
",",
"$",
"binary",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"server",
"->",
"push",
"(",
"$",
"this",
"->",
"id",
",",
"$",
"data",
",",
"$",
"binary",
... | Push data to the client.
@param string $data
@param bool $finish
@param bool $binary
@return bool | [
"Push",
"data",
"to",
"the",
"client",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/WebSocket/WebSocketConnection.php#L63-L68 |
228,220 | lawoole/framework | src/WebSocket/WebSocketConnection.php | WebSocketConnection.close | public function close($code = 1000, $reason = '')
{
return $this->server->disconnect($this->id, $code, $reason);
} | php | public function close($code = 1000, $reason = '')
{
return $this->server->disconnect($this->id, $code, $reason);
} | [
"public",
"function",
"close",
"(",
"$",
"code",
"=",
"1000",
",",
"$",
"reason",
"=",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"server",
"->",
"disconnect",
"(",
"$",
"this",
"->",
"id",
",",
"$",
"code",
",",
"$",
"reason",
")",
";",
"}"
] | Close to the connection.
@param int $code
@param string $reason
@return bool | [
"Close",
"to",
"the",
"connection",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/WebSocket/WebSocketConnection.php#L91-L94 |
228,221 | antaresproject/core | src/components/extension/src/Factories/SettingsFactory.php | SettingsFactory.createFromConfig | public function createFromConfig(string $path) : SettingsContract {
$configData = (array) $this->filesystem->getRequire($path);
return $this->createFromData($configData);
} | php | public function createFromConfig(string $path) : SettingsContract {
$configData = (array) $this->filesystem->getRequire($path);
return $this->createFromData($configData);
} | [
"public",
"function",
"createFromConfig",
"(",
"string",
"$",
"path",
")",
":",
"SettingsContract",
"{",
"$",
"configData",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"filesystem",
"->",
"getRequire",
"(",
"$",
"path",
")",
";",
"return",
"$",
"this",
"-... | Returns the settings by the given configuration file.
@param string $path
@return SettingsContract
@throws FileNotFoundException | [
"Returns",
"the",
"settings",
"by",
"the",
"given",
"configuration",
"file",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/Factories/SettingsFactory.php#L37-L41 |
228,222 | antaresproject/core | src/components/extension/src/Factories/SettingsFactory.php | SettingsFactory.createFromData | public function createFromData(array $configData) : SettingsContract {
$data = (array) Arr::get($configData, 'data', []);
$rules = (array) Arr::get($configData, 'rules', []);
$phrases = (array) Arr::get($configData, 'phrases', []);
$customUrl = (string) Arr::get($configDat... | php | public function createFromData(array $configData) : SettingsContract {
$data = (array) Arr::get($configData, 'data', []);
$rules = (array) Arr::get($configData, 'rules', []);
$phrases = (array) Arr::get($configData, 'phrases', []);
$customUrl = (string) Arr::get($configDat... | [
"public",
"function",
"createFromData",
"(",
"array",
"$",
"configData",
")",
":",
"SettingsContract",
"{",
"$",
"data",
"=",
"(",
"array",
")",
"Arr",
"::",
"get",
"(",
"$",
"configData",
",",
"'data'",
",",
"[",
"]",
")",
";",
"$",
"rules",
"=",
"(... | Returns the settings by the given configuration array.
@param array $configData
@return SettingsContract
@throws FileNotFoundException | [
"Returns",
"the",
"settings",
"by",
"the",
"given",
"configuration",
"array",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/Factories/SettingsFactory.php#L50-L57 |
228,223 | antaresproject/core | src/components/view/src/Decorator.php | Decorator.render | public function render($name, $data = null)
{
if (! isset($this->macros[$name])) {
throw new BadMethodCallException("Method [$name] does not exist.");
}
return call_user_func($this->macros[$name], $data);
} | php | public function render($name, $data = null)
{
if (! isset($this->macros[$name])) {
throw new BadMethodCallException("Method [$name] does not exist.");
}
return call_user_func($this->macros[$name], $data);
} | [
"public",
"function",
"render",
"(",
"$",
"name",
",",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"macros",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"BadMethodCallException",
"(",
"\"Method [$nam... | Render the macro.
@param string $name
@param array $data
@return string
@throws \BadMethodCallException | [
"Render",
"the",
"macro",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/view/src/Decorator.php#L57-L64 |
228,224 | antaresproject/core | src/components/translations/src/Repository/LanguageRepository.php | LanguageRepository.insert | public function insert($data)
{
DB::transaction(function() use($data) {
$data['code'] = strtolower($data['code']);
$model = new Languages($data);
$model->save();
$inserts = $this->prepareMultiInsert($data['code']);
DB::table('tbl_transl... | php | public function insert($data)
{
DB::transaction(function() use($data) {
$data['code'] = strtolower($data['code']);
$model = new Languages($data);
$model->save();
$inserts = $this->prepareMultiInsert($data['code']);
DB::table('tbl_transl... | [
"public",
"function",
"insert",
"(",
"$",
"data",
")",
"{",
"DB",
"::",
"transaction",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"[",
"'code'",
"]",
"=",
"strtolower",
"(",
"$",
"data",
"[",
"'code'",
"]",
")",
";... | store new language in database
@param array $data | [
"store",
"new",
"language",
"in",
"database"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/translations/src/Repository/LanguageRepository.php#L58-L67 |
228,225 | antaresproject/core | src/components/translations/src/Repository/LanguageRepository.php | LanguageRepository.prepareMultiInsert | protected function prepareMultiInsert($code)
{
$default = Languages::where('is_default', 1)->first()->code;
$translations = Translation::where('locale', $default)->get()->toArray();
$translation = new Translation();
$guarded = $translation->getGuarded();
$langId ... | php | protected function prepareMultiInsert($code)
{
$default = Languages::where('is_default', 1)->first()->code;
$translations = Translation::where('locale', $default)->get()->toArray();
$translation = new Translation();
$guarded = $translation->getGuarded();
$langId ... | [
"protected",
"function",
"prepareMultiInsert",
"(",
"$",
"code",
")",
"{",
"$",
"default",
"=",
"Languages",
"::",
"where",
"(",
"'is_default'",
",",
"1",
")",
"->",
"first",
"(",
")",
"->",
"code",
";",
"$",
"translations",
"=",
"Translation",
"::",
"wh... | prepare data before multiinsert translations from default
@param String $code
@return array | [
"prepare",
"data",
"before",
"multiinsert",
"translations",
"from",
"default"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/translations/src/Repository/LanguageRepository.php#L75-L89 |
228,226 | antaresproject/core | src/components/translations/src/Repository/LanguageRepository.php | LanguageRepository.findByLocale | public function findByLocale(array $params = [])
{
return (empty($params)) ? $this->fetchAll() : $this->makeModel()->whereIn('code', array_values($params))->get();
} | php | public function findByLocale(array $params = [])
{
return (empty($params)) ? $this->fetchAll() : $this->makeModel()->whereIn('code', array_values($params))->get();
} | [
"public",
"function",
"findByLocale",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"(",
"empty",
"(",
"$",
"params",
")",
")",
"?",
"$",
"this",
"->",
"fetchAll",
"(",
")",
":",
"$",
"this",
"->",
"makeModel",
"(",
")",
"->",
"... | Finds languages by specified locale
@param array $params
@return \Illuminate\Database\Eloquent\Collection | [
"Finds",
"languages",
"by",
"specified",
"locale"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/translations/src/Repository/LanguageRepository.php#L97-L100 |
228,227 | antaresproject/core | src/components/extension/src/Repositories/ExtensionsRepository.php | ExtensionsRepository.save | public function save(ExtensionContract $extension, array $attributes = []) : ExtensionModel {
$identity = [
'vendor' => $extension->getVendorName(),
'name' => $extension->getPackageName(),
];
/* @var $model ExtensionModel */
$model = ExtensionModel::query()->updateOrCreate($identity, $attributes)... | php | public function save(ExtensionContract $extension, array $attributes = []) : ExtensionModel {
$identity = [
'vendor' => $extension->getVendorName(),
'name' => $extension->getPackageName(),
];
/* @var $model ExtensionModel */
$model = ExtensionModel::query()->updateOrCreate($identity, $attributes)... | [
"public",
"function",
"save",
"(",
"ExtensionContract",
"$",
"extension",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"ExtensionModel",
"{",
"$",
"identity",
"=",
"[",
"'vendor'",
"=>",
"$",
"extension",
"->",
"getVendorName",
"(",
")",
",",
... | Create or update the package.
@param ExtensionContract $extension
@param array $attributes
@return ExtensionModel | [
"Create",
"or",
"update",
"the",
"package",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/Repositories/ExtensionsRepository.php#L28-L38 |
228,228 | antaresproject/core | src/components/html/src/Memory/Config.php | Config.getKeyId | protected function getKeyId($name)
{
return isset($this->keyMap[$name]) ? $this->keyMap[$name]['id'] : null;
} | php | protected function getKeyId($name)
{
return isset($this->keyMap[$name]) ? $this->keyMap[$name]['id'] : null;
} | [
"protected",
"function",
"getKeyId",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"keyMap",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"keyMap",
"[",
"$",
"name",
"]",
"[",
"'id'",
"]",
":",
"null",
";",
"}"
] | Is given key a new content.
@param string $name
@return int | [
"Is",
"given",
"key",
"a",
"new",
"content",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Memory/Config.php#L195-L198 |
228,229 | antaresproject/core | src/components/html/src/Memory/Config.php | Config.resolver | protected function resolver()
{
$model = Arr::get($this->config, 'model', $this->name);
return $this->repository->make($model)->newInstance();
} | php | protected function resolver()
{
$model = Arr::get($this->config, 'model', $this->name);
return $this->repository->make($model)->newInstance();
} | [
"protected",
"function",
"resolver",
"(",
")",
"{",
"$",
"model",
"=",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"config",
",",
"'model'",
",",
"$",
"this",
"->",
"name",
")",
";",
"return",
"$",
"this",
"->",
"repository",
"->",
"make",
"(",
"$"... | get handler model instance
@return Eloquent | [
"get",
"handler",
"model",
"instance"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Memory/Config.php#L204-L208 |
228,230 | bpocallaghan/impersonate | src/ImpersonateController.php | ImpersonateController.login | protected function login(Request $request, User $user)
{
impersonate()->login($user);
// if redirect url in request
if ($request->has('redirect_to')) {
return redirect($request->get('redirect_to'));
}
return back();
} | php | protected function login(Request $request, User $user)
{
impersonate()->login($user);
// if redirect url in request
if ($request->has('redirect_to')) {
return redirect($request->get('redirect_to'));
}
return back();
} | [
"protected",
"function",
"login",
"(",
"Request",
"$",
"request",
",",
"User",
"$",
"user",
")",
"{",
"impersonate",
"(",
")",
"->",
"login",
"(",
"$",
"user",
")",
";",
"// if redirect url in request",
"if",
"(",
"$",
"request",
"->",
"has",
"(",
"'redi... | Impersonate the given user
@param Request $request
@param User $user
@return \Illuminate\Http\RedirectResponse | [
"Impersonate",
"the",
"given",
"user"
] | e7404b94fe464782abe297ace8f1211fea7c41b0 | https://github.com/bpocallaghan/impersonate/blob/e7404b94fe464782abe297ace8f1211fea7c41b0/src/ImpersonateController.php#L17-L27 |
228,231 | bpocallaghan/impersonate | src/ImpersonateController.php | ImpersonateController.logout | protected function logout(Request $request)
{
impersonate()->logout();
// if redirect url in request
if ($request->has('redirect_to')) {
return redirect($request->get('redirect_to'));
}
return back();
} | php | protected function logout(Request $request)
{
impersonate()->logout();
// if redirect url in request
if ($request->has('redirect_to')) {
return redirect($request->get('redirect_to'));
}
return back();
} | [
"protected",
"function",
"logout",
"(",
"Request",
"$",
"request",
")",
"{",
"impersonate",
"(",
")",
"->",
"logout",
"(",
")",
";",
"// if redirect url in request",
"if",
"(",
"$",
"request",
"->",
"has",
"(",
"'redirect_to'",
")",
")",
"{",
"return",
"re... | Logout as the impersonated user
Log back in as the original user
@param Request $request
@return \Illuminate\Http\RedirectResponse | [
"Logout",
"as",
"the",
"impersonated",
"user",
"Log",
"back",
"in",
"as",
"the",
"original",
"user"
] | e7404b94fe464782abe297ace8f1211fea7c41b0 | https://github.com/bpocallaghan/impersonate/blob/e7404b94fe464782abe297ace8f1211fea7c41b0/src/ImpersonateController.php#L35-L45 |
228,232 | 24aitor/Localizer | src/Controllers/LocalizerController.php | LocalizerController.setLocale | private function setLocale($locale, $request)
{
$allowedLangs = array_keys(Localizer::allowedLanguages());
if (config('localizer.block_unallowed_langs') && !in_array($locale, $allowedLangs)) {
abort(404, 'Unallowed language');
}
if (Auth::check()) {
$user = A... | php | private function setLocale($locale, $request)
{
$allowedLangs = array_keys(Localizer::allowedLanguages());
if (config('localizer.block_unallowed_langs') && !in_array($locale, $allowedLangs)) {
abort(404, 'Unallowed language');
}
if (Auth::check()) {
$user = A... | [
"private",
"function",
"setLocale",
"(",
"$",
"locale",
",",
"$",
"request",
")",
"{",
"$",
"allowedLangs",
"=",
"array_keys",
"(",
"Localizer",
"::",
"allowedLanguages",
"(",
")",
")",
";",
"if",
"(",
"config",
"(",
"'localizer.block_unallowed_langs'",
")",
... | Set locale if it's allowed.
@param string $locale
@param \Illuminate\Http\Request $request | [
"Set",
"locale",
"if",
"it",
"s",
"allowed",
"."
] | 3f234dfeab1030119148ece01f61d79dba27ac67 | https://github.com/24aitor/Localizer/blob/3f234dfeab1030119148ece01f61d79dba27ac67/src/Controllers/LocalizerController.php#L18-L32 |
228,233 | 24aitor/Localizer | src/Controllers/LocalizerController.php | LocalizerController.setHome | public function setHome($locale, Request $request)
{
$this->setLocale($locale, $request);
return redirect(url('/'));
} | php | public function setHome($locale, Request $request)
{
$this->setLocale($locale, $request);
return redirect(url('/'));
} | [
"public",
"function",
"setHome",
"(",
"$",
"locale",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"setLocale",
"(",
"$",
"locale",
",",
"$",
"request",
")",
";",
"return",
"redirect",
"(",
"url",
"(",
"'/'",
")",
")",
";",
"}"
] | Set locale and return home url.
@param string $locale
@param \Illuminate\Http\Request $request | [
"Set",
"locale",
"and",
"return",
"home",
"url",
"."
] | 3f234dfeab1030119148ece01f61d79dba27ac67 | https://github.com/24aitor/Localizer/blob/3f234dfeab1030119148ece01f61d79dba27ac67/src/Controllers/LocalizerController.php#L40-L45 |
228,234 | 24aitor/Localizer | src/Controllers/LocalizerController.php | LocalizerController.set | public function set($locale, Request $request)
{
$this->setLocale($locale, $request);
return redirect()->back();
} | php | public function set($locale, Request $request)
{
$this->setLocale($locale, $request);
return redirect()->back();
} | [
"public",
"function",
"set",
"(",
"$",
"locale",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"setLocale",
"(",
"$",
"locale",
",",
"$",
"request",
")",
";",
"return",
"redirect",
"(",
")",
"->",
"back",
"(",
")",
";",
"}"
] | Set locale and return back.
@param string $locale
@param \Illuminate\Http\Request $request | [
"Set",
"locale",
"and",
"return",
"back",
"."
] | 3f234dfeab1030119148ece01f61d79dba27ac67 | https://github.com/24aitor/Localizer/blob/3f234dfeab1030119148ece01f61d79dba27ac67/src/Controllers/LocalizerController.php#L53-L58 |
228,235 | antaresproject/core | src/foundation/src/Http/Composers/LeftPane.php | LeftPane.compose | public function compose($name = null, $options = array())
{
if ($name instanceof View) {
$name = null;
}
if (is_null($this->widget)) {
return false;
}
$this->widget
->make((is_null($name) ? 'pane.left' : $name))
->add(i... | php | public function compose($name = null, $options = array())
{
if ($name instanceof View) {
$name = null;
}
if (is_null($this->widget)) {
return false;
}
$this->widget
->make((is_null($name) ? 'pane.left' : $name))
->add(i... | [
"public",
"function",
"compose",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"name",
"instanceof",
"View",
")",
"{",
"$",
"name",
"=",
"null",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"... | Handle pane for left conatiner.
@return void | [
"Handle",
"pane",
"for",
"left",
"conatiner",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Http/Composers/LeftPane.php#L76-L91 |
228,236 | lawoole/framework | src/Homer/Components/Component.php | Component.withMiddleware | protected function withMiddleware($invoker, $interface, $config)
{
if (empty($this->middleware)) {
return $invoker;
}
return new MiddlewareInvoker($this->container, $interface, $invoker, $this->middleware, $config);
} | php | protected function withMiddleware($invoker, $interface, $config)
{
if (empty($this->middleware)) {
return $invoker;
}
return new MiddlewareInvoker($this->container, $interface, $invoker, $this->middleware, $config);
} | [
"protected",
"function",
"withMiddleware",
"(",
"$",
"invoker",
",",
"$",
"interface",
",",
"$",
"config",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"middleware",
")",
")",
"{",
"return",
"$",
"invoker",
";",
"}",
"return",
"new",
"Middlewa... | Add middleware to the invoker.
@param \Lawoole\Homer\Calling\Invokers\Invoker $invoker
@param string $interface
@param array $config
@return \Lawoole\Homer\Calling\Invokers\Invoker | [
"Add",
"middleware",
"to",
"the",
"invoker",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Components/Component.php#L65-L72 |
228,237 | gggeek/ggwebservices | classes/ggrestrequest.php | ggRESTRequest.payload | function payload()
{
if ( $this->Verb == 'GET' || $this->Verb == 'HEAD' || $this->Verb == 'TRACE' )
{
return '';
}
else
{
$params = $this->Parameters;
if ( $this->NameVar != null )
{
$params[$this->NameVar] = $th... | php | function payload()
{
if ( $this->Verb == 'GET' || $this->Verb == 'HEAD' || $this->Verb == 'TRACE' )
{
return '';
}
else
{
$params = $this->Parameters;
if ( $this->NameVar != null )
{
$params[$this->NameVar] = $th... | [
"function",
"payload",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"Verb",
"==",
"'GET'",
"||",
"$",
"this",
"->",
"Verb",
"==",
"'HEAD'",
"||",
"$",
"this",
"->",
"Verb",
"==",
"'TRACE'",
")",
"{",
"return",
"''",
";",
"}",
"else",
"{",
"$",
... | No request body for GET requests, as all params are put in the url | [
"No",
"request",
"body",
"for",
"GET",
"requests",
"as",
"all",
"params",
"are",
"put",
"in",
"the",
"url"
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggrestrequest.php#L14-L29 |
228,238 | gggeek/ggwebservices | classes/ggrestrequest.php | ggRESTRequest.getHttpAccept | function getHttpAccept()
{
if ( isset( $_GET[$this->FormatVar] ) )
{
return $_GET[$this->FormatVar];
}
else
{
if ( isset( $_POST['http_accept'] ) )
$acceptList = explode( ',', $_POST['http_accept'] );
else if ( isset( $_POST... | php | function getHttpAccept()
{
if ( isset( $_GET[$this->FormatVar] ) )
{
return $_GET[$this->FormatVar];
}
else
{
if ( isset( $_POST['http_accept'] ) )
$acceptList = explode( ',', $_POST['http_accept'] );
else if ( isset( $_POST... | [
"function",
"getHttpAccept",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_GET",
"[",
"$",
"this",
"->",
"FormatVar",
"]",
")",
")",
"{",
"return",
"$",
"_GET",
"[",
"$",
"this",
"->",
"FormatVar",
"]",
";",
"}",
"else",
"{",
"if",
"(",
"isset",... | Method used server-side to retrieve the accepted value from HTTP.
Same logic as used by ezjscore for the 'call' view, but tries to respect
weights in http Accept header
@todo (!important) recover $aliasList form the response class | [
"Method",
"used",
"server",
"-",
"side",
"to",
"retrieve",
"the",
"accepted",
"value",
"from",
"HTTP",
".",
"Same",
"logic",
"as",
"used",
"by",
"ezjscore",
"for",
"the",
"call",
"view",
"but",
"tries",
"to",
"respect",
"weights",
"in",
"http",
"Accept",
... | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggrestrequest.php#L172-L236 |
228,239 | gggeek/ggwebservices | classes/ggrestrequest.php | ggRESTRequest.setContentType | function setContentType( $typeAlias )
{
// expand short-hand notation for "php", json" etc
if ( isset( self::$KnownContentTypes[$typeAlias] ) )
{
$this->ContentType = self::$KnownContentTypes[$typeAlias];
return true;
}
// accept as well other mimetype... | php | function setContentType( $typeAlias )
{
// expand short-hand notation for "php", json" etc
if ( isset( self::$KnownContentTypes[$typeAlias] ) )
{
$this->ContentType = self::$KnownContentTypes[$typeAlias];
return true;
}
// accept as well other mimetype... | [
"function",
"setContentType",
"(",
"$",
"typeAlias",
")",
"{",
"// expand short-hand notation for \"php\", json\" etc",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"KnownContentTypes",
"[",
"$",
"typeAlias",
"]",
")",
")",
"{",
"$",
"this",
"->",
"ContentType",
... | Only sets content-type header if we know how to serialize it later
@param string $typeAlias
@return bool
@todo should we allow more freedom to caller, and only map very obviously wrong things like "php", json" etc | [
"Only",
"sets",
"content",
"-",
"type",
"header",
"if",
"we",
"know",
"how",
"to",
"serialize",
"it",
"later"
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggrestrequest.php#L304-L320 |
228,240 | antaresproject/core | src/utils/asset/src/AssetServiceProvider.php | AssetServiceProvider.registerAssetSymlinker | protected function registerAssetSymlinker()
{
// $this->app->singleton('asset.symlinker', function() {
// $publicPath = sandbox_path('packages/antares');
//
// return new AssetSymlinker(new Filesystem, $publicPath);
// });
$this->app->singleton(AssetSymlinker::class, fun... | php | protected function registerAssetSymlinker()
{
// $this->app->singleton('asset.symlinker', function() {
// $publicPath = sandbox_path('packages/antares');
//
// return new AssetSymlinker(new Filesystem, $publicPath);
// });
$this->app->singleton(AssetSymlinker::class, fun... | [
"protected",
"function",
"registerAssetSymlinker",
"(",
")",
"{",
"// $this->app->singleton('asset.symlinker', function() {",
"// $publicPath = sandbox_path('packages/antares');",
"//",
"// return new AssetSymlinker(new Filesystem, $publicPath);",
"// });",
... | registering asset symlinker | [
"registering",
"asset",
"symlinker"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/asset/src/AssetServiceProvider.php#L68-L83 |
228,241 | bpocallaghan/impersonate | src/Impersonate.php | Impersonate.login | public function login(User $user)
{
// if not impersonated, save current logged in user
// otherwise do not update (leave first original user in session)
if (!$this->isActive()) {
session()->put($this->originalUserKey, auth()->user()->id);
}
auth()->loginUsingId(... | php | public function login(User $user)
{
// if not impersonated, save current logged in user
// otherwise do not update (leave first original user in session)
if (!$this->isActive()) {
session()->put($this->originalUserKey, auth()->user()->id);
}
auth()->loginUsingId(... | [
"public",
"function",
"login",
"(",
"User",
"$",
"user",
")",
"{",
"// if not impersonated, save current logged in user",
"// otherwise do not update (leave first original user in session)",
"if",
"(",
"!",
"$",
"this",
"->",
"isActive",
"(",
")",
")",
"{",
"session",
"... | Impersonate the given user
Store the currently logged in user's id in session.
Log the new user in
@param User $user | [
"Impersonate",
"the",
"given",
"user",
"Store",
"the",
"currently",
"logged",
"in",
"user",
"s",
"id",
"in",
"session",
".",
"Log",
"the",
"new",
"user",
"in"
] | e7404b94fe464782abe297ace8f1211fea7c41b0 | https://github.com/bpocallaghan/impersonate/blob/e7404b94fe464782abe297ace8f1211fea7c41b0/src/Impersonate.php#L28-L39 |
228,242 | bpocallaghan/impersonate | src/Impersonate.php | Impersonate.logout | public function logout()
{
if (!$this->isActive()) {
return false;
}
auth()->logout();
// log back in as the original user
$originalUserId = session()->get($this->originalUserKey);
if ($originalUserId) {
auth()->loginUsingId($originalUserId)... | php | public function logout()
{
if (!$this->isActive()) {
return false;
}
auth()->logout();
// log back in as the original user
$originalUserId = session()->get($this->originalUserKey);
if ($originalUserId) {
auth()->loginUsingId($originalUserId)... | [
"public",
"function",
"logout",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isActive",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"auth",
"(",
")",
"->",
"logout",
"(",
")",
";",
"// log back in as the original user",
"$",
"originalUserId",
... | Logout the impersonated user
Log back in as the orignal user
Delete the impersonation session
@return bool | [
"Logout",
"the",
"impersonated",
"user",
"Log",
"back",
"in",
"as",
"the",
"orignal",
"user",
"Delete",
"the",
"impersonation",
"session"
] | e7404b94fe464782abe297ace8f1211fea7c41b0 | https://github.com/bpocallaghan/impersonate/blob/e7404b94fe464782abe297ace8f1211fea7c41b0/src/Impersonate.php#L47-L66 |
228,243 | antaresproject/core | src/components/support/src/Support/Nesty.php | Nesty.lookForChild | protected function lookForChild($item, $after)
{
if (str_contains($after, '.')) {
$found = [];
$this->lookInDeep($this->items, $after, $item, $found);
if (!empty($found)) {
$this->items[key($found)]->childs = current($found);
return $item;
... | php | protected function lookForChild($item, $after)
{
if (str_contains($after, '.')) {
$found = [];
$this->lookInDeep($this->items, $after, $item, $found);
if (!empty($found)) {
$this->items[key($found)]->childs = current($found);
return $item;
... | [
"protected",
"function",
"lookForChild",
"(",
"$",
"item",
",",
"$",
"after",
")",
"{",
"if",
"(",
"str_contains",
"(",
"$",
"after",
",",
"'.'",
")",
")",
"{",
"$",
"found",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"lookInDeep",
"(",
"$",
"this",
... | does menu item should be placed before or after child item
@param Fluent $item
@param String $after
@return boolean | [
"does",
"menu",
"item",
"should",
"be",
"placed",
"before",
"or",
"after",
"child",
"item"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/support/src/Support/Nesty.php#L148-L159 |
228,244 | antaresproject/core | src/components/support/src/Support/Nesty.php | Nesty.lookInDeep | protected function lookInDeep(array $elements, $after, $item, &$buffer = [], &$return = '', $current = null)
{
$branch = array();
foreach ($elements as $key => $element) {
$return = strlen($return) <= 0 ? $current : $return . '.' . $current;
if ($return . '.' . $key == $afte... | php | protected function lookInDeep(array $elements, $after, $item, &$buffer = [], &$return = '', $current = null)
{
$branch = array();
foreach ($elements as $key => $element) {
$return = strlen($return) <= 0 ? $current : $return . '.' . $current;
if ($return . '.' . $key == $afte... | [
"protected",
"function",
"lookInDeep",
"(",
"array",
"$",
"elements",
",",
"$",
"after",
",",
"$",
"item",
",",
"&",
"$",
"buffer",
"=",
"[",
"]",
",",
"&",
"$",
"return",
"=",
"''",
",",
"$",
"current",
"=",
"null",
")",
"{",
"$",
"branch",
"=",... | looking for matched item in nesty array configuration
@param array $elements
@param Strng $after
@param Fluent $item
@param array $buffer
@param array $return
@param String $current
@return array | [
"looking",
"for",
"matched",
"item",
"in",
"nesty",
"array",
"configuration"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/support/src/Support/Nesty.php#L172-L197 |
228,245 | antaresproject/core | src/components/support/src/Support/Nesty.php | Nesty.buffer | protected function buffer(&$buffer, $elements, $item, $after, $current)
{
foreach ($elements as $keyname => $element) {
$found = last(explode('.', $after));
if ($keyname == $found) {
$buffer[$current][$keyname] = $element;
$buffer[$current][$item->id]... | php | protected function buffer(&$buffer, $elements, $item, $after, $current)
{
foreach ($elements as $keyname => $element) {
$found = last(explode('.', $after));
if ($keyname == $found) {
$buffer[$current][$keyname] = $element;
$buffer[$current][$item->id]... | [
"protected",
"function",
"buffer",
"(",
"&",
"$",
"buffer",
",",
"$",
"elements",
",",
"$",
"item",
",",
"$",
"after",
",",
"$",
"current",
")",
"{",
"foreach",
"(",
"$",
"elements",
"as",
"$",
"keyname",
"=>",
"$",
"element",
")",
"{",
"$",
"found... | buffer item into container
@param array $buffer
@param array $elements
@param Fluent $item
@param String $after
@param String $current
@return array | [
"buffer",
"item",
"into",
"container"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/support/src/Support/Nesty.php#L209-L221 |
228,246 | antaresproject/core | src/components/support/src/Support/Nesty.php | Nesty.add | public function add($id, $location = '#')
{
if ($location === '<' && count($keys = array_keys($this->items)) > 0) {
return $this->addBefore($id, $keys[0]);
} elseif (preg_match('/^(<|>|\^):(.+)$/', $location, $matches) && count($matches) >= 3) {
return $this->pickTraverseFrom... | php | public function add($id, $location = '#')
{
if ($location === '<' && count($keys = array_keys($this->items)) > 0) {
return $this->addBefore($id, $keys[0]);
} elseif (preg_match('/^(<|>|\^):(.+)$/', $location, $matches) && count($matches) >= 3) {
return $this->pickTraverseFrom... | [
"public",
"function",
"add",
"(",
"$",
"id",
",",
"$",
"location",
"=",
"'#'",
")",
"{",
"if",
"(",
"$",
"location",
"===",
"'<'",
"&&",
"count",
"(",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"items",
")",
")",
">",
"0",
")",
"{"... | Add a new item, by prepend or append.
@param string $id
@param string $location
@return \Illuminate\Support\Fluent | [
"Add",
"a",
"new",
"item",
"by",
"prepend",
"or",
"append",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/support/src/Support/Nesty.php#L267-L275 |
228,247 | antaresproject/core | src/components/support/src/Support/Nesty.php | Nesty.has | public function has($key)
{
$key = implode('.childs.', explode('.', $key));
return !is_null(data_get($this->items, $key));
} | php | public function has($key)
{
$key = implode('.childs.', explode('.', $key));
return !is_null(data_get($this->items, $key));
} | [
"public",
"function",
"has",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"implode",
"(",
"'.childs.'",
",",
"explode",
"(",
"'.'",
",",
"$",
"key",
")",
")",
";",
"return",
"!",
"is_null",
"(",
"data_get",
"(",
"$",
"this",
"->",
"items",
",",
"$... | Check whether item by id exists.
@param string $key
@return bool | [
"Check",
"whether",
"item",
"by",
"id",
"exists",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/support/src/Support/Nesty.php#L305-L311 |
228,248 | genkgo/cache | src/Adapter/StashAdapter.php | StashAdapter.get | public function get($key)
{
$item = $this->pool->getItem($key);
if ($item->isMiss() === false) {
return $this->serializer->deserialize($item->get());
} else {
return null;
}
} | php | public function get($key)
{
$item = $this->pool->getItem($key);
if ($item->isMiss() === false) {
return $this->serializer->deserialize($item->get());
} else {
return null;
}
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"item",
"=",
"$",
"this",
"->",
"pool",
"->",
"getItem",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"item",
"->",
"isMiss",
"(",
")",
"===",
"false",
")",
"{",
"return",
"$",
"this",
... | Gets a cache entry
returning null if not in cache
@param $key
@return null|mixed | [
"Gets",
"a",
"cache",
"entry",
"returning",
"null",
"if",
"not",
"in",
"cache"
] | 67408e8f1c555d3b098e639d772ac7d7d906118b | https://github.com/genkgo/cache/blob/67408e8f1c555d3b098e639d772ac7d7d906118b/src/Adapter/StashAdapter.php#L46-L54 |
228,249 | antaresproject/core | src/components/memory/src/Handlers/Component.php | Component.save | protected function save($key, $value, $isNew = false, $brandId = false, $flag = null)
{
try {
DB::transaction(function () use ($key, $value, $isNew, $brandId, $flag) {
$name = str_replace('acl_antares/', '', $key);
if (str_contains($key, 'acl_antares')) {
... | php | protected function save($key, $value, $isNew = false, $brandId = false, $flag = null)
{
try {
DB::transaction(function () use ($key, $value, $isNew, $brandId, $flag) {
$name = str_replace('acl_antares/', '', $key);
if (str_contains($key, 'acl_antares')) {
... | [
"protected",
"function",
"save",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"isNew",
"=",
"false",
",",
"$",
"brandId",
"=",
"false",
",",
"$",
"flag",
"=",
"null",
")",
"{",
"try",
"{",
"DB",
"::",
"transaction",
"(",
"function",
"(",
")",
"u... | updates module permission
@param type $key
@param type $value
@param type $isNew
@return boolean
@throws \Exception | [
"updates",
"module",
"permission"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/Handlers/Component.php#L56-L84 |
228,250 | antaresproject/core | src/components/extension/src/Processors/Acl.php | Acl.import | public function import(OperationHandlerContract $handler, ExtensionContract $extension, bool $reload = false)
{
$name = $extension->getPackage()->getName();
$filePath = $extension->getPath() . '/acl.php';
if (!File::exists($filePath)) {
$handler->operationInfo(new Operation(... | php | public function import(OperationHandlerContract $handler, ExtensionContract $extension, bool $reload = false)
{
$name = $extension->getPackage()->getName();
$filePath = $extension->getPath() . '/acl.php';
if (!File::exists($filePath)) {
$handler->operationInfo(new Operation(... | [
"public",
"function",
"import",
"(",
"OperationHandlerContract",
"$",
"handler",
",",
"ExtensionContract",
"$",
"extension",
",",
"bool",
"$",
"reload",
"=",
"false",
")",
"{",
"$",
"name",
"=",
"$",
"extension",
"->",
"getPackage",
"(",
")",
"->",
"getName"... | Import ACL of the given extension.
@param OperationHandlerContract $handler
@param ExtensionContract $extension
@param bool $reload | [
"Import",
"ACL",
"of",
"the",
"given",
"extension",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/Processors/Acl.php#L41-L70 |
228,251 | antaresproject/core | src/foundation/src/Processor/Security.php | Security.form | protected function form()
{
return app('antares.form')->of('security', function (FormGrid $form) {
$form->name('Security Form');
$form->fieldset(function (Fieldset $fieldset) {
$fieldset->control('button', 'button')
... | php | protected function form()
{
return app('antares.form')->of('security', function (FormGrid $form) {
$form->name('Security Form');
$form->fieldset(function (Fieldset $fieldset) {
$fieldset->control('button', 'button')
... | [
"protected",
"function",
"form",
"(",
")",
"{",
"return",
"app",
"(",
"'antares.form'",
")",
"->",
"of",
"(",
"'security'",
",",
"function",
"(",
"FormGrid",
"$",
"form",
")",
"{",
"$",
"form",
"->",
"name",
"(",
"'Security Form'",
")",
";",
"$",
"form... | Creates form instance
@return \Antares\Html\Form\FormBuilder | [
"Creates",
"form",
"instance"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Processor/Security.php#L66-L79 |
228,252 | antaresproject/core | src/foundation/src/Processor/Security.php | Security.submit | public function submit(FormResponseContract $listener, Request $request)
{
$response = (array) $this->dispatcher->fire(new SecurityFormSubmitted($listener, $request));
if (count($response)) {
return $response[0];
}
return null;
} | php | public function submit(FormResponseContract $listener, Request $request)
{
$response = (array) $this->dispatcher->fire(new SecurityFormSubmitted($listener, $request));
if (count($response)) {
return $response[0];
}
return null;
} | [
"public",
"function",
"submit",
"(",
"FormResponseContract",
"$",
"listener",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"dispatcher",
"->",
"fire",
"(",
"new",
"SecurityFormSubmitted",
"(",
"$",
"... | Fires an event of the security form with the given request instance.
@param FormResponseContract $listener
@param Request $request
@return mixed | [
"Fires",
"an",
"event",
"of",
"the",
"security",
"form",
"with",
"the",
"given",
"request",
"instance",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Processor/Security.php#L88-L96 |
228,253 | antaresproject/core | src/ui/components/datatables/src/Adapter/ColumnFilterAdapter.php | ColumnFilterAdapter.save | public function save(array $params = [])
{
$index = array_get($params, 'index');
$visibility = array_get($params, 'visible');
$key = array_get($params, 'key');
if (is_null($index) or is_null($visibility) or is_null($key)) {
return false;
}
$r... | php | public function save(array $params = [])
{
$index = array_get($params, 'index');
$visibility = array_get($params, 'visible');
$key = array_get($params, 'key');
if (is_null($index) or is_null($visibility) or is_null($key)) {
return false;
}
$r... | [
"public",
"function",
"save",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"index",
"=",
"array_get",
"(",
"$",
"params",
",",
"'index'",
")",
";",
"$",
"visibility",
"=",
"array_get",
"(",
"$",
"params",
",",
"'visible'",
")",
";",
"... | Saves visibility columns definition
@param array $params
@return boolean | [
"Saves",
"visibility",
"columns",
"definition"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Adapter/ColumnFilterAdapter.php#L83-L106 |
228,254 | antaresproject/core | src/ui/components/datatables/src/Adapter/ColumnFilterAdapter.php | ColumnFilterAdapter.getColumns | public function getColumns()
{
$session = request()->session();
$key = $this->key();
if (!$session->has($key)) {
return $this->columns;
}
$config = $session->get($key);
foreach ($this->columns as $index => $column) {
if (!isset($config[$ind... | php | public function getColumns()
{
$session = request()->session();
$key = $this->key();
if (!$session->has($key)) {
return $this->columns;
}
$config = $session->get($key);
foreach ($this->columns as $index => $column) {
if (!isset($config[$ind... | [
"public",
"function",
"getColumns",
"(",
")",
"{",
"$",
"session",
"=",
"request",
"(",
")",
"->",
"session",
"(",
")",
";",
"$",
"key",
"=",
"$",
"this",
"->",
"key",
"(",
")",
";",
"if",
"(",
"!",
"$",
"session",
"->",
"has",
"(",
"$",
"key",... | Gets column visibility definition
@return array | [
"Gets",
"column",
"visibility",
"definition"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/datatables/src/Adapter/ColumnFilterAdapter.php#L113-L129 |
228,255 | antaresproject/core | src/components/view/src/Helper/FilterDropdown.php | FilterDropdown.prepareData | protected function prepareData()
{
$dataProvider = $this->attributes['dataProvider'];
$urlPattern = $this->attributes['urlPattern'];
$return = new Collection();
foreach ($dataProvider as $item) {
$name = isset($item->title) ? $item->title : $item->name;
... | php | protected function prepareData()
{
$dataProvider = $this->attributes['dataProvider'];
$urlPattern = $this->attributes['urlPattern'];
$return = new Collection();
foreach ($dataProvider as $item) {
$name = isset($item->title) ? $item->title : $item->name;
... | [
"protected",
"function",
"prepareData",
"(",
")",
"{",
"$",
"dataProvider",
"=",
"$",
"this",
"->",
"attributes",
"[",
"'dataProvider'",
"]",
";",
"$",
"urlPattern",
"=",
"$",
"this",
"->",
"attributes",
"[",
"'urlPattern'",
"]",
";",
"$",
"return",
"=",
... | prepares data provider items
@return array | [
"prepares",
"data",
"provider",
"items"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/view/src/Helper/FilterDropdown.php#L76-L87 |
228,256 | antaresproject/core | src/components/view/src/Helper/FilterDropdown.php | FilterDropdown.scripts | protected function scripts()
{
$container = $this->app->make('antares.asset')->container('antares/foundation::scripts');
$container->inlineScript('version-box', $this->inline());
} | php | protected function scripts()
{
$container = $this->app->make('antares.asset')->container('antares/foundation::scripts');
$container->inlineScript('version-box', $this->inline());
} | [
"protected",
"function",
"scripts",
"(",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'antares.asset'",
")",
"->",
"container",
"(",
"'antares/foundation::scripts'",
")",
";",
"$",
"container",
"->",
"inlineScript",
"(",
"'v... | inline scripts used by helper | [
"inline",
"scripts",
"used",
"by",
"helper"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/view/src/Helper/FilterDropdown.php#L104-L108 |
228,257 | brick/http | src/Response.php | Response.parse | public static function parse(string $response) : Response
{
$responseObject = new Response();
if (preg_match('/^HTTP\/([0-9]\.[0-9]) ([0-9]{3}) .*\r\n/', $response, $matches) !== 1) {
throw new \RuntimeException('Could not parse response (error 1).');
}
[$line, $protoco... | php | public static function parse(string $response) : Response
{
$responseObject = new Response();
if (preg_match('/^HTTP\/([0-9]\.[0-9]) ([0-9]{3}) .*\r\n/', $response, $matches) !== 1) {
throw new \RuntimeException('Could not parse response (error 1).');
}
[$line, $protoco... | [
"public",
"static",
"function",
"parse",
"(",
"string",
"$",
"response",
")",
":",
"Response",
"{",
"$",
"responseObject",
"=",
"new",
"Response",
"(",
")",
";",
"if",
"(",
"preg_match",
"(",
"'/^HTTP\\/([0-9]\\.[0-9]) ([0-9]{3}) .*\\r\\n/'",
",",
"$",
"response... | Parses a raw response string, including headers and body, and returns a Response object.
@param string $response
@return \Brick\Http\Response
@throws \RuntimeException | [
"Parses",
"a",
"raw",
"response",
"string",
"including",
"headers",
"and",
"body",
"and",
"returns",
"a",
"Response",
"object",
"."
] | 1b185b0563d10f9f4293c254aa411545da00b597 | https://github.com/brick/http/blob/1b185b0563d10f9f4293c254aa411545da00b597/src/Response.php#L84-L131 |
228,258 | brick/http | src/Response.php | Response.setStatusCode | public function setStatusCode(int $statusCode, string $reasonPhrase = null) : Response
{
if ($statusCode < 100 || $statusCode > 999) {
throw new \InvalidArgumentException('Invalid status code: ' . $statusCode);
}
if ($reasonPhrase === null) {
$reasonPhrase = isset(s... | php | public function setStatusCode(int $statusCode, string $reasonPhrase = null) : Response
{
if ($statusCode < 100 || $statusCode > 999) {
throw new \InvalidArgumentException('Invalid status code: ' . $statusCode);
}
if ($reasonPhrase === null) {
$reasonPhrase = isset(s... | [
"public",
"function",
"setStatusCode",
"(",
"int",
"$",
"statusCode",
",",
"string",
"$",
"reasonPhrase",
"=",
"null",
")",
":",
"Response",
"{",
"if",
"(",
"$",
"statusCode",
"<",
"100",
"||",
"$",
"statusCode",
">",
"999",
")",
"{",
"throw",
"new",
"... | Sets the status code of this response.
@param int $statusCode The status code.
@param string|null $reasonPhrase An optional reason phrase, or null to use the default.
@return static
@throws \InvalidArgumentException If the status code is not valid. | [
"Sets",
"the",
"status",
"code",
"of",
"this",
"response",
"."
] | 1b185b0563d10f9f4293c254aa411545da00b597 | https://github.com/brick/http/blob/1b185b0563d10f9f4293c254aa411545da00b597/src/Response.php#L163-L181 |
228,259 | brick/http | src/Response.php | Response.setCookie | public function setCookie(Cookie $cookie) : Response
{
$this->cookies[] = $cookie;
$this->addHeader('Set-Cookie', (string) $cookie);
return $this;
} | php | public function setCookie(Cookie $cookie) : Response
{
$this->cookies[] = $cookie;
$this->addHeader('Set-Cookie', (string) $cookie);
return $this;
} | [
"public",
"function",
"setCookie",
"(",
"Cookie",
"$",
"cookie",
")",
":",
"Response",
"{",
"$",
"this",
"->",
"cookies",
"[",
"]",
"=",
"$",
"cookie",
";",
"$",
"this",
"->",
"addHeader",
"(",
"'Set-Cookie'",
",",
"(",
"string",
")",
"$",
"cookie",
... | Sets a cookie on this response.
@param \Brick\Http\Cookie $cookie The cookie to set.
@return static This response. | [
"Sets",
"a",
"cookie",
"on",
"this",
"response",
"."
] | 1b185b0563d10f9f4293c254aa411545da00b597 | https://github.com/brick/http/blob/1b185b0563d10f9f4293c254aa411545da00b597/src/Response.php#L200-L206 |
228,260 | brick/http | src/Response.php | Response.send | public function send() : bool
{
if (headers_sent()) {
return false;
}
header($this->getStartLine());
foreach ($this->getHeaders() as $name => $values) {
foreach ($values as $value) {
header($name . ': ' . $value, false);
}
... | php | public function send() : bool
{
if (headers_sent()) {
return false;
}
header($this->getStartLine());
foreach ($this->getHeaders() as $name => $values) {
foreach ($values as $value) {
header($name . ': ' . $value, false);
}
... | [
"public",
"function",
"send",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"headers_sent",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"header",
"(",
"$",
"this",
"->",
"getStartLine",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getHeade... | Sends the response.
This method will fail (return `false`) if the headers have been already sent.
@return bool Whether the response has been successfully sent. | [
"Sends",
"the",
"response",
"."
] | 1b185b0563d10f9f4293c254aa411545da00b597 | https://github.com/brick/http/blob/1b185b0563d10f9f4293c254aa411545da00b597/src/Response.php#L305-L324 |
228,261 | tomwalder/php-appengine-search | src/Search/Gateway.php | Gateway.prepareRequestParams | private function prepareRequestParams($obj_request)
{
$obj_params = $obj_request->mutableParams();
$obj_spec = $obj_params->mutableIndexSpec()->setName($this->str_index_name);
if(null !== $this->str_namespace) {
$obj_spec->setNamespace($this->str_namespace);
}
ret... | php | private function prepareRequestParams($obj_request)
{
$obj_params = $obj_request->mutableParams();
$obj_spec = $obj_params->mutableIndexSpec()->setName($this->str_index_name);
if(null !== $this->str_namespace) {
$obj_spec->setNamespace($this->str_namespace);
}
ret... | [
"private",
"function",
"prepareRequestParams",
"(",
"$",
"obj_request",
")",
"{",
"$",
"obj_params",
"=",
"$",
"obj_request",
"->",
"mutableParams",
"(",
")",
";",
"$",
"obj_spec",
"=",
"$",
"obj_params",
"->",
"mutableIndexSpec",
"(",
")",
"->",
"setName",
... | Prepare the request parameters
Index specs: consistency, mode, name, namespace, source, version
@param $obj_request
@return object | [
"Prepare",
"the",
"request",
"parameters"
] | e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba | https://github.com/tomwalder/php-appengine-search/blob/e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba/src/Search/Gateway.php#L90-L98 |
228,262 | tomwalder/php-appengine-search | src/Search/Gateway.php | Gateway.put | public function put(array $arr_docs)
{
$obj_request = new IndexDocumentRequest();
$obj_params = $this->prepareRequestParams($obj_request);
// Other index specs: consistency, mode, name, namespace, source, version
$obj_mapper = new Mapper();
foreach($arr_docs as $obj_doc) {
... | php | public function put(array $arr_docs)
{
$obj_request = new IndexDocumentRequest();
$obj_params = $this->prepareRequestParams($obj_request);
// Other index specs: consistency, mode, name, namespace, source, version
$obj_mapper = new Mapper();
foreach($arr_docs as $obj_doc) {
... | [
"public",
"function",
"put",
"(",
"array",
"$",
"arr_docs",
")",
"{",
"$",
"obj_request",
"=",
"new",
"IndexDocumentRequest",
"(",
")",
";",
"$",
"obj_params",
"=",
"$",
"this",
"->",
"prepareRequestParams",
"(",
"$",
"obj_request",
")",
";",
"// Other index... | Put one or more documents into the index
@param Document[] $arr_docs
@throws ApplicationError
@throws \Exception | [
"Put",
"one",
"or",
"more",
"documents",
"into",
"the",
"index"
] | e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba | https://github.com/tomwalder/php-appengine-search/blob/e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba/src/Search/Gateway.php#L107-L118 |
228,263 | tomwalder/php-appengine-search | src/Search/Gateway.php | Gateway.search | public function search(Query $obj_query)
{
$obj_request = new SearchRequest();
$obj_params = $this->prepareRequestParams($obj_request);
// Basics
$obj_params
->setQuery($obj_query->getQuery())
->setLimit($obj_query->getLimit())
->setOffset($obj_qu... | php | public function search(Query $obj_query)
{
$obj_request = new SearchRequest();
$obj_params = $this->prepareRequestParams($obj_request);
// Basics
$obj_params
->setQuery($obj_query->getQuery())
->setLimit($obj_query->getLimit())
->setOffset($obj_qu... | [
"public",
"function",
"search",
"(",
"Query",
"$",
"obj_query",
")",
"{",
"$",
"obj_request",
"=",
"new",
"SearchRequest",
"(",
")",
";",
"$",
"obj_params",
"=",
"$",
"this",
"->",
"prepareRequestParams",
"(",
"$",
"obj_request",
")",
";",
"// Basics",
"$"... | Run a Search Query
@param Query $obj_query
@return object
@throws ApplicationError
@throws \Exception | [
"Run",
"a",
"Search",
"Query"
] | e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba | https://github.com/tomwalder/php-appengine-search/blob/e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba/src/Search/Gateway.php#L128-L191 |
228,264 | tomwalder/php-appengine-search | src/Search/Gateway.php | Gateway.getDocById | public function getDocById($str_id)
{
$obj_request = new ListDocumentsRequest();
$obj_params = $this->prepareRequestParams($obj_request);
$obj_params->setStartDocId($str_id)->setLimit(1);
$this->execute('ListDocuments', $obj_request, new ListDocumentsResponse());
$obj_respons... | php | public function getDocById($str_id)
{
$obj_request = new ListDocumentsRequest();
$obj_params = $this->prepareRequestParams($obj_request);
$obj_params->setStartDocId($str_id)->setLimit(1);
$this->execute('ListDocuments', $obj_request, new ListDocumentsResponse());
$obj_respons... | [
"public",
"function",
"getDocById",
"(",
"$",
"str_id",
")",
"{",
"$",
"obj_request",
"=",
"new",
"ListDocumentsRequest",
"(",
")",
";",
"$",
"obj_params",
"=",
"$",
"this",
"->",
"prepareRequestParams",
"(",
"$",
"obj_request",
")",
";",
"$",
"obj_params",
... | Return a single document by ID
@param $str_id
@return array
@throws ApplicationError
@throws \Exception | [
"Return",
"a",
"single",
"document",
"by",
"ID"
] | e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba | https://github.com/tomwalder/php-appengine-search/blob/e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba/src/Search/Gateway.php#L201-L218 |
228,265 | tomwalder/php-appengine-search | src/Search/Gateway.php | Gateway.delete | public function delete(array $arr_ids)
{
$obj_request = new DeleteDocumentRequest();
$obj_params = $this->prepareRequestParams($obj_request);
foreach($arr_ids as $str_id) {
$obj_params->addDocId($str_id);
}
$this->execute('DeleteDocument', $obj_request, new Delete... | php | public function delete(array $arr_ids)
{
$obj_request = new DeleteDocumentRequest();
$obj_params = $this->prepareRequestParams($obj_request);
foreach($arr_ids as $str_id) {
$obj_params->addDocId($str_id);
}
$this->execute('DeleteDocument', $obj_request, new Delete... | [
"public",
"function",
"delete",
"(",
"array",
"$",
"arr_ids",
")",
"{",
"$",
"obj_request",
"=",
"new",
"DeleteDocumentRequest",
"(",
")",
";",
"$",
"obj_params",
"=",
"$",
"this",
"->",
"prepareRequestParams",
"(",
"$",
"obj_request",
")",
";",
"foreach",
... | Delete one or more documents by ID
@param array $arr_ids | [
"Delete",
"one",
"or",
"more",
"documents",
"by",
"ID"
] | e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba | https://github.com/tomwalder/php-appengine-search/blob/e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba/src/Search/Gateway.php#L225-L233 |
228,266 | tomwalder/php-appengine-search | src/Search/Gateway.php | Gateway.execute | private function execute($str_method, ProtocolMessage $obj_request, ProtocolMessage $obj_response)
{
try {
$this->obj_last_request = $obj_request;
$this->obj_last_response = null;
ApiProxy::makeSyncCall('search', $str_method, $obj_request, $obj_response, 60);
... | php | private function execute($str_method, ProtocolMessage $obj_request, ProtocolMessage $obj_response)
{
try {
$this->obj_last_request = $obj_request;
$this->obj_last_response = null;
ApiProxy::makeSyncCall('search', $str_method, $obj_request, $obj_response, 60);
... | [
"private",
"function",
"execute",
"(",
"$",
"str_method",
",",
"ProtocolMessage",
"$",
"obj_request",
",",
"ProtocolMessage",
"$",
"obj_response",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"obj_last_request",
"=",
"$",
"obj_request",
";",
"$",
"this",
"->",
"... | Run a Request
@param $str_method
@param ProtocolMessage $obj_request
@param ProtocolMessage $obj_response
@return ProtocolMessage|null|object
@throws ApplicationError
@throws \Exception | [
"Run",
"a",
"Request"
] | e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba | https://github.com/tomwalder/php-appengine-search/blob/e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba/src/Search/Gateway.php#L245-L255 |
228,267 | tomwalder/php-appengine-search | src/Search/Gateway.php | Gateway.processSearchResponse | private function processSearchResponse()
{
/** @var SearchResponse $obj_search_response */
$obj_search_response = $this->obj_last_response;
$obj_response = (object)[
'status' => $this->describeStatusCode($obj_search_response->getStatus()->getCode()),
'hits' => $obj_se... | php | private function processSearchResponse()
{
/** @var SearchResponse $obj_search_response */
$obj_search_response = $this->obj_last_response;
$obj_response = (object)[
'status' => $this->describeStatusCode($obj_search_response->getStatus()->getCode()),
'hits' => $obj_se... | [
"private",
"function",
"processSearchResponse",
"(",
")",
"{",
"/** @var SearchResponse $obj_search_response */",
"$",
"obj_search_response",
"=",
"$",
"this",
"->",
"obj_last_response",
";",
"$",
"obj_response",
"=",
"(",
"object",
")",
"[",
"'status'",
"=>",
"$",
... | Process a search response
@return object | [
"Process",
"a",
"search",
"response"
] | e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba | https://github.com/tomwalder/php-appengine-search/blob/e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba/src/Search/Gateway.php#L262-L301 |
228,268 | tomwalder/php-appengine-search | src/Search/Gateway.php | Gateway.processListResponse | private function processListResponse()
{
/** @var ListDocumentsResponse $obj_list_response */
$obj_list_response = $this->obj_last_response;
$obj_response = (object)[
'status' => $this->describeStatusCode($obj_list_response->getStatus()->getCode()),
'count' => $obj_li... | php | private function processListResponse()
{
/** @var ListDocumentsResponse $obj_list_response */
$obj_list_response = $this->obj_last_response;
$obj_response = (object)[
'status' => $this->describeStatusCode($obj_list_response->getStatus()->getCode()),
'count' => $obj_li... | [
"private",
"function",
"processListResponse",
"(",
")",
"{",
"/** @var ListDocumentsResponse $obj_list_response */",
"$",
"obj_list_response",
"=",
"$",
"this",
"->",
"obj_last_response",
";",
"$",
"obj_response",
"=",
"(",
"object",
")",
"[",
"'status'",
"=>",
"$",
... | Process a document list response
@return object | [
"Process",
"a",
"document",
"list",
"response"
] | e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba | https://github.com/tomwalder/php-appengine-search/blob/e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba/src/Search/Gateway.php#L308-L323 |
228,269 | lawoole/framework | src/Homer/Context.php | Context.setInvocation | public function setInvocation(Invocation $invocation)
{
$this->invocation = $invocation;
$this->setAttachments($invocation->getAttachments());
} | php | public function setInvocation(Invocation $invocation)
{
$this->invocation = $invocation;
$this->setAttachments($invocation->getAttachments());
} | [
"public",
"function",
"setInvocation",
"(",
"Invocation",
"$",
"invocation",
")",
"{",
"$",
"this",
"->",
"invocation",
"=",
"$",
"invocation",
";",
"$",
"this",
"->",
"setAttachments",
"(",
"$",
"invocation",
"->",
"getAttachments",
"(",
")",
")",
";",
"}... | Set the invocation instance.
@param \Lawoole\Homer\Calling\Invocation $invocation | [
"Set",
"the",
"invocation",
"instance",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Context.php#L61-L66 |
228,270 | lawoole/framework | src/Homer/Serialize/Serializations/ValidatorSerialization.php | ValidatorSerialization.recover | public function recover()
{
$validator = ValidatorFacade::make([], []);
foreach ($this->messages as $key => $value) {
foreach (Arr::wrap($value) as $message) {
$validator->errors()->add($key, $message);
}
}
return $validator;
} | php | public function recover()
{
$validator = ValidatorFacade::make([], []);
foreach ($this->messages as $key => $value) {
foreach (Arr::wrap($value) as $message) {
$validator->errors()->add($key, $message);
}
}
return $validator;
} | [
"public",
"function",
"recover",
"(",
")",
"{",
"$",
"validator",
"=",
"ValidatorFacade",
"::",
"make",
"(",
"[",
"]",
",",
"[",
"]",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"messages",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"foreach"... | Recover the validator from the serialization.
@return \Illuminate\Contracts\Validation\Validator | [
"Recover",
"the",
"validator",
"from",
"the",
"serialization",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Serialize/Serializations/ValidatorSerialization.php#L32-L43 |
228,271 | antaresproject/core | src/ui/components/templates/src/UiComponentsServiceProvider.php | UiComponentsServiceProvider.bootMenus | public function bootMenus()
{
$name = 'menu.top.right';
view()->composer('antares/foundation::*', function () use ($name) {
if (!Registry::isRegistered('menu.' . $name)) {
$this->app->instance($name, $this->app->make('antares.widget')->make($name));
$selec... | php | public function bootMenus()
{
$name = 'menu.top.right';
view()->composer('antares/foundation::*', function () use ($name) {
if (!Registry::isRegistered('menu.' . $name)) {
$this->app->instance($name, $this->app->make('antares.widget')->make($name));
$selec... | [
"public",
"function",
"bootMenus",
"(",
")",
"{",
"$",
"name",
"=",
"'menu.top.right'",
";",
"view",
"(",
")",
"->",
"composer",
"(",
"'antares/foundation::*'",
",",
"function",
"(",
")",
"use",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"Registry",
"... | Booting top left menu | [
"Booting",
"top",
"left",
"menu"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/UiComponentsServiceProvider.php#L135-L146 |
228,272 | crossjoin/PreMailer | src/Crossjoin/PreMailer/HtmlFile.php | HtmlFile.setFilename | protected function setFilename($filename)
{
if (is_string($filename)) {
if (is_readable($filename)) {
$this->filename = $filename;
} elseif (file_exists($filename)) {
throw new \InvalidArgumentException("File '$filename' isn't readable.");
... | php | protected function setFilename($filename)
{
if (is_string($filename)) {
if (is_readable($filename)) {
$this->filename = $filename;
} elseif (file_exists($filename)) {
throw new \InvalidArgumentException("File '$filename' isn't readable.");
... | [
"protected",
"function",
"setFilename",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"filename",
")",
")",
"{",
"if",
"(",
"is_readable",
"(",
"$",
"filename",
")",
")",
"{",
"$",
"this",
"->",
"filename",
"=",
"$",
"filename",
"... | Sets the file path of the HTML source file.
@param string $filename
@return $this | [
"Sets",
"the",
"file",
"path",
"of",
"the",
"HTML",
"source",
"file",
"."
] | e1fbd426a9f3ba2d5d00f6641b2509c72bf4f561 | https://github.com/crossjoin/PreMailer/blob/e1fbd426a9f3ba2d5d00f6641b2509c72bf4f561/src/Crossjoin/PreMailer/HtmlFile.php#L26-L43 |
228,273 | antaresproject/core | src/foundation/src/Providers/FoundationServiceProvider.php | FoundationServiceProvider.registerLogFilename | protected function registerLogFilename()
{
$handlers = $this->app->make('log')->getMonolog()->getHandlers();
foreach ($handlers as $handler) {
if (!$handler instanceof RotatingFileHandler) {
continue;
}
$filename = (php_sapi_name() === 'cli'... | php | protected function registerLogFilename()
{
$handlers = $this->app->make('log')->getMonolog()->getHandlers();
foreach ($handlers as $handler) {
if (!$handler instanceof RotatingFileHandler) {
continue;
}
$filename = (php_sapi_name() === 'cli'... | [
"protected",
"function",
"registerLogFilename",
"(",
")",
"{",
"$",
"handlers",
"=",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'log'",
")",
"->",
"getMonolog",
"(",
")",
"->",
"getHandlers",
"(",
")",
";",
"foreach",
"(",
"$",
"handlers",
"as",
"$"... | Registers log filename
@return void | [
"Registers",
"log",
"filename"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Providers/FoundationServiceProvider.php#L142-L154 |
228,274 | antaresproject/core | src/foundation/src/Providers/FoundationServiceProvider.php | FoundationServiceProvider.registerWidgetsFinder | protected function registerWidgetsFinder()
{
$this->app->singleton('antares.ui-components.finder', function($app) {
$config = [
'path.app' => $app->make('path'),
'path.base' => $app->make('path.base'),
];
return new Finder($app->m... | php | protected function registerWidgetsFinder()
{
$this->app->singleton('antares.ui-components.finder', function($app) {
$config = [
'path.app' => $app->make('path'),
'path.base' => $app->make('path.base'),
];
return new Finder($app->m... | [
"protected",
"function",
"registerWidgetsFinder",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'antares.ui-components.finder'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"config",
"=",
"[",
"'path.app'",
"=>",
"$",
"app",
"->",
... | Register the service provider for Extension Finder.
@return void | [
"Register",
"the",
"service",
"provider",
"for",
"Extension",
"Finder",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Providers/FoundationServiceProvider.php#L173-L183 |
228,275 | antaresproject/core | src/foundation/src/Providers/FoundationServiceProvider.php | FoundationServiceProvider.registerEvents | protected function registerEvents()
{
$this->app->terminating(function () {
$this->app->make('events')->fire('antares.done');
$this->app->make('events')->fire(new AntaresDone());
});
} | php | protected function registerEvents()
{
$this->app->terminating(function () {
$this->app->make('events')->fire('antares.done');
$this->app->make('events')->fire(new AntaresDone());
});
} | [
"protected",
"function",
"registerEvents",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"terminating",
"(",
"function",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'events'",
")",
"->",
"fire",
"(",
"'antares.done'",
")",
";",
"$",
... | Register additional events for application.
@return void | [
"Register",
"additional",
"events",
"for",
"application",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Providers/FoundationServiceProvider.php#L228-L234 |
228,276 | antaresproject/core | src/foundation/src/Providers/FoundationServiceProvider.php | FoundationServiceProvider.assignAreaTemplate | protected function assignAreaTemplate()
{
$path = realpath(__DIR__ . '/../../');
$area = area();
if (!is_null($area) && is_dir(resource_path('views' . DIRECTORY_SEPARATOR . $area))) {
$this->addViewComponent($area, 'antares/foundation', $path . '/resources/views');
... | php | protected function assignAreaTemplate()
{
$path = realpath(__DIR__ . '/../../');
$area = area();
if (!is_null($area) && is_dir(resource_path('views' . DIRECTORY_SEPARATOR . $area))) {
$this->addViewComponent($area, 'antares/foundation', $path . '/resources/views');
... | [
"protected",
"function",
"assignAreaTemplate",
"(",
")",
"{",
"$",
"path",
"=",
"realpath",
"(",
"__DIR__",
".",
"'/../../'",
")",
";",
"$",
"area",
"=",
"area",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"area",
")",
"&&",
"is_dir",
"(",
... | Assign area template based on current area | [
"Assign",
"area",
"template",
"based",
"on",
"current",
"area"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Providers/FoundationServiceProvider.php#L294-L302 |
228,277 | antaresproject/core | src/foundation/src/Providers/FoundationServiceProvider.php | FoundationServiceProvider.runtime | protected function runtime()
{
$filesystem = app(Filesystem::class);
$files = $filesystem->glob(storage_path('license') . '/*.key');
if (!empty($files)) {
app('antares.memory')->make('runtime')->push('instance_key', $filesystem->get($files[0]));
}
} | php | protected function runtime()
{
$filesystem = app(Filesystem::class);
$files = $filesystem->glob(storage_path('license') . '/*.key');
if (!empty($files)) {
app('antares.memory')->make('runtime')->push('instance_key', $filesystem->get($files[0]));
}
} | [
"protected",
"function",
"runtime",
"(",
")",
"{",
"$",
"filesystem",
"=",
"app",
"(",
"Filesystem",
"::",
"class",
")",
";",
"$",
"files",
"=",
"$",
"filesystem",
"->",
"glob",
"(",
"storage_path",
"(",
"'license'",
")",
".",
"'/*.key'",
")",
";",
"if... | runtime application configuration | [
"runtime",
"application",
"configuration"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Providers/FoundationServiceProvider.php#L307-L314 |
228,278 | antaresproject/core | src/foundation/src/Providers/FoundationServiceProvider.php | FoundationServiceProvider.bootWidgetsRouting | protected function bootWidgetsRouting()
{
try {
$widgets = $this->app->make('antares.ui-components.finder')->detectRoutes();
$widgets->each(function($widget) {
$widget::routes();
});
return true;
} catch (Exception $e) {
... | php | protected function bootWidgetsRouting()
{
try {
$widgets = $this->app->make('antares.ui-components.finder')->detectRoutes();
$widgets->each(function($widget) {
$widget::routes();
});
return true;
} catch (Exception $e) {
... | [
"protected",
"function",
"bootWidgetsRouting",
"(",
")",
"{",
"try",
"{",
"$",
"widgets",
"=",
"$",
"this",
"->",
"app",
"->",
"make",
"(",
"'antares.ui-components.finder'",
")",
"->",
"detectRoutes",
"(",
")",
";",
"$",
"widgets",
"->",
"each",
"(",
"func... | boot widgets routing | [
"boot",
"widgets",
"routing"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Providers/FoundationServiceProvider.php#L319-L331 |
228,279 | antaresproject/core | src/foundation/src/Providers/FoundationServiceProvider.php | FoundationServiceProvider.bootNotificationVariables | protected function bootNotificationVariables()
{
if (!app('antares.installed')) {
return;
}
/* @var $notification VariablesService */
if (class_exists(VariablesService::class)) {
$notification = app()->make(VariablesService::class);
$no... | php | protected function bootNotificationVariables()
{
if (!app('antares.installed')) {
return;
}
/* @var $notification VariablesService */
if (class_exists(VariablesService::class)) {
$notification = app()->make(VariablesService::class);
$no... | [
"protected",
"function",
"bootNotificationVariables",
"(",
")",
"{",
"if",
"(",
"!",
"app",
"(",
"'antares.installed'",
")",
")",
"{",
"return",
";",
"}",
"/* @var $notification VariablesService */",
"if",
"(",
"class_exists",
"(",
"VariablesService",
"::",
"class",... | appends notification variables | [
"appends",
"notification",
"variables"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Providers/FoundationServiceProvider.php#L355-L367 |
228,280 | antaresproject/core | src/components/html/src/CustomfieldsFinder.php | CustomfieldsFinder.getCustomfields | protected function getCustomfields()
{
$extensions = extensions();
$return = [];
event('customfields.before.search', $return);
event(new BeforeSearch($return));
foreach ($extensions as $name => $extension) {
$name = 'antares/' . str_replace(['component-', '... | php | protected function getCustomfields()
{
$extensions = extensions();
$return = [];
event('customfields.before.search', $return);
event(new BeforeSearch($return));
foreach ($extensions as $name => $extension) {
$name = 'antares/' . str_replace(['component-', '... | [
"protected",
"function",
"getCustomfields",
"(",
")",
"{",
"$",
"extensions",
"=",
"extensions",
"(",
")",
";",
"$",
"return",
"=",
"[",
"]",
";",
"event",
"(",
"'customfields.before.search'",
",",
"$",
"return",
")",
";",
"event",
"(",
"new",
"BeforeSearc... | Gets extensions with customfields
@return array | [
"Gets",
"extensions",
"with",
"customfields"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/CustomfieldsFinder.php#L69-L113 |
228,281 | antaresproject/core | src/components/html/src/CustomfieldsFinder.php | CustomfieldsFinder.validate | private function validate(array $config = [])
{
$customfields = [];
foreach ($config as $classname => $customfield) {
if (!class_exists($classname)) {
continue;
}
array_push($customfields, $customfield);
}
return !empty($customfield... | php | private function validate(array $config = [])
{
$customfields = [];
foreach ($config as $classname => $customfield) {
if (!class_exists($classname)) {
continue;
}
array_push($customfields, $customfield);
}
return !empty($customfield... | [
"private",
"function",
"validate",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"customfields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"classname",
"=>",
"$",
"customfield",
")",
"{",
"if",
"(",
"!",
"class_exists... | Whether customfield configuration is valid
@param array $config
@return boolean | [
"Whether",
"customfield",
"configuration",
"is",
"valid"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/CustomfieldsFinder.php#L121-L131 |
228,282 | antaresproject/core | src/components/html/src/CustomfieldsFinder.php | CustomfieldsFinder.getConfigurable | public function getConfigurable($group = null)
{
if (empty($this->configurable)) {
foreach ($this->customfields as $category => $customfield) {
foreach ($customfield as $field) {
if (!$field->configurable()) {
continue;
... | php | public function getConfigurable($group = null)
{
if (empty($this->configurable)) {
foreach ($this->customfields as $category => $customfield) {
foreach ($customfield as $field) {
if (!$field->configurable()) {
continue;
... | [
"public",
"function",
"getConfigurable",
"(",
"$",
"group",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"configurable",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"customfields",
"as",
"$",
"category",
"=>",
"$",
"customfi... | Gets configurable customfields
@param String $group
@return array | [
"Gets",
"configurable",
"customfields"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/CustomfieldsFinder.php#L139-L152 |
228,283 | antaresproject/core | src/foundation/src/Http/Controllers/Extension/ActionController.php | ActionController.setupMiddleware | protected function setupMiddleware() {
$this->middleware('antares.auth');
$this->middleware('antares.manage');
$this->middleware('antares.csrf');
$this->canMiddleware('install');
$this->canMiddleware('uninstall');
$this->canMiddleware('activate');
$this->canMiddl... | php | protected function setupMiddleware() {
$this->middleware('antares.auth');
$this->middleware('antares.manage');
$this->middleware('antares.csrf');
$this->canMiddleware('install');
$this->canMiddleware('uninstall');
$this->canMiddleware('activate');
$this->canMiddl... | [
"protected",
"function",
"setupMiddleware",
"(",
")",
"{",
"$",
"this",
"->",
"middleware",
"(",
"'antares.auth'",
")",
";",
"$",
"this",
"->",
"middleware",
"(",
"'antares.manage'",
")",
";",
"$",
"this",
"->",
"middleware",
"(",
"'antares.csrf'",
")",
";",... | Setup controller filters.
@return void | [
"Setup",
"controller",
"filters",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Http/Controllers/Extension/ActionController.php#L61-L70 |
228,284 | antaresproject/core | src/foundation/src/Listeners/DatatableMassActionsDependableActions.php | DatatableMassActionsDependableActions.addClass | protected function addClass($cssClass, &$attributes)
{
$class = array_get($attributes, 'class', '');
if (!str_contains($class, $cssClass)) {
$class .= ' ' . $cssClass;
}
return array_set($attributes, 'class', $class);
} | php | protected function addClass($cssClass, &$attributes)
{
$class = array_get($attributes, 'class', '');
if (!str_contains($class, $cssClass)) {
$class .= ' ' . $cssClass;
}
return array_set($attributes, 'class', $class);
} | [
"protected",
"function",
"addClass",
"(",
"$",
"cssClass",
",",
"&",
"$",
"attributes",
")",
"{",
"$",
"class",
"=",
"array_get",
"(",
"$",
"attributes",
",",
"'class'",
",",
"''",
")",
";",
"if",
"(",
"!",
"str_contains",
"(",
"$",
"class",
",",
"$"... | Add css class to link
@param String $cssClass
@param String $attributes
@return mixed | [
"Add",
"css",
"class",
"to",
"link"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Listeners/DatatableMassActionsDependableActions.php#L81-L88 |
228,285 | antaresproject/core | src/components/extension/src/Model/Extension.php | Extension.getFriendlyName | public function getFriendlyName(): string
{
$extra = $this->getPackage()->getExtra();
$regularName = str_replace(['component-', 'module-'], '', $this->getPackageName());
return (string) Arr::get($extra, 'friendly-name', $regularName);
} | php | public function getFriendlyName(): string
{
$extra = $this->getPackage()->getExtra();
$regularName = str_replace(['component-', 'module-'], '', $this->getPackageName());
return (string) Arr::get($extra, 'friendly-name', $regularName);
} | [
"public",
"function",
"getFriendlyName",
"(",
")",
":",
"string",
"{",
"$",
"extra",
"=",
"$",
"this",
"->",
"getPackage",
"(",
")",
"->",
"getExtra",
"(",
")",
";",
"$",
"regularName",
"=",
"str_replace",
"(",
"[",
"'component-'",
",",
"'module-'",
"]",... | Returns friendly name of the module from the composer extra attribute.
@return string | [
"Returns",
"friendly",
"name",
"of",
"the",
"module",
"from",
"the",
"composer",
"extra",
"attribute",
"."
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/Model/Extension.php#L218-L224 |
228,286 | antaresproject/core | src/foundation/src/Request.php | Request.getController | public function getController()
{
if (!is_null(self::$controller)) {
return self::$controller;
}
$controllerParam = array_get($this->routeParams, 'controller');
$match = null;
preg_match("'Foundation\\\Http\\\Controllers\\\(.*?)@'si", $controllerParam, ... | php | public function getController()
{
if (!is_null(self::$controller)) {
return self::$controller;
}
$controllerParam = array_get($this->routeParams, 'controller');
$match = null;
preg_match("'Foundation\\\Http\\\Controllers\\\(.*?)@'si", $controllerParam, ... | [
"public",
"function",
"getController",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"self",
"::",
"$",
"controller",
")",
")",
"{",
"return",
"self",
"::",
"$",
"controller",
";",
"}",
"$",
"controllerParam",
"=",
"array_get",
"(",
"$",
"this",
"->",... | get current controller name by route
@return String | [
"get",
"current",
"controller",
"name",
"by",
"route"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Request.php#L71-L86 |
228,287 | antaresproject/core | src/foundation/src/Request.php | Request.getControllerClass | public function getControllerClass()
{
$controller = array_get($this->routeParams, 'controller');
$match = null;
if (!preg_match('/(.*?)(?=@|$)/', $controller, $match)) {
return;
}
return $match[0];
} | php | public function getControllerClass()
{
$controller = array_get($this->routeParams, 'controller');
$match = null;
if (!preg_match('/(.*?)(?=@|$)/', $controller, $match)) {
return;
}
return $match[0];
} | [
"public",
"function",
"getControllerClass",
"(",
")",
"{",
"$",
"controller",
"=",
"array_get",
"(",
"$",
"this",
"->",
"routeParams",
",",
"'controller'",
")",
";",
"$",
"match",
"=",
"null",
";",
"if",
"(",
"!",
"preg_match",
"(",
"'/(.*?)(?=@|$)/'",
","... | get controller class name
@return String | [
"get",
"controller",
"class",
"name"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Request.php#L93-L101 |
228,288 | antaresproject/core | src/foundation/src/Request.php | Request.getAction | public function getAction()
{
if (!is_null(self::$action)) {
return self::$action;
}
$controllerParam = array_get($this->routeParams, 'controller');
$match = null;
if (!preg_match("/.+?(?=@)@(.*)/", $controllerParam, $match)) {
return;
... | php | public function getAction()
{
if (!is_null(self::$action)) {
return self::$action;
}
$controllerParam = array_get($this->routeParams, 'controller');
$match = null;
if (!preg_match("/.+?(?=@)@(.*)/", $controllerParam, $match)) {
return;
... | [
"public",
"function",
"getAction",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"self",
"::",
"$",
"action",
")",
")",
"{",
"return",
"self",
"::",
"$",
"action",
";",
"}",
"$",
"controllerParam",
"=",
"array_get",
"(",
"$",
"this",
"->",
"routePar... | get action name by route
@return String | [
"get",
"action",
"name",
"by",
"route"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Request.php#L108-L121 |
228,289 | antaresproject/core | src/foundation/src/Request.php | Request.getModule | public function getModule()
{
if (!is_null(self::$module)) {
return self::$module;
}
$controllerParam = array_get($this->routeParams, 'controller');
$match = null;
preg_match('/(.*?)(?=@|$)/', $controllerParam, $match);
if (!isset($match[0])) {
... | php | public function getModule()
{
if (!is_null(self::$module)) {
return self::$module;
}
$controllerParam = array_get($this->routeParams, 'controller');
$match = null;
preg_match('/(.*?)(?=@|$)/', $controllerParam, $match);
if (!isset($match[0])) {
... | [
"public",
"function",
"getModule",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"self",
"::",
"$",
"module",
")",
")",
"{",
"return",
"self",
"::",
"$",
"module",
";",
"}",
"$",
"controllerParam",
"=",
"array_get",
"(",
"$",
"this",
"->",
"routePar... | get module name by route
@return String | [
"get",
"module",
"name",
"by",
"route"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Request.php#L128-L149 |
228,290 | antaresproject/core | src/foundation/src/Request.php | Request.shouldMakeApiResponse | public function shouldMakeApiResponse()
{
$accept = request()->header('Accept');
$accepted = implode('.', [env('API_STANDARDS_TREE'), env('API_SUBTYPE')]);
return request()->wantsJson() && extension_active('api') && str_contains($accept, $accepted) && class_exists('\Antares\Modules\Api\Htt... | php | public function shouldMakeApiResponse()
{
$accept = request()->header('Accept');
$accepted = implode('.', [env('API_STANDARDS_TREE'), env('API_SUBTYPE')]);
return request()->wantsJson() && extension_active('api') && str_contains($accept, $accepted) && class_exists('\Antares\Modules\Api\Htt... | [
"public",
"function",
"shouldMakeApiResponse",
"(",
")",
"{",
"$",
"accept",
"=",
"request",
"(",
")",
"->",
"header",
"(",
"'Accept'",
")",
";",
"$",
"accepted",
"=",
"implode",
"(",
"'.'",
",",
"[",
"env",
"(",
"'API_STANDARDS_TREE'",
")",
",",
"env",
... | does the request wants api response
@return boolean | [
"does",
"the",
"request",
"wants",
"api",
"response"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Request.php#L156-L161 |
228,291 | marmelab/SonataElasticaBundle | Repository/ElasticaProxyRepository.php | ElasticaProxyRepository.getQueryString | protected function getQueryString($query)
{
$wrapper = ($query instanceof AbstractQuery) ? array('query' => $query->toArray()) : $query->toArray();
return json_encode($wrapper);
} | php | protected function getQueryString($query)
{
$wrapper = ($query instanceof AbstractQuery) ? array('query' => $query->toArray()) : $query->toArray();
return json_encode($wrapper);
} | [
"protected",
"function",
"getQueryString",
"(",
"$",
"query",
")",
"{",
"$",
"wrapper",
"=",
"(",
"$",
"query",
"instanceof",
"AbstractQuery",
")",
"?",
"array",
"(",
"'query'",
"=>",
"$",
"query",
"->",
"toArray",
"(",
")",
")",
":",
"$",
"query",
"->... | Useful for debugging with elastic head plugin
@param \Elastica\Query $query
@return string | [
"Useful",
"for",
"debugging",
"with",
"elastic",
"head",
"plugin"
] | 7b8a2fde72bca7844060fcae6387641478fe7bdc | https://github.com/marmelab/SonataElasticaBundle/blob/7b8a2fde72bca7844060fcae6387641478fe7bdc/Repository/ElasticaProxyRepository.php#L125-L130 |
228,292 | pxgamer/torrent-parser-php | src/WorldWideTorrents.php | WorldWideTorrents.search | public static function search($search_query)
{
$search_query = urlencode($search_query);
return self::get(self::BASE_URL . '/json.php?dllink=1&q=' . $search_query);
} | php | public static function search($search_query)
{
$search_query = urlencode($search_query);
return self::get(self::BASE_URL . '/json.php?dllink=1&q=' . $search_query);
} | [
"public",
"static",
"function",
"search",
"(",
"$",
"search_query",
")",
"{",
"$",
"search_query",
"=",
"urlencode",
"(",
"$",
"search_query",
")",
";",
"return",
"self",
"::",
"get",
"(",
"self",
"::",
"BASE_URL",
".",
"'/json.php?dllink=1&q='",
".",
"$",
... | Search for a specific query string
@param string $search_query
@return Collection | [
"Search",
"for",
"a",
"specific",
"query",
"string"
] | 7ad4d44b4701d54630ba775525bd2bd36ee448bb | https://github.com/pxgamer/torrent-parser-php/blob/7ad4d44b4701d54630ba775525bd2bd36ee448bb/src/WorldWideTorrents.php#L20-L25 |
228,293 | pxgamer/torrent-parser-php | src/WorldWideTorrents.php | WorldWideTorrents.user | public static function user($username)
{
$username = urlencode($username);
return self::get(self::BASE_URL . '/json.php?username=' . $username);
} | php | public static function user($username)
{
$username = urlencode($username);
return self::get(self::BASE_URL . '/json.php?username=' . $username);
} | [
"public",
"static",
"function",
"user",
"(",
"$",
"username",
")",
"{",
"$",
"username",
"=",
"urlencode",
"(",
"$",
"username",
")",
";",
"return",
"self",
"::",
"get",
"(",
"self",
"::",
"BASE_URL",
".",
"'/json.php?username='",
".",
"$",
"username",
"... | Search for torrents by a specific username
@param string $username
@return Collection | [
"Search",
"for",
"torrents",
"by",
"a",
"specific",
"username"
] | 7ad4d44b4701d54630ba775525bd2bd36ee448bb | https://github.com/pxgamer/torrent-parser-php/blob/7ad4d44b4701d54630ba775525bd2bd36ee448bb/src/WorldWideTorrents.php#L43-L48 |
228,294 | pxgamer/torrent-parser-php | src/WorldWideTorrents.php | WorldWideTorrents.createCollection | private static function createCollection($responseData)
{
$collection = new Collection();
foreach ($responseData as $element) {
$torrent = new Torrent();
$torrent->title = $element['title'] ?? null;
$torrent->hash = $element['info_hash'] ?? null;
$to... | php | private static function createCollection($responseData)
{
$collection = new Collection();
foreach ($responseData as $element) {
$torrent = new Torrent();
$torrent->title = $element['title'] ?? null;
$torrent->hash = $element['info_hash'] ?? null;
$to... | [
"private",
"static",
"function",
"createCollection",
"(",
"$",
"responseData",
")",
"{",
"$",
"collection",
"=",
"new",
"Collection",
"(",
")",
";",
"foreach",
"(",
"$",
"responseData",
"as",
"$",
"element",
")",
"{",
"$",
"torrent",
"=",
"new",
"Torrent",... | Create a new Collection of Torrent instances
@param array $responseData
@return Collection | [
"Create",
"a",
"new",
"Collection",
"of",
"Torrent",
"instances"
] | 7ad4d44b4701d54630ba775525bd2bd36ee448bb | https://github.com/pxgamer/torrent-parser-php/blob/7ad4d44b4701d54630ba775525bd2bd36ee448bb/src/WorldWideTorrents.php#L79-L105 |
228,295 | lawoole/framework | src/WebSocket/HandShakeResponse.php | HandShakeResponse.accept | public static function accept($request, $handler)
{
static::checkRequest($request);
$webSocketAccept = base64_encode(
sha1($request->getWebSocketKey().'258EAFA5-E914-47DA-95CA-C5AB0DC85B11', true)
);
$response = static::create('', self::HTTP_SWITCHING_PROTOCOLS);
... | php | public static function accept($request, $handler)
{
static::checkRequest($request);
$webSocketAccept = base64_encode(
sha1($request->getWebSocketKey().'258EAFA5-E914-47DA-95CA-C5AB0DC85B11', true)
);
$response = static::create('', self::HTTP_SWITCHING_PROTOCOLS);
... | [
"public",
"static",
"function",
"accept",
"(",
"$",
"request",
",",
"$",
"handler",
")",
"{",
"static",
"::",
"checkRequest",
"(",
"$",
"request",
")",
";",
"$",
"webSocketAccept",
"=",
"base64_encode",
"(",
"sha1",
"(",
"$",
"request",
"->",
"getWebSocket... | Accept the handshake request and open the connection.
@param \Illuminate\Http\Request $request
@param \Lawoole\Contracts\WebSocket\WebSocketHandler $handler
@return static | [
"Accept",
"the",
"handshake",
"request",
"and",
"open",
"the",
"connection",
"."
] | ac701a76f5d37c81273b7202ba37094766cb5dfe | https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/WebSocket/HandShakeResponse.php#L55-L82 |
228,296 | gggeek/ggwebservices | classes/ggxmlrpcresponse.php | ggXMLRPCResponse.payload | function payload()
{
if ( $this->IsFault )
{
$payload = xmlrpc_encode( array(
"faultCode" => $this->FaultCode,
"faultString" => $this->FaultString ) );
return str_replace( array( '<fault>', '</fault>' ), array( '<methodResponse><fault>', '</fau... | php | function payload()
{
if ( $this->IsFault )
{
$payload = xmlrpc_encode( array(
"faultCode" => $this->FaultCode,
"faultString" => $this->FaultString ) );
return str_replace( array( '<fault>', '</fault>' ), array( '<methodResponse><fault>', '</fau... | [
"function",
"payload",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"IsFault",
")",
"{",
"$",
"payload",
"=",
"xmlrpc_encode",
"(",
"array",
"(",
"\"faultCode\"",
"=>",
"$",
"this",
"->",
"FaultCode",
",",
"\"faultString\"",
"=>",
"$",
"this",
"->",
"F... | Returns the xmlrpc payload for the response. | [
"Returns",
"the",
"xmlrpc",
"payload",
"for",
"the",
"response",
"."
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggxmlrpcresponse.php#L18-L34 |
228,297 | gggeek/ggwebservices | classes/ggxmlrpcresponse.php | ggXMLRPCResponse.decodeStream | function decodeStream( $request, $stream, $headers=false, $cookies=array(), $statuscode="200" )
{
$this->decodeStreamCommon( $request, $stream, $headers, $cookies, $statuscode );
/// @todo refuse bad content-types?
/// @todo test if this automatically groks encoding from xml or not...
... | php | function decodeStream( $request, $stream, $headers=false, $cookies=array(), $statuscode="200" )
{
$this->decodeStreamCommon( $request, $stream, $headers, $cookies, $statuscode );
/// @todo refuse bad content-types?
/// @todo test if this automatically groks encoding from xml or not...
... | [
"function",
"decodeStream",
"(",
"$",
"request",
",",
"$",
"stream",
",",
"$",
"headers",
"=",
"false",
",",
"$",
"cookies",
"=",
"array",
"(",
")",
",",
"$",
"statuscode",
"=",
"\"200\"",
")",
"{",
"$",
"this",
"->",
"decodeStreamCommon",
"(",
"$",
... | Decodes the XMLRPC response stream.
@bug apparently xmlrpc_decode happily parses many xml ansers, wuch as eg. a soap response... | [
"Decodes",
"the",
"XMLRPC",
"response",
"stream",
"."
] | 4f6e1ada1aa94301acd2ef3cd0966c7be06313ec | https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggxmlrpcresponse.php#L41-L71 |
228,298 | antaresproject/core | src/components/memory/src/Handlers/Primary.php | Primary.forceDelete | public function forceDelete($key)
{
!is_null($this->cache) && $this->cache->forget($this->cacheKey);
$model = $this->resolver()->where('name', $key);
if (!is_null($model)) {
return $model->delete();
}
return false;
} | php | public function forceDelete($key)
{
!is_null($this->cache) && $this->cache->forget($this->cacheKey);
$model = $this->resolver()->where('name', $key);
if (!is_null($model)) {
return $model->delete();
}
return false;
} | [
"public",
"function",
"forceDelete",
"(",
"$",
"key",
")",
"{",
"!",
"is_null",
"(",
"$",
"this",
"->",
"cache",
")",
"&&",
"$",
"this",
"->",
"cache",
"->",
"forget",
"(",
"$",
"this",
"->",
"cacheKey",
")",
";",
"$",
"model",
"=",
"$",
"this",
... | deletes item from resolver
@param String $key
@return boolean | [
"deletes",
"item",
"from",
"resolver"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/Handlers/Primary.php#L149-L157 |
228,299 | antaresproject/core | src/utils/customfield/src/Traits/Customfields.php | Customfields.getAssignedCustomfields | protected function getAssignedCustomfields()
{
$customfields = array_get(app('customfields')->get(), get_called_class(), []);
return !is_array($customfields) ? [$customfields] : $customfields;
} | php | protected function getAssignedCustomfields()
{
$customfields = array_get(app('customfields')->get(), get_called_class(), []);
return !is_array($customfields) ? [$customfields] : $customfields;
} | [
"protected",
"function",
"getAssignedCustomfields",
"(",
")",
"{",
"$",
"customfields",
"=",
"array_get",
"(",
"app",
"(",
"'customfields'",
")",
"->",
"get",
"(",
")",
",",
"get_called_class",
"(",
")",
",",
"[",
"]",
")",
";",
"return",
"!",
"is_array",
... | Gets assigned customfieldsa
@return array | [
"Gets",
"assigned",
"customfieldsa"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/customfield/src/Traits/Customfields.php#L31-L36 |
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.