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
33,000
orchestral/support
src/Support/Concerns/DataContainer.php
DataContainer.allWithRemoved
public function allWithRemoved(): array { $items = $this->all(); foreach ($this->removedItems as $deleted) { Arr::set($items, $deleted, null); } return $items; }
php
public function allWithRemoved(): array { $items = $this->all(); foreach ($this->removedItems as $deleted) { Arr::set($items, $deleted, null); } return $items; }
[ "public", "function", "allWithRemoved", "(", ")", ":", "array", "{", "$", "items", "=", "$", "this", "->", "all", "(", ")", ";", "foreach", "(", "$", "this", "->", "removedItems", "as", "$", "deleted", ")", "{", "Arr", "::", "set", "(", "$", "items...
Get all available items including deleted. @return array
[ "Get", "all", "available", "items", "including", "deleted", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Concerns/DataContainer.php#L155-L164
33,001
nails/module-invoice
invoice/controllers/Payment.php
Payment.complete
protected function complete($oPayment) { $oPaymentModel = Factory::model('Payment', 'nails/module-invoice'); $this->data['oPayment'] = $oPayment; $this->data['oInvoice'] = $oPayment->invoice; if ($oPayment->status->id === $oPaymentModel::STATUS_FAILED) { // Payments wh...
php
protected function complete($oPayment) { $oPaymentModel = Factory::model('Payment', 'nails/module-invoice'); $this->data['oPayment'] = $oPayment; $this->data['oInvoice'] = $oPayment->invoice; if ($oPayment->status->id === $oPaymentModel::STATUS_FAILED) { // Payments wh...
[ "protected", "function", "complete", "(", "$", "oPayment", ")", "{", "$", "oPaymentModel", "=", "Factory", "::", "model", "(", "'Payment'", ",", "'nails/module-invoice'", ")", ";", "$", "this", "->", "data", "[", "'oPayment'", "]", "=", "$", "oPayment", ";...
Completes a payment @param \stdClass $oPayment The invoice object @return void
[ "Completes", "a", "payment" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/invoice/controllers/Payment.php#L26-L103
33,002
nails/module-invoice
invoice/controllers/Payment.php
Payment.thanks
protected function thanks($oPayment) { if ($oPayment->status->id === 'PROCESSING') { redirect($oPayment->urls->processing); } elseif ($oPayment->status->id !== 'COMPLETE') { show404(); } $this->data['oPayment'] = $oPayment; $this->data['headerOv...
php
protected function thanks($oPayment) { if ($oPayment->status->id === 'PROCESSING') { redirect($oPayment->urls->processing); } elseif ($oPayment->status->id !== 'COMPLETE') { show404(); } $this->data['oPayment'] = $oPayment; $this->data['headerOv...
[ "protected", "function", "thanks", "(", "$", "oPayment", ")", "{", "if", "(", "$", "oPayment", "->", "status", "->", "id", "===", "'PROCESSING'", ")", "{", "redirect", "(", "$", "oPayment", "->", "urls", "->", "processing", ")", ";", "}", "elseif", "("...
Shows a thank you page @param \stdClass $oPayment The invoice object @return void
[ "Shows", "a", "thank", "you", "page" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/invoice/controllers/Payment.php#L114-L133
33,003
canihavesomecoffee/theTVDbAPI
src/Exception/ResourceNotFoundException.php
ResourceNotFoundException.createErrorMessage
public static function createErrorMessage(string $baseMessage, string $path = null, array $parameters = []): string { $errorMessage = $baseMessage; if ($path !== null) { $errorMessage .= sprintf( static::PATH_MESSAGE, $path, \GuzzleHttp\Psr...
php
public static function createErrorMessage(string $baseMessage, string $path = null, array $parameters = []): string { $errorMessage = $baseMessage; if ($path !== null) { $errorMessage .= sprintf( static::PATH_MESSAGE, $path, \GuzzleHttp\Psr...
[ "public", "static", "function", "createErrorMessage", "(", "string", "$", "baseMessage", ",", "string", "$", "path", "=", "null", ",", "array", "$", "parameters", "=", "[", "]", ")", ":", "string", "{", "$", "errorMessage", "=", "$", "baseMessage", ";", ...
Creates an error message for a not found exception. @param string $baseMessage The base error message @param string $path The requested path @param array $parameters The query parameters (if defined) @return string
[ "Creates", "an", "error", "message", "for", "a", "not", "found", "exception", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/Exception/ResourceNotFoundException.php#L64-L75
33,004
canihavesomecoffee/theTVDbAPI
src/Exception/ResourceNotFoundException.php
ResourceNotFoundException.notFound
public static function notFound(string $path = null, array $options = []): ResourceNotFoundException { $query = []; if (array_key_exists('query', $options)) { $query = $options['query']; } return new static(static::createErrorMessage(static::NOT_FOUND_MESSAGE, $path, $que...
php
public static function notFound(string $path = null, array $options = []): ResourceNotFoundException { $query = []; if (array_key_exists('query', $options)) { $query = $options['query']; } return new static(static::createErrorMessage(static::NOT_FOUND_MESSAGE, $path, $que...
[ "public", "static", "function", "notFound", "(", "string", "$", "path", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", ":", "ResourceNotFoundException", "{", "$", "query", "=", "[", "]", ";", "if", "(", "array_key_exists", "(", "'query'",...
Returns a new instance for the resource not found exception. @param string $path The requested path @param array $options The options passed to the request @return ResourceNotFoundException
[ "Returns", "a", "new", "instance", "for", "the", "resource", "not", "found", "exception", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/Exception/ResourceNotFoundException.php#L85-L92
33,005
canihavesomecoffee/theTVDbAPI
src/Exception/ResourceNotFoundException.php
ResourceNotFoundException.noTranslationAvailable
public static function noTranslationAvailable(string $path = null, array $options = []): ResourceNotFoundException { $query = []; if (array_key_exists('query', $options)) { $query = $options['query']; } return new static(static::createErrorMessage(static::NO_TRANSLATION_M...
php
public static function noTranslationAvailable(string $path = null, array $options = []): ResourceNotFoundException { $query = []; if (array_key_exists('query', $options)) { $query = $options['query']; } return new static(static::createErrorMessage(static::NO_TRANSLATION_M...
[ "public", "static", "function", "noTranslationAvailable", "(", "string", "$", "path", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", ":", "ResourceNotFoundException", "{", "$", "query", "=", "[", "]", ";", "if", "(", "array_key_exists", "("...
Returns a new instance for the resource not found exception for missing translations @param string $path The requested path @param array $options The options passed to the request @return ResourceNotFoundException
[ "Returns", "a", "new", "instance", "for", "the", "resource", "not", "found", "exception", "for", "missing", "translations" ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/Exception/ResourceNotFoundException.php#L102-L109
33,006
orchestral/support
src/Support/Concerns/Descendible.php
Descendible.descendants
protected function descendants(array $array, ?string $key = null) { if (\is_null($key)) { return $array; } $keys = \explode('.', $key); $first = \array_shift($keys); if (! isset($array[$first])) { return null; } return $this->resolve...
php
protected function descendants(array $array, ?string $key = null) { if (\is_null($key)) { return $array; } $keys = \explode('.', $key); $first = \array_shift($keys); if (! isset($array[$first])) { return null; } return $this->resolve...
[ "protected", "function", "descendants", "(", "array", "$", "array", ",", "?", "string", "$", "key", "=", "null", ")", "{", "if", "(", "\\", "is_null", "(", "$", "key", ")", ")", "{", "return", "$", "array", ";", "}", "$", "keys", "=", "\\", "expl...
Get last descendant node from items recursively. @param array $array @param string|null $key @return \Illuminate\Support\Fluent|array|null
[ "Get", "last", "descendant", "node", "from", "items", "recursively", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Concerns/Descendible.php#L17-L31
33,007
orchestral/support
src/Support/Concerns/Descendible.php
Descendible.resolveLastDecendant
protected function resolveLastDecendant($array, array $keys): ?Fluent { $isLastDescendant = function ($array, $segment) { return ! \is_array($array->childs) || ! isset($array->childs[$segment]); }; // To retrieve the array item using dot syntax, we'll iterate through // ...
php
protected function resolveLastDecendant($array, array $keys): ?Fluent { $isLastDescendant = function ($array, $segment) { return ! \is_array($array->childs) || ! isset($array->childs[$segment]); }; // To retrieve the array item using dot syntax, we'll iterate through // ...
[ "protected", "function", "resolveLastDecendant", "(", "$", "array", ",", "array", "$", "keys", ")", ":", "?", "Fluent", "{", "$", "isLastDescendant", "=", "function", "(", "$", "array", ",", "$", "segment", ")", "{", "return", "!", "\\", "is_array", "(",...
Resolve last descendant node from items. @param mixed $array @param array $keys @return \Orchestra\Support\Fluent|null
[ "Resolve", "last", "descendant", "node", "from", "items", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Concerns/Descendible.php#L41-L60
33,008
silktide/syringe
src/MasterConfig.php
MasterConfig.stableWeightSort
protected function stableWeightSort(array &$array) { foreach ($array as $i => &$value) { $value["key"] = $i; } unset($value); usort($array, function(array $v1, array $v2) { $byWeight = $v1["weight"] - $v2["weight"]; if ($byWeight === 0) { ...
php
protected function stableWeightSort(array &$array) { foreach ($array as $i => &$value) { $value["key"] = $i; } unset($value); usort($array, function(array $v1, array $v2) { $byWeight = $v1["weight"] - $v2["weight"]; if ($byWeight === 0) { ...
[ "protected", "function", "stableWeightSort", "(", "array", "&", "$", "array", ")", "{", "foreach", "(", "$", "array", "as", "$", "i", "=>", "&", "$", "value", ")", "{", "$", "value", "[", "\"key\"", "]", "=", "$", "i", ";", "}", "unset", "(", "$"...
All of these should be ordered by weight, but keep their order if they were equal, aka, a stable sort Unfortunately, all of PHPs underlying sorting is done by QuickSort, so we have to do the sorting ourselves @param array $array @return array
[ "All", "of", "these", "should", "be", "ordered", "by", "weight", "but", "keep", "their", "order", "if", "they", "were", "equal", "aka", "a", "stable", "sort", "Unfortunately", "all", "of", "PHPs", "underlying", "sorting", "is", "done", "by", "QuickSort", "...
afff52640aaaacb44e58f65722a5d717648c15fd
https://github.com/silktide/syringe/blob/afff52640aaaacb44e58f65722a5d717648c15fd/src/MasterConfig.php#L76-L90
33,009
canihavesomecoffee/theTVDbAPI
src/Route/UpdatesRoute.php
UpdatesRoute.query
public function query(DateTime $fromTime, DateTime $toTime = null): array { $options = ['query' => ['fromTime' => $fromTime->getTimestamp()]]; if ($toTime !== null) { $options['query']['toTime'] = $toTime->getTimestamp(); } $json = $this->parent->performAPICallWithJsonRe...
php
public function query(DateTime $fromTime, DateTime $toTime = null): array { $options = ['query' => ['fromTime' => $fromTime->getTimestamp()]]; if ($toTime !== null) { $options['query']['toTime'] = $toTime->getTimestamp(); } $json = $this->parent->performAPICallWithJsonRe...
[ "public", "function", "query", "(", "DateTime", "$", "fromTime", ",", "DateTime", "$", "toTime", "=", "null", ")", ":", "array", "{", "$", "options", "=", "[", "'query'", "=>", "[", "'fromTime'", "=>", "$", "fromTime", "->", "getTimestamp", "(", ")", "...
Fetches the series that were updated between the given timestamps. If the toTime variable is left null, the API will take the current timestamp for this. @param DateTime $fromTime Fetch series that were updated after this timestamp. @param DateTime|null $toTime Fetch series that were updated before this timesta...
[ "Fetches", "the", "series", "that", "were", "updated", "between", "the", "given", "timestamps", ".", "If", "the", "toTime", "variable", "is", "left", "null", "the", "API", "will", "take", "the", "current", "timestamp", "for", "this", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/Route/UpdatesRoute.php#L54-L63
33,010
nails/module-invoice
admin/controllers/Invoice.php
Invoice.view
public function view() { if (!userHasPermission('admin:invoice:invoice:edit')) { unauthorised(); } $oUri = Factory::service('Uri'); $oModel = $this->oInvoiceModel; $iInvoiceId = (int) $oUri->segment(5); $this->da...
php
public function view() { if (!userHasPermission('admin:invoice:invoice:edit')) { unauthorised(); } $oUri = Factory::service('Uri'); $oModel = $this->oInvoiceModel; $iInvoiceId = (int) $oUri->segment(5); $this->da...
[ "public", "function", "view", "(", ")", "{", "if", "(", "!", "userHasPermission", "(", "'admin:invoice:invoice:edit'", ")", ")", "{", "unauthorised", "(", ")", ";", "}", "$", "oUri", "=", "Factory", "::", "service", "(", "'Uri'", ")", ";", "$", "oModel",...
View an invoice @throws \Nails\Common\Exception\FactoryException
[ "View", "an", "invoice" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/admin/controllers/Invoice.php#L447-L471
33,011
nails/module-invoice
admin/controllers/Invoice.php
Invoice._callbackValidCurrency
public function _callbackValidCurrency($sCode) { $oFormValidation = Factory::service('FormValidation'); $oFormValidation->set_message('_callbackValidCurrency', 'Invalid currency.'); $oCurrency = Factory::service('Currency', 'nails/module-currency'); $aEnabled = $oCurrency->getAllEn...
php
public function _callbackValidCurrency($sCode) { $oFormValidation = Factory::service('FormValidation'); $oFormValidation->set_message('_callbackValidCurrency', 'Invalid currency.'); $oCurrency = Factory::service('Currency', 'nails/module-currency'); $aEnabled = $oCurrency->getAllEn...
[ "public", "function", "_callbackValidCurrency", "(", "$", "sCode", ")", "{", "$", "oFormValidation", "=", "Factory", "::", "service", "(", "'FormValidation'", ")", ";", "$", "oFormValidation", "->", "set_message", "(", "'_callbackValidCurrency'", ",", "'Invalid curr...
Form validation cal;back to validate currency selection @param string $sCode the currency code @return bool @throws \Nails\Common\Exception\FactoryException
[ "Form", "validation", "cal", ";", "back", "to", "validate", "currency", "selection" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/admin/controllers/Invoice.php#L483-L498
33,012
nails/module-invoice
admin/controllers/Invoice.php
Invoice.make_draft
public function make_draft() { if (!userHasPermission('admin:invoice:invoice:edit')) { unauthorised(); } // -------------------------------------------------------------------------- $oUri = Factory::service('Uri'); $oInvoice = $this->oInvoiceModel->getById(...
php
public function make_draft() { if (!userHasPermission('admin:invoice:invoice:edit')) { unauthorised(); } // -------------------------------------------------------------------------- $oUri = Factory::service('Uri'); $oInvoice = $this->oInvoiceModel->getById(...
[ "public", "function", "make_draft", "(", ")", "{", "if", "(", "!", "userHasPermission", "(", "'admin:invoice:invoice:edit'", ")", ")", "{", "unauthorised", "(", ")", ";", "}", "// --------------------------------------------------------------------------", "$", "oUri", ...
Make an invoice a draft @throws \Nails\Common\Exception\FactoryException
[ "Make", "an", "invoice", "a", "draft" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/admin/controllers/Invoice.php#L507-L541
33,013
nails/module-invoice
admin/controllers/Invoice.php
Invoice.delete
public function delete() { if (!userHasPermission('admin:invoice:invoice:delete')) { unauthorised(); } // -------------------------------------------------------------------------- $oUri = Factory::service('Uri'); $oInvoice = $this->oInvoiceModel->getById($o...
php
public function delete() { if (!userHasPermission('admin:invoice:invoice:delete')) { unauthorised(); } // -------------------------------------------------------------------------- $oUri = Factory::service('Uri'); $oInvoice = $this->oInvoiceModel->getById($o...
[ "public", "function", "delete", "(", ")", "{", "if", "(", "!", "userHasPermission", "(", "'admin:invoice:invoice:delete'", ")", ")", "{", "unauthorised", "(", ")", ";", "}", "// --------------------------------------------------------------------------", "$", "oUri", "=...
Delete an invoice @throws \Nails\Common\Exception\FactoryException
[ "Delete", "an", "invoice" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/admin/controllers/Invoice.php#L593-L621
33,014
nails/module-invoice
admin/controllers/Invoice.php
Invoice.validatePost
protected function validatePost() { $oFormValidation = Factory::service('FormValidation'); $aRules = [ 'ref' => 'trim', 'state' => 'trim|required', 'dated' => 'trim|required|valid_date', 'currency' => 'trim|requi...
php
protected function validatePost() { $oFormValidation = Factory::service('FormValidation'); $aRules = [ 'ref' => 'trim', 'state' => 'trim|required', 'dated' => 'trim|required|valid_date', 'currency' => 'trim|requi...
[ "protected", "function", "validatePost", "(", ")", "{", "$", "oFormValidation", "=", "Factory", "::", "service", "(", "'FormValidation'", ")", ";", "$", "aRules", "=", "[", "'ref'", "=>", "'trim'", ",", "'state'", "=>", "'trim|required'", ",", "'dated'", "=>...
Validate the POST data @return boolean @throws \Nails\Common\Exception\FactoryException
[ "Validate", "the", "POST", "data" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/admin/controllers/Invoice.php#L631-L663
33,015
nails/module-invoice
admin/controllers/Invoice.php
Invoice.getObjectFromPost
protected function getObjectFromPost() { $oInput = Factory::service('Input'); $oUri = Factory::service('Uri'); $aData = [ 'ref' => $oInput->post('ref') ?: null, 'state' => $oInput->post('state') ?: null, 'dated' => $oInpu...
php
protected function getObjectFromPost() { $oInput = Factory::service('Input'); $oUri = Factory::service('Uri'); $aData = [ 'ref' => $oInput->post('ref') ?: null, 'state' => $oInput->post('state') ?: null, 'dated' => $oInpu...
[ "protected", "function", "getObjectFromPost", "(", ")", "{", "$", "oInput", "=", "Factory", "::", "service", "(", "'Input'", ")", ";", "$", "oUri", "=", "Factory", "::", "service", "(", "'Uri'", ")", ";", "$", "aData", "=", "[", "'ref'", "=>", "$", "...
Get an object generated from the POST data @return array @throws \Nails\Common\Exception\FactoryException
[ "Get", "an", "object", "generated", "from", "the", "POST", "data" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/admin/controllers/Invoice.php#L673-L710
33,016
rinvex/cortex-console
src/Http/Controllers/Adminarea/TerminalController.php
TerminalController.index
public function index(Request $request, Terminal $terminal) { $token = null; if ($request->hasSession() === true) { $token = $request->session()->token(); } $terminal->call('list --ansi'); $options = json_encode([ 'username' => 'LARAVEL', ...
php
public function index(Request $request, Terminal $terminal) { $token = null; if ($request->hasSession() === true) { $token = $request->session()->token(); } $terminal->call('list --ansi'); $options = json_encode([ 'username' => 'LARAVEL', ...
[ "public", "function", "index", "(", "Request", "$", "request", ",", "Terminal", "$", "terminal", ")", "{", "$", "token", "=", "null", ";", "if", "(", "$", "request", "->", "hasSession", "(", ")", "===", "true", ")", "{", "$", "token", "=", "$", "re...
Show terminal index. @param \Illuminate\Http\Request $request @param \Cortex\Console\Services\Terminal $terminal @return \Illuminate\View\View
[ "Show", "terminal", "index", "." ]
218307609effc38f16b00dba46786a296246f3b5
https://github.com/rinvex/cortex-console/blob/218307609effc38f16b00dba46786a296246f3b5/src/Http/Controllers/Adminarea/TerminalController.php#L27-L64
33,017
QoboLtd/qobo-robo
src/Command/Project/DotenvReload.php
DotenvReload.projectDotenvReload
public function projectDotenvReload($envPath = '.env', $opts = ['format' => 'table', 'fields' => '']) { // Reload $result = $this->taskDotenvReload() ->path($envPath) ->run(); if (!$result->wasSuccessful()) { $this->exitError("Failed to run command"); ...
php
public function projectDotenvReload($envPath = '.env', $opts = ['format' => 'table', 'fields' => '']) { // Reload $result = $this->taskDotenvReload() ->path($envPath) ->run(); if (!$result->wasSuccessful()) { $this->exitError("Failed to run command"); ...
[ "public", "function", "projectDotenvReload", "(", "$", "envPath", "=", "'.env'", ",", "$", "opts", "=", "[", "'format'", "=>", "'table'", ",", "'fields'", "=>", "''", "]", ")", "{", "// Reload", "$", "result", "=", "$", "this", "->", "taskDotenvReload", ...
Reload environment from given dotenv file @param string $envPath Path to dotenv file @option string $format Output format (table, list, csv, json, xml) @option string $fields Limit output to given fields, comma-separated @return PropertyList result
[ "Reload", "environment", "from", "given", "dotenv", "file" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/Command/Project/DotenvReload.php#L28-L40
33,018
QoboLtd/qobo-robo
src/Command/Mysql/Export.php
Export.mysqlExport
public function mysqlExport($db, $file = 'etc/mysql.sql', $user = 'root', $pass = null, $host = null, $port = null, $opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskMysqlExport() ->db($db) ->file($file) ->user($user) ->pass($pass) ...
php
public function mysqlExport($db, $file = 'etc/mysql.sql', $user = 'root', $pass = null, $host = null, $port = null, $opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskMysqlExport() ->db($db) ->file($file) ->user($user) ->pass($pass) ...
[ "public", "function", "mysqlExport", "(", "$", "db", ",", "$", "file", "=", "'etc/mysql.sql'", ",", "$", "user", "=", "'root'", ",", "$", "pass", "=", "null", ",", "$", "host", "=", "null", ",", "$", "port", "=", "null", ",", "$", "opts", "=", "[...
Dump mysql database @param string $db Database name @param string $file Destination file for a dump @param string $user MySQL user to bind with @param string $pass (Optional) MySQL user password @param string $host (Optional) MySQL server host @param string $port (Optional) MySQL server port @option string $format Out...
[ "Dump", "mysql", "database" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/Command/Mysql/Export.php#L33-L50
33,019
doganoo/PHPUtil
src/Util/NumberUtil.php
NumberUtil.format
public static function format($value, int $decimals = 2): ?string { if (!\is_numeric($value)) { return null; } return \number_format($value, $decimals); }
php
public static function format($value, int $decimals = 2): ?string { if (!\is_numeric($value)) { return null; } return \number_format($value, $decimals); }
[ "public", "static", "function", "format", "(", "$", "value", ",", "int", "$", "decimals", "=", "2", ")", ":", "?", "string", "{", "if", "(", "!", "\\", "is_numeric", "(", "$", "value", ")", ")", "{", "return", "null", ";", "}", "return", "\\", "n...
returns the formatted number with grouped thousands @param $value @param int $decimals @return null|string
[ "returns", "the", "formatted", "number", "with", "grouped", "thousands" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Util/NumberUtil.php#L44-L49
33,020
doganoo/PHPUtil
src/Util/NumberUtil.php
NumberUtil.stripNonInteger
public static function stripNonInteger(array $array): array { $newArray = []; foreach ($array as $value) { if (!NumberUtil::isInteger($value)) continue; $newArray[] = \intval($value); } return $newArray; }
php
public static function stripNonInteger(array $array): array { $newArray = []; foreach ($array as $value) { if (!NumberUtil::isInteger($value)) continue; $newArray[] = \intval($value); } return $newArray; }
[ "public", "static", "function", "stripNonInteger", "(", "array", "$", "array", ")", ":", "array", "{", "$", "newArray", "=", "[", "]", ";", "foreach", "(", "$", "array", "as", "$", "value", ")", "{", "if", "(", "!", "NumberUtil", "::", "isInteger", "...
strips all non integer fields from the input and returns all values as integer data type. @param array $array @return array
[ "strips", "all", "non", "integer", "fields", "from", "the", "input", "and", "returns", "all", "values", "as", "integer", "data", "type", "." ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Util/NumberUtil.php#L112-L119
33,021
QoboLtd/qobo-robo
src/Command/Template/Tokens.php
Tokens.templateTokens
public function templateTokens($path, $pre = '%%', $post = '%%', $opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskTemplateTokens() ->path($path) ->pre($pre) ->post($post) ->run(); if (!$result->wasSuccessful()) { $this...
php
public function templateTokens($path, $pre = '%%', $post = '%%', $opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskTemplateTokens() ->path($path) ->pre($pre) ->post($post) ->run(); if (!$result->wasSuccessful()) { $this...
[ "public", "function", "templateTokens", "(", "$", "path", ",", "$", "pre", "=", "'%%'", ",", "$", "post", "=", "'%%'", ",", "$", "opts", "=", "[", "'format'", "=>", "'table'", ",", "'fields'", "=>", "''", "]", ")", "{", "$", "result", "=", "$", "...
List all present tokens in a given template @param string $path Path to template @param string $pre Token prefix @param string $post Token postfix @option string $format Output format (table, list, csv, json, xml) @option string $fields Limit output to given fields, comma-separated @return RowsOfFields|false on succe...
[ "List", "all", "present", "tokens", "in", "a", "given", "template" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/Command/Template/Tokens.php#L30-L53
33,022
g4code/data-mapper
src/Bulk/Solr.php
Solr.markForSetAtomic
public function markForSetAtomic(\G4\DataMapper\Domain\DomainAbstract $domain) { $this->data[] = $this->addMethodToData(self::METHOD_SET, array_filter($domain->getRawData())); return $this; }
php
public function markForSetAtomic(\G4\DataMapper\Domain\DomainAbstract $domain) { $this->data[] = $this->addMethodToData(self::METHOD_SET, array_filter($domain->getRawData())); return $this; }
[ "public", "function", "markForSetAtomic", "(", "\\", "G4", "\\", "DataMapper", "\\", "Domain", "\\", "DomainAbstract", "$", "domain", ")", "{", "$", "this", "->", "data", "[", "]", "=", "$", "this", "->", "addMethodToData", "(", "self", "::", "METHOD_SET",...
Atomic update of all fields that are not null @param \G4\DataMapper\Domain\DomainAbstract $domain @return $this
[ "Atomic", "update", "of", "all", "fields", "that", "are", "not", "null" ]
ac794cb5b02d277b524fb9e65f59ba87170afd97
https://github.com/g4code/data-mapper/blob/ac794cb5b02d277b524fb9e65f59ba87170afd97/src/Bulk/Solr.php#L86-L90
33,023
doganoo/PHPUtil
src/HTTP/Session.php
Session.readArray
public function readArray($index) { return isset ($_SESSION [$index]) && is_array($_SESSION [$index]) ? $_SESSION [$index] : []; }
php
public function readArray($index) { return isset ($_SESSION [$index]) && is_array($_SESSION [$index]) ? $_SESSION [$index] : []; }
[ "public", "function", "readArray", "(", "$", "index", ")", "{", "return", "isset", "(", "$", "_SESSION", "[", "$", "index", "]", ")", "&&", "is_array", "(", "$", "_SESSION", "[", "$", "index", "]", ")", "?", "$", "_SESSION", "[", "$", "index", "]",...
reads an array from the session @param $index @return array
[ "reads", "an", "array", "from", "the", "session" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/HTTP/Session.php#L54-L56
33,024
rinvex/cortex-console
src/Http/Controllers/Adminarea/RoutesController.php
RoutesController.index
public function index(RoutesDataTable $routesDataTable) { $middlewareClosure = function ($middleware) { return $middleware instanceof Closure ? 'Closure' : $middleware; }; return $routesDataTable->with([ 'id' => 'adminarea-routes-index-table', 'middleware...
php
public function index(RoutesDataTable $routesDataTable) { $middlewareClosure = function ($middleware) { return $middleware instanceof Closure ? 'Closure' : $middleware; }; return $routesDataTable->with([ 'id' => 'adminarea-routes-index-table', 'middleware...
[ "public", "function", "index", "(", "RoutesDataTable", "$", "routesDataTable", ")", "{", "$", "middlewareClosure", "=", "function", "(", "$", "middleware", ")", "{", "return", "$", "middleware", "instanceof", "Closure", "?", "'Closure'", ":", "$", "middleware", ...
List all routes. @param \Cortex\Console\DataTables\Adminarea\RoutesDataTable $routesDataTable @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
[ "List", "all", "routes", "." ]
218307609effc38f16b00dba46786a296246f3b5
https://github.com/rinvex/cortex-console/blob/218307609effc38f16b00dba46786a296246f3b5/src/Http/Controllers/Adminarea/RoutesController.php#L25-L35
33,025
QoboLtd/qobo-robo
src/Command/Template/Process.php
Process.templateProcess
public function templateProcess($src, $dst, $opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskDotenvFileRead() ->path('.env') ->run(); if (!$result->wasSuccessful()) { $this->exitError("Failed to run command"); } $data = $resul...
php
public function templateProcess($src, $dst, $opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskDotenvFileRead() ->path('.env') ->run(); if (!$result->wasSuccessful()) { $this->exitError("Failed to run command"); } $data = $resul...
[ "public", "function", "templateProcess", "(", "$", "src", ",", "$", "dst", ",", "$", "opts", "=", "[", "'format'", "=>", "'table'", ",", "'fields'", "=>", "''", "]", ")", "{", "$", "result", "=", "$", "this", "->", "taskDotenvFileRead", "(", ")", "->...
Process given template with tokens from environment variables @param string $src Path to template @param string $dst Path to final file @option string $format Output format (table, list, csv, json, xml) @option string $fields Limit output to given fields, comma-separated @return bool true on success, false on failure
[ "Process", "given", "template", "with", "tokens", "from", "environment", "variables" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/Command/Template/Process.php#L29-L55
33,026
orchestral/support
src/Support/Serializer.php
Serializer.serializeBasicDataset
final protected function serializeBasicDataset($dataset): array { $key = $this->resolveSerializerKey($dataset); if ($dataset instanceof Paginator) { $collection = $dataset->toArray(); $collection[$key] = $collection['data']; unset($collection['data']); ...
php
final protected function serializeBasicDataset($dataset): array { $key = $this->resolveSerializerKey($dataset); if ($dataset instanceof Paginator) { $collection = $dataset->toArray(); $collection[$key] = $collection['data']; unset($collection['data']); ...
[ "final", "protected", "function", "serializeBasicDataset", "(", "$", "dataset", ")", ":", "array", "{", "$", "key", "=", "$", "this", "->", "resolveSerializerKey", "(", "$", "dataset", ")", ";", "if", "(", "$", "dataset", "instanceof", "Paginator", ")", "{...
Resolve paginated dataset. @param mixed $dataset @return array
[ "Resolve", "paginated", "dataset", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Serializer.php#L40-L56
33,027
orchestral/support
src/Support/Serializer.php
Serializer.resolveSerializerKey
protected function resolveSerializerKey($dataset): string { if ($dataset instanceof BaseCollection || $dataset instanceof Paginator) { return Str::plural($this->getKey()); } return $this->getKey(); }
php
protected function resolveSerializerKey($dataset): string { if ($dataset instanceof BaseCollection || $dataset instanceof Paginator) { return Str::plural($this->getKey()); } return $this->getKey(); }
[ "protected", "function", "resolveSerializerKey", "(", "$", "dataset", ")", ":", "string", "{", "if", "(", "$", "dataset", "instanceof", "BaseCollection", "||", "$", "dataset", "instanceof", "Paginator", ")", "{", "return", "Str", "::", "plural", "(", "$", "t...
Resolve serializer key. @param mixed $dataset @return string
[ "Resolve", "serializer", "key", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Serializer.php#L75-L82
33,028
doganoo/PHPUtil
src/Log/Logger.php
Logger.log
private static function log(string $message, int $level) { \Logger::configure(self::getConfiguration()); $logger = \Logger::getRootLogger(); $logger->setLevel(self::getLoggerLevel()); switch ($level) { case Logger::DEBUG: $logger->debug($message); ...
php
private static function log(string $message, int $level) { \Logger::configure(self::getConfiguration()); $logger = \Logger::getRootLogger(); $logger->setLevel(self::getLoggerLevel()); switch ($level) { case Logger::DEBUG: $logger->debug($message); ...
[ "private", "static", "function", "log", "(", "string", "$", "message", ",", "int", "$", "level", ")", "{", "\\", "Logger", "::", "configure", "(", "self", "::", "getConfiguration", "(", ")", ")", ";", "$", "logger", "=", "\\", "Logger", "::", "getRootL...
logs a message to the console @param string $message @param int $level
[ "logs", "a", "message", "to", "the", "console" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Log/Logger.php#L136-L162
33,029
orchestral/support
src/Support/Concerns/Validation.php
Validation.bindToValidation
final public function bindToValidation(array $bindings): self { $this->validationBindings = \array_merge($this->validationBindings, $bindings); return $this; }
php
final public function bindToValidation(array $bindings): self { $this->validationBindings = \array_merge($this->validationBindings, $bindings); return $this; }
[ "final", "public", "function", "bindToValidation", "(", "array", "$", "bindings", ")", ":", "self", "{", "$", "this", "->", "validationBindings", "=", "\\", "array_merge", "(", "$", "this", "->", "validationBindings", ",", "$", "bindings", ")", ";", "return"...
Add bindings. @param array $bindings @return $this
[ "Add", "bindings", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Concerns/Validation.php#L63-L68
33,030
orchestral/support
src/Support/Concerns/Validation.php
Validation.getBindedRules
protected function getBindedRules(): array { $rules = $this->getValidationRules(); if (! empty($this->validationBindings)) { foreach ($rules as $key => $value) { $rules[$key] = Str::replace($value, $this->validationBindings); } } return $rule...
php
protected function getBindedRules(): array { $rules = $this->getValidationRules(); if (! empty($this->validationBindings)) { foreach ($rules as $key => $value) { $rules[$key] = Str::replace($value, $this->validationBindings); } } return $rule...
[ "protected", "function", "getBindedRules", "(", ")", ":", "array", "{", "$", "rules", "=", "$", "this", "->", "getValidationRules", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "validationBindings", ")", ")", "{", "foreach", "(", "$"...
Run rules bindings. @return array
[ "Run", "rules", "bindings", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Concerns/Validation.php#L99-L110
33,031
byjg/restserver
src/HttpRequest.php
HttpRequest.request
public function request($value) { if (!isset($this->request[$value])) { return false; } else { return $this->request[$value]; } }
php
public function request($value) { if (!isset($this->request[$value])) { return false; } else { return $this->request[$value]; } }
[ "public", "function", "request", "(", "$", "value", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "request", "[", "$", "value", "]", ")", ")", "{", "return", "false", ";", "}", "else", "{", "return", "$", "this", "->", "request", "["...
Get a value from any of get, post, server, cookie or session. If not found return false. @param string $value @return string|boolean
[ "Get", "a", "value", "from", "any", "of", "get", "post", "server", "cookie", "or", "session", ".", "If", "not", "found", "return", "false", "." ]
1fdbd58f414f5d9958de0873d67eea961dc52fda
https://github.com/byjg/restserver/blob/1fdbd58f414f5d9958de0873d67eea961dc52fda/src/HttpRequest.php#L115-L122
33,032
byjg/restserver
src/HttpRequest.php
HttpRequest.getRequestIp
public function getRequestIp() { $headers = [ 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR', ]; foreach ($headers as $header) { if ($this-...
php
public function getRequestIp() { $headers = [ 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR', ]; foreach ($headers as $header) { if ($this-...
[ "public", "function", "getRequestIp", "(", ")", "{", "$", "headers", "=", "[", "'HTTP_CLIENT_IP'", ",", "'HTTP_X_FORWARDED_FOR'", ",", "'HTTP_X_FORWARDED'", ",", "'HTTP_FORWARDED_FOR'", ",", "'HTTP_FORWARDED'", ",", "'REMOTE_ADDR'", ",", "]", ";", "foreach", "(", ...
Use this method to get the CLIENT REQUEST IP. Note that if you behing a Proxy, the variable REMOTE_ADDR will always have the same IP @return string
[ "Use", "this", "method", "to", "get", "the", "CLIENT", "REQUEST", "IP", ".", "Note", "that", "if", "you", "behing", "a", "Proxy", "the", "variable", "REMOTE_ADDR", "will", "always", "have", "the", "same", "IP" ]
1fdbd58f414f5d9958de0873d67eea961dc52fda
https://github.com/byjg/restserver/blob/1fdbd58f414f5d9958de0873d67eea961dc52fda/src/HttpRequest.php#L145-L162
33,033
hiqdev/hipanel-rbac
src/SetterTrait.php
SetterTrait.setPermission
public function setPermission($name, $description = null) { $permission = $this->getPermission($name) ?: $this->createPermission($name); if ($description) { $permission->description = $description; } $this->add($permission); return $permission; }
php
public function setPermission($name, $description = null) { $permission = $this->getPermission($name) ?: $this->createPermission($name); if ($description) { $permission->description = $description; } $this->add($permission); return $permission; }
[ "public", "function", "setPermission", "(", "$", "name", ",", "$", "description", "=", "null", ")", "{", "$", "permission", "=", "$", "this", "->", "getPermission", "(", "$", "name", ")", "?", ":", "$", "this", "->", "createPermission", "(", "$", "name...
Set permission. @param string $name @param string $description @return Item
[ "Set", "permission", "." ]
8fb14f035db3eb7b87bf6c0bcd894535097f14ef
https://github.com/hiqdev/hipanel-rbac/blob/8fb14f035db3eb7b87bf6c0bcd894535097f14ef/src/SetterTrait.php#L31-L40
33,034
hiqdev/hipanel-rbac
src/SetterTrait.php
SetterTrait.setRole
public function setRole($name, $description = null) { $role = $this->getRole($name) ?: $this->createRole($name); if ($description) { $role->description = $description; } $this->add($role); return $role; }
php
public function setRole($name, $description = null) { $role = $this->getRole($name) ?: $this->createRole($name); if ($description) { $role->description = $description; } $this->add($role); return $role; }
[ "public", "function", "setRole", "(", "$", "name", ",", "$", "description", "=", "null", ")", "{", "$", "role", "=", "$", "this", "->", "getRole", "(", "$", "name", ")", "?", ":", "$", "this", "->", "createRole", "(", "$", "name", ")", ";", "if",...
Set role. @param string $name @param string $description @return Item
[ "Set", "role", "." ]
8fb14f035db3eb7b87bf6c0bcd894535097f14ef
https://github.com/hiqdev/hipanel-rbac/blob/8fb14f035db3eb7b87bf6c0bcd894535097f14ef/src/SetterTrait.php#L48-L57
33,035
hiqdev/hipanel-rbac
src/SetterTrait.php
SetterTrait.setChild
public function setChild($parent, $child) { if (is_string($parent)) { $name = $parent; $parent = $this->getItem($parent); if (is_null($parent)) { throw new Exception("Unknown parent:$name at setChild"); } } if (is_string($chil...
php
public function setChild($parent, $child) { if (is_string($parent)) { $name = $parent; $parent = $this->getItem($parent); if (is_null($parent)) { throw new Exception("Unknown parent:$name at setChild"); } } if (is_string($chil...
[ "public", "function", "setChild", "(", "$", "parent", ",", "$", "child", ")", "{", "if", "(", "is_string", "(", "$", "parent", ")", ")", "{", "$", "name", "=", "$", "parent", ";", "$", "parent", "=", "$", "this", "->", "getItem", "(", "$", "paren...
Set child. @param string|Item $parent @param string|Item $child @return bool
[ "Set", "child", "." ]
8fb14f035db3eb7b87bf6c0bcd894535097f14ef
https://github.com/hiqdev/hipanel-rbac/blob/8fb14f035db3eb7b87bf6c0bcd894535097f14ef/src/SetterTrait.php#L65-L86
33,036
hiqdev/hipanel-rbac
src/SetterTrait.php
SetterTrait.setAssignments
public function setAssignments($items, $userId) { if (is_string($items)) { $items = explode(',', $items); } foreach ($items as $item) { $this->setAssignment($item, $userId); } }
php
public function setAssignments($items, $userId) { if (is_string($items)) { $items = explode(',', $items); } foreach ($items as $item) { $this->setAssignment($item, $userId); } }
[ "public", "function", "setAssignments", "(", "$", "items", ",", "$", "userId", ")", "{", "if", "(", "is_string", "(", "$", "items", ")", ")", "{", "$", "items", "=", "explode", "(", "','", ",", "$", "items", ")", ";", "}", "foreach", "(", "$", "i...
Assigns items to a user. @param string|array $items @param string|integer $userId
[ "Assigns", "items", "to", "a", "user", "." ]
8fb14f035db3eb7b87bf6c0bcd894535097f14ef
https://github.com/hiqdev/hipanel-rbac/blob/8fb14f035db3eb7b87bf6c0bcd894535097f14ef/src/SetterTrait.php#L132-L140
33,037
orchestral/support
src/Support/Concerns/Uploadable.php
Uploadable.getUploadedFilename
protected function getUploadedFilename(UploadedFile $file): string { $extension = $file->getClientOriginalExtension(); return \sprintf('%s.%s', Str::random(10), $extension); }
php
protected function getUploadedFilename(UploadedFile $file): string { $extension = $file->getClientOriginalExtension(); return \sprintf('%s.%s', Str::random(10), $extension); }
[ "protected", "function", "getUploadedFilename", "(", "UploadedFile", "$", "file", ")", ":", "string", "{", "$", "extension", "=", "$", "file", "->", "getClientOriginalExtension", "(", ")", ";", "return", "\\", "sprintf", "(", "'%s.%s'", ",", "Str", "::", "ra...
Get uploaded filename. @param \Symfony\Component\HttpFoundation\File\UploadedFile $file @return string
[ "Get", "uploaded", "filename", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Concerns/Uploadable.php#L45-L50
33,038
anomalylabs/variables-module
src/Variable/VariableRepository.php
VariableRepository.presenter
public function presenter($group, $field) { if (!$group = $this->group($group)) { return null; } return (new Decorator())->decorate($group)->{$field}; }
php
public function presenter($group, $field) { if (!$group = $this->group($group)) { return null; } return (new Decorator())->decorate($group)->{$field}; }
[ "public", "function", "presenter", "(", "$", "group", ",", "$", "field", ")", "{", "if", "(", "!", "$", "group", "=", "$", "this", "->", "group", "(", "$", "group", ")", ")", "{", "return", "null", ";", "}", "return", "(", "new", "Decorator", "("...
Get a variable presenter. @param $group @param $field @return FieldTypePresenter|null
[ "Get", "a", "variable", "presenter", "." ]
bcd903670471a175f07aba3123693cb3a3c07d0b
https://github.com/anomalylabs/variables-module/blob/bcd903670471a175f07aba3123693cb3a3c07d0b/src/Variable/VariableRepository.php#L61-L68
33,039
hiqdev/hipanel-module-domain
src/repositories/DomainTariffRepository.php
DomainTariffRepository.getTariff
public function getTariff() { if ($this->app->user->isGuest) { $seller = $this->app->user->seller; $client_id = null; } else { $seller = $this->app->user->identity->seller; $client_id = $this->app->user->id; } return $this->app->get('c...
php
public function getTariff() { if ($this->app->user->isGuest) { $seller = $this->app->user->seller; $client_id = null; } else { $seller = $this->app->user->identity->seller; $client_id = $this->app->user->id; } return $this->app->get('c...
[ "public", "function", "getTariff", "(", ")", "{", "if", "(", "$", "this", "->", "app", "->", "user", "->", "isGuest", ")", "{", "$", "seller", "=", "$", "this", "->", "app", "->", "user", "->", "seller", ";", "$", "client_id", "=", "null", ";", "...
Returns the tariff for the domain operations Caches the API request for 3600 seconds and depends on client id and seller login. @return Tariff|null The domain tariff or boolean `false` when no tariff was found
[ "Returns", "the", "tariff", "for", "the", "domain", "operations", "Caches", "the", "API", "request", "for", "3600", "seconds", "and", "depends", "on", "client", "id", "and", "seller", "login", "." ]
b1b02782fcb69970cacafe6c6ead238b14b54209
https://github.com/hiqdev/hipanel-module-domain/blob/b1b02782fcb69970cacafe6c6ead238b14b54209/src/repositories/DomainTariffRepository.php#L33-L58
33,040
QoboLtd/qobo-robo
src/Command/Mysql/Schema.php
Schema.mysqlSchema
public function mysqlSchema($db, $file = 'etc/mysql.sql', $user = 'root', $pass = null, $host = null, $port = null, $opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskMysqlSchema() ->db($db) ->file($file) ->user($user) ->pass($pass) ...
php
public function mysqlSchema($db, $file = 'etc/mysql.sql', $user = 'root', $pass = null, $host = null, $port = null, $opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskMysqlSchema() ->db($db) ->file($file) ->user($user) ->pass($pass) ...
[ "public", "function", "mysqlSchema", "(", "$", "db", ",", "$", "file", "=", "'etc/mysql.sql'", ",", "$", "user", "=", "'root'", ",", "$", "pass", "=", "null", ",", "$", "host", "=", "null", ",", "$", "port", "=", "null", ",", "$", "opts", "=", "[...
Dump mysql database schema @param string $db Database name @param string $file Destination file for a dump @param string $user MySQL user to bind with @param string $pass (Optional) MySQL user password @param string $host (Optional) MySQL server host @param string $port (Optional) MySQL server port @option string $for...
[ "Dump", "mysql", "database", "schema" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/Command/Mysql/Schema.php#L33-L50
33,041
QoboLtd/qobo-robo
src/AbstractCmdTask.php
AbstractCmdTask.checkPath
public static function checkPath($path) { if (!is_string($path)) { throw new InvalidArgumentException(sprintf("String expected as path, got '%s' instead", gettype($path))); } if (!file_exists($path)) { throw new InvalidArgumentException(sprintf("'%s' does not exist", ...
php
public static function checkPath($path) { if (!is_string($path)) { throw new InvalidArgumentException(sprintf("String expected as path, got '%s' instead", gettype($path))); } if (!file_exists($path)) { throw new InvalidArgumentException(sprintf("'%s' does not exist", ...
[ "public", "static", "function", "checkPath", "(", "$", "path", ")", "{", "if", "(", "!", "is_string", "(", "$", "path", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "\"String expected as path, got '%s' instead\"", ",", "gettype...
Check if path is readable
[ "Check", "if", "path", "is", "readable" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/AbstractCmdTask.php#L130-L148
33,042
QoboLtd/qobo-robo
src/AbstractCmdTask.php
AbstractCmdTask.checkCmd
public static function checkCmd($cmd) { // cut out the actual executable part only // and leave args away $cmdParts = preg_split("/\s+/", $cmd); $cmd = $cmdParts[0]; // try to find a command if not absolute path is given if (!preg_match('/^\.?\/.*$/', $cmd)) { ...
php
public static function checkCmd($cmd) { // cut out the actual executable part only // and leave args away $cmdParts = preg_split("/\s+/", $cmd); $cmd = $cmdParts[0]; // try to find a command if not absolute path is given if (!preg_match('/^\.?\/.*$/', $cmd)) { ...
[ "public", "static", "function", "checkCmd", "(", "$", "cmd", ")", "{", "// cut out the actual executable part only", "// and leave args away", "$", "cmdParts", "=", "preg_split", "(", "\"/\\s+/\"", ",", "$", "cmd", ")", ";", "$", "cmd", "=", "$", "cmdParts", "["...
Check if cmd exists and is an executable file
[ "Check", "if", "cmd", "exists", "and", "is", "an", "executable", "file" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/AbstractCmdTask.php#L153-L183
33,043
orchestral/support
src/Support/Nesty.php
Nesty.addParent
protected function addParent(string $id): Fluent { return $this->items[$id] = $this->toFluent($id); }
php
protected function addParent(string $id): Fluent { return $this->items[$id] = $this->toFluent($id); }
[ "protected", "function", "addParent", "(", "string", "$", "id", ")", ":", "Fluent", "{", "return", "$", "this", "->", "items", "[", "$", "id", "]", "=", "$", "this", "->", "toFluent", "(", "$", "id", ")", ";", "}" ]
Add item as parent. @param string $id @return \Orchestra\Support\Fluent
[ "Add", "item", "as", "parent", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Nesty.php#L149-L152
33,044
anomalylabs/variables-module
src/VariablesModulePlugin.php
VariablesModulePlugin.getFunctions
public function getFunctions() { return [ new \Twig_SimpleFunction( 'variable', function ($group, $field) { return $this->dispatch(new GetValuePresenter($group, $field)); } ), new \Twig_SimpleFunction( ...
php
public function getFunctions() { return [ new \Twig_SimpleFunction( 'variable', function ($group, $field) { return $this->dispatch(new GetValuePresenter($group, $field)); } ), new \Twig_SimpleFunction( ...
[ "public", "function", "getFunctions", "(", ")", "{", "return", "[", "new", "\\", "Twig_SimpleFunction", "(", "'variable'", ",", "function", "(", "$", "group", ",", "$", "field", ")", "{", "return", "$", "this", "->", "dispatch", "(", "new", "GetValuePresen...
Get the functions. @return array
[ "Get", "the", "functions", "." ]
bcd903670471a175f07aba3123693cb3a3c07d0b
https://github.com/anomalylabs/variables-module/blob/bcd903670471a175f07aba3123693cb3a3c07d0b/src/VariablesModulePlugin.php#L24-L46
33,045
nails/module-invoice
src/Factory/RequestBase.php
RequestBase.setDriver
public function setDriver($sDriverSlug) { // Validate the driver $aDrivers = $this->oDriverService->getEnabled(); $oDriver = null; foreach ($aDrivers as $oDriverConfig) { if ($oDriverConfig->slug == $sDriverSlug) { $oDriver = $this->oDriverService->getI...
php
public function setDriver($sDriverSlug) { // Validate the driver $aDrivers = $this->oDriverService->getEnabled(); $oDriver = null; foreach ($aDrivers as $oDriverConfig) { if ($oDriverConfig->slug == $sDriverSlug) { $oDriver = $this->oDriverService->getI...
[ "public", "function", "setDriver", "(", "$", "sDriverSlug", ")", "{", "// Validate the driver", "$", "aDrivers", "=", "$", "this", "->", "oDriverService", "->", "getEnabled", "(", ")", ";", "$", "oDriver", "=", "null", ";", "foreach", "(", "$", "aDrivers", ...
Set the driver to be used for the request @param string $sDriverSlug The driver's slug @return $this @throws RequestException
[ "Set", "the", "driver", "to", "be", "used", "for", "the", "request" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Factory/RequestBase.php#L52-L71
33,046
nails/module-invoice
src/Factory/RequestBase.php
RequestBase.setInvoice
public function setInvoice($iInvoiceId) { // Validate $oModel = $this->oInvoiceModel; $oInvoice = $oModel->getById( $iInvoiceId, ['expand' => $oModel::EXPAND_ALL] ); if (empty($oInvoice)) { throw new RequestException('Invalid invoice ID...
php
public function setInvoice($iInvoiceId) { // Validate $oModel = $this->oInvoiceModel; $oInvoice = $oModel->getById( $iInvoiceId, ['expand' => $oModel::EXPAND_ALL] ); if (empty($oInvoice)) { throw new RequestException('Invalid invoice ID...
[ "public", "function", "setInvoice", "(", "$", "iInvoiceId", ")", "{", "// Validate", "$", "oModel", "=", "$", "this", "->", "oInvoiceModel", ";", "$", "oInvoice", "=", "$", "oModel", "->", "getById", "(", "$", "iInvoiceId", ",", "[", "'expand'", "=>", "...
Set the invoice object @param integer $iInvoiceId The invoice to use for the request @return $this @throws RequestException
[ "Set", "the", "invoice", "object" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Factory/RequestBase.php#L83-L98
33,047
nails/module-invoice
src/Factory/RequestBase.php
RequestBase.setPayment
public function setPayment($iPaymentId) { // Validate $oPayment = $this->oPaymentModel->getById( $iPaymentId, ['expand' => ['invoice']] ); if (empty($oPayment)) { throw new RequestException('Invalid payment ID.'); } $this->oPayme...
php
public function setPayment($iPaymentId) { // Validate $oPayment = $this->oPaymentModel->getById( $iPaymentId, ['expand' => ['invoice']] ); if (empty($oPayment)) { throw new RequestException('Invalid payment ID.'); } $this->oPayme...
[ "public", "function", "setPayment", "(", "$", "iPaymentId", ")", "{", "// Validate", "$", "oPayment", "=", "$", "this", "->", "oPaymentModel", "->", "getById", "(", "$", "iPaymentId", ",", "[", "'expand'", "=>", "[", "'invoice'", "]", "]", ")", ";", "if...
Set the payment object @param integer $iPaymentId The payment to use for the request @return $this @throws RequestException
[ "Set", "the", "payment", "object" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Factory/RequestBase.php#L110-L124
33,048
nails/module-invoice
src/Factory/RequestBase.php
RequestBase.setRefund
public function setRefund($iRefundId) { // Validate $oRefund = $this->oRefundModel->getById($iRefundId); if (empty($oRefund)) { throw new RequestException('Invalid refund ID.'); } $this->oRefund = $oRefund; return $this; }
php
public function setRefund($iRefundId) { // Validate $oRefund = $this->oRefundModel->getById($iRefundId); if (empty($oRefund)) { throw new RequestException('Invalid refund ID.'); } $this->oRefund = $oRefund; return $this; }
[ "public", "function", "setRefund", "(", "$", "iRefundId", ")", "{", "// Validate", "$", "oRefund", "=", "$", "this", "->", "oRefundModel", "->", "getById", "(", "$", "iRefundId", ")", ";", "if", "(", "empty", "(", "$", "oRefund", ")", ")", "{", "throw...
Set the refund object @param integer $iRefundId The refund to use for the request @return $this @throws RequestException
[ "Set", "the", "refund", "object" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Factory/RequestBase.php#L136-L147
33,049
nails/module-invoice
src/Factory/RequestBase.php
RequestBase.setPaymentComplete
protected function setPaymentComplete($sTxnId = null, $iFee = null) { // Ensure we have a payment if (empty($this->oPayment)) { throw new RequestException('No payment selected.'); } // Ensure we have an invoice if (empty($this->oInvoice)) { throw ne...
php
protected function setPaymentComplete($sTxnId = null, $iFee = null) { // Ensure we have a payment if (empty($this->oPayment)) { throw new RequestException('No payment selected.'); } // Ensure we have an invoice if (empty($this->oInvoice)) { throw ne...
[ "protected", "function", "setPaymentComplete", "(", "$", "sTxnId", "=", "null", ",", "$", "iFee", "=", "null", ")", "{", "// Ensure we have a payment", "if", "(", "empty", "(", "$", "this", "->", "oPayment", ")", ")", "{", "throw", "new", "RequestException"...
Set a payment as COMPLETE, and mark the invoice as paid if so @param string $sTxnId The payment's transaction ID @param integer $iFee The fee charged by the processor, if known @return $this @throws RequestException
[ "Set", "a", "payment", "as", "COMPLETE", "and", "mark", "the", "invoice", "as", "paid", "if", "so" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Factory/RequestBase.php#L203-L239
33,050
doganoo/PHPUtil
src/FileSystem/FileHandler.php
FileHandler.forceCreate
public function forceCreate(): bool { if (!$this->isFile()) { return \mkdir($this->path, 0744, true); } if ($this->isFile() && !$this->isWritable()) { $user = \get_current_user(); return \chown($this->path, $user); } return false; }
php
public function forceCreate(): bool { if (!$this->isFile()) { return \mkdir($this->path, 0744, true); } if ($this->isFile() && !$this->isWritable()) { $user = \get_current_user(); return \chown($this->path, $user); } return false; }
[ "public", "function", "forceCreate", "(", ")", ":", "bool", "{", "if", "(", "!", "$", "this", "->", "isFile", "(", ")", ")", "{", "return", "\\", "mkdir", "(", "$", "this", "->", "path", ",", "0744", ",", "true", ")", ";", "}", "if", "(", "$", ...
forces a file creation @return bool @deprecated Use create() instead
[ "forces", "a", "file", "creation" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/FileSystem/FileHandler.php#L111-L120
33,051
doganoo/PHPUtil
src/FileSystem/FileHandler.php
FileHandler.getContent
public function getContent(): ?string { if (null !== $this->content) return $this->content; if (!$this->isFile()) return null; $content = \file_get_contents($this->path); if (false === $content) return null; return $content; }
php
public function getContent(): ?string { if (null !== $this->content) return $this->content; if (!$this->isFile()) return null; $content = \file_get_contents($this->path); if (false === $content) return null; return $content; }
[ "public", "function", "getContent", "(", ")", ":", "?", "string", "{", "if", "(", "null", "!==", "$", "this", "->", "content", ")", "return", "$", "this", "->", "content", ";", "if", "(", "!", "$", "this", "->", "isFile", "(", ")", ")", "return", ...
returns the file content if file is available. Otherwise null @return null|string
[ "returns", "the", "file", "content", "if", "file", "is", "available", ".", "Otherwise", "null" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/FileSystem/FileHandler.php#L136-L142
33,052
nails/module-invoice
src/Model/Invoice/Item.php
Item.getUnits
public function getUnits() { return [ self::UNIT_NONE => 'None', self::UNIT_MINUTE => 'Minutes', self::UNIT_HOUR => 'Hours', self::UNIT_DAY => 'Days', self::UNIT_WEEK => 'Weeks', self::UNIT_MONTH => 'Months', self:...
php
public function getUnits() { return [ self::UNIT_NONE => 'None', self::UNIT_MINUTE => 'Minutes', self::UNIT_HOUR => 'Hours', self::UNIT_DAY => 'Days', self::UNIT_WEEK => 'Weeks', self::UNIT_MONTH => 'Months', self:...
[ "public", "function", "getUnits", "(", ")", "{", "return", "[", "self", "::", "UNIT_NONE", "=>", "'None'", ",", "self", "::", "UNIT_MINUTE", "=>", "'Minutes'", ",", "self", "::", "UNIT_HOUR", "=>", "'Hours'", ",", "self", "::", "UNIT_DAY", "=>", "'Days'", ...
Returns the item quantity units with human friendly names @return array
[ "Returns", "the", "item", "quantity", "units", "with", "human", "friendly", "names" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Invoice/Item.php#L71-L82
33,053
doganoo/PHPUtil
src/Datatype/StringClass.php
StringClass.replace
public function replace($search, $value) { $this->value = str_replace($search, $value, $this->value); }
php
public function replace($search, $value) { $this->value = str_replace($search, $value, $this->value); }
[ "public", "function", "replace", "(", "$", "search", ",", "$", "value", ")", "{", "$", "this", "->", "value", "=", "str_replace", "(", "$", "search", ",", "$", "value", ",", "$", "this", "->", "value", ")", ";", "}" ]
replaces search by value @param $search @param $value
[ "replaces", "search", "by", "value" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Datatype/StringClass.php#L129-L131
33,054
doganoo/PHPUtil
src/Datatype/StringClass.php
StringClass.replaceIgnoreCase
public function replaceIgnoreCase($search, $value) { $this->value = str_ireplace($search, $value, $this->value); }
php
public function replaceIgnoreCase($search, $value) { $this->value = str_ireplace($search, $value, $this->value); }
[ "public", "function", "replaceIgnoreCase", "(", "$", "search", ",", "$", "value", ")", "{", "$", "this", "->", "value", "=", "str_ireplace", "(", "$", "search", ",", "$", "value", ",", "$", "this", "->", "value", ")", ";", "}" ]
replaces search by value and is case insensitive @param $search @param $value
[ "replaces", "search", "by", "value", "and", "is", "case", "insensitive" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Datatype/StringClass.php#L139-L141
33,055
doganoo/PHPUtil
src/Datatype/StringClass.php
StringClass.hasPrefix
public function hasPrefix(string $prefix):bool { if (0 !== $this->getLength() && "" === $prefix) return false; return true === (substr( $this->getValue(), 0, strlen($prefix)) === $prefix); }
php
public function hasPrefix(string $prefix):bool { if (0 !== $this->getLength() && "" === $prefix) return false; return true === (substr( $this->getValue(), 0, strlen($prefix)) === $prefix); }
[ "public", "function", "hasPrefix", "(", "string", "$", "prefix", ")", ":", "bool", "{", "if", "(", "0", "!==", "$", "this", "->", "getLength", "(", ")", "&&", "\"\"", "===", "$", "prefix", ")", "return", "false", ";", "return", "true", "===", "(", ...
checks a prefix have a look here: https://stackoverflow.com/a/2790919 @param string $prefix @return bool
[ "checks", "a", "prefix" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Datatype/StringClass.php#L198-L201
33,056
doganoo/PHPUtil
src/Datatype/StringClass.php
StringClass.hasSuffix
public function hasSuffix(string $suffix):bool { if (0 !== $this->getLength() && "" === $suffix) return false; return (substr($this->getValue(), -1 * strlen($suffix), strlen($suffix)) === $suffix); }
php
public function hasSuffix(string $suffix):bool { if (0 !== $this->getLength() && "" === $suffix) return false; return (substr($this->getValue(), -1 * strlen($suffix), strlen($suffix)) === $suffix); }
[ "public", "function", "hasSuffix", "(", "string", "$", "suffix", ")", ":", "bool", "{", "if", "(", "0", "!==", "$", "this", "->", "getLength", "(", ")", "&&", "\"\"", "===", "$", "suffix", ")", "return", "false", ";", "return", "(", "substr", "(", ...
checks a suffix @param string $suffix @return bool
[ "checks", "a", "suffix" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Datatype/StringClass.php#L209-L212
33,057
nails/module-invoice
invoice/controllers/Invoice.php
Invoice.download
protected function download($oInvoice) { // Business details $this->data['business'] = (object) [ 'name' => appSetting('business_name', 'nails/module-invoice'), 'address' => appSetting('business_address', 'nails/module-invoice'), 'telephone' => appSetti...
php
protected function download($oInvoice) { // Business details $this->data['business'] = (object) [ 'name' => appSetting('business_name', 'nails/module-invoice'), 'address' => appSetting('business_address', 'nails/module-invoice'), 'telephone' => appSetti...
[ "protected", "function", "download", "(", "$", "oInvoice", ")", "{", "// Business details", "$", "this", "->", "data", "[", "'business'", "]", "=", "(", "object", ")", "[", "'name'", "=>", "appSetting", "(", "'business_name'", ",", "'nails/module-invoice'", "...
Download a single invoice @param \stdClass $oInvoice The invoice object @return void
[ "Download", "a", "single", "invoice" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/invoice/controllers/Invoice.php#L36-L58
33,058
nails/module-invoice
invoice/controllers/Invoice.php
Invoice.view
protected function view($oInvoice) { // Business details $this->data['business'] = (object) [ 'name' => appSetting('business_name', 'nails/module-invoice'), 'address' => appSetting('business_address', 'nails/module-invoice'), 'telephone' => appSetting('...
php
protected function view($oInvoice) { // Business details $this->data['business'] = (object) [ 'name' => appSetting('business_name', 'nails/module-invoice'), 'address' => appSetting('business_address', 'nails/module-invoice'), 'telephone' => appSetting('...
[ "protected", "function", "view", "(", "$", "oInvoice", ")", "{", "// Business details", "$", "this", "->", "data", "[", "'business'", "]", "=", "(", "object", ")", "[", "'name'", "=>", "appSetting", "(", "'business_name'", ",", "'nails/module-invoice'", ")", ...
View a single invoice @param \stdClass $oInvoice The invoice object @return void
[ "View", "a", "single", "invoice" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/invoice/controllers/Invoice.php#L69-L86
33,059
QoboLtd/qobo-robo
src/DataAwareTrait.php
DataAwareTrait.setData
public function setData($name, $value) { if (!isset($this->data)) { throw new RuntimeException("Data property is required for DataAwareTrait to work"); } // we use snake_case field keys // but camelCase setters $name = $this->decamelize($name); // only s...
php
public function setData($name, $value) { if (!isset($this->data)) { throw new RuntimeException("Data property is required for DataAwareTrait to work"); } // we use snake_case field keys // but camelCase setters $name = $this->decamelize($name); // only s...
[ "public", "function", "setData", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "data", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"Data property is required for DataAwareTrait to work\"", ")", ...
Data setter Make sure only valid data passes through @param string $name data key name @param mixed $value data value name
[ "Data", "setter", "Make", "sure", "only", "valid", "data", "passes", "through" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/DataAwareTrait.php#L29-L45
33,060
QoboLtd/qobo-robo
src/DataAwareTrait.php
DataAwareTrait.checkRequiredData
protected function checkRequiredData() { if (!isset($this->data)) { throw new RuntimeException("'data' property is required for DataAwareTrait to work"); } if (!isset($this->requiredData)) { throw new RuntimeException("'requiredData' property is required for DataAware...
php
protected function checkRequiredData() { if (!isset($this->data)) { throw new RuntimeException("'data' property is required for DataAwareTrait to work"); } if (!isset($this->requiredData)) { throw new RuntimeException("'requiredData' property is required for DataAware...
[ "protected", "function", "checkRequiredData", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "data", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"'data' property is required for DataAwareTrait to work\"", ")", ";", "}", "if", "(", ...
Check that all required data present @return \Robo\Result
[ "Check", "that", "all", "required", "data", "present" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/DataAwareTrait.php#L52-L75
33,061
canihavesomecoffee/theTVDbAPI
src/MultiLanguageWrapper/Route/SeriesRouteLanguageFallback.php
SeriesRouteLanguageFallback.getClosureById
public function getClosureById(int $seriesId): Closure { return function ($language) use ($seriesId) { $json = $this->parent->performAPICallWithJsonResponse( 'get', '/series/'.$seriesId, [ 'headers' => ['Accept-Language' => $lan...
php
public function getClosureById(int $seriesId): Closure { return function ($language) use ($seriesId) { $json = $this->parent->performAPICallWithJsonResponse( 'get', '/series/'.$seriesId, [ 'headers' => ['Accept-Language' => $lan...
[ "public", "function", "getClosureById", "(", "int", "$", "seriesId", ")", ":", "Closure", "{", "return", "function", "(", "$", "language", ")", "use", "(", "$", "seriesId", ")", "{", "$", "json", "=", "$", "this", "->", "parent", "->", "performAPICallWit...
Returns the closure used to retrieve a series with a given id for a single language. @param int $seriesId The ID of the series to retrieve. @return Closure
[ "Returns", "the", "closure", "used", "to", "retrieve", "a", "series", "with", "a", "given", "id", "for", "a", "single", "language", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/MultiLanguageWrapper/Route/SeriesRouteLanguageFallback.php#L74-L87
33,062
canihavesomecoffee/theTVDbAPI
src/MultiLanguageWrapper/Route/SeriesRouteLanguageFallback.php
SeriesRouteLanguageFallback.getClosureForEpisodes
public function getClosureForEpisodes(int $seriesId, array $options): Closure { return function ($language) use ($seriesId, $options) { $options['headers'] = ['Accept-Language' => $language]; $json = $this->parent->performAPICallWithJsonResponse( 'get', ...
php
public function getClosureForEpisodes(int $seriesId, array $options): Closure { return function ($language) use ($seriesId, $options) { $options['headers'] = ['Accept-Language' => $language]; $json = $this->parent->performAPICallWithJsonResponse( 'get', ...
[ "public", "function", "getClosureForEpisodes", "(", "int", "$", "seriesId", ",", "array", "$", "options", ")", ":", "Closure", "{", "return", "function", "(", "$", "language", ")", "use", "(", "$", "seriesId", ",", "$", "options", ")", "{", "$", "options...
Returns the closure used to retrieve a set of episodes for a series for a single language. @param int $seriesId The series id @param array $options The options (pagination, ...) @return Closure
[ "Returns", "the", "closure", "used", "to", "retrieve", "a", "set", "of", "episodes", "for", "a", "series", "for", "a", "single", "language", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/MultiLanguageWrapper/Route/SeriesRouteLanguageFallback.php#L117-L129
33,063
canihavesomecoffee/theTVDbAPI
src/MultiLanguageWrapper/Route/SeriesRouteLanguageFallback.php
SeriesRouteLanguageFallback.getClosureForImagesWithQuery
public function getClosureForImagesWithQuery(int $seriesId, array $options): Closure { return function ($language) use ($seriesId, $options) { $options['headers'] = ['Accept-Language' => $language]; $json = $this->parent->performAPICallWithJsonResponse( 'get', ...
php
public function getClosureForImagesWithQuery(int $seriesId, array $options): Closure { return function ($language) use ($seriesId, $options) { $options['headers'] = ['Accept-Language' => $language]; $json = $this->parent->performAPICallWithJsonResponse( 'get', ...
[ "public", "function", "getClosureForImagesWithQuery", "(", "int", "$", "seriesId", ",", "array", "$", "options", ")", ":", "Closure", "{", "return", "function", "(", "$", "language", ")", "use", "(", "$", "seriesId", ",", "$", "options", ")", "{", "$", "...
Returns the closure used to retrieve search images for a series with a certain query for a single language. @param int $seriesId The series id @param array $options The options (pagination, ...) @return Closure
[ "Returns", "the", "closure", "used", "to", "retrieve", "search", "images", "for", "a", "series", "with", "a", "certain", "query", "for", "a", "single", "language", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/MultiLanguageWrapper/Route/SeriesRouteLanguageFallback.php#L204-L216
33,064
hiqdev/hipanel-module-domain
src/cart/DomainRenewalProduct.php
DomainRenewalProduct.daysBeforeExpireValidator
public function daysBeforeExpireValidator($attribute) { if (isset($this->daysBeforeExpire[$this->getZone()])) { $minDays = $this->daysBeforeExpire[$this->getZone()]; $interval = (new DateTime())->diff(new DateTime($this->_model->expires)); $diff = $interval->format('%a') ...
php
public function daysBeforeExpireValidator($attribute) { if (isset($this->daysBeforeExpire[$this->getZone()])) { $minDays = $this->daysBeforeExpire[$this->getZone()]; $interval = (new DateTime())->diff(new DateTime($this->_model->expires)); $diff = $interval->format('%a') ...
[ "public", "function", "daysBeforeExpireValidator", "(", "$", "attribute", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "daysBeforeExpire", "[", "$", "this", "->", "getZone", "(", ")", "]", ")", ")", "{", "$", "minDays", "=", "$", "this", "->",...
Checks whether domain reached the limit of days before expiration date and can be renewed. @param $attribute @return bool
[ "Checks", "whether", "domain", "reached", "the", "limit", "of", "days", "before", "expiration", "date", "and", "can", "be", "renewed", "." ]
b1b02782fcb69970cacafe6c6ead238b14b54209
https://github.com/hiqdev/hipanel-module-domain/blob/b1b02782fcb69970cacafe6c6ead238b14b54209/src/cart/DomainRenewalProduct.php#L90-L105
33,065
QoboLtd/qobo-robo
src/Command/Project/Changelog.php
Changelog.projectChangelog
public function projectChangelog($opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskProjectChangelog() ->format('--reverse --no-merges --pretty=format:"* %<(72,trunc)%s (%ad, %an)" --date=short') ->run(); if (!$result->wasSuccessful()) { $this-...
php
public function projectChangelog($opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskProjectChangelog() ->format('--reverse --no-merges --pretty=format:"* %<(72,trunc)%s (%ad, %an)" --date=short') ->run(); if (!$result->wasSuccessful()) { $this-...
[ "public", "function", "projectChangelog", "(", "$", "opts", "=", "[", "'format'", "=>", "'table'", ",", "'fields'", "=>", "''", "]", ")", "{", "$", "result", "=", "$", "this", "->", "taskProjectChangelog", "(", ")", "->", "format", "(", "'--reverse --no-me...
Get project changelog @return \Qobo\Robo\Formatter\RowsOfFields
[ "Get", "project", "changelog" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/Command/Project/Changelog.php#L24-L52
33,066
anomalylabs/variables-module
src/VariablesModuleServiceProvider.php
VariablesModuleServiceProvider.map
public function map(FieldRouter $fields, VersionRouter $versions, AssignmentRouter $assignments) { $fields->route($this->addon, FieldsController::class); $versions->route($this->addon, VersionsController::class); $assignments->route($this->addon, AssignmentsController::class, 'admin/variable...
php
public function map(FieldRouter $fields, VersionRouter $versions, AssignmentRouter $assignments) { $fields->route($this->addon, FieldsController::class); $versions->route($this->addon, VersionsController::class); $assignments->route($this->addon, AssignmentsController::class, 'admin/variable...
[ "public", "function", "map", "(", "FieldRouter", "$", "fields", ",", "VersionRouter", "$", "versions", ",", "AssignmentRouter", "$", "assignments", ")", "{", "$", "fields", "->", "route", "(", "$", "this", "->", "addon", ",", "FieldsController", "::", "class...
Map the addon. @param FieldRouter $fields @param VersionRouter $versions @param AssignmentRouter $assignments
[ "Map", "the", "addon", "." ]
bcd903670471a175f07aba3123693cb3a3c07d0b
https://github.com/anomalylabs/variables-module/blob/bcd903670471a175f07aba3123693cb3a3c07d0b/src/VariablesModuleServiceProvider.php#L48-L53
33,067
nails/module-invoice
src/Factory/ChargeResponse.php
ChargeResponse.setRedirectUrl
public function setRedirectUrl($sRedirectUrl) { if (!$this->bIsLocked) { $this->sRedirectUrl = $sRedirectUrl; $this->setIsRedirect(!empty($sRedirectUrl)); } return $this; }
php
public function setRedirectUrl($sRedirectUrl) { if (!$this->bIsLocked) { $this->sRedirectUrl = $sRedirectUrl; $this->setIsRedirect(!empty($sRedirectUrl)); } return $this; }
[ "public", "function", "setRedirectUrl", "(", "$", "sRedirectUrl", ")", "{", "if", "(", "!", "$", "this", "->", "bIsLocked", ")", "{", "$", "this", "->", "sRedirectUrl", "=", "$", "sRedirectUrl", ";", "$", "this", "->", "setIsRedirect", "(", "!", "empty",...
Set the redirectUrl value @param string $sRedirectUrl The Redirect URL @return $this
[ "Set", "the", "redirectUrl", "value" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Factory/ChargeResponse.php#L75-L82
33,068
nails/module-invoice
src/Factory/ChargeResponse.php
ChargeResponse.setRedirectPostData
public function setRedirectPostData($aRedirectPostData) { if (!$this->bIsLocked) { $this->aRedirectPostData = $aRedirectPostData; $this->setIsRedirect(!empty($aRedirectPostData)); } return $this; }
php
public function setRedirectPostData($aRedirectPostData) { if (!$this->bIsLocked) { $this->aRedirectPostData = $aRedirectPostData; $this->setIsRedirect(!empty($aRedirectPostData)); } return $this; }
[ "public", "function", "setRedirectPostData", "(", "$", "aRedirectPostData", ")", "{", "if", "(", "!", "$", "this", "->", "bIsLocked", ")", "{", "$", "this", "->", "aRedirectPostData", "=", "$", "aRedirectPostData", ";", "$", "this", "->", "setIsRedirect", "(...
Set any data which should be POST'ed to the endpoint @param array $aRedirectPostData The data to post @return $this
[ "Set", "any", "data", "which", "should", "be", "POST", "ed", "to", "the", "endpoint" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Factory/ChargeResponse.php#L188-L195
33,069
nails/module-invoice
src/Driver/PaymentBase.php
PaymentBase.charge
public function charge( $iAmount, $sCurrency, $oData, $oCustomData, $sDescription, $oPayment, $oInvoice, $sSuccessUrl, $sFailUrl, $sContinueUrl ) { throw new DriverException('Driver must implement the charge() method', 1); }
php
public function charge( $iAmount, $sCurrency, $oData, $oCustomData, $sDescription, $oPayment, $oInvoice, $sSuccessUrl, $sFailUrl, $sContinueUrl ) { throw new DriverException('Driver must implement the charge() method', 1); }
[ "public", "function", "charge", "(", "$", "iAmount", ",", "$", "sCurrency", ",", "$", "oData", ",", "$", "oCustomData", ",", "$", "sDescription", ",", "$", "oPayment", ",", "$", "oInvoice", ",", "$", "sSuccessUrl", ",", "$", "sFailUrl", ",", "$", "sCon...
Initiate a payment @param integer $iAmount The payment amount @param string $sCurrency The payment currency @param \stdClass $oData An array of driver data @param \stdClass $oCustomData The custom data object @param string $sDescription The charge description @param \stdClass $oPayment ...
[ "Initiate", "a", "payment" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Driver/PaymentBase.php#L87-L100
33,070
canihavesomecoffee/theTVDbAPI
src/MultiLanguageWrapper/MultiLanguageFallbackGenerator.php
MultiLanguageFallbackGenerator.create
public function create( Closure $performRequest, string $returnTypeClass, array $languages, bool $merge = false ) { $languageIdx = 0; $returnValue = null; $langLength = sizeof($languages); do { $result = $performRequest($languages[$languag...
php
public function create( Closure $performRequest, string $returnTypeClass, array $languages, bool $merge = false ) { $languageIdx = 0; $returnValue = null; $langLength = sizeof($languages); do { $result = $performRequest($languages[$languag...
[ "public", "function", "create", "(", "Closure", "$", "performRequest", ",", "string", "$", "returnTypeClass", ",", "array", "$", "languages", ",", "bool", "$", "merge", "=", "false", ")", "{", "$", "languageIdx", "=", "0", ";", "$", "returnValue", "=", "...
Creates an object using the provided closure, and keeps using fallback languages while the object isn't valid. @param Closure $performRequest The closure that calls the API and returns an object of the provided class. The function call must accept only one parameter: the language for the request. @param string $retu...
[ "Creates", "an", "object", "using", "the", "provided", "closure", "and", "keeps", "using", "fallback", "languages", "while", "the", "object", "isn", "t", "valid", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/MultiLanguageWrapper/MultiLanguageFallbackGenerator.php#L70-L89
33,071
orchestral/support
src/Support/Concerns/Observable.php
Observable.fireObservableEvent
protected function fireObservableEvent(string $event, bool $halt) { if (! isset(static::$dispatcher)) { return true; } $className = \get_class($this); $event = $this->getObservableKey($event); $method = $halt ? 'until' : 'handle'; return static::$dispat...
php
protected function fireObservableEvent(string $event, bool $halt) { if (! isset(static::$dispatcher)) { return true; } $className = \get_class($this); $event = $this->getObservableKey($event); $method = $halt ? 'until' : 'handle'; return static::$dispat...
[ "protected", "function", "fireObservableEvent", "(", "string", "$", "event", ",", "bool", "$", "halt", ")", "{", "if", "(", "!", "isset", "(", "static", "::", "$", "dispatcher", ")", ")", "{", "return", "true", ";", "}", "$", "className", "=", "\\", ...
Fire the given event. @param string $event @param bool $halt @return mixed
[ "Fire", "the", "given", "event", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Concerns/Observable.php#L85-L97
33,072
orchestral/support
src/Support/Concerns/Observable.php
Observable.flushEventListeners
public static function flushEventListeners(): void { if (! isset(static::$dispatcher)) { return; } $instance = new static(); $className = static::class; foreach ($instance->getObservableEvents() as $event) { $event = $instance->getObservableKey($even...
php
public static function flushEventListeners(): void { if (! isset(static::$dispatcher)) { return; } $instance = new static(); $className = static::class; foreach ($instance->getObservableEvents() as $event) { $event = $instance->getObservableKey($even...
[ "public", "static", "function", "flushEventListeners", "(", ")", ":", "void", "{", "if", "(", "!", "isset", "(", "static", "::", "$", "dispatcher", ")", ")", "{", "return", ";", "}", "$", "instance", "=", "new", "static", "(", ")", ";", "$", "classNa...
Remove all of the event listeners for the observers. @return void
[ "Remove", "all", "of", "the", "event", "listeners", "for", "the", "observers", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Concerns/Observable.php#L104-L118
33,073
canihavesomecoffee/theTVDbAPI
src/TheTVDbAPI.php
TheTVDbAPI.getDefaultHttpClientOptions
private function getDefaultHttpClientOptions(array $options = []): array { $headers = []; if ($this->token !== null) { $headers['Authorization'] = 'Bearer '.$this->token; } $languagesInOptions = (array_key_exists('headers', $options) && array_key_exists('Acc...
php
private function getDefaultHttpClientOptions(array $options = []): array { $headers = []; if ($this->token !== null) { $headers['Authorization'] = 'Bearer '.$this->token; } $languagesInOptions = (array_key_exists('headers', $options) && array_key_exists('Acc...
[ "private", "function", "getDefaultHttpClientOptions", "(", "array", "$", "options", "=", "[", "]", ")", ":", "array", "{", "$", "headers", "=", "[", "]", ";", "if", "(", "$", "this", "->", "token", "!==", "null", ")", "{", "$", "headers", "[", "'Auth...
Returns the default client options. @param array $options A list of options to start with (optional) @return array An array containing the passed in options, as well as the added ones
[ "Returns", "the", "default", "client", "options", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/TheTVDbAPI.php#L254-L275
33,074
canihavesomecoffee/theTVDbAPI
src/TheTVDbAPI.php
TheTVDbAPI.requestHeaders
public function requestHeaders($method, $path, array $options = []): array { $options = $this->getDefaultHttpClientOptions($options); /* @type Response $response */ $response = $this->httpClient->{$method}($path, $options); if ($response->getStatusCode() === 401) { thro...
php
public function requestHeaders($method, $path, array $options = []): array { $options = $this->getDefaultHttpClientOptions($options); /* @type Response $response */ $response = $this->httpClient->{$method}($path, $options); if ($response->getStatusCode() === 401) { thro...
[ "public", "function", "requestHeaders", "(", "$", "method", ",", "$", "path", ",", "array", "$", "options", "=", "[", "]", ")", ":", "array", "{", "$", "options", "=", "$", "this", "->", "getDefaultHttpClientOptions", "(", "$", "options", ")", ";", "/*...
Makes a call to the API and return headers only. @param string $method HTTP Method (post, getUserData, put, etc.) @param string $path Path to the API call @param array $options HTTP Client options @return array @throws ResourceNotFoundException @throws UnauthorizedException
[ "Makes", "a", "call", "to", "the", "API", "and", "return", "headers", "only", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/TheTVDbAPI.php#L288-L302
33,075
canihavesomecoffee/theTVDbAPI
src/TheTVDbAPI.php
TheTVDbAPI.performAPICall
public function performAPICall($method, $path, array $options = []): Response { $options = $this->getDefaultHttpClientOptions($options); // Reset JSON errors. $this->jsonErrors = []; // Reset Link section. $this->links = []; /* @type Response $response */ $re...
php
public function performAPICall($method, $path, array $options = []): Response { $options = $this->getDefaultHttpClientOptions($options); // Reset JSON errors. $this->jsonErrors = []; // Reset Link section. $this->links = []; /* @type Response $response */ $re...
[ "public", "function", "performAPICall", "(", "$", "method", ",", "$", "path", ",", "array", "$", "options", "=", "[", "]", ")", ":", "Response", "{", "$", "options", "=", "$", "this", "->", "getDefaultHttpClientOptions", "(", "$", "options", ")", ";", ...
Perform an API call to theTVDb. @param string $method HTTP Method (post, getUserData, put, etc.) @param string $path Path to the API call @param array $options HTTP Client options @return Response @throws UnauthorizedException @throws ResourceNotFoundException
[ "Perform", "an", "API", "call", "to", "theTVDb", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/TheTVDbAPI.php#L315-L333
33,076
canihavesomecoffee/theTVDbAPI
src/TheTVDbAPI.php
TheTVDbAPI.performAPICallWithJsonResponse
public function performAPICallWithJsonResponse($method, $path, array $options = []) { $response = $this->performAPICall($method, $path, $options); if ($response->getStatusCode() === 200) { $contents = $response->getBody()->getContents(); $json = json_decode($contents, tr...
php
public function performAPICallWithJsonResponse($method, $path, array $options = []) { $response = $this->performAPICall($method, $path, $options); if ($response->getStatusCode() === 200) { $contents = $response->getBody()->getContents(); $json = json_decode($contents, tr...
[ "public", "function", "performAPICallWithJsonResponse", "(", "$", "method", ",", "$", "path", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "performAPICall", "(", "$", "method", ",", "$", "path", ",", "...
Perform an API call to theTVDb and return a JSON response @param string $method HTTP Method (post, getUserData, put, etc.) @param string $path Path to the API call @param array $options HTTP Client options @return mixed @throws ResourceNotFoundException @throws UnauthorizedException @throws Exception
[ "Perform", "an", "API", "call", "to", "theTVDb", "and", "return", "a", "JSON", "response" ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/TheTVDbAPI.php#L347-L379
33,077
canihavesomecoffee/theTVDbAPI
src/TheTVDbAPI.php
TheTVDbAPI.parseErrorSection
private function parseErrorSection(array $errors) { if (array_key_exists('invalidFilters', $errors)) { $this->jsonErrors[] = new JSONError(JSONError::INVALID_FILTER, $errors['invalidFilters']); } if (array_key_exists('invalidQueryParams', $errors)) { $this->jsonErrors...
php
private function parseErrorSection(array $errors) { if (array_key_exists('invalidFilters', $errors)) { $this->jsonErrors[] = new JSONError(JSONError::INVALID_FILTER, $errors['invalidFilters']); } if (array_key_exists('invalidQueryParams', $errors)) { $this->jsonErrors...
[ "private", "function", "parseErrorSection", "(", "array", "$", "errors", ")", "{", "if", "(", "array_key_exists", "(", "'invalidFilters'", ",", "$", "errors", ")", ")", "{", "$", "this", "->", "jsonErrors", "[", "]", "=", "new", "JSONError", "(", "JSONErro...
Parses the errors and stores them in lastJSONErrors. @param array $errors The JSON errors. @return void
[ "Parses", "the", "errors", "and", "stores", "them", "in", "lastJSONErrors", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/TheTVDbAPI.php#L408-L419
33,078
orchestral/support
src/Support/Keyword.php
Keyword.searchIn
public function searchIn(array $items = []) { if (\is_null($slug = $this->slug)) { return \array_search($this->value, $items); } return \array_search($slug, $items); }
php
public function searchIn(array $items = []) { if (\is_null($slug = $this->slug)) { return \array_search($this->value, $items); } return \array_search($slug, $items); }
[ "public", "function", "searchIn", "(", "array", "$", "items", "=", "[", "]", ")", "{", "if", "(", "\\", "is_null", "(", "$", "slug", "=", "$", "this", "->", "slug", ")", ")", "{", "return", "\\", "array_search", "(", "$", "this", "->", "value", "...
Search slug in given items and return the key. @param array $items @return mixed
[ "Search", "slug", "in", "given", "items", "and", "return", "the", "key", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Keyword.php#L78-L85
33,079
orchestral/support
src/Support/Keyword.php
Keyword.hasIn
public function hasIn(array $items = []) { if (\is_null($slug = $this->slug)) { return isset($items[$this->value]); } return isset($items[$slug]); }
php
public function hasIn(array $items = []) { if (\is_null($slug = $this->slug)) { return isset($items[$this->value]); } return isset($items[$slug]); }
[ "public", "function", "hasIn", "(", "array", "$", "items", "=", "[", "]", ")", "{", "if", "(", "\\", "is_null", "(", "$", "slug", "=", "$", "this", "->", "slug", ")", ")", "{", "return", "isset", "(", "$", "items", "[", "$", "this", "->", "valu...
Search slug in given items and return if the key exist. @param array $items @return bool
[ "Search", "slug", "in", "given", "items", "and", "return", "if", "the", "key", "exist", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Keyword.php#L94-L101
33,080
doganoo/PHPUtil
src/Util/ClassUtil.php
ClassUtil.getClassName
public static function getClassName($object): ?string { $validObject = ClassUtil::isValidObject($object); if (!$validObject) { return null; } return (new \ReflectionClass($object))->getName(); }
php
public static function getClassName($object): ?string { $validObject = ClassUtil::isValidObject($object); if (!$validObject) { return null; } return (new \ReflectionClass($object))->getName(); }
[ "public", "static", "function", "getClassName", "(", "$", "object", ")", ":", "?", "string", "{", "$", "validObject", "=", "ClassUtil", "::", "isValidObject", "(", "$", "object", ")", ";", "if", "(", "!", "$", "validObject", ")", "{", "return", "null", ...
returns the name of an object @param $object @return null|string @throws \ReflectionException
[ "returns", "the", "name", "of", "an", "object" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Util/ClassUtil.php#L51-L57
33,081
doganoo/PHPUtil
src/Util/ClassUtil.php
ClassUtil.isSerialized
public static function isSerialized(string $string): bool { $data = @unserialize($string); if (false === $data) { return false; } else { return true; } }
php
public static function isSerialized(string $string): bool { $data = @unserialize($string); if (false === $data) { return false; } else { return true; } }
[ "public", "static", "function", "isSerialized", "(", "string", "$", "string", ")", ":", "bool", "{", "$", "data", "=", "@", "unserialize", "(", "$", "string", ")", ";", "if", "(", "false", "===", "$", "data", ")", "{", "return", "false", ";", "}", ...
whether the string is an serialized object or not @param string $string @return bool
[ "whether", "the", "string", "is", "an", "serialized", "object", "or", "not" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Util/ClassUtil.php#L99-L106
33,082
doganoo/PHPUtil
src/Util/ClassUtil.php
ClassUtil.getAllProperties
public static function getAllProperties($object, bool $asString = true) { $validObject = ClassUtil::isValidObject($object); if (!$validObject) { return null; } $reflectionClass = new \ReflectionClass($object); $properties = $reflectionClass->getProperties(); ...
php
public static function getAllProperties($object, bool $asString = true) { $validObject = ClassUtil::isValidObject($object); if (!$validObject) { return null; } $reflectionClass = new \ReflectionClass($object); $properties = $reflectionClass->getProperties(); ...
[ "public", "static", "function", "getAllProperties", "(", "$", "object", ",", "bool", "$", "asString", "=", "true", ")", "{", "$", "validObject", "=", "ClassUtil", "::", "isValidObject", "(", "$", "object", ")", ";", "if", "(", "!", "$", "validObject", ")...
returns all properties of an object TODO let caller define the visibility @param $object @param bool $asString @return null|\ReflectionProperty[]|string @throws \ReflectionException
[ "returns", "all", "properties", "of", "an", "object" ]
4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5
https://github.com/doganoo/PHPUtil/blob/4415a014b4448b1ddf6d2e3f0f0d39cd1a83b8f5/src/Util/ClassUtil.php#L118-L131
33,083
canihavesomecoffee/theTVDbAPI
src/Route/RouteFactory.php
RouteFactory.getRouteInstance
public static function getRouteInstance(TheTVDbAPIInterface $parent, string $routeClassName) { if (array_key_exists($routeClassName, static::$routeInstances) === false) { $classImplements = class_implements($routeClassName); if (in_array('CanIHaveSomeCoffee\TheTVDbAPI\Route\RouteInte...
php
public static function getRouteInstance(TheTVDbAPIInterface $parent, string $routeClassName) { if (array_key_exists($routeClassName, static::$routeInstances) === false) { $classImplements = class_implements($routeClassName); if (in_array('CanIHaveSomeCoffee\TheTVDbAPI\Route\RouteInte...
[ "public", "static", "function", "getRouteInstance", "(", "TheTVDbAPIInterface", "$", "parent", ",", "string", "$", "routeClassName", ")", "{", "if", "(", "array_key_exists", "(", "$", "routeClassName", ",", "static", "::", "$", "routeInstances", ")", "===", "fal...
Retrieves an instance of the given routeClassName. @param TheTVDbAPIInterface $parent The parent object that is needed for constructing a new object. @param string $routeClassName The name of the instance to retrieve. @return mixed The requested instance @throws InvalidArgumentException If the gi...
[ "Retrieves", "an", "instance", "of", "the", "given", "routeClassName", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/Route/RouteFactory.php#L59-L70
33,084
nails/module-invoice
src/Factory/CompleteRequest.php
CompleteRequest.execute
public function execute($aGetVars, $aPostVars) { // Ensure we have a driver if (empty($this->oDriver)) { throw new CompleteRequestException('No driver selected.', 1); } // Ensure we have a payment if (empty($this->oPayment)) { throw new CompleteRequ...
php
public function execute($aGetVars, $aPostVars) { // Ensure we have a driver if (empty($this->oDriver)) { throw new CompleteRequestException('No driver selected.', 1); } // Ensure we have a payment if (empty($this->oPayment)) { throw new CompleteRequ...
[ "public", "function", "execute", "(", "$", "aGetVars", ",", "$", "aPostVars", ")", "{", "// Ensure we have a driver", "if", "(", "empty", "(", "$", "this", "->", "oDriver", ")", ")", "{", "throw", "new", "CompleteRequestException", "(", "'No driver selected.'",...
Complete the payment @param array $aGetVars Any $_GET variables passed from the redirect flow @param array $aPostVars Any $_POST variables passed from the redirect flow @return \Nails\Invoice\Factory\CompleteResponse @throws CompleteRequestException
[ "Complete", "the", "payment" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Factory/CompleteRequest.php#L58-L137
33,085
orchestral/support
src/Support/Str.php
Str.humanize
public static function humanize(string $text): string { $text = \str_replace(['-', '_'], ' ', $text); return Stringy::create($text)->humanize()->titleize(); }
php
public static function humanize(string $text): string { $text = \str_replace(['-', '_'], ' ', $text); return Stringy::create($text)->humanize()->titleize(); }
[ "public", "static", "function", "humanize", "(", "string", "$", "text", ")", ":", "string", "{", "$", "text", "=", "\\", "str_replace", "(", "[", "'-'", ",", "'_'", "]", ",", "' '", ",", "$", "text", ")", ";", "return", "Stringy", "::", "create", "...
Convert slug type text to human readable text. @param string $text @return string
[ "Convert", "slug", "type", "text", "to", "human", "readable", "text", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Str.php#L17-L22
33,086
orchestral/support
src/Support/Str.php
Str.streamGetContents
public static function streamGetContents($data): string { // check if it's actually a resource, we can directly convert // string without any issue. if (! \is_resource($data)) { return $data; } // Get the content from stream. $hex = \stream_get_contents($...
php
public static function streamGetContents($data): string { // check if it's actually a resource, we can directly convert // string without any issue. if (! \is_resource($data)) { return $data; } // Get the content from stream. $hex = \stream_get_contents($...
[ "public", "static", "function", "streamGetContents", "(", "$", "data", ")", ":", "string", "{", "// check if it's actually a resource, we can directly convert", "// string without any issue.", "if", "(", "!", "\\", "is_resource", "(", "$", "data", ")", ")", "{", "retu...
Convert filter to string, this process is required to filter stream data return from Postgres where blob type schema would actually use BYTEA and convert the string to stream. @param mixed $data @return string
[ "Convert", "filter", "to", "string", "this", "process", "is", "required", "to", "filter", "stream", "data", "return", "from", "Postgres", "where", "blob", "type", "schema", "would", "actually", "use", "BYTEA", "and", "convert", "the", "string", "to", "stream",...
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Str.php#L113-L137
33,087
orchestral/support
src/Support/Str.php
Str.fromHex
protected static function fromHex(string $hex): string { $data = ''; // Convert hex to string. for ($i = 0; $i < \strlen($hex) - 1; $i += 2) { $data .= \chr(\hexdec($hex[$i].$hex[$i + 1])); } return $data; }
php
protected static function fromHex(string $hex): string { $data = ''; // Convert hex to string. for ($i = 0; $i < \strlen($hex) - 1; $i += 2) { $data .= \chr(\hexdec($hex[$i].$hex[$i + 1])); } return $data; }
[ "protected", "static", "function", "fromHex", "(", "string", "$", "hex", ")", ":", "string", "{", "$", "data", "=", "''", ";", "// Convert hex to string.", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "\\", "strlen", "(", "$", "hex", ")", "-...
Convert hex to string. @param string $hex @return string
[ "Convert", "hex", "to", "string", "." ]
b56f0469f967737e39fc9a33d40ae7439f4f6884
https://github.com/orchestral/support/blob/b56f0469f967737e39fc9a33d40ae7439f4f6884/src/Support/Str.php#L146-L156
33,088
QoboLtd/qobo-robo
src/Command/Mysql/Import.php
Import.mysqlImport
public function mysqlImport($db, $file = 'etc/mysql.sql', $user = 'root', $pass = null, $host = null, $port = null, $opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskMysqlImport() ->db($db) ->file($file) ->user($user) ->pass($pass) ...
php
public function mysqlImport($db, $file = 'etc/mysql.sql', $user = 'root', $pass = null, $host = null, $port = null, $opts = ['format' => 'table', 'fields' => '']) { $result = $this->taskMysqlImport() ->db($db) ->file($file) ->user($user) ->pass($pass) ...
[ "public", "function", "mysqlImport", "(", "$", "db", ",", "$", "file", "=", "'etc/mysql.sql'", ",", "$", "user", "=", "'root'", ",", "$", "pass", "=", "null", ",", "$", "host", "=", "null", ",", "$", "port", "=", "null", ",", "$", "opts", "=", "[...
Import mysql dump @param string $db Database name @param string $file Destination file for a dump @param string $user MySQL user to bind with @param string $pass (Optional) MySQL user password @param string $host (Optional) MySQL server host @param string $port (Optional) MySQL server port @option string $format Outpu...
[ "Import", "mysql", "dump" ]
ea10f778bb046ad41324d22b27fce5a2fb8915ce
https://github.com/QoboLtd/qobo-robo/blob/ea10f778bb046ad41324d22b27fce5a2fb8915ce/src/Command/Mysql/Import.php#L33-L50
33,089
nails/module-invoice
src/Model/Payment.php
Payment.getStatuses
public function getStatuses() { return [ self::STATUS_PENDING, self::STATUS_PROCESSING, self::STATUS_COMPLETE, self::STATUS_FAILED, self::STATUS_REFUNDED, self::STATUS_REFUNDED_PARTIAL, ]; }
php
public function getStatuses() { return [ self::STATUS_PENDING, self::STATUS_PROCESSING, self::STATUS_COMPLETE, self::STATUS_FAILED, self::STATUS_REFUNDED, self::STATUS_REFUNDED_PARTIAL, ]; }
[ "public", "function", "getStatuses", "(", ")", "{", "return", "[", "self", "::", "STATUS_PENDING", ",", "self", "::", "STATUS_PROCESSING", ",", "self", "::", "STATUS_COMPLETE", ",", "self", "::", "STATUS_FAILED", ",", "self", "::", "STATUS_REFUNDED", ",", "sel...
Returns all the statuses as an array @return array
[ "Returns", "all", "the", "statuses", "as", "an", "array" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Payment.php#L82-L92
33,090
nails/module-invoice
src/Model/Payment.php
Payment.getStatusesHuman
public function getStatusesHuman() { return [ self::STATUS_PENDING => 'Pending', self::STATUS_PROCESSING => 'Processing', self::STATUS_COMPLETE => 'Complete', self::STATUS_FAILED => 'Failed', self::STATUS_REFUNDED ...
php
public function getStatusesHuman() { return [ self::STATUS_PENDING => 'Pending', self::STATUS_PROCESSING => 'Processing', self::STATUS_COMPLETE => 'Complete', self::STATUS_FAILED => 'Failed', self::STATUS_REFUNDED ...
[ "public", "function", "getStatusesHuman", "(", ")", "{", "return", "[", "self", "::", "STATUS_PENDING", "=>", "'Pending'", ",", "self", "::", "STATUS_PROCESSING", "=>", "'Processing'", ",", "self", "::", "STATUS_COMPLETE", "=>", "'Complete'", ",", "self", "::", ...
Returns an array of statsues with human friendly labels @return array
[ "Returns", "an", "array", "of", "statsues", "with", "human", "friendly", "labels" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Payment.php#L101-L111
33,091
nails/module-invoice
src/Model/Payment.php
Payment.create
public function create(array $aData = [], $bReturnObject = false) { $oDb = Factory::service('Database'); try { $oDb->trans_begin(); if (empty($aData['ref'])) { $aData['ref'] = $this->generateValidRef(); } $aData['token'] = $this->ge...
php
public function create(array $aData = [], $bReturnObject = false) { $oDb = Factory::service('Database'); try { $oDb->trans_begin(); if (empty($aData['ref'])) { $aData['ref'] = $this->generateValidRef(); } $aData['token'] = $this->ge...
[ "public", "function", "create", "(", "array", "$", "aData", "=", "[", "]", ",", "$", "bReturnObject", "=", "false", ")", "{", "$", "oDb", "=", "Factory", "::", "service", "(", "'Database'", ")", ";", "try", "{", "$", "oDb", "->", "trans_begin", "(", ...
Create a new payment @param array $aData The data to create the payment with @param boolean $bReturnObject Whether to return the complete payment object @return bool|mixed @throws \Nails\Common\Exception\FactoryException
[ "Create", "a", "new", "payment" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Payment.php#L195-L232
33,092
nails/module-invoice
src/Model/Payment.php
Payment.setPending
public function setPending($iPaymentId, $aData = []): bool { $aData['status'] = self::STATUS_PENDING; return $this->update($iPaymentId, $aData); }
php
public function setPending($iPaymentId, $aData = []): bool { $aData['status'] = self::STATUS_PENDING; return $this->update($iPaymentId, $aData); }
[ "public", "function", "setPending", "(", "$", "iPaymentId", ",", "$", "aData", "=", "[", "]", ")", ":", "bool", "{", "$", "aData", "[", "'status'", "]", "=", "self", "::", "STATUS_PENDING", ";", "return", "$", "this", "->", "update", "(", "$", "iPaym...
Set a payment as PENDING @param integer $iPaymentId The payment to update @param array $aData Any additional data to save to the transaction @return bool @throws \Nails\Common\Exception\FactoryException
[ "Set", "a", "payment", "as", "PENDING" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Payment.php#L318-L322
33,093
nails/module-invoice
src/Model/Payment.php
Payment.setComplete
public function setComplete($iPaymentId, $aData = []): bool { $aData['status'] = self::STATUS_COMPLETE; return $this->update($iPaymentId, $aData); }
php
public function setComplete($iPaymentId, $aData = []): bool { $aData['status'] = self::STATUS_COMPLETE; return $this->update($iPaymentId, $aData); }
[ "public", "function", "setComplete", "(", "$", "iPaymentId", ",", "$", "aData", "=", "[", "]", ")", ":", "bool", "{", "$", "aData", "[", "'status'", "]", "=", "self", "::", "STATUS_COMPLETE", ";", "return", "$", "this", "->", "update", "(", "$", "iPa...
Set a payment as COMPLETE @param integer $iPaymentId The payment to update @param array $aData Any additional data to save to the transaction @return bool @throws \Nails\Common\Exception\FactoryException
[ "Set", "a", "payment", "as", "COMPLETE" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Payment.php#L352-L356
33,094
nails/module-invoice
src/Model/Payment.php
Payment.setFailed
public function setFailed($iPaymentId, $aData = []): bool { $aData['status'] = self::STATUS_FAILED; return $this->update($iPaymentId, $aData); }
php
public function setFailed($iPaymentId, $aData = []): bool { $aData['status'] = self::STATUS_FAILED; return $this->update($iPaymentId, $aData); }
[ "public", "function", "setFailed", "(", "$", "iPaymentId", ",", "$", "aData", "=", "[", "]", ")", ":", "bool", "{", "$", "aData", "[", "'status'", "]", "=", "self", "::", "STATUS_FAILED", ";", "return", "$", "this", "->", "update", "(", "$", "iPaymen...
Set a payment as FAILED @param integer $iPaymentId The payment to update @param array $aData Any additional data to save to the transaction @return bool @throws \Nails\Common\Exception\FactoryException
[ "Set", "a", "payment", "as", "FAILED" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Payment.php#L369-L373
33,095
nails/module-invoice
src/Model/Payment.php
Payment.setRefunded
public function setRefunded($iPaymentId, $aData = []): bool { $aData['status'] = self::STATUS_REFUNDED; return $this->update($iPaymentId, $aData); }
php
public function setRefunded($iPaymentId, $aData = []): bool { $aData['status'] = self::STATUS_REFUNDED; return $this->update($iPaymentId, $aData); }
[ "public", "function", "setRefunded", "(", "$", "iPaymentId", ",", "$", "aData", "=", "[", "]", ")", ":", "bool", "{", "$", "aData", "[", "'status'", "]", "=", "self", "::", "STATUS_REFUNDED", ";", "return", "$", "this", "->", "update", "(", "$", "iPa...
Set a payment as REFUNDED @param integer $iPaymentId The payment to update @param array $aData Any additional data to save to the transaction @return bool @throws \Nails\Common\Exception\FactoryException
[ "Set", "a", "payment", "as", "REFUNDED" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Payment.php#L386-L390
33,096
nails/module-invoice
src/Model/Payment.php
Payment.setRefundedPartial
public function setRefundedPartial($iPaymentId, $aData = []): bool { $aData['status'] = self::STATUS_REFUNDED_PARTIAL; return $this->update($iPaymentId, $aData); }
php
public function setRefundedPartial($iPaymentId, $aData = []): bool { $aData['status'] = self::STATUS_REFUNDED_PARTIAL; return $this->update($iPaymentId, $aData); }
[ "public", "function", "setRefundedPartial", "(", "$", "iPaymentId", ",", "$", "aData", "=", "[", "]", ")", ":", "bool", "{", "$", "aData", "[", "'status'", "]", "=", "self", "::", "STATUS_REFUNDED_PARTIAL", ";", "return", "$", "this", "->", "update", "("...
Set a payment as REFUNDED_PARTIAL @param integer $iPaymentId The payment to update @param array $aData Any additional data to save to the transaction @return bool @throws \Nails\Common\Exception\FactoryException
[ "Set", "a", "payment", "as", "REFUNDED_PARTIAL" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Payment.php#L403-L407
33,097
nails/module-invoice
src/Model/Payment.php
Payment.refund
public function refund(int $iPaymentId, int $iAmount = null, string $sReason = null): bool { try { // Validate payment $oPayment = $this->getById($iPaymentId, ['expand' => ['invoice']]); if (!$oPayment) { throw new PaymentException('Invalid payment ID.')...
php
public function refund(int $iPaymentId, int $iAmount = null, string $sReason = null): bool { try { // Validate payment $oPayment = $this->getById($iPaymentId, ['expand' => ['invoice']]); if (!$oPayment) { throw new PaymentException('Invalid payment ID.')...
[ "public", "function", "refund", "(", "int", "$", "iPaymentId", ",", "int", "$", "iAmount", "=", "null", ",", "string", "$", "sReason", "=", "null", ")", ":", "bool", "{", "try", "{", "// Validate payment", "$", "oPayment", "=", "$", "this", "->", "get...
Perform a refund @param int $iPaymentId @param int $iAmount @param string $sReason @return bool @throws ModelException @throws \Nails\Common\Exception\FactoryException @throws \Nails\Invoice\Exception\RefundRequestException @throws \Nails\Invoice\Exception\RequestException
[ "Perform", "a", "refund" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Payment.php#L523-L566
33,098
nails/module-invoice
src/Model/Payment.php
Payment.getPaymentForEvent
protected function getPaymentForEvent(int $iPaymentId): Resource { $oPayment = $this->getById($iPaymentId); if (empty($oPayment)) { throw new ModelException('Invalid payment ID'); } return $oPayment; }
php
protected function getPaymentForEvent(int $iPaymentId): Resource { $oPayment = $this->getById($iPaymentId); if (empty($oPayment)) { throw new ModelException('Invalid payment ID'); } return $oPayment; }
[ "protected", "function", "getPaymentForEvent", "(", "int", "$", "iPaymentId", ")", ":", "Resource", "{", "$", "oPayment", "=", "$", "this", "->", "getById", "(", "$", "iPaymentId", ")", ";", "if", "(", "empty", "(", "$", "oPayment", ")", ")", "{", "thr...
Get a payment in a suitable format for the event triggers @param int $iPaymentId The payment ID @return Resource @throws \Nails\Common\Exception\ModelException
[ "Get", "a", "payment", "in", "a", "suitable", "format", "for", "the", "event", "triggers" ]
3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716
https://github.com/nails/module-invoice/blob/3e62067f9de1b0ddb6b0ce0eddeb3eea4ee85716/src/Model/Payment.php#L578-L585
33,099
canihavesomecoffee/theTVDbAPI
src/Route/SeriesRoute.php
SeriesRoute.getLastModified
public function getLastModified(int $id): DateTimeImmutable { $headers = $this->parent->requestHeaders('head', '/series/'.$id); if (array_key_exists('Last-Modified', $headers) && array_key_exists(0, $headers['Last-Modified'])) { $lastModified = DateTimeImmutable::createFromFormat( ...
php
public function getLastModified(int $id): DateTimeImmutable { $headers = $this->parent->requestHeaders('head', '/series/'.$id); if (array_key_exists('Last-Modified', $headers) && array_key_exists(0, $headers['Last-Modified'])) { $lastModified = DateTimeImmutable::createFromFormat( ...
[ "public", "function", "getLastModified", "(", "int", "$", "id", ")", ":", "DateTimeImmutable", "{", "$", "headers", "=", "$", "this", "->", "parent", "->", "requestHeaders", "(", "'head'", ",", "'/series/'", ".", "$", "id", ")", ";", "if", "(", "array_ke...
Fetches the last modified parameter for a series through a HEAD request. @param int $id The id of the series. @return DateTimeImmutable The datetime for when the series was last modified. @throws ParseException is thrown when the header is missing or couldn't be parsed.
[ "Fetches", "the", "last", "modified", "parameter", "for", "a", "series", "through", "a", "HEAD", "request", "." ]
f23f544029269fe2a244818209b060d08654eca6
https://github.com/canihavesomecoffee/theTVDbAPI/blob/f23f544029269fe2a244818209b060d08654eca6/src/Route/SeriesRoute.php#L78-L96