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
198,300
Wedeto/HTTP
src/Response/StringResponse.php
StringResponse.output
public function output(string $mime) { $output = $this->getOutput($mime); if (empty($output)) $output = "Unknown mime type requested"; echo $output; return $this; }
php
public function output(string $mime) { $output = $this->getOutput($mime); if (empty($output)) $output = "Unknown mime type requested"; echo $output; return $this; }
[ "public", "function", "output", "(", "string", "$", "mime", ")", "{", "$", "output", "=", "$", "this", "->", "getOutput", "(", "$", "mime", ")", ";", "if", "(", "empty", "(", "$", "output", ")", ")", "$", "output", "=", "\"Unknown mime type requested\"...
Write the string to the script output @return StringResponse Provides fluent interface
[ "Write", "the", "string", "to", "the", "script", "output" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Response/StringResponse.php#L108-L116
198,301
mrcrmn/collection
src/Collection.php
Collection.set
public function set($key, $value = null) { if (isset($value)) { return $this->array[$key] = $value; } return $this->array[] = $key; }
php
public function set($key, $value = null) { if (isset($value)) { return $this->array[$key] = $value; } return $this->array[] = $key; }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "value", ")", ")", "{", "return", "$", "this", "->", "array", "[", "$", "key", "]", "=", "$", "value", ";", "}", "return", "...
Adds an element to the array. With key or without. @param int|string $key @param mixed $value @return void
[ "Adds", "an", "element", "to", "the", "array", ".", "With", "key", "or", "without", "." ]
a48c5ed15f14ff4b52d2a824c4df7456a88f7678
https://github.com/mrcrmn/collection/blob/a48c5ed15f14ff4b52d2a824c4df7456a88f7678/src/Collection.php#L123-L130
198,302
mrcrmn/collection
src/Collection.php
Collection.each
public function each($callback) { array_walk($this->array, function($value, $key) use ($callback) { $callback($key, $value); }); return $this; }
php
public function each($callback) { array_walk($this->array, function($value, $key) use ($callback) { $callback($key, $value); }); return $this; }
[ "public", "function", "each", "(", "$", "callback", ")", "{", "array_walk", "(", "$", "this", "->", "array", ",", "function", "(", "$", "value", ",", "$", "key", ")", "use", "(", "$", "callback", ")", "{", "$", "callback", "(", "$", "key", ",", "...
Runs the given callback on each element of the array. @param Callable $callback @return $this
[ "Runs", "the", "given", "callback", "on", "each", "element", "of", "the", "array", "." ]
a48c5ed15f14ff4b52d2a824c4df7456a88f7678
https://github.com/mrcrmn/collection/blob/a48c5ed15f14ff4b52d2a824c4df7456a88f7678/src/Collection.php#L213-L220
198,303
mrcrmn/collection
src/Collection.php
Collection.filter
public function filter($callback = null) { if (is_null($callback)) { return new static(array_filter($this->array)); } return new static(array_filter($this->array, $callback)); }
php
public function filter($callback = null) { if (is_null($callback)) { return new static(array_filter($this->array)); } return new static(array_filter($this->array, $callback)); }
[ "public", "function", "filter", "(", "$", "callback", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "callback", ")", ")", "{", "return", "new", "static", "(", "array_filter", "(", "$", "this", "->", "array", ")", ")", ";", "}", "return", "...
Filters the array by a given callback. @param Callable $callback @return self
[ "Filters", "the", "array", "by", "a", "given", "callback", "." ]
a48c5ed15f14ff4b52d2a824c4df7456a88f7678
https://github.com/mrcrmn/collection/blob/a48c5ed15f14ff4b52d2a824c4df7456a88f7678/src/Collection.php#L249-L255
198,304
mrcrmn/collection
src/Collection.php
Collection.chunk
public function chunk($size) { $chunked = array_chunk($this->array, $size); return new static(array_map(function ($item) { return new static($item); }, $chunked)); }
php
public function chunk($size) { $chunked = array_chunk($this->array, $size); return new static(array_map(function ($item) { return new static($item); }, $chunked)); }
[ "public", "function", "chunk", "(", "$", "size", ")", "{", "$", "chunked", "=", "array_chunk", "(", "$", "this", "->", "array", ",", "$", "size", ")", ";", "return", "new", "static", "(", "array_map", "(", "function", "(", "$", "item", ")", "{", "r...
Splits the array into chunks of the given size. @param string $size @return self
[ "Splits", "the", "array", "into", "chunks", "of", "the", "given", "size", "." ]
a48c5ed15f14ff4b52d2a824c4df7456a88f7678
https://github.com/mrcrmn/collection/blob/a48c5ed15f14ff4b52d2a824c4df7456a88f7678/src/Collection.php#L263-L270
198,305
pryley/castor-framework
src/Forms/Form.php
Form.normalize
public function normalize( array $args = [] ) { $defaults = [ 'action' => '', 'attributes' => '', 'id' => '', 'class' => '', 'enctype' => 'multipart/form-data', 'method' => 'post', 'nonce' => '', 'submit' => __( 'Submit', 'site-reviews' ), ]; $this->args ...
php
public function normalize( array $args = [] ) { $defaults = [ 'action' => '', 'attributes' => '', 'id' => '', 'class' => '', 'enctype' => 'multipart/form-data', 'method' => 'post', 'nonce' => '', 'submit' => __( 'Submit', 'site-reviews' ), ]; $this->args ...
[ "public", "function", "normalize", "(", "array", "$", "args", "=", "[", "]", ")", "{", "$", "defaults", "=", "[", "'action'", "=>", "''", ",", "'attributes'", "=>", "''", ",", "'id'", "=>", "''", ",", "'class'", "=>", "''", ",", "'enctype'", "=>", ...
Normalize the form arguments @return Form
[ "Normalize", "the", "form", "arguments" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Form.php#L106-L126
198,306
pryley/castor-framework
src/Forms/Form.php
Form.generateFields
protected function generateFields() { $hiddenFields = ''; $fields = array_reduce( $this->fields, function( $carry, $formField ) use ( &$hiddenFields ) { $stringLegend = '<legend class="screen-reader-text"><span>%s</span></legend>'; $stringFieldset = '<fieldset%s>%s%s</fieldset>'; $stringRendered = ...
php
protected function generateFields() { $hiddenFields = ''; $fields = array_reduce( $this->fields, function( $carry, $formField ) use ( &$hiddenFields ) { $stringLegend = '<legend class="screen-reader-text"><span>%s</span></legend>'; $stringFieldset = '<fieldset%s>%s%s</fieldset>'; $stringRendered = ...
[ "protected", "function", "generateFields", "(", ")", "{", "$", "hiddenFields", "=", "''", ";", "$", "fields", "=", "array_reduce", "(", "$", "this", "->", "fields", ",", "function", "(", "$", "carry", ",", "$", "formField", ")", "use", "(", "&", "$", ...
Generate the form fields @return string
[ "Generate", "the", "form", "fields" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Form.php#L168-L212
198,307
pryley/castor-framework
src/Forms/Form.php
Form.generateSubmitButton
protected function generateSubmitButton() { $args = $this->args['submit']; is_array( $args ) ?: $args = ['text' => $args ]; $args = shortcode_atts([ 'text' => __( 'Save Changes', 'site-reviews' ), 'type' => 'primary', 'name' => 'submit', 'wrap' => true, 'other_attributes' => null, ], $args ); ...
php
protected function generateSubmitButton() { $args = $this->args['submit']; is_array( $args ) ?: $args = ['text' => $args ]; $args = shortcode_atts([ 'text' => __( 'Save Changes', 'site-reviews' ), 'type' => 'primary', 'name' => 'submit', 'wrap' => true, 'other_attributes' => null, ], $args ); ...
[ "protected", "function", "generateSubmitButton", "(", ")", "{", "$", "args", "=", "$", "this", "->", "args", "[", "'submit'", "]", ";", "is_array", "(", "$", "args", ")", "?", ":", "$", "args", "=", "[", "'text'", "=>", "$", "args", "]", ";", "$", ...
Generate the form submit button @return null|string
[ "Generate", "the", "form", "submit", "button" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Form.php#L219-L238
198,308
Talesoft/tale-framework
src/Tale/Enum.php
Enum.getName
public static function getName( $value ) { $constants = array_flip( static::getValues() ); if( !isset( $constants[ $value ] ) ) throw new InvalidArgumentException( "Invalid argument passed to Enum::getName: $value is not a valid value in this enum" ); return $constants[ $value ]; ...
php
public static function getName( $value ) { $constants = array_flip( static::getValues() ); if( !isset( $constants[ $value ] ) ) throw new InvalidArgumentException( "Invalid argument passed to Enum::getName: $value is not a valid value in this enum" ); return $constants[ $value ]; ...
[ "public", "static", "function", "getName", "(", "$", "value", ")", "{", "$", "constants", "=", "array_flip", "(", "static", "::", "getValues", "(", ")", ")", ";", "if", "(", "!", "isset", "(", "$", "constants", "[", "$", "value", "]", ")", ")", "th...
Returns the name for a specific enum value. Notice that it find's the first constant having that value, all constants with the same value after that will be ignored @param mixed $value The value for the constant name to find @return string The name of the constant with the given value
[ "Returns", "the", "name", "for", "a", "specific", "enum", "value", ".", "Notice", "that", "it", "find", "s", "the", "first", "constant", "having", "that", "value", "all", "constants", "with", "the", "same", "value", "after", "that", "will", "be", "ignored"...
739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49
https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Enum.php#L58-L66
198,309
mpf-soft/admin-widgets
datatable/columns/Basic.php
Basic.getFilter
public function getFilter() { if (false === $this->filter) { return ''; } if (is_array($this->filter)) { return Form::get()->select($this->dataProvider->filtersKey . '[' . $this->name . ']', $this->filter, null, array(), ''); } if (is_string($...
php
public function getFilter() { if (false === $this->filter) { return ''; } if (is_array($this->filter)) { return Form::get()->select($this->dataProvider->filtersKey . '[' . $this->name . ']', $this->filter, null, array(), ''); } if (is_string($...
[ "public", "function", "getFilter", "(", ")", "{", "if", "(", "false", "===", "$", "this", "->", "filter", ")", "{", "return", "''", ";", "}", "if", "(", "is_array", "(", "$", "this", "->", "filter", ")", ")", "{", "return", "Form", "::", "get", "...
Get HTML table filter for selected column; @return string
[ "Get", "HTML", "table", "filter", "for", "selected", "column", ";" ]
92597f9a09d086664268d6b7e0111d5a5586d8c7
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/datatable/columns/Basic.php#L181-L195
198,310
mpf-soft/admin-widgets
datatable/columns/Basic.php
Basic.getHeaderHtmlOptions
public function getHeaderHtmlOptions() { $r = ''; if ($this->htmlClass) { $this->headerHtmlOptions['class'] = (isset($this->headerHtmlOptions['class']) ? $this->headerHtmlOptions['class'] . ' ' : '') . $this->htmlClass; } foreach ($this->headerHtmlOptions as $k => $v) ...
php
public function getHeaderHtmlOptions() { $r = ''; if ($this->htmlClass) { $this->headerHtmlOptions['class'] = (isset($this->headerHtmlOptions['class']) ? $this->headerHtmlOptions['class'] . ' ' : '') . $this->htmlClass; } foreach ($this->headerHtmlOptions as $k => $v) ...
[ "public", "function", "getHeaderHtmlOptions", "(", ")", "{", "$", "r", "=", "''", ";", "if", "(", "$", "this", "->", "htmlClass", ")", "{", "$", "this", "->", "headerHtmlOptions", "[", "'class'", "]", "=", "(", "isset", "(", "$", "this", "->", "heade...
Return html options for header; @return string
[ "Return", "html", "options", "for", "header", ";" ]
92597f9a09d086664268d6b7e0111d5a5586d8c7
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/datatable/columns/Basic.php#L201-L210
198,311
mpf-soft/admin-widgets
datatable/columns/Basic.php
Basic.getFilterHtmlOptions
public function getFilterHtmlOptions() { $r = ''; if ($this->htmlClass) { $this->filterHtmlOptions['class'] = (isset($this->filterHtmlOptions['class']) ? $this->filterHtmlOptions['class'] . ' ' : '') . $this->htmlClass; } foreach ($this->filterHtmlOptions as $k => $v) ...
php
public function getFilterHtmlOptions() { $r = ''; if ($this->htmlClass) { $this->filterHtmlOptions['class'] = (isset($this->filterHtmlOptions['class']) ? $this->filterHtmlOptions['class'] . ' ' : '') . $this->htmlClass; } foreach ($this->filterHtmlOptions as $k => $v) ...
[ "public", "function", "getFilterHtmlOptions", "(", ")", "{", "$", "r", "=", "''", ";", "if", "(", "$", "this", "->", "htmlClass", ")", "{", "$", "this", "->", "filterHtmlOptions", "[", "'class'", "]", "=", "(", "isset", "(", "$", "this", "->", "filte...
Return html options for filter; @return string
[ "Return", "html", "options", "for", "filter", ";" ]
92597f9a09d086664268d6b7e0111d5a5586d8c7
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/datatable/columns/Basic.php#L216-L225
198,312
mpf-soft/admin-widgets
datatable/columns/Basic.php
Basic.getHtmlOptions
public function getHtmlOptions() { $r = ''; if ($this->htmlClass) { $this->htmlOptions['class'] = (isset($this->htmlOptions['class']) ? $this->htmlOptions['class'] . ' ' : '') . $this->htmlClass; } foreach ($this->htmlOptions as $k => $v) $r .= "$k = '$v' "; ...
php
public function getHtmlOptions() { $r = ''; if ($this->htmlClass) { $this->htmlOptions['class'] = (isset($this->htmlOptions['class']) ? $this->htmlOptions['class'] . ' ' : '') . $this->htmlClass; } foreach ($this->htmlOptions as $k => $v) $r .= "$k = '$v' "; ...
[ "public", "function", "getHtmlOptions", "(", ")", "{", "$", "r", "=", "''", ";", "if", "(", "$", "this", "->", "htmlClass", ")", "{", "$", "this", "->", "htmlOptions", "[", "'class'", "]", "=", "(", "isset", "(", "$", "this", "->", "htmlOptions", "...
Return html options for cell; @return string
[ "Return", "html", "options", "for", "cell", ";" ]
92597f9a09d086664268d6b7e0111d5a5586d8c7
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/datatable/columns/Basic.php#L231-L240
198,313
mpf-soft/admin-widgets
datatable/columns/Basic.php
Basic.getHeaderCode
public function getHeaderCode(\mpf\widgets\datatable\Table $table) { $label = $this->getLabel(); if (!$this->order) { return $label; } $order = $this->dataProvider->getOrder(); $prefix = ''; $this->iconArrowUp = str_replace(array('%DATATABLE_ASSETS%', '%S...
php
public function getHeaderCode(\mpf\widgets\datatable\Table $table) { $label = $this->getLabel(); if (!$this->order) { return $label; } $order = $this->dataProvider->getOrder(); $prefix = ''; $this->iconArrowUp = str_replace(array('%DATATABLE_ASSETS%', '%S...
[ "public", "function", "getHeaderCode", "(", "\\", "mpf", "\\", "widgets", "\\", "datatable", "\\", "Table", "$", "table", ")", "{", "$", "label", "=", "$", "this", "->", "getLabel", "(", ")", ";", "if", "(", "!", "$", "this", "->", "order", ")", "{...
Get HTML code for header @param Table $table @return string
[ "Get", "HTML", "code", "for", "header" ]
92597f9a09d086664268d6b7e0111d5a5586d8c7
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/datatable/columns/Basic.php#L247-L268
198,314
Subscribo/klarna-invoice-sdk-wrapped
src/CurlTransport.php
CurlTransport.send
public function send($request) { $this->handle->init(); $this->handle->setOption(CURLOPT_URL, $request->getURL()); $this->handle->setOption(CURLOPT_HTTPHEADER, $request->getHeaders()); $this->handle->setOption(CURLOPT_RETURNTRANSFER, true); $this->handle->setOption(CURLOPT_C...
php
public function send($request) { $this->handle->init(); $this->handle->setOption(CURLOPT_URL, $request->getURL()); $this->handle->setOption(CURLOPT_HTTPHEADER, $request->getHeaders()); $this->handle->setOption(CURLOPT_RETURNTRANSFER, true); $this->handle->setOption(CURLOPT_C...
[ "public", "function", "send", "(", "$", "request", ")", "{", "$", "this", "->", "handle", "->", "init", "(", ")", ";", "$", "this", "->", "handle", "->", "setOption", "(", "CURLOPT_URL", ",", "$", "request", "->", "getURL", "(", ")", ")", ";", "$",...
Send a request object @param object $request The request to send @throws KlarnaException For e.g. a timeout @return object A response to the request sent
[ "Send", "a", "request", "object" ]
4a45ddd9ec444f5a6d02628ad65e635a3e12611c
https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/CurlTransport.php#L63-L93
198,315
gregorybesson/PlaygroundStats
src/Service/Stats.php
Stats.getParticipationsByDayByGame
public function getParticipationsByDayByGame($game = null) { $em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default'); $emConfig = $em->getConfiguration(); $emConfig->addCustomDatetimeFunction('DATE', '\DoctrineExtensions\Query\Mysql\Date'); if ($game !== null) { ...
php
public function getParticipationsByDayByGame($game = null) { $em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default'); $emConfig = $em->getConfiguration(); $emConfig->addCustomDatetimeFunction('DATE', '\DoctrineExtensions\Query\Mysql\Date'); if ($game !== null) { ...
[ "public", "function", "getParticipationsByDayByGame", "(", "$", "game", "=", "null", ")", "{", "$", "em", "=", "$", "this", "->", "getServiceManager", "(", ")", "->", "get", "(", "'doctrine.entitymanager.orm_default'", ")", ";", "$", "emConfig", "=", "$", "e...
Return count of participation for a game @param number|unknown $startDate @param number|unknown $endDate
[ "Return", "count", "of", "participation", "for", "a", "game" ]
166fb340c0b6a19fd5a333eeb8b54350f7cf3360
https://github.com/gregorybesson/PlaygroundStats/blob/166fb340c0b6a19fd5a333eeb8b54350f7cf3360/src/Service/Stats.php#L319-L344
198,316
jenskooij/cloudcontrol
src/components/LanguageComponent.php
LanguageComponent.checkParameters
protected function checkParameters() { if (isset($this->parameters[self::PARAMETER_DEFAULT_LANGUAGE])) { self::$DEFAULT_LANGUAGE = $this->parameters[self::PARAMETER_DEFAULT_LANGUAGE]; unset($this->parameters[self::PARAMETER_DEFAULT_LANGUAGE]); } if (isset($this->param...
php
protected function checkParameters() { if (isset($this->parameters[self::PARAMETER_DEFAULT_LANGUAGE])) { self::$DEFAULT_LANGUAGE = $this->parameters[self::PARAMETER_DEFAULT_LANGUAGE]; unset($this->parameters[self::PARAMETER_DEFAULT_LANGUAGE]); } if (isset($this->param...
[ "protected", "function", "checkParameters", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "parameters", "[", "self", "::", "PARAMETER_DEFAULT_LANGUAGE", "]", ")", ")", "{", "self", "::", "$", "DEFAULT_LANGUAGE", "=", "$", "this", "->", "parame...
Checks to see if any parameters are given from the configuration in the CMS
[ "Checks", "to", "see", "if", "any", "parameters", "are", "given", "from", "the", "configuration", "in", "the", "CMS" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/LanguageComponent.php#L66-L84
198,317
jenskooij/cloudcontrol
src/components/LanguageComponent.php
LanguageComponent.detectLanguage
protected function detectLanguage($lang, $request) { $lang = $this->setLanguagInSession($lang); $this->sessionValues = $_SESSION[self::SESSION_PARAMETER_LANGUAGE_COMPONENT]; $this->checkForceRedirect($lang, $request); }
php
protected function detectLanguage($lang, $request) { $lang = $this->setLanguagInSession($lang); $this->sessionValues = $_SESSION[self::SESSION_PARAMETER_LANGUAGE_COMPONENT]; $this->checkForceRedirect($lang, $request); }
[ "protected", "function", "detectLanguage", "(", "$", "lang", ",", "$", "request", ")", "{", "$", "lang", "=", "$", "this", "->", "setLanguagInSession", "(", "$", "lang", ")", ";", "$", "this", "->", "sessionValues", "=", "$", "_SESSION", "[", "self", "...
Check if the found language is allowed and if an action is to be taken. @param $lang @param Request $request
[ "Check", "if", "the", "found", "language", "is", "allowed", "and", "if", "an", "action", "is", "to", "be", "taken", "." ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/LanguageComponent.php#L102-L109
198,318
jenskooij/cloudcontrol
src/components/LanguageComponent.php
LanguageComponent.checkLanguageSwitch
protected function checkLanguageSwitch($request) { if (isset($request::$get['langSwitch'])) { $this->forceRedirect = true; $this->detectLanguage($request::$get['langSwitch'], $request); } }
php
protected function checkLanguageSwitch($request) { if (isset($request::$get['langSwitch'])) { $this->forceRedirect = true; $this->detectLanguage($request::$get['langSwitch'], $request); } }
[ "protected", "function", "checkLanguageSwitch", "(", "$", "request", ")", "{", "if", "(", "isset", "(", "$", "request", "::", "$", "get", "[", "'langSwitch'", "]", ")", ")", "{", "$", "this", "->", "forceRedirect", "=", "true", ";", "$", "this", "->", ...
Detect if the language is switched manually @param Request $request
[ "Detect", "if", "the", "language", "is", "switched", "manually" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/LanguageComponent.php#L116-L122
198,319
rawphp/RawDispatcher
src/RawPHP/RawDispatcher/Dispatcher.php
Dispatcher.removeListener
public function removeListener( $eventName, IListener $listener ) { if ( !isset( $this->listeners[ $eventName ] ) ) { return $this; } foreach ( $this->listeners[ $eventName ] as $priority => $listeners ) { if ( FALSE !== ( $key = array_search...
php
public function removeListener( $eventName, IListener $listener ) { if ( !isset( $this->listeners[ $eventName ] ) ) { return $this; } foreach ( $this->listeners[ $eventName ] as $priority => $listeners ) { if ( FALSE !== ( $key = array_search...
[ "public", "function", "removeListener", "(", "$", "eventName", ",", "IListener", "$", "listener", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "listeners", "[", "$", "eventName", "]", ")", ")", "{", "return", "$", "this", ";", "}", "for...
Remove a listener from an event. @param string $eventName @param IListener $listener @return IDispatcher
[ "Remove", "a", "listener", "from", "an", "event", "." ]
b9a62f3ef2266d355e2647d681312770158a6843
https://github.com/rawphp/RawDispatcher/blob/b9a62f3ef2266d355e2647d681312770158a6843/src/RawPHP/RawDispatcher/Dispatcher.php#L102-L118
198,320
rawphp/RawDispatcher
src/RawPHP/RawDispatcher/Dispatcher.php
Dispatcher.getListeners
public function getListeners( $eventName = NULL ) { if ( NULL !== $eventName ) { if ( !isset( $this->_sorted[ $eventName ] ) ) { $this->sortListeners( $eventName ); } return $this->_sorted[ $eventName ]; } ...
php
public function getListeners( $eventName = NULL ) { if ( NULL !== $eventName ) { if ( !isset( $this->_sorted[ $eventName ] ) ) { $this->sortListeners( $eventName ); } return $this->_sorted[ $eventName ]; } ...
[ "public", "function", "getListeners", "(", "$", "eventName", "=", "NULL", ")", "{", "if", "(", "NULL", "!==", "$", "eventName", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_sorted", "[", "$", "eventName", "]", ")", ")", "{", "$", ...
Get all listeners or just for an event. @param string $eventName @return array
[ "Get", "all", "listeners", "or", "just", "for", "an", "event", "." ]
b9a62f3ef2266d355e2647d681312770158a6843
https://github.com/rawphp/RawDispatcher/blob/b9a62f3ef2266d355e2647d681312770158a6843/src/RawPHP/RawDispatcher/Dispatcher.php#L127-L148
198,321
rawphp/RawDispatcher
src/RawPHP/RawDispatcher/Dispatcher.php
Dispatcher.sortListeners
protected function sortListeners( $eventName ) { $this->_sorted[ $eventName ] = [ ]; if ( isset( $this->listeners[ $eventName ] ) ) { krsort( $this->listeners[ $eventName ] ); $this->_sorted[ $eventName ] = call_user_func_array( 'array_merge', $this->listeners...
php
protected function sortListeners( $eventName ) { $this->_sorted[ $eventName ] = [ ]; if ( isset( $this->listeners[ $eventName ] ) ) { krsort( $this->listeners[ $eventName ] ); $this->_sorted[ $eventName ] = call_user_func_array( 'array_merge', $this->listeners...
[ "protected", "function", "sortListeners", "(", "$", "eventName", ")", "{", "$", "this", "->", "_sorted", "[", "$", "eventName", "]", "=", "[", "]", ";", "if", "(", "isset", "(", "$", "this", "->", "listeners", "[", "$", "eventName", "]", ")", ")", ...
Sorts listeners for an event. @param string $eventName
[ "Sorts", "listeners", "for", "an", "event", "." ]
b9a62f3ef2266d355e2647d681312770158a6843
https://github.com/rawphp/RawDispatcher/blob/b9a62f3ef2266d355e2647d681312770158a6843/src/RawPHP/RawDispatcher/Dispatcher.php#L167-L176
198,322
MichaelJ2324/PHP-REST-Client
src/Auth/Abstracts/AbstractOAuth2Controller.php
AbstractOAuth2Controller.refresh
public function refresh() { if (isset($this->token['refresh_token'])) { $Endpoint = $this->getActionEndpoint(self::ACTION_OAUTH_REFRESH); if ($Endpoint !== null) { $Endpoint = $this->configureEndpoint($Endpoint, self::ACTION_OAUTH_REFRESH); $response =...
php
public function refresh() { if (isset($this->token['refresh_token'])) { $Endpoint = $this->getActionEndpoint(self::ACTION_OAUTH_REFRESH); if ($Endpoint !== null) { $Endpoint = $this->configureEndpoint($Endpoint, self::ACTION_OAUTH_REFRESH); $response =...
[ "public", "function", "refresh", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "token", "[", "'refresh_token'", "]", ")", ")", "{", "$", "Endpoint", "=", "$", "this", "->", "getActionEndpoint", "(", "self", "::", "ACTION_OAUTH_REFRESH", ")",...
Refreshes the OAuth 2 Token @return bool @throws InvalidToken
[ "Refreshes", "the", "OAuth", "2", "Token" ]
b8a2caaf6456eccaa845ba5c5098608aa9645c92
https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Auth/Abstracts/AbstractOAuth2Controller.php#L112-L128
198,323
MichaelJ2324/PHP-REST-Client
src/Auth/Abstracts/AbstractOAuth2Controller.php
AbstractOAuth2Controller.isAuthenticated
public function isAuthenticated() { if (parent::isAuthenticated()) { if (isset($this->token['access_token'])) { $expired = $this->isTokenExpired(); //We err on the side of valid vs invalid, as the API will invalidate if we are wrong, which isn't harmful ...
php
public function isAuthenticated() { if (parent::isAuthenticated()) { if (isset($this->token['access_token'])) { $expired = $this->isTokenExpired(); //We err on the side of valid vs invalid, as the API will invalidate if we are wrong, which isn't harmful ...
[ "public", "function", "isAuthenticated", "(", ")", "{", "if", "(", "parent", "::", "isAuthenticated", "(", ")", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "token", "[", "'access_token'", "]", ")", ")", "{", "$", "expired", "=", "$", "this"...
Checks for Access Token property in token, and checks if Token is expired @inheritdoc
[ "Checks", "for", "Access", "Token", "property", "in", "token", "and", "checks", "if", "Token", "is", "expired" ]
b8a2caaf6456eccaa845ba5c5098608aa9645c92
https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Auth/Abstracts/AbstractOAuth2Controller.php#L134-L146
198,324
MichaelJ2324/PHP-REST-Client
src/Auth/Abstracts/AbstractOAuth2Controller.php
AbstractOAuth2Controller.configureRefreshEndpoint
protected function configureRefreshEndpoint(EndpointInterface $Endpoint) { $data = array(); $data['client_id'] = $this->credentials['client_id']; $data['client_secret'] = $this->credentials['client_secret']; $data['grant_type'] = self::OAUTH_REFRESH_GRANT; $data['refresh_toke...
php
protected function configureRefreshEndpoint(EndpointInterface $Endpoint) { $data = array(); $data['client_id'] = $this->credentials['client_id']; $data['client_secret'] = $this->credentials['client_secret']; $data['grant_type'] = self::OAUTH_REFRESH_GRANT; $data['refresh_toke...
[ "protected", "function", "configureRefreshEndpoint", "(", "EndpointInterface", "$", "Endpoint", ")", "{", "$", "data", "=", "array", "(", ")", ";", "$", "data", "[", "'client_id'", "]", "=", "$", "this", "->", "credentials", "[", "'client_id'", "]", ";", "...
Configure the Refresh Data based on Creds, Token, and Refresh Grant Type @param EndpointInterface $Endpoint @return EndpointInterface
[ "Configure", "the", "Refresh", "Data", "based", "on", "Creds", "Token", "and", "Refresh", "Grant", "Type" ]
b8a2caaf6456eccaa845ba5c5098608aa9645c92
https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Auth/Abstracts/AbstractOAuth2Controller.php#L183-L191
198,325
MichaelJ2324/PHP-REST-Client
src/Auth/Abstracts/AbstractOAuth2Controller.php
AbstractOAuth2Controller.configureAuthenticationEndpoint
protected function configureAuthenticationEndpoint(EndpointInterface $Endpoint) { $data = $this->credentials; $data['grant_type'] = static::$_DEFAULT_GRANT_TYPE; return $Endpoint->setData($data); }
php
protected function configureAuthenticationEndpoint(EndpointInterface $Endpoint) { $data = $this->credentials; $data['grant_type'] = static::$_DEFAULT_GRANT_TYPE; return $Endpoint->setData($data); }
[ "protected", "function", "configureAuthenticationEndpoint", "(", "EndpointInterface", "$", "Endpoint", ")", "{", "$", "data", "=", "$", "this", "->", "credentials", ";", "$", "data", "[", "'grant_type'", "]", "=", "static", "::", "$", "_DEFAULT_GRANT_TYPE", ";",...
Add OAuth Grant Type for Auth @inheritdoc
[ "Add", "OAuth", "Grant", "Type", "for", "Auth" ]
b8a2caaf6456eccaa845ba5c5098608aa9645c92
https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Auth/Abstracts/AbstractOAuth2Controller.php#L197-L202
198,326
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Persister/PersistenceBuilder.php
PersistenceBuilder.prepareAttributeValue
public function prepareAttributeValue($mapping, $value) { if ($value === null) { return Type::getNull(); } $type = $mapping !== null ? $mapping->getType() : TypeFactory::getTypeFromPHPVariable($value); if (is_array($value)) { $value = array_map( ...
php
public function prepareAttributeValue($mapping, $value) { if ($value === null) { return Type::getNull(); } $type = $mapping !== null ? $mapping->getType() : TypeFactory::getTypeFromPHPVariable($value); if (is_array($value)) { $value = array_map( ...
[ "public", "function", "prepareAttributeValue", "(", "$", "mapping", ",", "$", "value", ")", "{", "if", "(", "$", "value", "===", "null", ")", "{", "return", "Type", "::", "getNull", "(", ")", ";", "}", "$", "type", "=", "$", "mapping", "!==", "null",...
Prepares a non-associated attribute value. @param PropertyMetadata|null $mapping @param mixed $value @return array
[ "Prepares", "a", "non", "-", "associated", "attribute", "value", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Persister/PersistenceBuilder.php#L113-L131
198,327
mylxsw/FocusPHP
src/MVC/SmpView.php
SmpView.assign
public function assign($key, $value) { if (empty($key)) { throw new \RuntimeException('ASSIGN_KEY_EMPTY'); } $this->_data[$key] = $value; return $this; }
php
public function assign($key, $value) { if (empty($key)) { throw new \RuntimeException('ASSIGN_KEY_EMPTY'); } $this->_data[$key] = $value; return $this; }
[ "public", "function", "assign", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "empty", "(", "$", "key", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'ASSIGN_KEY_EMPTY'", ")", ";", "}", "$", "this", "->", "_data", "[", "...
passing data to template parser. @param string $key data key @param mixed $value data body @return View
[ "passing", "data", "to", "template", "parser", "." ]
33922bacbea66f11f874d991d7308a36cdf5831a
https://github.com/mylxsw/FocusPHP/blob/33922bacbea66f11f874d991d7308a36cdf5831a/src/MVC/SmpView.php#L89-L97
198,328
mylxsw/FocusPHP
src/MVC/SmpView.php
SmpView.setLayout
public function setLayout($layoutName) { $this->_layout = empty($layoutName) ? null : $layoutName.$this->_suffix; }
php
public function setLayout($layoutName) { $this->_layout = empty($layoutName) ? null : $layoutName.$this->_suffix; }
[ "public", "function", "setLayout", "(", "$", "layoutName", ")", "{", "$", "this", "->", "_layout", "=", "empty", "(", "$", "layoutName", ")", "?", "null", ":", "$", "layoutName", ".", "$", "this", "->", "_suffix", ";", "}" ]
set the default layout name. @param string|null $layoutName layout name
[ "set", "the", "default", "layout", "name", "." ]
33922bacbea66f11f874d991d7308a36cdf5831a
https://github.com/mylxsw/FocusPHP/blob/33922bacbea66f11f874d991d7308a36cdf5831a/src/MVC/SmpView.php#L142-L145
198,329
mylxsw/FocusPHP
src/MVC/SmpView.php
SmpView.remove
public function remove($key) { if (isset($this->_data[$key])) { unset($this->_data[$key]); } return $this; }
php
public function remove($key) { if (isset($this->_data[$key])) { unset($this->_data[$key]); } return $this; }
[ "public", "function", "remove", "(", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_data", "[", "$", "key", "]", ")", ")", "{", "unset", "(", "$", "this", "->", "_data", "[", "$", "key", "]", ")", ";", "}", "return", "$",...
Remove a key from data array. @param string $key the key to remove @return View
[ "Remove", "a", "key", "from", "data", "array", "." ]
33922bacbea66f11f874d991d7308a36cdf5831a
https://github.com/mylxsw/FocusPHP/blob/33922bacbea66f11f874d991d7308a36cdf5831a/src/MVC/SmpView.php#L167-L174
198,330
romm/configuration_object
Classes/Service/Items/Persistence/PersistenceService.php
PersistenceService.configurationObjectAfter
public function configurationObjectAfter(GetConfigurationObjectDTO $serviceDataTransferObject) { // Will save the registered domain object properties paths. $this->delay( self::PRIORITY_SAVE_DOMAIN_OBJECTS_PATHS, function (GetConfigurationObjectDTO $serviceDataTransferObject)...
php
public function configurationObjectAfter(GetConfigurationObjectDTO $serviceDataTransferObject) { // Will save the registered domain object properties paths. $this->delay( self::PRIORITY_SAVE_DOMAIN_OBJECTS_PATHS, function (GetConfigurationObjectDTO $serviceDataTransferObject)...
[ "public", "function", "configurationObjectAfter", "(", "GetConfigurationObjectDTO", "$", "serviceDataTransferObject", ")", "{", "// Will save the registered domain object properties paths.", "$", "this", "->", "delay", "(", "self", "::", "PRIORITY_SAVE_DOMAIN_OBJECTS_PATHS", ",",...
This function will first save the entire storage of properties paths set in the function `objectConversionBefore`. Then, each of the properties above will be fetched from Extbase persistence. @param GetConfigurationObjectDTO $serviceDataTransferObject
[ "This", "function", "will", "first", "save", "the", "entire", "storage", "of", "properties", "paths", "set", "in", "the", "function", "objectConversionBefore", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Service/Items/Persistence/PersistenceService.php#L103-L133
198,331
romm/configuration_object
Classes/Service/Items/Persistence/PersistenceService.php
PersistenceService.setDomainObjectInProperty
protected function setDomainObjectInProperty($object, $propertyName, $domainObject, $lastObject, array $objectArrayPropertyPath) { if (is_object($object)) { ObjectAccess::setProperty($object, $propertyName, $domainObject); } elseif (is_array($object)) { $this->injectDomainObj...
php
protected function setDomainObjectInProperty($object, $propertyName, $domainObject, $lastObject, array $objectArrayPropertyPath) { if (is_object($object)) { ObjectAccess::setProperty($object, $propertyName, $domainObject); } elseif (is_array($object)) { $this->injectDomainObj...
[ "protected", "function", "setDomainObjectInProperty", "(", "$", "object", ",", "$", "propertyName", ",", "$", "domainObject", ",", "$", "lastObject", ",", "array", "$", "objectArrayPropertyPath", ")", "{", "if", "(", "is_object", "(", "$", "object", ")", ")", ...
Will inject the domain object in the property, at the correct path. @param object|array $object @param string $propertyName @param object $domainObject @param object $lastObject @param array $objectArrayPropertyPath
[ "Will", "inject", "the", "domain", "object", "in", "the", "property", "at", "the", "correct", "path", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Service/Items/Persistence/PersistenceService.php#L180-L187
198,332
miknatr/grace-dbal
lib/Grace/DBAL/QueryLogger.php
QueryLogger.startQuery
public function startQuery($queryString) { $this->queries[$this->counter] = array('query' => $queryString); $this->timer = time() + microtime(true); }
php
public function startQuery($queryString) { $this->queries[$this->counter] = array('query' => $queryString); $this->timer = time() + microtime(true); }
[ "public", "function", "startQuery", "(", "$", "queryString", ")", "{", "$", "this", "->", "queries", "[", "$", "this", "->", "counter", "]", "=", "array", "(", "'query'", "=>", "$", "queryString", ")", ";", "$", "this", "->", "timer", "=", "time", "(...
Start timer for query @param string $queryString sql query string
[ "Start", "timer", "for", "query" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/DBAL/QueryLogger.php#L28-L32
198,333
miknatr/grace-dbal
lib/Grace/DBAL/QueryLogger.php
QueryLogger.stopQuery
public function stopQuery() { $this->queries[$this->counter]['time'] = (time() + microtime(true) - $this->timer); $this->counter++; $this->timer = 0; }
php
public function stopQuery() { $this->queries[$this->counter]['time'] = (time() + microtime(true) - $this->timer); $this->counter++; $this->timer = 0; }
[ "public", "function", "stopQuery", "(", ")", "{", "$", "this", "->", "queries", "[", "$", "this", "->", "counter", "]", "[", "'time'", "]", "=", "(", "time", "(", ")", "+", "microtime", "(", "true", ")", "-", "$", "this", "->", "timer", ")", ";",...
Stops timer and logs query information
[ "Stops", "timer", "and", "logs", "query", "information" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/DBAL/QueryLogger.php#L36-L41
198,334
miknatr/grace-dbal
lib/Grace/DBAL/QueryLogger.php
QueryLogger.startConnection
public function startConnection($queryString) { $this->connections[$this->counterConnections] = array('query' => $queryString); $this->timer = time() + microtime(true); }
php
public function startConnection($queryString) { $this->connections[$this->counterConnections] = array('query' => $queryString); $this->timer = time() + microtime(true); }
[ "public", "function", "startConnection", "(", "$", "queryString", ")", "{", "$", "this", "->", "connections", "[", "$", "this", "->", "counterConnections", "]", "=", "array", "(", "'query'", "=>", "$", "queryString", ")", ";", "$", "this", "->", "timer", ...
Start timer for connection @param string $queryString sql query string
[ "Start", "timer", "for", "connection" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/DBAL/QueryLogger.php#L59-L63
198,335
miknatr/grace-dbal
lib/Grace/DBAL/QueryLogger.php
QueryLogger.stopConnection
public function stopConnection() { $this->connections[$this->counterConnections]['time'] = (time() + microtime(true) - $this->timer); $this->counterConnections++; $this->timer = 0; }
php
public function stopConnection() { $this->connections[$this->counterConnections]['time'] = (time() + microtime(true) - $this->timer); $this->counterConnections++; $this->timer = 0; }
[ "public", "function", "stopConnection", "(", ")", "{", "$", "this", "->", "connections", "[", "$", "this", "->", "counterConnections", "]", "[", "'time'", "]", "=", "(", "time", "(", ")", "+", "microtime", "(", "true", ")", "-", "$", "this", "->", "t...
Stops timer and logs connection information
[ "Stops", "timer", "and", "logs", "connection", "information" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/DBAL/QueryLogger.php#L67-L72
198,336
miknatr/grace-dbal
lib/Grace/DBAL/QueryLogger.php
QueryLogger.reset
public function reset() { $this->timer = 0; $this->counter = 0; $this->counterConnections = 0; $this->queries = array(); $this->connections = array(); }
php
public function reset() { $this->timer = 0; $this->counter = 0; $this->counterConnections = 0; $this->queries = array(); $this->connections = array(); }
[ "public", "function", "reset", "(", ")", "{", "$", "this", "->", "timer", "=", "0", ";", "$", "this", "->", "counter", "=", "0", ";", "$", "this", "->", "counterConnections", "=", "0", ";", "$", "this", "->", "queries", "=", "array", "(", ")", ";...
Clear all logged data
[ "Clear", "all", "logged", "data" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/DBAL/QueryLogger.php#L84-L91
198,337
stevenliebregt/crispysystem
src/View/SmartyView.php
SmartyView.with
public function with(array $data) : SmartyView { foreach ($data as $k => $v) { $this->smarty->assign($k, $v); } return $this; }
php
public function with(array $data) : SmartyView { foreach ($data as $k => $v) { $this->smarty->assign($k, $v); } return $this; }
[ "public", "function", "with", "(", "array", "$", "data", ")", ":", "SmartyView", "{", "foreach", "(", "$", "data", "as", "$", "k", "=>", "$", "v", ")", "{", "$", "this", "->", "smarty", "->", "assign", "(", "$", "k", ",", "$", "v", ")", ";", ...
Assigns data to Smarty @param array $data @return SmartyView @since 1.0.0
[ "Assigns", "data", "to", "Smarty" ]
06547dae100dae1023a93ec903f2d2abacce9aec
https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/View/SmartyView.php#L109-L116
198,338
nicodevs/laito
src/Laito/Session/Session.php
Session.login
public function login($username, $password, $data) { // Verify the password against the stored hash if (!password_verify($password, $this->getStoredPassword($username))) { throw new \Exception('Incorrect username or password', 401); } // Create token return $this...
php
public function login($username, $password, $data) { // Verify the password against the stored hash if (!password_verify($password, $this->getStoredPassword($username))) { throw new \Exception('Incorrect username or password', 401); } // Create token return $this...
[ "public", "function", "login", "(", "$", "username", ",", "$", "password", ",", "$", "data", ")", "{", "// Verify the password against the stored hash", "if", "(", "!", "password_verify", "(", "$", "password", ",", "$", "this", "->", "getStoredPassword", "(", ...
Attempts to start a session @param string $username Username to login @param string $password Password @param array $data Data to store in the session @return array|bool Session data or false
[ "Attempts", "to", "start", "a", "session" ]
d2d28abfcbf981c4decfec28ce94f8849600e9fe
https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Session/Session.php#L31-L40
198,339
nicodevs/laito
src/Laito/Session/Session.php
Session.getField
public function getField($field, $token = null) { $session = $this->app->tokens->get($token); return ($session && isset($session[$field]))? $session[$field] : null; }
php
public function getField($field, $token = null) { $session = $this->app->tokens->get($token); return ($session && isset($session[$field]))? $session[$field] : null; }
[ "public", "function", "getField", "(", "$", "field", ",", "$", "token", "=", "null", ")", "{", "$", "session", "=", "$", "this", "->", "app", "->", "tokens", "->", "get", "(", "$", "token", ")", ";", "return", "(", "$", "session", "&&", "isset", ...
Gets a session field @param string $field Field name @param string $token Token hash @return array|bool Session data or false
[ "Gets", "a", "session", "field" ]
d2d28abfcbf981c4decfec28ce94f8849600e9fe
https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Session/Session.php#L71-L75
198,340
nicodevs/laito
src/Laito/Session/Session.php
Session.update
public function update($token = null, $data = []) { return $this->app->tokens->update($token, $data); }
php
public function update($token = null, $data = []) { return $this->app->tokens->update($token, $data); }
[ "public", "function", "update", "(", "$", "token", "=", "null", ",", "$", "data", "=", "[", "]", ")", "{", "return", "$", "this", "->", "app", "->", "tokens", "->", "update", "(", "$", "token", ",", "$", "data", ")", ";", "}" ]
Updates a session @param string $token Token hash @param array $data Data to store @return array|bool Session data or false
[ "Updates", "a", "session" ]
d2d28abfcbf981c4decfec28ce94f8849600e9fe
https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Session/Session.php#L84-L87
198,341
nicodevs/laito
src/Laito/Session/Session.php
Session.getStoredPassword
private function getStoredPassword($username) { // Get table object $db = $this->app->db->reset()->table($this->table); // Find user by username column $user = $db->select($this->passwordColumn)->limit(1)->where($this->usernameColumn, $username)->getOne(); // Abort if the u...
php
private function getStoredPassword($username) { // Get table object $db = $this->app->db->reset()->table($this->table); // Find user by username column $user = $db->select($this->passwordColumn)->limit(1)->where($this->usernameColumn, $username)->getOne(); // Abort if the u...
[ "private", "function", "getStoredPassword", "(", "$", "username", ")", "{", "// Get table object", "$", "db", "=", "$", "this", "->", "app", "->", "db", "->", "reset", "(", ")", "->", "table", "(", "$", "this", "->", "table", ")", ";", "// Find user by u...
Gets an stored password for a user @param string $username Username @return mixed User password, of false if the user does not exist
[ "Gets", "an", "stored", "password", "for", "a", "user" ]
d2d28abfcbf981c4decfec28ce94f8849600e9fe
https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Session/Session.php#L106-L121
198,342
rafrsr/generic-api
src/ApiRequestBuilder.php
ApiRequestBuilder.withJsonBody
public function withJsonBody($data, SerializationContext $context = null) { if (is_string($data)) { $json = $data; } else { $json = SerializerBuilder::create()->build()->serialize($data, 'json', $context); } $this->withBody($json); return $this; }
php
public function withJsonBody($data, SerializationContext $context = null) { if (is_string($data)) { $json = $data; } else { $json = SerializerBuilder::create()->build()->serialize($data, 'json', $context); } $this->withBody($json); return $this; }
[ "public", "function", "withJsonBody", "(", "$", "data", ",", "SerializationContext", "$", "context", "=", "null", ")", "{", "if", "(", "is_string", "(", "$", "data", ")", ")", "{", "$", "json", "=", "$", "data", ";", "}", "else", "{", "$", "json", ...
Create json with given data using serialization @param $data @param SerializationContext|null $context @return $this
[ "Create", "json", "with", "given", "data", "using", "serialization" ]
2572d3dcc32e03914cf710f0229d72e1c09ea65b
https://github.com/rafrsr/generic-api/blob/2572d3dcc32e03914cf710f0229d72e1c09ea65b/src/ApiRequestBuilder.php#L282-L292
198,343
rafrsr/generic-api
src/ApiRequestBuilder.php
ApiRequestBuilder.withXMLBody
public function withXMLBody($data, SerializationContext $context = null) { if (is_string($data)) { $xml = $data; } else { $xml = SerializerBuilder::create()->build()->serialize($data, 'xml', $context); } $this->addHeader('Content-Type', 'text/xml; charset=utf-...
php
public function withXMLBody($data, SerializationContext $context = null) { if (is_string($data)) { $xml = $data; } else { $xml = SerializerBuilder::create()->build()->serialize($data, 'xml', $context); } $this->addHeader('Content-Type', 'text/xml; charset=utf-...
[ "public", "function", "withXMLBody", "(", "$", "data", ",", "SerializationContext", "$", "context", "=", "null", ")", "{", "if", "(", "is_string", "(", "$", "data", ")", ")", "{", "$", "xml", "=", "$", "data", ";", "}", "else", "{", "$", "xml", "="...
Create xml with given data using serialization @param $data @param SerializationContext|null $context @return $this
[ "Create", "xml", "with", "given", "data", "using", "serialization" ]
2572d3dcc32e03914cf710f0229d72e1c09ea65b
https://github.com/rafrsr/generic-api/blob/2572d3dcc32e03914cf710f0229d72e1c09ea65b/src/ApiRequestBuilder.php#L302-L313
198,344
RedCirclePL/ConsoleProcessManagerBundle
EventListener/CommandListener.php
CommandListener.onConsoleCommand
public function onConsoleCommand(ConsoleCommandEvent $event) { if (!$this->processRepository->createSchemaIfNotExists()) { throw new Exception('Cannot create schema for ConsoleProcessManagerBundle'); } $argv = $_SERVER['argv']; unset($argv[0]); $command = implode...
php
public function onConsoleCommand(ConsoleCommandEvent $event) { if (!$this->processRepository->createSchemaIfNotExists()) { throw new Exception('Cannot create schema for ConsoleProcessManagerBundle'); } $argv = $_SERVER['argv']; unset($argv[0]); $command = implode...
[ "public", "function", "onConsoleCommand", "(", "ConsoleCommandEvent", "$", "event", ")", "{", "if", "(", "!", "$", "this", "->", "processRepository", "->", "createSchemaIfNotExists", "(", ")", ")", "{", "throw", "new", "Exception", "(", "'Cannot create schema for ...
Run on console command start @param ConsoleCommandEvent $event @throws Exception
[ "Run", "on", "console", "command", "start" ]
76b17924d3b7faf81f81f5fdaa96555200dee66b
https://github.com/RedCirclePL/ConsoleProcessManagerBundle/blob/76b17924d3b7faf81f81f5fdaa96555200dee66b/EventListener/CommandListener.php#L46-L71
198,345
RedCirclePL/ConsoleProcessManagerBundle
EventListener/CommandListener.php
CommandListener.onConsoleException
public function onConsoleException(ConsoleExceptionEvent $event) { $call = $this->callRepository->find($_REQUEST['call_id']); $call->setStatus(Call::STATUS_FAILED) ->setOutput($event->getException()); $this->callRepository->update($call); $this->registerError($call); ...
php
public function onConsoleException(ConsoleExceptionEvent $event) { $call = $this->callRepository->find($_REQUEST['call_id']); $call->setStatus(Call::STATUS_FAILED) ->setOutput($event->getException()); $this->callRepository->update($call); $this->registerError($call); ...
[ "public", "function", "onConsoleException", "(", "ConsoleExceptionEvent", "$", "event", ")", "{", "$", "call", "=", "$", "this", "->", "callRepository", "->", "find", "(", "$", "_REQUEST", "[", "'call_id'", "]", ")", ";", "$", "call", "->", "setStatus", "(...
Run on console command exception @param ConsoleExceptionEvent $event
[ "Run", "on", "console", "command", "exception" ]
76b17924d3b7faf81f81f5fdaa96555200dee66b
https://github.com/RedCirclePL/ConsoleProcessManagerBundle/blob/76b17924d3b7faf81f81f5fdaa96555200dee66b/EventListener/CommandListener.php#L78-L88
198,346
RedCirclePL/ConsoleProcessManagerBundle
EventListener/CommandListener.php
CommandListener.onConsoleTerminate
public function onConsoleTerminate(ConsoleTerminateEvent $event) { $call = $this->callRepository->find($_REQUEST['call_id']); if (!$call->getStatus()) { $call->setStatus(Call::STATUS_SUCCESS); } if ($event->getExitCode()) { $call->setStatus(Call::STATUS_ABOR...
php
public function onConsoleTerminate(ConsoleTerminateEvent $event) { $call = $this->callRepository->find($_REQUEST['call_id']); if (!$call->getStatus()) { $call->setStatus(Call::STATUS_SUCCESS); } if ($event->getExitCode()) { $call->setStatus(Call::STATUS_ABOR...
[ "public", "function", "onConsoleTerminate", "(", "ConsoleTerminateEvent", "$", "event", ")", "{", "$", "call", "=", "$", "this", "->", "callRepository", "->", "find", "(", "$", "_REQUEST", "[", "'call_id'", "]", ")", ";", "if", "(", "!", "$", "call", "->...
Run on console command ends @param ConsoleTerminateEvent $event
[ "Run", "on", "console", "command", "ends" ]
76b17924d3b7faf81f81f5fdaa96555200dee66b
https://github.com/RedCirclePL/ConsoleProcessManagerBundle/blob/76b17924d3b7faf81f81f5fdaa96555200dee66b/EventListener/CommandListener.php#L95-L116
198,347
mtils/cmsable
src/Cmsable/Resource/ResourceBus.php
ResourceBus.getEventBus
public function getEventBus() { if ($this->eventBus) { return $this->eventBus; } if (isset(static::$staticEventBus) && static::$staticEventBus) { return static::$staticEventBus; } if (!$this->eventBus) { $this->eventBus = Bus::instance();...
php
public function getEventBus() { if ($this->eventBus) { return $this->eventBus; } if (isset(static::$staticEventBus) && static::$staticEventBus) { return static::$staticEventBus; } if (!$this->eventBus) { $this->eventBus = Bus::instance();...
[ "public", "function", "getEventBus", "(", ")", "{", "if", "(", "$", "this", "->", "eventBus", ")", "{", "return", "$", "this", "->", "eventBus", ";", "}", "if", "(", "isset", "(", "static", "::", "$", "staticEventBus", ")", "&&", "static", "::", "$",...
Return the single instance of resource bus @return BusContract
[ "Return", "the", "single", "instance", "of", "resource", "bus" ]
03ae84ee3c7d46146f2a1cf687e5c29d6de4286d
https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Resource/ResourceBus.php#L28-L42
198,348
Arcesilas/dot-array
src/DotArray.php
DotArray.get
public function get(string $key, $default = null) { if (array_key_exists($key, $this->input)) { return $this->input[$key]; } elseif (array_key_exists($key, $this->cache)) { return $this->cache[$key]; } // No dot, then not nested keys. We already tried that ke...
php
public function get(string $key, $default = null) { if (array_key_exists($key, $this->input)) { return $this->input[$key]; } elseif (array_key_exists($key, $this->cache)) { return $this->cache[$key]; } // No dot, then not nested keys. We already tried that ke...
[ "public", "function", "get", "(", "string", "$", "key", ",", "$", "default", "=", "null", ")", "{", "if", "(", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "input", ")", ")", "{", "return", "$", "this", "->", "input", "[", "$", "k...
Returns an item using dot notation @method get @param string $key @param mixed $default @return mixed
[ "Returns", "an", "item", "using", "dot", "notation" ]
89839a56c71cb472a8df7d7d1d3b90d68bf31f97
https://github.com/Arcesilas/dot-array/blob/89839a56c71cb472a8df7d7d1d3b90d68bf31f97/src/DotArray.php#L80-L99
198,349
Arcesilas/dot-array
src/DotArray.php
DotArray.has
public function has(string $key) { if (array_key_exists($key, $this->input)) { return true; } try { $this->find($this->input, $key); return true; } catch (\Exception $e) { return false; } }
php
public function has(string $key) { if (array_key_exists($key, $this->input)) { return true; } try { $this->find($this->input, $key); return true; } catch (\Exception $e) { return false; } }
[ "public", "function", "has", "(", "string", "$", "key", ")", "{", "if", "(", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "input", ")", ")", "{", "return", "true", ";", "}", "try", "{", "$", "this", "->", "find", "(", "$", "this",...
Checks whether the dotted key exists @method has @param string $key @return boolean
[ "Checks", "whether", "the", "dotted", "key", "exists" ]
89839a56c71cb472a8df7d7d1d3b90d68bf31f97
https://github.com/Arcesilas/dot-array/blob/89839a56c71cb472a8df7d7d1d3b90d68bf31f97/src/DotArray.php#L107-L119
198,350
Arcesilas/dot-array
src/DotArray.php
DotArray.find
protected function find(array $array, string $key) { $item = $array; foreach (explode('.', $key) as $segment) { if (is_array($item) && array_key_exists($segment, $item)) { $item = $item[$segment]; } else { throw new \Exception(); }...
php
protected function find(array $array, string $key) { $item = $array; foreach (explode('.', $key) as $segment) { if (is_array($item) && array_key_exists($segment, $item)) { $item = $item[$segment]; } else { throw new \Exception(); }...
[ "protected", "function", "find", "(", "array", "$", "array", ",", "string", "$", "key", ")", "{", "$", "item", "=", "$", "array", ";", "foreach", "(", "explode", "(", "'.'", ",", "$", "key", ")", "as", "$", "segment", ")", "{", "if", "(", "is_arr...
Find a value with its dotted key in an array @param array $array @param string $key @return mixed @throws \Exception if the key is not found
[ "Find", "a", "value", "with", "its", "dotted", "key", "in", "an", "array" ]
89839a56c71cb472a8df7d7d1d3b90d68bf31f97
https://github.com/Arcesilas/dot-array/blob/89839a56c71cb472a8df7d7d1d3b90d68bf31f97/src/DotArray.php#L128-L143
198,351
Arcesilas/dot-array
src/DotArray.php
DotArray.set
public function set(string $key, $value) { $array = &$this->input; $keys = explode('.', $key); while (count($keys) > 1) { $k = array_shift($keys); if (!isset($array[$k]) || ! is_array($array[$k])) { $array[$k] = []; } $array = ...
php
public function set(string $key, $value) { $array = &$this->input; $keys = explode('.', $key); while (count($keys) > 1) { $k = array_shift($keys); if (!isset($array[$k]) || ! is_array($array[$k])) { $array[$k] = []; } $array = ...
[ "public", "function", "set", "(", "string", "$", "key", ",", "$", "value", ")", "{", "$", "array", "=", "&", "$", "this", "->", "input", ";", "$", "keys", "=", "explode", "(", "'.'", ",", "$", "key", ")", ";", "while", "(", "count", "(", "$", ...
Sets a value using dot notation @param string $key @param mixed $value
[ "Sets", "a", "value", "using", "dot", "notation" ]
89839a56c71cb472a8df7d7d1d3b90d68bf31f97
https://github.com/Arcesilas/dot-array/blob/89839a56c71cb472a8df7d7d1d3b90d68bf31f97/src/DotArray.php#L150-L165
198,352
Arcesilas/dot-array
src/DotArray.php
DotArray.unset
public function unset(string $key) { if (array_key_exists($key, $this->input)) { unset($this->input[$key]); unset($this->cache[$key]); } $item = &$this->input; foreach (explode('.', $key) as $segment) { if (! isset($item[$segment])) { ...
php
public function unset(string $key) { if (array_key_exists($key, $this->input)) { unset($this->input[$key]); unset($this->cache[$key]); } $item = &$this->input; foreach (explode('.', $key) as $segment) { if (! isset($item[$segment])) { ...
[ "public", "function", "unset", "(", "string", "$", "key", ")", "{", "if", "(", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "input", ")", ")", "{", "unset", "(", "$", "this", "->", "input", "[", "$", "key", "]", ")", ";", "unset",...
Unsets a dotted key @param string $key
[ "Unsets", "a", "dotted", "key" ]
89839a56c71cb472a8df7d7d1d3b90d68bf31f97
https://github.com/Arcesilas/dot-array/blob/89839a56c71cb472a8df7d7d1d3b90d68bf31f97/src/DotArray.php#L171-L192
198,353
Arcesilas/dot-array
src/DotArray.php
DotArray.import
public function import($input) { if (false !== ($array = $this->getImportableArray($input))) { $this->input = array_replace_recursive($this->input, $array); $this->cache = []; } }
php
public function import($input) { if (false !== ($array = $this->getImportableArray($input))) { $this->input = array_replace_recursive($this->input, $array); $this->cache = []; } }
[ "public", "function", "import", "(", "$", "input", ")", "{", "if", "(", "false", "!==", "(", "$", "array", "=", "$", "this", "->", "getImportableArray", "(", "$", "input", ")", ")", ")", "{", "$", "this", "->", "input", "=", "array_replace_recursive", ...
Import an array, ArrayAccess @method import @param mixed $input
[ "Import", "an", "array", "ArrayAccess" ]
89839a56c71cb472a8df7d7d1d3b90d68bf31f97
https://github.com/Arcesilas/dot-array/blob/89839a56c71cb472a8df7d7d1d3b90d68bf31f97/src/DotArray.php#L199-L205
198,354
ciims/ciims-modules-api
components/ApiController.php
ApiController.createAction
public function createAction($actionID) { if ($actionID==='') $actionID=$this->defaultAction; if (Yii::app()->request->getRequestType() != 'GET' && $actionID != 'error') $actionID .= Yii::app()->request->getRequestType(); if (method_exists($this,'action'.$actionID) && strcasecmp($actionID,'s')) /...
php
public function createAction($actionID) { if ($actionID==='') $actionID=$this->defaultAction; if (Yii::app()->request->getRequestType() != 'GET' && $actionID != 'error') $actionID .= Yii::app()->request->getRequestType(); if (method_exists($this,'action'.$actionID) && strcasecmp($actionID,'s')) /...
[ "public", "function", "createAction", "(", "$", "actionID", ")", "{", "if", "(", "$", "actionID", "===", "''", ")", "$", "actionID", "=", "$", "this", "->", "defaultAction", ";", "if", "(", "Yii", "::", "app", "(", ")", "->", "request", "->", "getReq...
Method overload allows clearer separation of controller actions in relation to REQUEST_TYPE GET actions will be routed to action$actionID Other actions will be routed to action$actionIDREQUEST_TYPE @param $actionID string The string name of the action that we want to run @return CInlineAction @see CController::create...
[ "Method", "overload", "allows", "clearer", "separation", "of", "controller", "actions", "in", "relation", "to", "REQUEST_TYPE" ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/components/ApiController.php#L115-L133
198,355
ciims/ciims-modules-api
components/ApiController.php
ApiController.beforeAction
public function beforeAction($action) { try { @Yii::app()->newRelic->setTransactionName($this->id, $action->id); } catch (Exception $e) {} // Ignore errors if NewRelic isn't installed/configured properly // Force SSL for secure areas if enabled from the dashboard if (!Yii::app()->getRequest()->isSec...
php
public function beforeAction($action) { try { @Yii::app()->newRelic->setTransactionName($this->id, $action->id); } catch (Exception $e) {} // Ignore errors if NewRelic isn't installed/configured properly // Force SSL for secure areas if enabled from the dashboard if (!Yii::app()->getRequest()->isSec...
[ "public", "function", "beforeAction", "(", "$", "action", ")", "{", "try", "{", "@", "Yii", "::", "app", "(", ")", "->", "newRelic", "->", "setTransactionName", "(", "$", "this", "->", "id", ",", "$", "action", "->", "id", ")", ";", "}", "catch", "...
BeforeAction, validates that there is a valid response body @param CAction $action The action we want to run
[ "BeforeAction", "validates", "that", "there", "is", "a", "valid", "response", "body" ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/components/ApiController.php#L139-L167
198,356
ciims/ciims-modules-api
components/ApiController.php
ApiController.actionError
public function actionError() { $response = array(); $this->message = Yii::t('Api.Controller', 'An unexpected error occured.'); if ($error=Yii::app()->errorHandler->error) { $this->status = $error['code']; $this->message = $error['message']; if (YII_DEBUG) $response = $error; } ...
php
public function actionError() { $response = array(); $this->message = Yii::t('Api.Controller', 'An unexpected error occured.'); if ($error=Yii::app()->errorHandler->error) { $this->status = $error['code']; $this->message = $error['message']; if (YII_DEBUG) $response = $error; } ...
[ "public", "function", "actionError", "(", ")", "{", "$", "response", "=", "array", "(", ")", ";", "$", "this", "->", "message", "=", "Yii", "::", "t", "(", "'Api.Controller'", ",", "'An unexpected error occured.'", ")", ";", "if", "(", "$", "error", "=",...
Default Error Handler. Yii automatically magics the response when renderOutput is called. This just updates the necessary components for us
[ "Default", "Error", "Handler", ".", "Yii", "automatically", "magics", "the", "response", "when", "renderOutput", "is", "called", ".", "This", "just", "updates", "the", "necessary", "components", "for", "us" ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/components/ApiController.php#L173-L187
198,357
ciims/ciims-modules-api
components/ApiController.php
ApiController.renderOutput
public function renderOutput($response = array(), $status=NULL, $message=NULL) { http_response_code( $status != NULL ? $status : $this->status ); header('Content-Type: application/json'); header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Headers: x-auth-token, x-auth-email"); heade...
php
public function renderOutput($response = array(), $status=NULL, $message=NULL) { http_response_code( $status != NULL ? $status : $this->status ); header('Content-Type: application/json'); header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Headers: x-auth-token, x-auth-email"); heade...
[ "public", "function", "renderOutput", "(", "$", "response", "=", "array", "(", ")", ",", "$", "status", "=", "NULL", ",", "$", "message", "=", "NULL", ")", "{", "http_response_code", "(", "$", "status", "!=", "NULL", "?", "$", "status", ":", "$", "th...
Outputs the data as JSON @param boolean|null $response the response data
[ "Outputs", "the", "data", "as", "JSON" ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/components/ApiController.php#L235-L253
198,358
ciims/ciims-modules-api
components/ApiController.php
ApiController.returnError
public function returnError($status, $message = NULL, $response) { header('HTTP/1.1 '. $status); $this->status = $status; if ($message === NULL) $this->message = Yii::t('Api.main', 'Failed to set model attributes.'); else $this->message = $message; // This is a special condition in Yii. We ...
php
public function returnError($status, $message = NULL, $response) { header('HTTP/1.1 '. $status); $this->status = $status; if ($message === NULL) $this->message = Yii::t('Api.main', 'Failed to set model attributes.'); else $this->message = $message; // This is a special condition in Yii. We ...
[ "public", "function", "returnError", "(", "$", "status", ",", "$", "message", "=", "NULL", ",", "$", "response", ")", "{", "header", "(", "'HTTP/1.1 '", ".", "$", "status", ")", ";", "$", "this", "->", "status", "=", "$", "status", ";", "if", "(", ...
Performs an error dump with the given status code @param int $status The HTTP Status Code @param string $message The error message @param array $response The error response @return array
[ "Performs", "an", "error", "dump", "with", "the", "given", "status", "code" ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/components/ApiController.php#L262-L277
198,359
ciims/ciims-modules-api
components/ApiController.php
ApiController.getRole
protected function getRole($role) { if (!isset($this->user)) return false; if (isset($this->user->role)) return $this->user->role->hasPermission($role); return false; }
php
protected function getRole($role) { if (!isset($this->user)) return false; if (isset($this->user->role)) return $this->user->role->hasPermission($role); return false; }
[ "protected", "function", "getRole", "(", "$", "role", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "user", ")", ")", "return", "false", ";", "if", "(", "isset", "(", "$", "this", "->", "user", "->", "role", ")", ")", "return", "$", ...
Helper function to get the user's role @param integer $role the user's role' @return boolean
[ "Helper", "function", "to", "get", "the", "user", "s", "role" ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/components/ApiController.php#L284-L293
198,360
stubbles/stubbles-reflect
src/main/php/annotation/Annotation.php
Annotation.getValueByName
public function getValueByName(string $name, $default = null) { if (isset($this->values[$name])) { return $this->parseType($this->values[$name]); } return $default; }
php
public function getValueByName(string $name, $default = null) { if (isset($this->values[$name])) { return $this->parseType($this->values[$name]); } return $default; }
[ "public", "function", "getValueByName", "(", "string", "$", "name", ",", "$", "default", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "values", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "parseType", "(...
returns a value by its name Returns null if a value with given name does not exist or is not set. @api @param string $name @param mixed $default optional value to return if value not set @return mixed @since 1.7.0
[ "returns", "a", "value", "by", "its", "name" ]
ab48f9b8692293ef0d276b52619625dbb8869c97
https://github.com/stubbles/stubbles-reflect/blob/ab48f9b8692293ef0d276b52619625dbb8869c97/src/main/php/annotation/Annotation.php#L125-L132
198,361
stubbles/stubbles-reflect
src/main/php/annotation/Annotation.php
Annotation.parseType
private function parseType(string $value) { if ((substr($value, 0, 1) === '"' && substr($value, -1) === '"') || (substr($value, 0, 1) === "'" && substr($value, -1) === "'")) { return substr($value, 1, strlen($value) - 2); } return Parse::toType($value); }
php
private function parseType(string $value) { if ((substr($value, 0, 1) === '"' && substr($value, -1) === '"') || (substr($value, 0, 1) === "'" && substr($value, -1) === "'")) { return substr($value, 1, strlen($value) - 2); } return Parse::toType($value); }
[ "private", "function", "parseType", "(", "string", "$", "value", ")", "{", "if", "(", "(", "substr", "(", "$", "value", ",", "0", ",", "1", ")", "===", "'\"'", "&&", "substr", "(", "$", "value", ",", "-", "1", ")", "===", "'\"'", ")", "||", "("...
parses value to correct type @param string $value @return mixed
[ "parses", "value", "to", "correct", "type" ]
ab48f9b8692293ef0d276b52619625dbb8869c97
https://github.com/stubbles/stubbles-reflect/blob/ab48f9b8692293ef0d276b52619625dbb8869c97/src/main/php/annotation/Annotation.php#L231-L238
198,362
redkite-labs/ThemeEngineBundle
Core/Rendering/DependencyInjection/BaseExtension.php
BaseExtension.loadConfigurationRecursive
protected function loadConfigurationRecursive(ContainerBuilder $container, array $configuration) { foreach ($configuration as $values) { $loader = new XmlFileLoader($container, new FileLocator($values['path'])); foreach ($values['configFiles'] as $configFile) { $loade...
php
protected function loadConfigurationRecursive(ContainerBuilder $container, array $configuration) { foreach ($configuration as $values) { $loader = new XmlFileLoader($container, new FileLocator($values['path'])); foreach ($values['configFiles'] as $configFile) { $loade...
[ "protected", "function", "loadConfigurationRecursive", "(", "ContainerBuilder", "$", "container", ",", "array", "$", "configuration", ")", "{", "foreach", "(", "$", "configuration", "as", "$", "values", ")", "{", "$", "loader", "=", "new", "XmlFileLoader", "(", ...
Loads the them configuration recursively @param \Symfony\Component\DependencyInjection\ContainerBuilder $container @param array $configuration
[ "Loads", "the", "them", "configuration", "recursively" ]
427409110f2d4f8f39d8802c17d5dd4115cbdf2b
https://github.com/redkite-labs/ThemeEngineBundle/blob/427409110f2d4f8f39d8802c17d5dd4115cbdf2b/Core/Rendering/DependencyInjection/BaseExtension.php#L67-L78
198,363
ekyna/PaymentBundle
DependencyInjection/Configuration.php
Configuration.addPoolsSection
private function addPoolsSection(ArrayNodeDefinition $node) { $node ->children() ->arrayNode('pools') ->addDefaultsIfNotSet() ->children() ->arrayNode('method') ->addDefaultsIfNotSet() ...
php
private function addPoolsSection(ArrayNodeDefinition $node) { $node ->children() ->arrayNode('pools') ->addDefaultsIfNotSet() ->children() ->arrayNode('method') ->addDefaultsIfNotSet() ...
[ "private", "function", "addPoolsSection", "(", "ArrayNodeDefinition", "$", "node", ")", "{", "$", "node", "->", "children", "(", ")", "->", "arrayNode", "(", "'pools'", ")", "->", "addDefaultsIfNotSet", "(", ")", "->", "children", "(", ")", "->", "arrayNode"...
Adds admin pool sections. @param ArrayNodeDefinition $node
[ "Adds", "admin", "pool", "sections", "." ]
1b4f4103b28e3a4f8dbfac2cbd872d728238f4d1
https://github.com/ekyna/PaymentBundle/blob/1b4f4103b28e3a4f8dbfac2cbd872d728238f4d1/DependencyInjection/Configuration.php#L34-L63
198,364
byjg/authuser
src/UsersDBDataset.php
UsersDBDataset.getIterator
public function getIterator(IteratorFilter $filter = null) { if (is_null($filter)) { $filter = new IteratorFilter(); } $param = []; $formatter = new IteratorFilterSqlFormatter(); $sql = $formatter->getFilter($filter->getRawFilters(), $param); $query = Qu...
php
public function getIterator(IteratorFilter $filter = null) { if (is_null($filter)) { $filter = new IteratorFilter(); } $param = []; $formatter = new IteratorFilterSqlFormatter(); $sql = $formatter->getFilter($filter->getRawFilters(), $param); $query = Qu...
[ "public", "function", "getIterator", "(", "IteratorFilter", "$", "filter", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "filter", ")", ")", "{", "$", "filter", "=", "new", "IteratorFilter", "(", ")", ";", "}", "$", "param", "=", "[", "]", ...
Get the users database information based on a filter. @param IteratorFilter $filter Filter to find user @return UserModel[] @throws \ByJG\MicroOrm\Exception\InvalidArgumentException @throws \ByJG\Serializer\Exception\InvalidArgumentException
[ "Get", "the", "users", "database", "information", "based", "on", "a", "filter", "." ]
2ca520e921e559257d14dd933c746a1df28eaf9f
https://github.com/byjg/authuser/blob/2ca520e921e559257d14dd933c746a1df28eaf9f/src/UsersDBDataset.php#L134-L149
198,365
byjg/authuser
src/UsersDBDataset.php
UsersDBDataset.removeByLoginField
public function removeByLoginField($login) { $user = $this->getByLoginField($login); if ($user !== null) { return $this->removeUserById($user->getUserid()); } return false; }
php
public function removeByLoginField($login) { $user = $this->getByLoginField($login); if ($user !== null) { return $this->removeUserById($user->getUserid()); } return false; }
[ "public", "function", "removeByLoginField", "(", "$", "login", ")", "{", "$", "user", "=", "$", "this", "->", "getByLoginField", "(", "$", "login", ")", ";", "if", "(", "$", "user", "!==", "null", ")", "{", "return", "$", "this", "->", "removeUserById"...
Remove the user based on his user login. @param string $login @return bool @throws \Exception
[ "Remove", "the", "user", "based", "on", "his", "user", "login", "." ]
2ca520e921e559257d14dd933c746a1df28eaf9f
https://github.com/byjg/authuser/blob/2ca520e921e559257d14dd933c746a1df28eaf9f/src/UsersDBDataset.php#L181-L190
198,366
byjg/authuser
src/UsersDBDataset.php
UsersDBDataset.removeUserById
public function removeUserById($userId) { $updtableProperties = Updatable::getInstance() ->table($this->getUserPropertiesDefinition()->table()) ->where( "{$this->getUserPropertiesDefinition()->getUserid()} = :id", [ "id" => $userId ...
php
public function removeUserById($userId) { $updtableProperties = Updatable::getInstance() ->table($this->getUserPropertiesDefinition()->table()) ->where( "{$this->getUserPropertiesDefinition()->getUserid()} = :id", [ "id" => $userId ...
[ "public", "function", "removeUserById", "(", "$", "userId", ")", "{", "$", "updtableProperties", "=", "Updatable", "::", "getInstance", "(", ")", "->", "table", "(", "$", "this", "->", "getUserPropertiesDefinition", "(", ")", "->", "table", "(", ")", ")", ...
Remove the user based on his user id. @param mixed $userId @return bool @throws \Exception
[ "Remove", "the", "user", "based", "on", "his", "user", "id", "." ]
2ca520e921e559257d14dd933c746a1df28eaf9f
https://github.com/byjg/authuser/blob/2ca520e921e559257d14dd933c746a1df28eaf9f/src/UsersDBDataset.php#L199-L214
198,367
byjg/authuser
src/UsersDBDataset.php
UsersDBDataset.removeProperty
public function removeProperty($userId, $propertyName, $value = null) { $user = $this->getById($userId); if ($user !== null) { $updateable = Updatable::getInstance() ->table($this->getUserPropertiesDefinition()->table()) ->where("{$this->getUserProperties...
php
public function removeProperty($userId, $propertyName, $value = null) { $user = $this->getById($userId); if ($user !== null) { $updateable = Updatable::getInstance() ->table($this->getUserPropertiesDefinition()->table()) ->where("{$this->getUserProperties...
[ "public", "function", "removeProperty", "(", "$", "userId", ",", "$", "propertyName", ",", "$", "value", "=", "null", ")", "{", "$", "user", "=", "$", "this", "->", "getById", "(", "$", "userId", ")", ";", "if", "(", "$", "user", "!==", "null", ")"...
Remove a specific site from user Return True or false @param int $userId User Id @param string $propertyName Property name @param string $value Property value with a site @return bool @throws \ByJG\MicroOrm\Exception\InvalidArgumentException @throws \ByJG\Serializer\Exception\InvalidArgumentException
[ "Remove", "a", "specific", "site", "from", "user", "Return", "True", "or", "false" ]
2ca520e921e559257d14dd933c746a1df28eaf9f
https://github.com/byjg/authuser/blob/2ca520e921e559257d14dd933c746a1df28eaf9f/src/UsersDBDataset.php#L254-L274
198,368
byjg/authuser
src/UsersDBDataset.php
UsersDBDataset.setPropertiesInUser
protected function setPropertiesInUser(UserModel $userRow) { $query = Query::getInstance() ->table($this->getUserPropertiesDefinition()->table()) ->where("{$this->getUserPropertiesDefinition()->getUserid()} = :id", ['id' =>$userRow->getUserid()]); $userRow->setProperties($thi...
php
protected function setPropertiesInUser(UserModel $userRow) { $query = Query::getInstance() ->table($this->getUserPropertiesDefinition()->table()) ->where("{$this->getUserPropertiesDefinition()->getUserid()} = :id", ['id' =>$userRow->getUserid()]); $userRow->setProperties($thi...
[ "protected", "function", "setPropertiesInUser", "(", "UserModel", "$", "userRow", ")", "{", "$", "query", "=", "Query", "::", "getInstance", "(", ")", "->", "table", "(", "$", "this", "->", "getUserPropertiesDefinition", "(", ")", "->", "table", "(", ")", ...
Return all property's fields from this user @param UserModel $userRow @throws \ByJG\MicroOrm\Exception\InvalidArgumentException @throws \ByJG\Serializer\Exception\InvalidArgumentException
[ "Return", "all", "property", "s", "fields", "from", "this", "user" ]
2ca520e921e559257d14dd933c746a1df28eaf9f
https://github.com/byjg/authuser/blob/2ca520e921e559257d14dd933c746a1df28eaf9f/src/UsersDBDataset.php#L307-L313
198,369
ptlis/grep-db
src/Search/Search.php
Search.searchServer
public function searchServer( Connection $connection, string $searchTerm ): \Generator { $serverMetadata = (new MetadataFactory())->getServerMetadata($connection); foreach ($serverMetadata->getAllDatabaseMetadata() as $databaseMetadata) { $resultList = $this->searchDatab...
php
public function searchServer( Connection $connection, string $searchTerm ): \Generator { $serverMetadata = (new MetadataFactory())->getServerMetadata($connection); foreach ($serverMetadata->getAllDatabaseMetadata() as $databaseMetadata) { $resultList = $this->searchDatab...
[ "public", "function", "searchServer", "(", "Connection", "$", "connection", ",", "string", "$", "searchTerm", ")", ":", "\\", "Generator", "{", "$", "serverMetadata", "=", "(", "new", "MetadataFactory", "(", ")", ")", "->", "getServerMetadata", "(", "$", "co...
Performs a search across databases on a server. @param Connection $connection @param string $searchTerm @return \Generator|RowSearchResult[]
[ "Performs", "a", "search", "across", "databases", "on", "a", "server", "." ]
7abff68982d426690d0515ccd7adc7a2e3d72a3f
https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Search/Search.php#L28-L45
198,370
ptlis/grep-db
src/Search/Search.php
Search.searchDatabase
public function searchDatabase( Connection $connection, string $databaseName, string $searchTerm ): \Generator { $databaseMetadata = (new MetadataFactory())->getDatabaseMetadata($connection, $databaseName); foreach ($databaseMetadata->getAllTableMetadata() as $tableMetadata)...
php
public function searchDatabase( Connection $connection, string $databaseName, string $searchTerm ): \Generator { $databaseMetadata = (new MetadataFactory())->getDatabaseMetadata($connection, $databaseName); foreach ($databaseMetadata->getAllTableMetadata() as $tableMetadata)...
[ "public", "function", "searchDatabase", "(", "Connection", "$", "connection", ",", "string", "$", "databaseName", ",", "string", "$", "searchTerm", ")", ":", "\\", "Generator", "{", "$", "databaseMetadata", "=", "(", "new", "MetadataFactory", "(", ")", ")", ...
Performs a search across tables in a database. @param Connection $connection @param string $databaseName @param string $searchTerm @return \Generator|RowSearchResult[]
[ "Performs", "a", "search", "across", "tables", "in", "a", "database", "." ]
7abff68982d426690d0515ccd7adc7a2e3d72a3f
https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Search/Search.php#L55-L74
198,371
ptlis/grep-db
src/Search/Search.php
Search.searchTable
public function searchTable( Connection $connection, string $databaseName, string $tableName, string $searchTerm ): \Generator { $tableMetadata = (new MetadataFactory())->getTableMetadata($connection, $databaseName, $tableName); if (!$tableMetadata->hasStringTypeColu...
php
public function searchTable( Connection $connection, string $databaseName, string $tableName, string $searchTerm ): \Generator { $tableMetadata = (new MetadataFactory())->getTableMetadata($connection, $databaseName, $tableName); if (!$tableMetadata->hasStringTypeColu...
[ "public", "function", "searchTable", "(", "Connection", "$", "connection", ",", "string", "$", "databaseName", ",", "string", "$", "tableName", ",", "string", "$", "searchTerm", ")", ":", "\\", "Generator", "{", "$", "tableMetadata", "=", "(", "new", "Metada...
Performs a search on the provided table. @param Connection $connection @param string $databaseName @param string $tableName @param string $searchTerm @return \Generator|RowSearchResult[]
[ "Performs", "a", "search", "on", "the", "provided", "table", "." ]
7abff68982d426690d0515ccd7adc7a2e3d72a3f
https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Search/Search.php#L85-L107
198,372
zenodorus-tools/filesystem
src/Filesystem.php
Filesystem.slash
public static function slash(string ...$sections) { $count = count($sections); // If we only got a single section, return it. if (1 === $count) { return $sections[0]; } // Somehow we got NO sections, so return null. elseif (0 >= $count || empty($sections)) { ...
php
public static function slash(string ...$sections) { $count = count($sections); // If we only got a single section, return it. if (1 === $count) { return $sections[0]; } // Somehow we got NO sections, so return null. elseif (0 >= $count || empty($sections)) { ...
[ "public", "static", "function", "slash", "(", "string", "...", "$", "sections", ")", "{", "$", "count", "=", "count", "(", "$", "sections", ")", ";", "// If we only got a single section, return it.", "if", "(", "1", "===", "$", "count", ")", "{", "return", ...
Combine strings with a directory separator. Accepts any number of strings. This is purely string manipulation: Although this function will likely be used for paths, it does no path validation of any sort. @param string[] ...$sections All strings you wish to concatenate. @return string
[ "Combine", "strings", "with", "a", "directory", "separator", "." ]
210d098fa9cc7f261d68402667763497cba1fba0
https://github.com/zenodorus-tools/filesystem/blob/210d098fa9cc7f261d68402667763497cba1fba0/src/Filesystem.php#L16-L48
198,373
zenodorus-tools/filesystem
src/Filesystem.php
Filesystem.resolve
public static function resolve(string $path, bool $absolute = false) { $path = static::normalize($path); if (strpos($path, DIRECTORY_SEPARATOR) === 0) { // This was an absolute string, so keep it that way. $absolute = true; } /** @noinspection SpellCheckingIns...
php
public static function resolve(string $path, bool $absolute = false) { $path = static::normalize($path); if (strpos($path, DIRECTORY_SEPARATOR) === 0) { // This was an absolute string, so keep it that way. $absolute = true; } /** @noinspection SpellCheckingIns...
[ "public", "static", "function", "resolve", "(", "string", "$", "path", ",", "bool", "$", "absolute", "=", "false", ")", "{", "$", "path", "=", "static", "::", "normalize", "(", "$", "path", ")", ";", "if", "(", "strpos", "(", "$", "path", ",", "DIR...
Naively resolve paths. This attempts to discern the correct directory path from something that contains relative indicators (i.e. `../`). It does not touch the actual filesystem, so do not assume that these paths are accurate, or that they even exist. Notably, this means that you can use this to deal with symlinks (S...
[ "Naively", "resolve", "paths", "." ]
210d098fa9cc7f261d68402667763497cba1fba0
https://github.com/zenodorus-tools/filesystem/blob/210d098fa9cc7f261d68402667763497cba1fba0/src/Filesystem.php#L94-L121
198,374
zenodorus-tools/filesystem
src/Filesystem.php
Filesystem.resolveReal
public static function resolveReal(string $path, string $workingDir = null) { if (null === $workingDir /** * Path includes full (absolute) path, which doesn't need * working directory. */ && file_exists($real = Filesystem::resolve($path))) { return ...
php
public static function resolveReal(string $path, string $workingDir = null) { if (null === $workingDir /** * Path includes full (absolute) path, which doesn't need * working directory. */ && file_exists($real = Filesystem::resolve($path))) { return ...
[ "public", "static", "function", "resolveReal", "(", "string", "$", "path", ",", "string", "$", "workingDir", "=", "null", ")", "{", "if", "(", "null", "===", "$", "workingDir", "/**\n * Path includes full (absolute) path, which doesn't need\n * working dir...
Resolve paths to real locations. A wrapper for `Filesystem::resolve()` that returns real paths. It will fully evaluate symbolic links, so they will return their targets. If a directory/file does not exist, this method returns `null`. In certain situations, this may return `null` for files that are, technically acces...
[ "Resolve", "paths", "to", "real", "locations", "." ]
210d098fa9cc7f261d68402667763497cba1fba0
https://github.com/zenodorus-tools/filesystem/blob/210d098fa9cc7f261d68402667763497cba1fba0/src/Filesystem.php#L142-L161
198,375
zenodorus-tools/filesystem
src/Filesystem.php
Filesystem.recursiveRemove
public static function recursiveRemove(string $dir, bool $complete = true) { $di = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS); $ri = new \RecursiveIteratorIterator($di, \RecursiveIteratorIterator::CHILD_FIRST); foreach ($ri as $file) { $file->isDir() ? ...
php
public static function recursiveRemove(string $dir, bool $complete = true) { $di = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS); $ri = new \RecursiveIteratorIterator($di, \RecursiveIteratorIterator::CHILD_FIRST); foreach ($ri as $file) { $file->isDir() ? ...
[ "public", "static", "function", "recursiveRemove", "(", "string", "$", "dir", ",", "bool", "$", "complete", "=", "true", ")", "{", "$", "di", "=", "new", "\\", "RecursiveDirectoryIterator", "(", "$", "dir", ",", "\\", "FilesystemIterator", "::", "SKIP_DOTS",...
Removes all files and directories in a directory. BE CAREFUL! By default, this includes directory specified in `$dir`. Pass `false` to the second argument to disable this behavior and leave `$dir` in place. @see https://stackoverflow.com/a/24563703 @param string $dir @param boolean $complete @return boolean
[ "Removes", "all", "files", "and", "directories", "in", "a", "directory", ".", "BE", "CAREFUL!" ]
210d098fa9cc7f261d68402667763497cba1fba0
https://github.com/zenodorus-tools/filesystem/blob/210d098fa9cc7f261d68402667763497cba1fba0/src/Filesystem.php#L175-L186
198,376
spyrit/PropelDatagridBundle
Datagrid/PropelDatagrid.php
PropelDatagrid.getPaginationPath
public function getPaginationPath($route, $page, $extraParams = array()) { $params = array( $this->getActionParameterName() => $this->getPageActionParameterName(), $this->getDatagridParameterName() => $this->getName(), $this->getPageParameterName() => $page, ); ...
php
public function getPaginationPath($route, $page, $extraParams = array()) { $params = array( $this->getActionParameterName() => $this->getPageActionParameterName(), $this->getDatagridParameterName() => $this->getName(), $this->getPageParameterName() => $page, ); ...
[ "public", "function", "getPaginationPath", "(", "$", "route", ",", "$", "page", ",", "$", "extraParams", "=", "array", "(", ")", ")", "{", "$", "params", "=", "array", "(", "$", "this", "->", "getActionParameterName", "(", ")", "=>", "$", "this", "->",...
Generate pagination route @param type $route @param type $extraParams @return type
[ "Generate", "pagination", "route" ]
2c12ad90e8e6f44dc106a4512225c1ec68871076
https://github.com/spyrit/PropelDatagridBundle/blob/2c12ad90e8e6f44dc106a4512225c1ec68871076/Datagrid/PropelDatagrid.php#L462-L470
198,377
spyrit/PropelDatagridBundle
Datagrid/PropelDatagrid.php
PropelDatagrid.getResetPath
public function getResetPath($route, $extraParams = array()) { $params = array( $this->getActionParameterName() => $this->getResetActionParameterName(), $this->getDatagridParameterName() => $this->getName(), ); return $this->container->get('router')->generate($route, ...
php
public function getResetPath($route, $extraParams = array()) { $params = array( $this->getActionParameterName() => $this->getResetActionParameterName(), $this->getDatagridParameterName() => $this->getName(), ); return $this->container->get('router')->generate($route, ...
[ "public", "function", "getResetPath", "(", "$", "route", ",", "$", "extraParams", "=", "array", "(", ")", ")", "{", "$", "params", "=", "array", "(", "$", "this", "->", "getActionParameterName", "(", ")", "=>", "$", "this", "->", "getResetActionParameterNa...
Generate reset route for the button view @param type $route @param type $extraParams @return type
[ "Generate", "reset", "route", "for", "the", "button", "view" ]
2c12ad90e8e6f44dc106a4512225c1ec68871076
https://github.com/spyrit/PropelDatagridBundle/blob/2c12ad90e8e6f44dc106a4512225c1ec68871076/Datagrid/PropelDatagrid.php#L478-L485
198,378
spyrit/PropelDatagridBundle
Datagrid/PropelDatagrid.php
PropelDatagrid.getSortPath
public function getSortPath($route, $column, $order, $extraParams = array()) { $params = array( $this->getActionParameterName() => $this->getSortActionParameterName(), $this->getDatagridParameterName() => $this->getName(), $this->getSortColumnParameterName() => $column, ...
php
public function getSortPath($route, $column, $order, $extraParams = array()) { $params = array( $this->getActionParameterName() => $this->getSortActionParameterName(), $this->getDatagridParameterName() => $this->getName(), $this->getSortColumnParameterName() => $column, ...
[ "public", "function", "getSortPath", "(", "$", "route", ",", "$", "column", ",", "$", "order", ",", "$", "extraParams", "=", "array", "(", ")", ")", "{", "$", "params", "=", "array", "(", "$", "this", "->", "getActionParameterName", "(", ")", "=>", "...
Generate sorting route for a given column to be displayed in view @todo Remove the order parameter and ask to the datagrid to guess it ? @param type $route @param type $column @param type $order @param type $extraParams @return type
[ "Generate", "sorting", "route", "for", "a", "given", "column", "to", "be", "displayed", "in", "view" ]
2c12ad90e8e6f44dc106a4512225c1ec68871076
https://github.com/spyrit/PropelDatagridBundle/blob/2c12ad90e8e6f44dc106a4512225c1ec68871076/Datagrid/PropelDatagrid.php#L496-L505
198,379
shrink0r/php-schema
src/Property/ScalarProperty.php
ScalarProperty.validate
public function validate($value) { return is_scalar($value) ? Ok::unit() : Error::unit([ Error::NON_SCALAR ]); }
php
public function validate($value) { return is_scalar($value) ? Ok::unit() : Error::unit([ Error::NON_SCALAR ]); }
[ "public", "function", "validate", "(", "$", "value", ")", "{", "return", "is_scalar", "(", "$", "value", ")", "?", "Ok", "::", "unit", "(", ")", ":", "Error", "::", "unit", "(", "[", "Error", "::", "NON_SCALAR", "]", ")", ";", "}" ]
Tells if a given value is a valid scalar. @param mixed $value @return ResultInterface Returns Ok if the value is valid, otherwise an Error is returned.
[ "Tells", "if", "a", "given", "value", "is", "a", "valid", "scalar", "." ]
94293fe897af376dd9d05962e2c516079409dd29
https://github.com/shrink0r/php-schema/blob/94293fe897af376dd9d05962e2c516079409dd29/src/Property/ScalarProperty.php#L18-L21
198,380
OxfordInfoLabs/kinikit-core
src/Validation/FieldValidators/LengthFieldValidator.php
LengthFieldValidator.validateObjectFieldValue
public function validateObjectFieldValue($value, $fieldName, $targetObject, &$validatorParams, $validatorKey) { if (sizeof($validatorParams) < ($this->mode == self::MODE_RANGE ? 2 : 1)) { throw new MisconfiguredValidatorException($validatorKey, $fieldName, $targetObject); } if (!$v...
php
public function validateObjectFieldValue($value, $fieldName, $targetObject, &$validatorParams, $validatorKey) { if (sizeof($validatorParams) < ($this->mode == self::MODE_RANGE ? 2 : 1)) { throw new MisconfiguredValidatorException($validatorKey, $fieldName, $targetObject); } if (!$v...
[ "public", "function", "validateObjectFieldValue", "(", "$", "value", ",", "$", "fieldName", ",", "$", "targetObject", ",", "&", "$", "validatorParams", ",", "$", "validatorKey", ")", "{", "if", "(", "sizeof", "(", "$", "validatorParams", ")", "<", "(", "$"...
Validate a range object @param string $value @param $fieldName @param SerialisableObject $targetObject @param array $validatorParams @param $validatorKey @return bool|mixed @throws MisconfiguredValidatorException
[ "Validate", "a", "range", "object" ]
edc1b2e6ffabd595c4c7d322279b3dd1e59ef359
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Validation/FieldValidators/LengthFieldValidator.php#L39-L56
198,381
jbouzekri/SculpinTagCloudBundle
Component/Manager/TagCloudManager.php
TagCloudManager.applyStrategies
protected function applyStrategies(\Jb\Bundle\TagCloudBundle\Model\TagCloud $tagCloud) { foreach ($this->strategies as $strategy) { $strategy->process($tagCloud); } }
php
protected function applyStrategies(\Jb\Bundle\TagCloudBundle\Model\TagCloud $tagCloud) { foreach ($this->strategies as $strategy) { $strategy->process($tagCloud); } }
[ "protected", "function", "applyStrategies", "(", "\\", "Jb", "\\", "Bundle", "\\", "TagCloudBundle", "\\", "Model", "\\", "TagCloud", "$", "tagCloud", ")", "{", "foreach", "(", "$", "this", "->", "strategies", "as", "$", "strategy", ")", "{", "$", "strateg...
Apply all registered strategies @param \Jb\Bundle\TagCloudBundle\Model\TagCloud $tagCloud
[ "Apply", "all", "registered", "strategies" ]
936cf34ce60cb8fb4774931b1841fc775a3e9208
https://github.com/jbouzekri/SculpinTagCloudBundle/blob/936cf34ce60cb8fb4774931b1841fc775a3e9208/Component/Manager/TagCloudManager.php#L107-L112
198,382
Th3Mouk/CMSPageBundle
Migration/BlocksMigration.php
BlocksMigration.migrateCkeditorBlocks
public function migrateCkeditorBlocks() { $legacyBlocks = $this->getLegacyCkeditorBlocks(); foreach ($legacyBlocks as $legacyBlock) { $legacyBlock->setType('cms.block.ckeditor'); $settings = $legacyBlock->getSettings(); if (isset($settings['contenu'])) { ...
php
public function migrateCkeditorBlocks() { $legacyBlocks = $this->getLegacyCkeditorBlocks(); foreach ($legacyBlocks as $legacyBlock) { $legacyBlock->setType('cms.block.ckeditor'); $settings = $legacyBlock->getSettings(); if (isset($settings['contenu'])) { ...
[ "public", "function", "migrateCkeditorBlocks", "(", ")", "{", "$", "legacyBlocks", "=", "$", "this", "->", "getLegacyCkeditorBlocks", "(", ")", ";", "foreach", "(", "$", "legacyBlocks", "as", "$", "legacyBlock", ")", "{", "$", "legacyBlock", "->", "setType", ...
Function of migration of included blocks.
[ "Function", "of", "migration", "of", "included", "blocks", "." ]
c78667ae6969f5947263dcde625e0541f9064774
https://github.com/Th3Mouk/CMSPageBundle/blob/c78667ae6969f5947263dcde625e0541f9064774/Migration/BlocksMigration.php#L34-L52
198,383
Facebook-Anonymous-Publisher/shortener
src/Drivers/Hashids.php
Hashids.exists
protected function exists($url) { $shortener = Shortener::where('hash', hash('sha512', $url))->first(); if (is_null($shortener)) { return false; } return route('shortener.show', [ 'url' => $this->hashids->encode($shortener->getKey()), ]); }
php
protected function exists($url) { $shortener = Shortener::where('hash', hash('sha512', $url))->first(); if (is_null($shortener)) { return false; } return route('shortener.show', [ 'url' => $this->hashids->encode($shortener->getKey()), ]); }
[ "protected", "function", "exists", "(", "$", "url", ")", "{", "$", "shortener", "=", "Shortener", "::", "where", "(", "'hash'", ",", "hash", "(", "'sha512'", ",", "$", "url", ")", ")", "->", "first", "(", ")", ";", "if", "(", "is_null", "(", "$", ...
Returns shorten url if exists, or false. @param $url @return string
[ "Returns", "shorten", "url", "if", "exists", "or", "false", "." ]
3b2e49d9cdd96758d35cf57a7a27659d2b6682aa
https://github.com/Facebook-Anonymous-Publisher/shortener/blob/3b2e49d9cdd96758d35cf57a7a27659d2b6682aa/src/Drivers/Hashids.php#L53-L64
198,384
Facebook-Anonymous-Publisher/shortener
src/Drivers/Hashids.php
Hashids.decode
public function decode($short) { $ids = $this->hashids->decode($short); if (empty($ids)) { throw new \InvalidArgumentException; } return Shortener::findOrFail(reset($ids))->getAttribute('url'); }
php
public function decode($short) { $ids = $this->hashids->decode($short); if (empty($ids)) { throw new \InvalidArgumentException; } return Shortener::findOrFail(reset($ids))->getAttribute('url'); }
[ "public", "function", "decode", "(", "$", "short", ")", "{", "$", "ids", "=", "$", "this", "->", "hashids", "->", "decode", "(", "$", "short", ")", ";", "if", "(", "empty", "(", "$", "ids", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentExcep...
Get the origin url. @param string $short @return string
[ "Get", "the", "origin", "url", "." ]
3b2e49d9cdd96758d35cf57a7a27659d2b6682aa
https://github.com/Facebook-Anonymous-Publisher/shortener/blob/3b2e49d9cdd96758d35cf57a7a27659d2b6682aa/src/Drivers/Hashids.php#L73-L82
198,385
ARCANESOFT/SEO
src/Helpers/SeoChecker.php
SeoChecker.label
public static function label($status) { $statuses = [ SeoChecker::STATUS_DANGER => 'danger', SeoChecker::STATUS_GOOD => 'success', SeoChecker::STATUS_WARNING => 'warning', ]; return Arr::get($statuses, $status, 'default'); }
php
public static function label($status) { $statuses = [ SeoChecker::STATUS_DANGER => 'danger', SeoChecker::STATUS_GOOD => 'success', SeoChecker::STATUS_WARNING => 'warning', ]; return Arr::get($statuses, $status, 'default'); }
[ "public", "static", "function", "label", "(", "$", "status", ")", "{", "$", "statuses", "=", "[", "SeoChecker", "::", "STATUS_DANGER", "=>", "'danger'", ",", "SeoChecker", "::", "STATUS_GOOD", "=>", "'success'", ",", "SeoChecker", "::", "STATUS_WARNING", "=>",...
Get the label class for the given status. @param string $status @return string
[ "Get", "the", "label", "class", "for", "the", "given", "status", "." ]
ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2
https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Helpers/SeoChecker.php#L61-L70
198,386
ARCANESOFT/SEO
src/Helpers/SeoChecker.php
SeoChecker.check
protected static function check($value, $min, $max) { $length = strlen($value); if ($length < $min) return self::STATUS_WARNING; if ($min <= $length && $length <= $max) return self::STATUS_GOOD; return self::STATUS_DANGER; }
php
protected static function check($value, $min, $max) { $length = strlen($value); if ($length < $min) return self::STATUS_WARNING; if ($min <= $length && $length <= $max) return self::STATUS_GOOD; return self::STATUS_DANGER; }
[ "protected", "static", "function", "check", "(", "$", "value", ",", "$", "min", ",", "$", "max", ")", "{", "$", "length", "=", "strlen", "(", "$", "value", ")", ";", "if", "(", "$", "length", "<", "$", "min", ")", "return", "self", "::", "STATUS_...
Check the value with min & max length. @param string $value @param int $min @param int $max @return string
[ "Check", "the", "value", "with", "min", "&", "max", "length", "." ]
ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2
https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Helpers/SeoChecker.php#L86-L97
198,387
PatrolServer/patrolsdk-php
lib/Server.php
Server.save
public function save() { if ($this->id) { throw new Exception('Can\'t save this server because it is already stored'); } $server = $this->_post('servers', $this->dirty_values); $this->mergeValues($server); }
php
public function save() { if ($this->id) { throw new Exception('Can\'t save this server because it is already stored'); } $server = $this->_post('servers', $this->dirty_values); $this->mergeValues($server); }
[ "public", "function", "save", "(", ")", "{", "if", "(", "$", "this", "->", "id", ")", "{", "throw", "new", "Exception", "(", "'Can\\'t save this server because it is already stored'", ")", ";", "}", "$", "server", "=", "$", "this", "->", "_post", "(", "'se...
Saves a server
[ "Saves", "a", "server" ]
2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2
https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/Server.php#L41-L48
198,388
PatrolServer/patrolsdk-php
lib/Server.php
Server.verify
public function verify($token = null) { if (!$token) { $data = $this->requestVerificationToken(); $token = $data['token']; } return $this->_post('servers/' . $this->id . '/verify', ['token' => $token]); }
php
public function verify($token = null) { if (!$token) { $data = $this->requestVerificationToken(); $token = $data['token']; } return $this->_post('servers/' . $this->id . '/verify', ['token' => $token]); }
[ "public", "function", "verify", "(", "$", "token", "=", "null", ")", "{", "if", "(", "!", "$", "token", ")", "{", "$", "data", "=", "$", "this", "->", "requestVerificationToken", "(", ")", ";", "$", "token", "=", "$", "data", "[", "'token'", "]", ...
Verifies the server with the verification token
[ "Verifies", "the", "server", "with", "the", "verification", "token" ]
2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2
https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/Server.php#L64-L71
198,389
PatrolServer/patrolsdk-php
lib/Server.php
Server.allSoftware
public function allSoftware($scopes = []) { if (!$this->id) { throw new Exception("The server has no ID, can\'t get software"); } $software = new Software($this->patrol); $software->defaults([ 'server_id' => $this->id ]); return $software->all($...
php
public function allSoftware($scopes = []) { if (!$this->id) { throw new Exception("The server has no ID, can\'t get software"); } $software = new Software($this->patrol); $software->defaults([ 'server_id' => $this->id ]); return $software->all($...
[ "public", "function", "allSoftware", "(", "$", "scopes", "=", "[", "]", ")", "{", "if", "(", "!", "$", "this", "->", "id", ")", "{", "throw", "new", "Exception", "(", "\"The server has no ID, can\\'t get software\"", ")", ";", "}", "$", "software", "=", ...
Gets all installed software from this server @param array $scopes optional @return array List of PatrolSdk\Software
[ "Gets", "all", "installed", "software", "from", "this", "server" ]
2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2
https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/Server.php#L92-L104
198,390
PatrolServer/patrolsdk-php
lib/Server.php
Server.software
public function software($id, $scopes = []) { if (!$this->id) { throw new Exception("The server has no ID, can\'t get software"); } $software = new Software($this->patrol); $software->defaults([ 'server_id' => $this->id ]); return $software->fin...
php
public function software($id, $scopes = []) { if (!$this->id) { throw new Exception("The server has no ID, can\'t get software"); } $software = new Software($this->patrol); $software->defaults([ 'server_id' => $this->id ]); return $software->fin...
[ "public", "function", "software", "(", "$", "id", ",", "$", "scopes", "=", "[", "]", ")", "{", "if", "(", "!", "$", "this", "->", "id", ")", "{", "throw", "new", "Exception", "(", "\"The server has no ID, can\\'t get software\"", ")", ";", "}", "$", "s...
Gets a single installed software from this server @param integer $id @param array $scopes optional @return Software
[ "Gets", "a", "single", "installed", "software", "from", "this", "server" ]
2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2
https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/Server.php#L114-L126
198,391
PatrolServer/patrolsdk-php
lib/Server.php
Server.buckets
public function buckets() { if (!$this->id) { throw new Exception("The server has no ID, can\'t get buckets"); } $bucket = new Bucket($this->patrol); $bucket->defaults([ 'server_id' => $this->id ]); return $bucket->all(); }
php
public function buckets() { if (!$this->id) { throw new Exception("The server has no ID, can\'t get buckets"); } $bucket = new Bucket($this->patrol); $bucket->defaults([ 'server_id' => $this->id ]); return $bucket->all(); }
[ "public", "function", "buckets", "(", ")", "{", "if", "(", "!", "$", "this", "->", "id", ")", "{", "throw", "new", "Exception", "(", "\"The server has no ID, can\\'t get buckets\"", ")", ";", "}", "$", "bucket", "=", "new", "Bucket", "(", "$", "this", "-...
Gets all software buckets from this server @return array List of PatrolSdk\Bucket
[ "Gets", "all", "software", "buckets", "from", "this", "server" ]
2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2
https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/Server.php#L133-L145
198,392
PatrolServer/patrolsdk-php
lib/Server.php
Server.bucket
public function bucket($key = null) { if (!$this->id) { throw new Exception("The server has no ID, can\'t get buckets"); } $bucket = new Bucket($this->patrol); $bucket->defaults([ 'server_id' => $this->id ]); if (is_null($key)) { ret...
php
public function bucket($key = null) { if (!$this->id) { throw new Exception("The server has no ID, can\'t get buckets"); } $bucket = new Bucket($this->patrol); $bucket->defaults([ 'server_id' => $this->id ]); if (is_null($key)) { ret...
[ "public", "function", "bucket", "(", "$", "key", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "id", ")", "{", "throw", "new", "Exception", "(", "\"The server has no ID, can\\'t get buckets\"", ")", ";", "}", "$", "bucket", "=", "new", "Bucke...
Gets a single software bucket If no key is set, an empty Bucket object will be returned which will act as a repository @param string $key optional @return Bucket
[ "Gets", "a", "single", "software", "bucket", "If", "no", "key", "is", "set", "an", "empty", "Bucket", "object", "will", "be", "returned", "which", "will", "act", "as", "a", "repository" ]
2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2
https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/Server.php#L155-L180
198,393
UWEnrollmentManagement/Secure-Upload
src/Cipher.php
Cipher.cleanFilename
public static function cleanFilename($filename) { return preg_replace( '/[^A-Za-z0-9_\-]/', '_', htmlentities(pathinfo($filename, PATHINFO_FILENAME)) ) . '.' . preg_replace( '/[^A-Za-z0-9_\-]/', '_', htmlentities(pathinfo($filen...
php
public static function cleanFilename($filename) { return preg_replace( '/[^A-Za-z0-9_\-]/', '_', htmlentities(pathinfo($filename, PATHINFO_FILENAME)) ) . '.' . preg_replace( '/[^A-Za-z0-9_\-]/', '_', htmlentities(pathinfo($filen...
[ "public", "static", "function", "cleanFilename", "(", "$", "filename", ")", "{", "return", "preg_replace", "(", "'/[^A-Za-z0-9_\\-]/'", ",", "'_'", ",", "htmlentities", "(", "pathinfo", "(", "$", "filename", ",", "PATHINFO_FILENAME", ")", ")", ")", ".", "'.'",...
White list scrub of file name. @param string $filename A filename to be cleaned of potentially troublesome characters. @return string
[ "White", "list", "scrub", "of", "file", "name", "." ]
153e1f59224d9311585be464e22bd53ed7e1fb01
https://github.com/UWEnrollmentManagement/Secure-Upload/blob/153e1f59224d9311585be464e22bd53ed7e1fb01/src/Cipher.php#L19-L30
198,394
UWEnrollmentManagement/Secure-Upload
src/Cipher.php
Cipher.encrypt
public static function encrypt($name, $location, $destination, $publicKeyLocation) { /** @var resource $publicKey */ $publicKey = openssl_get_publickey(file_get_contents($publicKeyLocation)); /** @var string $data */ $data = file_get_contents($location); /** @var string $inf...
php
public static function encrypt($name, $location, $destination, $publicKeyLocation) { /** @var resource $publicKey */ $publicKey = openssl_get_publickey(file_get_contents($publicKeyLocation)); /** @var string $data */ $data = file_get_contents($location); /** @var string $inf...
[ "public", "static", "function", "encrypt", "(", "$", "name", ",", "$", "location", ",", "$", "destination", ",", "$", "publicKeyLocation", ")", "{", "/** @var resource $publicKey */", "$", "publicKey", "=", "openssl_get_publickey", "(", "file_get_contents", "(", "...
Encrypt a specified file. @param string $name The name that the file shall have when it's decrypted. @param string $location The current location of the file. @param string $destination The folder into which you wish to encrypt the file. @param string $publicKeyLocation The location of the ...
[ "Encrypt", "a", "specified", "file", "." ]
153e1f59224d9311585be464e22bd53ed7e1fb01
https://github.com/UWEnrollmentManagement/Secure-Upload/blob/153e1f59224d9311585be464e22bd53ed7e1fb01/src/Cipher.php#L41-L66
198,395
Panigale/laravel5-Points
src/Traits/GetPointEvent.php
GetPointEvent.getPointEvent
public function getPointEvent($typeId = null) { $this->buildQuery(); $query = $this->eventQuery; if(! is_null($typeId)){ $query->where('point_event_type_id' ,$typeId); } return $this->doQuery(); }
php
public function getPointEvent($typeId = null) { $this->buildQuery(); $query = $this->eventQuery; if(! is_null($typeId)){ $query->where('point_event_type_id' ,$typeId); } return $this->doQuery(); }
[ "public", "function", "getPointEvent", "(", "$", "typeId", "=", "null", ")", "{", "$", "this", "->", "buildQuery", "(", ")", ";", "$", "query", "=", "$", "this", "->", "eventQuery", ";", "if", "(", "!", "is_null", "(", "$", "typeId", ")", ")", "{",...
get user point event @return \Illuminate\Database\Eloquent\Collection|static[]
[ "get", "user", "point", "event" ]
6fb559d91694a336f5a11d8408348a85395b4ff3
https://github.com/Panigale/laravel5-Points/blob/6fb559d91694a336f5a11d8408348a85395b4ff3/src/Traits/GetPointEvent.php#L40-L50
198,396
Panigale/laravel5-Points
src/Traits/GetPointEvent.php
GetPointEvent.getPointEventByType
public function getPointEventByType($isIncrease = true) { $query = PointEventType::select('id'); $isIncrease ? $query->where('is_increase' ,$isIncrease) : $query->where('is_deduction'); $eventType = $query->get(); $this->eventQuery = PointEvent::with('activities') ->whe...
php
public function getPointEventByType($isIncrease = true) { $query = PointEventType::select('id'); $isIncrease ? $query->where('is_increase' ,$isIncrease) : $query->where('is_deduction'); $eventType = $query->get(); $this->eventQuery = PointEvent::with('activities') ->whe...
[ "public", "function", "getPointEventByType", "(", "$", "isIncrease", "=", "true", ")", "{", "$", "query", "=", "PointEventType", "::", "select", "(", "'id'", ")", ";", "$", "isIncrease", "?", "$", "query", "->", "where", "(", "'is_increase'", ",", "$", "...
get point event by type @param bool $isIncrease @return \Illuminate\Database\Eloquent\Collection|static[]
[ "get", "point", "event", "by", "type" ]
6fb559d91694a336f5a11d8408348a85395b4ff3
https://github.com/Panigale/laravel5-Points/blob/6fb559d91694a336f5a11d8408348a85395b4ff3/src/Traits/GetPointEvent.php#L58-L69
198,397
erenmustafaozdal/laravel-modules-base
src/Validators/BaseValidator.php
BaseValidator.validateElfinder
public function validateElfinder($attribute, $value, $parameters, $validator) { if( ! File::exists($value) ) { return false; } if(count($parameters)>0) { return in_array( File::extension($value),$parameters ); } return true; }
php
public function validateElfinder($attribute, $value, $parameters, $validator) { if( ! File::exists($value) ) { return false; } if(count($parameters)>0) { return in_array( File::extension($value),$parameters ); } return true; }
[ "public", "function", "validateElfinder", "(", "$", "attribute", ",", "$", "value", ",", "$", "parameters", ",", "$", "validator", ")", "{", "if", "(", "!", "File", "::", "exists", "(", "$", "value", ")", ")", "{", "return", "false", ";", "}", "if", ...
validator elfinder file @param $attribute @param $value @param $parameters @param $validator @return bool
[ "validator", "elfinder", "file" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Validators/BaseValidator.php#L19-L30
198,398
erenmustafaozdal/laravel-modules-base
src/Validators/BaseValidator.php
BaseValidator.validateElfinderMax
public function validateElfinderMax($attribute, $value, $parameters, $validator) { $size = $parameters[0] * 1024; // parameters kB to B if ( File::size($value) > $size ) { return false; } return true; }
php
public function validateElfinderMax($attribute, $value, $parameters, $validator) { $size = $parameters[0] * 1024; // parameters kB to B if ( File::size($value) > $size ) { return false; } return true; }
[ "public", "function", "validateElfinderMax", "(", "$", "attribute", ",", "$", "value", ",", "$", "parameters", ",", "$", "validator", ")", "{", "$", "size", "=", "$", "parameters", "[", "0", "]", "*", "1024", ";", "// parameters kB to B\r", "if", "(", "F...
validator elfinder max size file @param $attribute @param $value @param $parameters @param $validator @return bool
[ "validator", "elfinder", "max", "size", "file" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Validators/BaseValidator.php#L41-L48
198,399
erenmustafaozdal/laravel-modules-base
src/Validators/BaseValidator.php
BaseValidator.validateVideoLink
public function validateVideoLink($attribute, $value, $parameters, $validator) { return preg_match($this->youtubeRegex, $value) || preg_match($this->vimeoRegex, $value); }
php
public function validateVideoLink($attribute, $value, $parameters, $validator) { return preg_match($this->youtubeRegex, $value) || preg_match($this->vimeoRegex, $value); }
[ "public", "function", "validateVideoLink", "(", "$", "attribute", ",", "$", "value", ",", "$", "parameters", ",", "$", "validator", ")", "{", "return", "preg_match", "(", "$", "this", "->", "youtubeRegex", ",", "$", "value", ")", "||", "preg_match", "(", ...
validator youtube link @param $attribute @param $value @param $parameters @param $validator @param $validator @return bool
[ "validator", "youtube", "link" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Validators/BaseValidator.php#L104-L107