repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
axelitus/php-base
src/Str.php
Str.nsprintf
public static function nsprintf($format, array $args = []) { // Filter unnamed %s strings that should not be processed $filterRegex = '/%s/'; $format = preg_replace($filterRegex, '#[:~s]#', $format); // The pattern to match variables $pattern = '/(?<=%)([a-zA-Z0-9_]\w*)(?=\$...
php
public static function nsprintf($format, array $args = []) { // Filter unnamed %s strings that should not be processed $filterRegex = '/%s/'; $format = preg_replace($filterRegex, '#[:~s]#', $format); // The pattern to match variables $pattern = '/(?<=%)([a-zA-Z0-9_]\w*)(?=\$...
[ "public", "static", "function", "nsprintf", "(", "$", "format", ",", "array", "$", "args", "=", "[", "]", ")", "{", "// Filter unnamed %s strings that should not be processed", "$", "filterRegex", "=", "'/%s/'", ";", "$", "format", "=", "preg_replace", "(", "$",...
Function sprintf for named variables inside format. Args are only used if found in the format. Predefined tags (which can be overwritten passing them as args): %cr$s -> \r %lf$s -> \n %crlf$s -> \r\n %tab$s -> \t This method is based on the work of Nate Bessette (www.twitter.com/frickenate) @param string $format The...
[ "Function", "sprintf", "for", "named", "variables", "inside", "format", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L872-L904
ryanwachtl/silverstripe-foundation-forms
code/forms/FoundationSwitchField.php
FoundationSwitchField.getSource
public function getSource() { if (is_array($this->source)) { if (count($this->source) != 2) { user_error('FoundationSwitchField::getSource(): accepts only 2 options', E_USER_ERROR); } return array_slice($this->source, 0, 2); } }
php
public function getSource() { if (is_array($this->source)) { if (count($this->source) != 2) { user_error('FoundationSwitchField::getSource(): accepts only 2 options', E_USER_ERROR); } return array_slice($this->source, 0, 2); } }
[ "public", "function", "getSource", "(", ")", "{", "if", "(", "is_array", "(", "$", "this", "->", "source", ")", ")", "{", "if", "(", "count", "(", "$", "this", "->", "source", ")", "!=", "2", ")", "{", "user_error", "(", "'FoundationSwitchField::getSou...
Gets the first two items from source array, since SwitchField only works with two values. @return array
[ "Gets", "the", "first", "two", "items", "from", "source", "array", "since", "SwitchField", "only", "works", "with", "two", "values", "." ]
train
https://github.com/ryanwachtl/silverstripe-foundation-forms/blob/9055449fcb895811187124d81e57b7c93948403f/code/forms/FoundationSwitchField.php#L26-L33
gintonicweb/GintonicCMS
src/Shell/GintonicShell.php
GintonicShell.install
public function install() { $connections = ConnectionManager::configured(); if (empty($connections)) { $this->out('Your database configuration was not found.'); $this->out('Add your database connection information to config/app.php.'); return false; } ...
php
public function install() { $connections = ConnectionManager::configured(); if (empty($connections)) { $this->out('Your database configuration was not found.'); $this->out('Add your database connection information to config/app.php.'); return false; } ...
[ "public", "function", "install", "(", ")", "{", "$", "connections", "=", "ConnectionManager", "::", "configured", "(", ")", ";", "if", "(", "empty", "(", "$", "connections", ")", ")", "{", "$", "this", "->", "out", "(", "'Your database configuration was not ...
main() method. @return bool|int Success or error code.
[ "main", "()", "method", "." ]
train
https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Shell/GintonicShell.php#L21-L35
gintonicweb/GintonicCMS
src/Shell/GintonicShell.php
GintonicShell.cleanup
public function cleanup() { Cache::clear(false, 'default'); Cache::clear(false, '_cake_model_'); Cache::clear(false, '_cake_core_'); $this->dispatchShell('orm_cache clear'); $this->dispatchShell('orm_cache build'); }
php
public function cleanup() { Cache::clear(false, 'default'); Cache::clear(false, '_cake_model_'); Cache::clear(false, '_cake_core_'); $this->dispatchShell('orm_cache clear'); $this->dispatchShell('orm_cache build'); }
[ "public", "function", "cleanup", "(", ")", "{", "Cache", "::", "clear", "(", "false", ",", "'default'", ")", ";", "Cache", "::", "clear", "(", "false", ",", "'_cake_model_'", ")", ";", "Cache", "::", "clear", "(", "false", ",", "'_cake_core_'", ")", ";...
Clears the cache @return void
[ "Clears", "the", "cache" ]
train
https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Shell/GintonicShell.php#L42-L49
gintonicweb/GintonicCMS
src/Shell/GintonicShell.php
GintonicShell.migrate
public function migrate($plugin = null) { $plugin = ($plugin === null)? '' : ' -p ' . $plugin; $this->dispatchShell('migrations migrate' . $plugin); }
php
public function migrate($plugin = null) { $plugin = ($plugin === null)? '' : ' -p ' . $plugin; $this->dispatchShell('migrations migrate' . $plugin); }
[ "public", "function", "migrate", "(", "$", "plugin", "=", "null", ")", "{", "$", "plugin", "=", "(", "$", "plugin", "===", "null", ")", "?", "''", ":", "' -p '", ".", "$", "plugin", ";", "$", "this", "->", "dispatchShell", "(", "'migrations migrate'", ...
Run the migration, optionally for a plugin @param string $plugin Plugin name (optional) @return void
[ "Run", "the", "migration", "optionally", "for", "a", "plugin" ]
train
https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Shell/GintonicShell.php#L57-L61
faustbrian/Laravel-Countries
src/Console/Commands/SeedCountries.php
SeedCountries.handle
public function handle() { $model = $this->getModel(); $data = base_path('vendor/mledoze/countries/dist/countries.json'); $data = json_decode(file_get_contents($data), true); foreach ($data as $country) { $model->create($country); } $this->getOutput()->...
php
public function handle() { $model = $this->getModel(); $data = base_path('vendor/mledoze/countries/dist/countries.json'); $data = json_decode(file_get_contents($data), true); foreach ($data as $country) { $model->create($country); } $this->getOutput()->...
[ "public", "function", "handle", "(", ")", "{", "$", "model", "=", "$", "this", "->", "getModel", "(", ")", ";", "$", "data", "=", "base_path", "(", "'vendor/mledoze/countries/dist/countries.json'", ")", ";", "$", "data", "=", "json_decode", "(", "file_get_co...
Execute the console command. @return mixed
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/faustbrian/Laravel-Countries/blob/3d72301acd37e7f351d9b991dba41807ab68362b/src/Console/Commands/SeedCountries.php#L40-L52
mayoturis/properties-ini
src/FileSaver.php
FileSaver.save
public function save($fileName, $values, $map = null) { if ($map !== null) { $output = $this->createOutputWithMap($values,$map); } else { $output = $this->createOutput($values); } $this->saveToFile($fileName, $output); }
php
public function save($fileName, $values, $map = null) { if ($map !== null) { $output = $this->createOutputWithMap($values,$map); } else { $output = $this->createOutput($values); } $this->saveToFile($fileName, $output); }
[ "public", "function", "save", "(", "$", "fileName", ",", "$", "values", ",", "$", "map", "=", "null", ")", "{", "if", "(", "$", "map", "!==", "null", ")", "{", "$", "output", "=", "$", "this", "->", "createOutputWithMap", "(", "$", "values", ",", ...
Writes configuration array to file @param string $fileName File name @param array $values Configuration values @param array|null $map File map
[ "Writes", "configuration", "array", "to", "file" ]
train
https://github.com/mayoturis/properties-ini/blob/79d56d8174637b1124eb90a41ffa3dca4c4a4e93/src/FileSaver.php#L24-L32
mayoturis/properties-ini
src/FileSaver.php
FileSaver.createOutputWithMap
public function createOutputWithMap(array $values, array $map) { $output = ''; foreach ($map as $outputLine) { if ($outputLine['type'] == 'empty') { $output .= PHP_EOL; } elseif($outputLine['type'] == 'comment') { $output .= $outputLine['value'] . PHP_EOL; } else { $output .= $this->createLine(...
php
public function createOutputWithMap(array $values, array $map) { $output = ''; foreach ($map as $outputLine) { if ($outputLine['type'] == 'empty') { $output .= PHP_EOL; } elseif($outputLine['type'] == 'comment') { $output .= $outputLine['value'] . PHP_EOL; } else { $output .= $this->createLine(...
[ "public", "function", "createOutputWithMap", "(", "array", "$", "values", ",", "array", "$", "map", ")", "{", "$", "output", "=", "''", ";", "foreach", "(", "$", "map", "as", "$", "outputLine", ")", "{", "if", "(", "$", "outputLine", "[", "'type'", "...
Creates output string with provided map @param array $values Configuration values @param array $map @return string
[ "Creates", "output", "string", "with", "provided", "map" ]
train
https://github.com/mayoturis/properties-ini/blob/79d56d8174637b1124eb90a41ffa3dca4c4a4e93/src/FileSaver.php#L41-L58
mayoturis/properties-ini
src/FileSaver.php
FileSaver.createOutput
public function createOutput($values) { $output = ''; foreach ($values as $key => $value) { $output .= $this->createLine($key, $value) . PHP_EOL; } return $output; }
php
public function createOutput($values) { $output = ''; foreach ($values as $key => $value) { $output .= $this->createLine($key, $value) . PHP_EOL; } return $output; }
[ "public", "function", "createOutput", "(", "$", "values", ")", "{", "$", "output", "=", "''", ";", "foreach", "(", "$", "values", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "output", ".=", "$", "this", "->", "createLine", "(", "$", "key",...
Creates output string from configuration values @param array $values Configuration values @return string
[ "Creates", "output", "string", "from", "configuration", "values" ]
train
https://github.com/mayoturis/properties-ini/blob/79d56d8174637b1124eb90a41ffa3dca4c4a4e93/src/FileSaver.php#L66-L73
mayoturis/properties-ini
src/FileSaver.php
FileSaver.createLine
protected function createLine($key, $value, $outputLineMap = null) { return $key .= '=' . $this->createValue($value, $outputLineMap); }
php
protected function createLine($key, $value, $outputLineMap = null) { return $key .= '=' . $this->createValue($value, $outputLineMap); }
[ "protected", "function", "createLine", "(", "$", "key", ",", "$", "value", ",", "$", "outputLineMap", "=", "null", ")", "{", "return", "$", "key", ".=", "'='", ".", "$", "this", "->", "createValue", "(", "$", "value", ",", "$", "outputLineMap", ")", ...
Creates string from $key and $value @param string $key @param mixed $value @param array|null $outputLineMap @return string
[ "Creates", "string", "from", "$key", "and", "$value" ]
train
https://github.com/mayoturis/properties-ini/blob/79d56d8174637b1124eb90a41ffa3dca4c4a4e93/src/FileSaver.php#L83-L85
mayoturis/properties-ini
src/FileSaver.php
FileSaver.createValue
protected function createValue($value, $outputLineMap = null) { if (is_bool($value)) { return $this->processor->boolToString($value); } if (is_numeric($value)) { return $value . ''; } if ($value == null) { return 'null'; } if (isset($outputLineMap['info']['around'])) { return $outputLineMap...
php
protected function createValue($value, $outputLineMap = null) { if (is_bool($value)) { return $this->processor->boolToString($value); } if (is_numeric($value)) { return $value . ''; } if ($value == null) { return 'null'; } if (isset($outputLineMap['info']['around'])) { return $outputLineMap...
[ "protected", "function", "createValue", "(", "$", "value", ",", "$", "outputLineMap", "=", "null", ")", "{", "if", "(", "is_bool", "(", "$", "value", ")", ")", "{", "return", "$", "this", "->", "processor", "->", "boolToString", "(", "$", "value", ")",...
Creates string from $value. $outputLineMap can help to create the value @param mixed $value @param array|null $outputLineMap @return string
[ "Creates", "string", "from", "$value", ".", "$outputLineMap", "can", "help", "to", "create", "the", "value" ]
train
https://github.com/mayoturis/properties-ini/blob/79d56d8174637b1124eb90a41ffa3dca4c4a4e93/src/FileSaver.php#L95-L117
phossa2/middleware
src/Middleware/Queue.php
Queue.push
public function push($middleware, $condition = null) { $this->queue->push([$middleware, $condition]); $this->queue->rewind(); return $this; }
php
public function push($middleware, $condition = null) { $this->queue->push([$middleware, $condition]); $this->queue->rewind(); return $this; }
[ "public", "function", "push", "(", "$", "middleware", ",", "$", "condition", "=", "null", ")", "{", "$", "this", "->", "queue", "->", "push", "(", "[", "$", "middleware", ",", "$", "condition", "]", ")", ";", "$", "this", "->", "queue", "->", "rewi...
{@inheritDoc}
[ "{" ]
train
https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Queue.php#L92-L97
phossa2/middleware
src/Middleware/Queue.php
Queue.process
public function process( RequestInterface $request, ResponseInterface $response, DelegateInterface $next = null )/*# : ResponseInterface */ { // process the queue $response = $this->next($request, $response); // $next is parent queue return ($next && !$this->...
php
public function process( RequestInterface $request, ResponseInterface $response, DelegateInterface $next = null )/*# : ResponseInterface */ { // process the queue $response = $this->next($request, $response); // $next is parent queue return ($next && !$this->...
[ "public", "function", "process", "(", "RequestInterface", "$", "request", ",", "ResponseInterface", "$", "response", ",", "DelegateInterface", "$", "next", "=", "null", ")", "/*# : ResponseInterface */", "{", "// process the queue", "$", "response", "=", "$", "this"...
{@inheritDoc}
[ "{" ]
train
https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Queue.php#L102-L114
phossa2/middleware
src/Middleware/Queue.php
Queue.next
public function next( RequestInterface $request, ResponseInterface $response )/*# : ResponseInterface */ { if ($this->queue->valid()) { list($middleware, $condition) = $this->queue->current(); $this->queue->next(); if (null === $condition || ...
php
public function next( RequestInterface $request, ResponseInterface $response )/*# : ResponseInterface */ { if ($this->queue->valid()) { list($middleware, $condition) = $this->queue->current(); $this->queue->next(); if (null === $condition || ...
[ "public", "function", "next", "(", "RequestInterface", "$", "request", ",", "ResponseInterface", "$", "response", ")", "/*# : ResponseInterface */", "{", "if", "(", "$", "this", "->", "queue", "->", "valid", "(", ")", ")", "{", "list", "(", "$", "middleware"...
{@inheritDoc}
[ "{" ]
train
https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Queue.php#L119-L137
phossa2/middleware
src/Middleware/Queue.php
Queue.fillTheQueue
protected function fillTheQueue(array $middlewares) { foreach ($middlewares as $mw) { // with conditions specified if (is_array($mw)) { $this->push($mw[0], $mw[1]); // no condition } else { $this->push($mw); } ...
php
protected function fillTheQueue(array $middlewares) { foreach ($middlewares as $mw) { // with conditions specified if (is_array($mw)) { $this->push($mw[0], $mw[1]); // no condition } else { $this->push($mw); } ...
[ "protected", "function", "fillTheQueue", "(", "array", "$", "middlewares", ")", "{", "foreach", "(", "$", "middlewares", "as", "$", "mw", ")", "{", "// with conditions specified", "if", "(", "is_array", "(", "$", "mw", ")", ")", "{", "$", "this", "->", "...
Fill the queue with middlewares @param array $middlewares @access protected
[ "Fill", "the", "queue", "with", "middlewares" ]
train
https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Queue.php#L145-L157
phossa2/middleware
src/Middleware/Queue.php
Queue.runMiddleware
protected function runMiddleware( $middleware, RequestInterface $request, ResponseInterface $response )/*# : ResponseInterface */ { // instance of MiddlewareInterface if (is_object($middleware) && $middleware instanceof MiddlewareInterface) { return $middleware->p...
php
protected function runMiddleware( $middleware, RequestInterface $request, ResponseInterface $response )/*# : ResponseInterface */ { // instance of MiddlewareInterface if (is_object($middleware) && $middleware instanceof MiddlewareInterface) { return $middleware->p...
[ "protected", "function", "runMiddleware", "(", "$", "middleware", ",", "RequestInterface", "$", "request", ",", "ResponseInterface", "$", "response", ")", "/*# : ResponseInterface */", "{", "// instance of MiddlewareInterface", "if", "(", "is_object", "(", "$", "middlew...
Process/run this middleware @param MiddlewareInterface|callable $middleware @param RequestInterface $request @param ResponseInterface $response @return ResponseInterface @throws LogicException if invalid middleware type @access protected
[ "Process", "/", "run", "this", "middleware" ]
train
https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Queue.php#L169-L189
phossa2/middleware
src/Middleware/Queue.php
Queue.evalCondition
protected function evalCondition( $condition, RequestInterface $request, ResponseInterface $response )/*# : bool */ { // instanceof ConditionInterface if (is_object($condition) && $condition instanceof ConditionInterface) { return $condition->evaluate($request, $r...
php
protected function evalCondition( $condition, RequestInterface $request, ResponseInterface $response )/*# : bool */ { // instanceof ConditionInterface if (is_object($condition) && $condition instanceof ConditionInterface) { return $condition->evaluate($request, $r...
[ "protected", "function", "evalCondition", "(", "$", "condition", ",", "RequestInterface", "$", "request", ",", "ResponseInterface", "$", "response", ")", "/*# : bool */", "{", "// instanceof ConditionInterface", "if", "(", "is_object", "(", "$", "condition", ")", "&...
Evaluate the condition support both a callable returns bool value or an object instance of ConditionInterface. @param ConditionInterface|callable $condition @param RequestInterface $request @param ResponseInterface $response @return bool @throws LogicException if condition is invalid @access protected
[ "Evaluate", "the", "condition" ]
train
https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Queue.php#L204-L224
blast-project/CoreBundle
src/Tools/Reflection/ClassAnalyzer.php
ClassAnalyzer.getAncestors
public static function getAncestors($class) { $rc = $class instanceof \ReflectionClass ? \ReflectionClass($class->getName()) : new \ReflectionClass($class); $ancestors = []; while ($parent = $rc->getParentClass()) { $ancestors[] = $parent->getName(); $rc = $parent; ...
php
public static function getAncestors($class) { $rc = $class instanceof \ReflectionClass ? \ReflectionClass($class->getName()) : new \ReflectionClass($class); $ancestors = []; while ($parent = $rc->getParentClass()) { $ancestors[] = $parent->getName(); $rc = $parent; ...
[ "public", "static", "function", "getAncestors", "(", "$", "class", ")", "{", "$", "rc", "=", "$", "class", "instanceof", "\\", "ReflectionClass", "?", "\\", "ReflectionClass", "(", "$", "class", "->", "getName", "(", ")", ")", ":", "new", "\\", "Reflecti...
Returns all parents of a class (parent, parent of parent, parent of parent's parent and so on). @param ReflectionClass|string $class A ReflectionClass object or a class name @return array
[ "Returns", "all", "parents", "of", "a", "class", "(", "parent", "parent", "of", "parent", "parent", "of", "parent", "s", "parent", "and", "so", "on", ")", "." ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Tools/Reflection/ClassAnalyzer.php#L24-L34
blast-project/CoreBundle
src/Tools/Reflection/ClassAnalyzer.php
ClassAnalyzer.hasProperty
public static function hasProperty($class, $propertyName) { $rc = $class instanceof \ReflectionClass ? $class : new ReflectionClass($class); if ($rc->hasProperty($propertyName)) { return true; } $parentClass = $rc->getParentClass(); if (false === $parentClass) ...
php
public static function hasProperty($class, $propertyName) { $rc = $class instanceof \ReflectionClass ? $class : new ReflectionClass($class); if ($rc->hasProperty($propertyName)) { return true; } $parentClass = $rc->getParentClass(); if (false === $parentClass) ...
[ "public", "static", "function", "hasProperty", "(", "$", "class", ",", "$", "propertyName", ")", "{", "$", "rc", "=", "$", "class", "instanceof", "\\", "ReflectionClass", "?", "$", "class", ":", "new", "ReflectionClass", "(", "$", "class", ")", ";", "if"...
hasProperty. This static method says if a class has a property @param ReflectionClass|string $class A ReflectionClass object or a class name @param string $propertyName A string representing an existing property @return bool
[ "hasProperty", "." ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Tools/Reflection/ClassAnalyzer.php#L77-L92
blast-project/CoreBundle
src/Tools/Reflection/ClassAnalyzer.php
ClassAnalyzer._getTraits
private static function _getTraits($class, array $traits = null) { $rc = $class instanceof \ReflectionClass ? $class : new \ReflectionClass($class); if (is_null($traits)) { $traits = array(); } // traits being embedded through the current class or the embedded traits ...
php
private static function _getTraits($class, array $traits = null) { $rc = $class instanceof \ReflectionClass ? $class : new \ReflectionClass($class); if (is_null($traits)) { $traits = array(); } // traits being embedded through the current class or the embedded traits ...
[ "private", "static", "function", "_getTraits", "(", "$", "class", ",", "array", "$", "traits", "=", "null", ")", "{", "$", "rc", "=", "$", "class", "instanceof", "\\", "ReflectionClass", "?", "$", "class", ":", "new", "\\", "ReflectionClass", "(", "$", ...
@param ReflectionClass|string $class A ReflectionClass object or a class name @param array $traits An array of traits (strings) @return array
[ "@param", "ReflectionClass|string", "$class", "A", "ReflectionClass", "object", "or", "a", "class", "name", "@param", "array", "$traits", "An", "array", "of", "traits", "(", "strings", ")" ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Tools/Reflection/ClassAnalyzer.php#L117-L138
paulzi/multicurl
MultiCurl.php
MultiCurl.add
public function add($request) { $this->onBefore($request); array_push($this->_requests, $request); curl_multi_add_handle($this->_mh, $request->curl); $this->_updated = true; }
php
public function add($request) { $this->onBefore($request); array_push($this->_requests, $request); curl_multi_add_handle($this->_mh, $request->curl); $this->_updated = true; }
[ "public", "function", "add", "(", "$", "request", ")", "{", "$", "this", "->", "onBefore", "(", "$", "request", ")", ";", "array_push", "(", "$", "this", "->", "_requests", ",", "$", "request", ")", ";", "curl_multi_add_handle", "(", "$", "this", "->",...
Add request to execute @param MultiCurlRequest $request
[ "Add", "request", "to", "execute" ]
train
https://github.com/paulzi/multicurl/blob/2e326d868add238bb2820f3271e235bfed12e5cb/MultiCurl.php#L47-L53
paulzi/multicurl
MultiCurl.php
MultiCurl.run
public function run() { $running = null; do { curl_multi_exec($this->_mh, $running); $this->_updated = false; while ($info = curl_multi_info_read($this->_mh)) { $index = false; foreach ($this->_requests as $i => $item) { ...
php
public function run() { $running = null; do { curl_multi_exec($this->_mh, $running); $this->_updated = false; while ($info = curl_multi_info_read($this->_mh)) { $index = false; foreach ($this->_requests as $i => $item) { ...
[ "public", "function", "run", "(", ")", "{", "$", "running", "=", "null", ";", "do", "{", "curl_multi_exec", "(", "$", "this", "->", "_mh", ",", "$", "running", ")", ";", "$", "this", "->", "_updated", "=", "false", ";", "while", "(", "$", "info", ...
Execute requests
[ "Execute", "requests" ]
train
https://github.com/paulzi/multicurl/blob/2e326d868add238bb2820f3271e235bfed12e5cb/MultiCurl.php#L58-L94
philippfrenzel/yii2-textareaautosize
yii2textareaautosize.php
yii2textareaautosize.registerAssets
public function registerAssets() { $id = $this->options['id']; $view = $this->getView(); CoreAsset::register($view); $cleanOptions = $this->getClientOptions(); $js[] = "$('textarea.element-$id').textareaAutoSize();"; $view->registerJs(implode("\n", $js),View::POS_READ...
php
public function registerAssets() { $id = $this->options['id']; $view = $this->getView(); CoreAsset::register($view); $cleanOptions = $this->getClientOptions(); $js[] = "$('textarea.element-$id').textareaAutoSize();"; $view->registerJs(implode("\n", $js),View::POS_READ...
[ "public", "function", "registerAssets", "(", ")", "{", "$", "id", "=", "$", "this", "->", "options", "[", "'id'", "]", ";", "$", "view", "=", "$", "this", "->", "getView", "(", ")", ";", "CoreAsset", "::", "register", "(", "$", "view", ")", ";", ...
Registers the needed assets
[ "Registers", "the", "needed", "assets" ]
train
https://github.com/philippfrenzel/yii2-textareaautosize/blob/3732a29a48c0b1c15aba608e3f49e6529d13a8bd/yii2textareaautosize.php#L56-L64
philippfrenzel/yii2-textareaautosize
yii2textareaautosize.php
yii2textareaautosize.renderInput
public function renderInput() { Html::addCssClass($this->_displayOptions, 'element-' . $this->options['id']); Html::addCssClass($this->_displayOptions, 'form-control'); $this->_displayOptions['rows'] = 1; $input = Html::activeTextarea($this->model, $this->attribute, $this->_displa...
php
public function renderInput() { Html::addCssClass($this->_displayOptions, 'element-' . $this->options['id']); Html::addCssClass($this->_displayOptions, 'form-control'); $this->_displayOptions['rows'] = 1; $input = Html::activeTextarea($this->model, $this->attribute, $this->_displa...
[ "public", "function", "renderInput", "(", ")", "{", "Html", "::", "addCssClass", "(", "$", "this", "->", "_displayOptions", ",", "'element-'", ".", "$", "this", "->", "options", "[", "'id'", "]", ")", ";", "Html", "::", "addCssClass", "(", "$", "this", ...
Renders the widget.
[ "Renders", "the", "widget", "." ]
train
https://github.com/philippfrenzel/yii2-textareaautosize/blob/3732a29a48c0b1c15aba608e3f49e6529d13a8bd/yii2textareaautosize.php#L81-L88
blast-project/CoreBundle
src/Admin/Traits/Mapper.php
Mapper.addContent
protected function addContent(BaseMapper $mapper, $group) { // helper links $this->parseHelperLinks(); // flat organization (DatagridMapper / ListMapper...) if (!$mapper instanceof BaseGroupedMapper) { //list actions $this->addActions(); $this->re...
php
protected function addContent(BaseMapper $mapper, $group) { // helper links $this->parseHelperLinks(); // flat organization (DatagridMapper / ListMapper...) if (!$mapper instanceof BaseGroupedMapper) { //list actions $this->addActions(); $this->re...
[ "protected", "function", "addContent", "(", "BaseMapper", "$", "mapper", ",", "$", "group", ")", "{", "// helper links", "$", "this", "->", "parseHelperLinks", "(", ")", ";", "// flat organization (DatagridMapper / ListMapper...)", "if", "(", "!", "$", "mapper", "...
@param BaseMapper $mapper @param array $group @return BaseMapper
[ "@param", "BaseMapper", "$mapper", "@param", "array", "$group" ]
train
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/Traits/Mapper.php#L232-L455
alexpts/psr15-middlewares
src/Memory.php
Memory.process
public function process(ServerRequestInterface $request, RequestHandlerInterface $next) : ResponseInterface { $response = $next->handle($request); $memory = $this->getPeakMemory() . ' kbyte'; return $response->withHeader(self::HEADER, $memory); }
php
public function process(ServerRequestInterface $request, RequestHandlerInterface $next) : ResponseInterface { $response = $next->handle($request); $memory = $this->getPeakMemory() . ' kbyte'; return $response->withHeader(self::HEADER, $memory); }
[ "public", "function", "process", "(", "ServerRequestInterface", "$", "request", ",", "RequestHandlerInterface", "$", "next", ")", ":", "ResponseInterface", "{", "$", "response", "=", "$", "next", "->", "handle", "(", "$", "request", ")", ";", "$", "memory", ...
@param ServerRequestInterface $request @param RequestHandlerInterface $next @return ResponseInterface @throws \InvalidArgumentException
[ "@param", "ServerRequestInterface", "$request", "@param", "RequestHandlerInterface", "$next" ]
train
https://github.com/alexpts/psr15-middlewares/blob/bff2887d5af01c54d9288fd19c20f0f593b69358/src/Memory.php#L28-L34
jan-dolata/crude-crud
src/Http/Requests/ApiUpdateRequest.php
ApiUpdateRequest.authorize
public function authorize() { $crude = CrudeInstance::get($this->crudeName); if ($crude == null) return false; if ($crude->cannotView()) return false; $model = $crude->getById($this->id); return $crude->canUpdate($model); }
php
public function authorize() { $crude = CrudeInstance::get($this->crudeName); if ($crude == null) return false; if ($crude->cannotView()) return false; $model = $crude->getById($this->id); return $crude->canUpdate($model); }
[ "public", "function", "authorize", "(", ")", "{", "$", "crude", "=", "CrudeInstance", "::", "get", "(", "$", "this", "->", "crudeName", ")", ";", "if", "(", "$", "crude", "==", "null", ")", "return", "false", ";", "if", "(", "$", "crude", "->", "ca...
Determine if the user is authorized to make this request. @return bool
[ "Determine", "if", "the", "user", "is", "authorized", "to", "make", "this", "request", "." ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Http/Requests/ApiUpdateRequest.php#L16-L29
jan-dolata/crude-crud
src/Http/Requests/ApiUpdateRequest.php
ApiUpdateRequest.rules
public function rules() { $crude = CrudeInstance::get($this->crudeName); if ($crude == null) return []; if (! $crude instanceof \JanDolata\CrudeCRUD\Engine\Interfaces\WithValidationInterface) return []; $attr = $crude->getCrudeSetup()->getEditForm(); ...
php
public function rules() { $crude = CrudeInstance::get($this->crudeName); if ($crude == null) return []; if (! $crude instanceof \JanDolata\CrudeCRUD\Engine\Interfaces\WithValidationInterface) return []; $attr = $crude->getCrudeSetup()->getEditForm(); ...
[ "public", "function", "rules", "(", ")", "{", "$", "crude", "=", "CrudeInstance", "::", "get", "(", "$", "this", "->", "crudeName", ")", ";", "if", "(", "$", "crude", "==", "null", ")", "return", "[", "]", ";", "if", "(", "!", "$", "crude", "inst...
Get the validation rules that apply to the request. @return array
[ "Get", "the", "validation", "rules", "that", "apply", "to", "the", "request", "." ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Http/Requests/ApiUpdateRequest.php#L36-L49
jan-dolata/crude-crud
src/Engine/Traits/FromModelTraitPart/ModelTrait.php
ModelTrait.prepareModelCrudeSetup
public function prepareModelCrudeSetup() { $crudeName = $this->getCalledClassName(); $modelAttr = array_merge(['id'], $this->model->getFillable(), ['created_at']); foreach ($modelAttr as $attr) $this->scope[$attr] = $this->model->getTable() . '.' . $attr; $this->crudeSe...
php
public function prepareModelCrudeSetup() { $crudeName = $this->getCalledClassName(); $modelAttr = array_merge(['id'], $this->model->getFillable(), ['created_at']); foreach ($modelAttr as $attr) $this->scope[$attr] = $this->model->getTable() . '.' . $attr; $this->crudeSe...
[ "public", "function", "prepareModelCrudeSetup", "(", ")", "{", "$", "crudeName", "=", "$", "this", "->", "getCalledClassName", "(", ")", ";", "$", "modelAttr", "=", "array_merge", "(", "[", "'id'", "]", ",", "$", "this", "->", "model", "->", "getFillable",...
Prepare default crude setup @return self
[ "Prepare", "default", "crude", "setup" ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Traits/FromModelTraitPart/ModelTrait.php#L40-L65
FrenchFrogs/framework
src/Table/Column/Link.php
Link.getBindedLink
public function getBindedLink($row = []) { $bind = array_intersect_key($row, array_fill_keys($this->getBinds(), '')); // patch pour les paramètre bindé en query $link = str_replace('%25', '%', $this->getLink()); return vsprintf($link, $bind); }
php
public function getBindedLink($row = []) { $bind = array_intersect_key($row, array_fill_keys($this->getBinds(), '')); // patch pour les paramètre bindé en query $link = str_replace('%25', '%', $this->getLink()); return vsprintf($link, $bind); }
[ "public", "function", "getBindedLink", "(", "$", "row", "=", "[", "]", ")", "{", "$", "bind", "=", "array_intersect_key", "(", "$", "row", ",", "array_fill_keys", "(", "$", "this", "->", "getBinds", "(", ")", ",", "''", ")", ")", ";", "// patch pour le...
Return the binded link @param array $row @return string
[ "Return", "the", "binded", "link" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Link.php#L154-L161
joomla-framework/profiler
src/Profiler.php
Profiler.getTimeBetween
public function getTimeBetween($first, $second) { if (!isset($this->lookup[$first])) { throw new \LogicException( sprintf( 'The point %s was not marked in the profiler %s.', $first, $this->name ) ); } if (!isset($this->lookup[$second])) { throw new \LogicException( sprint...
php
public function getTimeBetween($first, $second) { if (!isset($this->lookup[$first])) { throw new \LogicException( sprintf( 'The point %s was not marked in the profiler %s.', $first, $this->name ) ); } if (!isset($this->lookup[$second])) { throw new \LogicException( sprint...
[ "public", "function", "getTimeBetween", "(", "$", "first", ",", "$", "second", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "lookup", "[", "$", "first", "]", ")", ")", "{", "throw", "new", "\\", "LogicException", "(", "sprintf", "(", ...
Get the elapsed time in seconds between the two points. @param string $first The name of the first point. @param string $second The name of the second point. @return float The elapsed time between these points in seconds. @since 1.0 @throws \LogicException If the points were not marked.
[ "Get", "the", "elapsed", "time", "in", "seconds", "between", "the", "two", "points", "." ]
train
https://github.com/joomla-framework/profiler/blob/efdea10dc547d8fa853be6737100c844be227ca6/src/Profiler.php#L269-L300
joomla-framework/profiler
src/Profiler.php
Profiler.getMemoryBytesBetween
public function getMemoryBytesBetween($first, $second) { if (!isset($this->lookup[$first])) { throw new \LogicException( sprintf( 'The point %s was not marked in the profiler %s.', $first, $this->name ) ); } if (!isset($this->lookup[$second])) { throw new \LogicException( ...
php
public function getMemoryBytesBetween($first, $second) { if (!isset($this->lookup[$first])) { throw new \LogicException( sprintf( 'The point %s was not marked in the profiler %s.', $first, $this->name ) ); } if (!isset($this->lookup[$second])) { throw new \LogicException( ...
[ "public", "function", "getMemoryBytesBetween", "(", "$", "first", ",", "$", "second", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "lookup", "[", "$", "first", "]", ")", ")", "{", "throw", "new", "\\", "LogicException", "(", "sprintf", ...
Get the amount of allocated memory in bytes between the two points. @param string $first The name of the first point. @param string $second The name of the second point. @return integer The amount of allocated memory between these points in bytes. @since 1.0 @throws \LogicException If the points were ...
[ "Get", "the", "amount", "of", "allocated", "memory", "in", "bytes", "between", "the", "two", "points", "." ]
train
https://github.com/joomla-framework/profiler/blob/efdea10dc547d8fa853be6737100c844be227ca6/src/Profiler.php#L313-L344
joomla-framework/profiler
src/Profiler.php
Profiler.setStart
public function setStart($timeStamp = 0.0, $memoryBytes = 0) { if (!empty($this->points)) { throw new \RuntimeException('The start point cannot be adjusted after points are added to the profiler.'); } $this->startTimeStamp = $timeStamp; $this->startMemoryBytes = $memoryBytes; $point = new ProfilePoi...
php
public function setStart($timeStamp = 0.0, $memoryBytes = 0) { if (!empty($this->points)) { throw new \RuntimeException('The start point cannot be adjusted after points are added to the profiler.'); } $this->startTimeStamp = $timeStamp; $this->startMemoryBytes = $memoryBytes; $point = new ProfilePoi...
[ "public", "function", "setStart", "(", "$", "timeStamp", "=", "0.0", ",", "$", "memoryBytes", "=", "0", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "points", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'The start point...
Creates a profile point with the specified starting time and memory. This method will only add a point if no other points have been added as the ProfilePointInterface objects created before changing the start point would result in inaccurate measurements. @param float $timeStamp Unix timestamp in microseconds...
[ "Creates", "a", "profile", "point", "with", "the", "specified", "starting", "time", "and", "memory", "." ]
train
https://github.com/joomla-framework/profiler/blob/efdea10dc547d8fa853be6737100c844be227ca6/src/Profiler.php#L460-L479
yosmanyga/resource
src/Yosmanyga/Resource/Reader/Flat/FileReader.php
FileReader.read
public function read(Resource $resource) { $file = $resource->getMetadata('file'); if (!is_file($file)) { throw new \InvalidArgumentException(sprintf('File "%s" not found.', $file)); } return file_get_contents($file); }
php
public function read(Resource $resource) { $file = $resource->getMetadata('file'); if (!is_file($file)) { throw new \InvalidArgumentException(sprintf('File "%s" not found.', $file)); } return file_get_contents($file); }
[ "public", "function", "read", "(", "Resource", "$", "resource", ")", "{", "$", "file", "=", "$", "resource", "->", "getMetadata", "(", "'file'", ")", ";", "if", "(", "!", "is_file", "(", "$", "file", ")", ")", "{", "throw", "new", "\\", "InvalidArgum...
{@inheritdoc}
[ "{" ]
train
https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Reader/Flat/FileReader.php#L33-L42
verschoof/bunq-api
src/Service/DefaultInstallationService.php
DefaultInstallationService.install
public function install() { $publicKey = $this->certificateStorage->load(CertificateType::PUBLIC_KEY()); $response = $this->sendInstallationPostRequest( '/v1/installation', [ 'json' => [ 'client_public_key' => $publicKey->toString(), ...
php
public function install() { $publicKey = $this->certificateStorage->load(CertificateType::PUBLIC_KEY()); $response = $this->sendInstallationPostRequest( '/v1/installation', [ 'json' => [ 'client_public_key' => $publicKey->toString(), ...
[ "public", "function", "install", "(", ")", "{", "$", "publicKey", "=", "$", "this", "->", "certificateStorage", "->", "load", "(", "CertificateType", "::", "PUBLIC_KEY", "(", ")", ")", ";", "$", "response", "=", "$", "this", "->", "sendInstallationPostReques...
Registers your public key with the Bunq API. @return array
[ "Registers", "your", "public", "key", "with", "the", "Bunq", "API", "." ]
train
https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Service/DefaultInstallationService.php#L60-L79
verschoof/bunq-api
src/Service/DefaultInstallationService.php
DefaultInstallationService.registerDevice
public function registerDevice(Token $token) { $this->sendInstallationPostRequest( '/v1/device-server', [ 'headers' => [ 'X-Bunq-Client-Authentication' => $token->toString(), ], 'json' => [ 'de...
php
public function registerDevice(Token $token) { $this->sendInstallationPostRequest( '/v1/device-server', [ 'headers' => [ 'X-Bunq-Client-Authentication' => $token->toString(), ], 'json' => [ 'de...
[ "public", "function", "registerDevice", "(", "Token", "$", "token", ")", "{", "$", "this", "->", "sendInstallationPostRequest", "(", "'/v1/device-server'", ",", "[", "'headers'", "=>", "[", "'X-Bunq-Client-Authentication'", "=>", "$", "token", "->", "toString", "(...
Registers a device with the Bunq API. @param Token $token return void
[ "Registers", "a", "device", "with", "the", "Bunq", "API", "." ]
train
https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Service/DefaultInstallationService.php#L88-L103
verschoof/bunq-api
src/Service/DefaultInstallationService.php
DefaultInstallationService.createSession
public function createSession(Token $token) { $response = $this->sendInstallationPostRequest( '/v1/session-server', [ 'headers' => [ 'X-Bunq-Client-Authentication' => $token->toString(), ], 'json' => [ ...
php
public function createSession(Token $token) { $response = $this->sendInstallationPostRequest( '/v1/session-server', [ 'headers' => [ 'X-Bunq-Client-Authentication' => $token->toString(), ], 'json' => [ ...
[ "public", "function", "createSession", "(", "Token", "$", "token", ")", "{", "$", "response", "=", "$", "this", "->", "sendInstallationPostRequest", "(", "'/v1/session-server'", ",", "[", "'headers'", "=>", "[", "'X-Bunq-Client-Authentication'", "=>", "$", "token"...
Registers a session with the Bunq API. @param Token $token @return array
[ "Registers", "a", "session", "with", "the", "Bunq", "API", "." ]
train
https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Service/DefaultInstallationService.php#L112-L129
verschoof/bunq-api
src/Service/DefaultInstallationService.php
DefaultInstallationService.sendInstallationPostRequest
private function sendInstallationPostRequest($url, array $options = []) { try { return $this->httpClient->request('POST', $url, $options); } catch (ClientException $exception) { throw new BunqException($exception); } }
php
private function sendInstallationPostRequest($url, array $options = []) { try { return $this->httpClient->request('POST', $url, $options); } catch (ClientException $exception) { throw new BunqException($exception); } }
[ "private", "function", "sendInstallationPostRequest", "(", "$", "url", ",", "array", "$", "options", "=", "[", "]", ")", "{", "try", "{", "return", "$", "this", "->", "httpClient", "->", "request", "(", "'POST'", ",", "$", "url", ",", "$", "options", "...
Sends a post request using the installation HTTP Client @param $url @param array $options @return ResponseInterface @throws BunqException
[ "Sends", "a", "post", "request", "using", "the", "installation", "HTTP", "Client" ]
train
https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Service/DefaultInstallationService.php#L140-L147
huasituo/hstcms
src/Libraries/Fields/Kindeditor.php
Kindeditor.input
public function input($cname, $name, $cfg, $value = NULL, $id = 0) { $source = isset($cfg['option']['source']) && $cfg['option']['source'] ? 'true' : 'false'; $cfg['option']['value'] = isset($cfg['option']['value']) ? $cfg['option']['value'] : ""; // 字段显示名称 $text = (isset($cfg['validate']['required']) && $cfg...
php
public function input($cname, $name, $cfg, $value = NULL, $id = 0) { $source = isset($cfg['option']['source']) && $cfg['option']['source'] ? 'true' : 'false'; $cfg['option']['value'] = isset($cfg['option']['value']) ? $cfg['option']['value'] : ""; // 字段显示名称 $text = (isset($cfg['validate']['required']) && $cfg...
[ "public", "function", "input", "(", "$", "cname", ",", "$", "name", ",", "$", "cfg", ",", "$", "value", "=", "NULL", ",", "$", "id", "=", "0", ")", "{", "$", "source", "=", "isset", "(", "$", "cfg", "[", "'option'", "]", "[", "'source'", "]", ...
字段表单输入 @param string $cname 字段别名 @param string $name 字段名称 @param array $cfg 字段配置 @param string $value 值 @return string
[ "字段表单输入" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Fields/Kindeditor.php#L120-L178
huasituo/hstcms
src/Libraries/Fields/Kindeditor.php
Kindeditor.insert_value
public function insert_value(Request $request, $field, $postData = []) { $value = $request->get($field['fieldname']); $postData[$field['relatedtable']][$field['fieldname']] = $value; return $postData; }
php
public function insert_value(Request $request, $field, $postData = []) { $value = $request->get($field['fieldname']); $postData[$field['relatedtable']][$field['fieldname']] = $value; return $postData; }
[ "public", "function", "insert_value", "(", "Request", "$", "request", ",", "$", "field", ",", "$", "postData", "=", "[", "]", ")", "{", "$", "value", "=", "$", "request", "->", "get", "(", "$", "field", "[", "'fieldname'", "]", ")", ";", "$", "post...
处理输入数据,提供给入库
[ "处理输入数据,提供给入库" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Fields/Kindeditor.php#L183-L188
ray-di/Ray.WebFormModule
src/AuraInputModule.php
AuraInputModule.configure
protected function configure() { $this->install(new AuraSessionModule); $this->bind(Reader::class)->to(AnnotationReader::class)->in(Scope::SINGLETON); $this->bind(BuilderInterface::class)->to(Builder::class); $this->bind(FilterInterface::class)->to(Filter::class); $this->bind...
php
protected function configure() { $this->install(new AuraSessionModule); $this->bind(Reader::class)->to(AnnotationReader::class)->in(Scope::SINGLETON); $this->bind(BuilderInterface::class)->to(Builder::class); $this->bind(FilterInterface::class)->to(Filter::class); $this->bind...
[ "protected", "function", "configure", "(", ")", "{", "$", "this", "->", "install", "(", "new", "AuraSessionModule", ")", ";", "$", "this", "->", "bind", "(", "Reader", "::", "class", ")", "->", "to", "(", "AnnotationReader", "::", "class", ")", "->", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/ray-di/Ray.WebFormModule/blob/4b6d33adb4a5c285278a068f3e7a5afdc4e680d9/src/AuraInputModule.php#L29-L50
mremi/Dolist
src/Mremi/Dolist/Authentication/AuthenticationManager.php
AuthenticationManager.getAuthenticationTokenContext
public function getAuthenticationTokenContext() { if (!$this->authenticationTokenResponse || $this->authenticationTokenResponse->isDeprecated()) { $this->authenticationTokenResponse = $this->authenticate(); } return new AuthenticationTokenContext($this->authenticationRequest->ge...
php
public function getAuthenticationTokenContext() { if (!$this->authenticationTokenResponse || $this->authenticationTokenResponse->isDeprecated()) { $this->authenticationTokenResponse = $this->authenticate(); } return new AuthenticationTokenContext($this->authenticationRequest->ge...
[ "public", "function", "getAuthenticationTokenContext", "(", ")", "{", "if", "(", "!", "$", "this", "->", "authenticationTokenResponse", "||", "$", "this", "->", "authenticationTokenResponse", "->", "isDeprecated", "(", ")", ")", "{", "$", "this", "->", "authenti...
{@inheritdoc}
[ "{" ]
train
https://github.com/mremi/Dolist/blob/452c863aba12ef2965bafdb619c0278f8fc732d0/src/Mremi/Dolist/Authentication/AuthenticationManager.php#L67-L74
mremi/Dolist
src/Mremi/Dolist/Authentication/AuthenticationManager.php
AuthenticationManager.authenticate
private function authenticate() { $try = 0; while (true) { $try++; try { $response = $this->soapClient->__soapCall('GetAuthenticationToken', array(array( 'authenticationRequest' => $this->authenticationRequest->toArray(), ...
php
private function authenticate() { $try = 0; while (true) { $try++; try { $response = $this->soapClient->__soapCall('GetAuthenticationToken', array(array( 'authenticationRequest' => $this->authenticationRequest->toArray(), ...
[ "private", "function", "authenticate", "(", ")", "{", "$", "try", "=", "0", ";", "while", "(", "true", ")", "{", "$", "try", "++", ";", "try", "{", "$", "response", "=", "$", "this", "->", "soapClient", "->", "__soapCall", "(", "'GetAuthenticationToken...
Calls the authentication API @return AuthenticationTokenResponse @throws \SoapFault
[ "Calls", "the", "authentication", "API" ]
train
https://github.com/mremi/Dolist/blob/452c863aba12ef2965bafdb619c0278f8fc732d0/src/Mremi/Dolist/Authentication/AuthenticationManager.php#L83-L109
rinvex/obsolete-module
src/ModuleServiceProvider.php
ModuleServiceProvider.register
public function register() { // Merge config $this->mergeConfigFrom( realpath(__DIR__.'/../config/config.php'), 'rinvex.module' ); // Bind rinvex module instance to the IoC container $this->app->singleton('rinvex.module', function ($app) { return new ...
php
public function register() { // Merge config $this->mergeConfigFrom( realpath(__DIR__.'/../config/config.php'), 'rinvex.module' ); // Bind rinvex module instance to the IoC container $this->app->singleton('rinvex.module', function ($app) { return new ...
[ "public", "function", "register", "(", ")", "{", "// Merge config", "$", "this", "->", "mergeConfigFrom", "(", "realpath", "(", "__DIR__", ".", "'/../config/config.php'", ")", ",", "'rinvex.module'", ")", ";", "// Bind rinvex module instance to the IoC container", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/rinvex/obsolete-module/blob/95e372ae97ecbe7071c3da397b0afd57f327361f/src/ModuleServiceProvider.php#L27-L45
comodojo/dispatcher.framework
src/Comodojo/Dispatcher/Response/Preprocessor/Status201.php
Status201.consolidate
public function consolidate(Response $response) { $location = $response->getLocation()->get(); if ($location != null) { $response->getHeaders() ->set("Location", $location); } parent::consolidate(); }
php
public function consolidate(Response $response) { $location = $response->getLocation()->get(); if ($location != null) { $response->getHeaders() ->set("Location", $location); } parent::consolidate(); }
[ "public", "function", "consolidate", "(", "Response", "$", "response", ")", "{", "$", "location", "=", "$", "response", "->", "getLocation", "(", ")", "->", "get", "(", ")", ";", "if", "(", "$", "location", "!=", "null", ")", "{", "$", "response", "-...
{@inheritdoc}
[ "{" ]
train
https://github.com/comodojo/dispatcher.framework/blob/5093297dcb7441a8d8f79cbb2429c93232e16d1c/src/Comodojo/Dispatcher/Response/Preprocessor/Status201.php#L28-L39
fsi-open/datasource-bundle
DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php
FormFieldExtension.initOptions
public function initOptions(FieldTypeInterface $field) { $field->getOptionsResolver() ->setDefaults([ 'form_filter' => true, 'form_options' => [], 'form_from_options' => [], 'form_to_options' =>[] ]) ->setDef...
php
public function initOptions(FieldTypeInterface $field) { $field->getOptionsResolver() ->setDefaults([ 'form_filter' => true, 'form_options' => [], 'form_from_options' => [], 'form_to_options' =>[] ]) ->setDef...
[ "public", "function", "initOptions", "(", "FieldTypeInterface", "$", "field", ")", "{", "$", "field", "->", "getOptionsResolver", "(", ")", "->", "setDefaults", "(", "[", "'form_filter'", "=>", "true", ",", "'form_options'", "=>", "[", "]", ",", "'form_from_op...
{@inheritdoc}
[ "{" ]
train
https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php#L77-L97
fsi-open/datasource-bundle
DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php
FormFieldExtension.postBuildView
public function postBuildView(FieldEvent\ViewEventArgs $event) { $field = $event->getField(); $view = $event->getView(); if ($form = $this->getForm($field)) { $view->setAttribute('form', $form->createView()); } }
php
public function postBuildView(FieldEvent\ViewEventArgs $event) { $field = $event->getField(); $view = $event->getView(); if ($form = $this->getForm($field)) { $view->setAttribute('form', $form->createView()); } }
[ "public", "function", "postBuildView", "(", "FieldEvent", "\\", "ViewEventArgs", "$", "event", ")", "{", "$", "field", "=", "$", "event", "->", "getField", "(", ")", ";", "$", "view", "=", "$", "event", "->", "getView", "(", ")", ";", "if", "(", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php#L102-L110
fsi-open/datasource-bundle
DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php
FormFieldExtension.preBindParameter
public function preBindParameter(FieldEvent\ParameterEventArgs $event) { $field = $event->getField(); $form = $this->getForm($field); if ($form === null) { return; } $field_oid = spl_object_hash($field); $parameter = $event->getParameter(); if ($...
php
public function preBindParameter(FieldEvent\ParameterEventArgs $event) { $field = $event->getField(); $form = $this->getForm($field); if ($form === null) { return; } $field_oid = spl_object_hash($field); $parameter = $event->getParameter(); if ($...
[ "public", "function", "preBindParameter", "(", "FieldEvent", "\\", "ParameterEventArgs", "$", "event", ")", "{", "$", "field", "=", "$", "event", "->", "getField", "(", ")", ";", "$", "form", "=", "$", "this", "->", "getForm", "(", "$", "field", ")", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php#L115-L151
fsi-open/datasource-bundle
DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php
FormFieldExtension.preGetParameter
public function preGetParameter(FieldEvent\ParameterEventArgs $event) { $field = $event->getField(); $field_oid = spl_object_hash($field); if (isset($this->parameters[$field_oid])) { $parameters = []; $this->setParameterValue($parameters, $field, $this->parameters[$f...
php
public function preGetParameter(FieldEvent\ParameterEventArgs $event) { $field = $event->getField(); $field_oid = spl_object_hash($field); if (isset($this->parameters[$field_oid])) { $parameters = []; $this->setParameterValue($parameters, $field, $this->parameters[$f...
[ "public", "function", "preGetParameter", "(", "FieldEvent", "\\", "ParameterEventArgs", "$", "event", ")", "{", "$", "field", "=", "$", "event", "->", "getField", "(", ")", ";", "$", "field_oid", "=", "spl_object_hash", "(", "$", "field", ")", ";", "if", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php#L156-L166
fsi-open/datasource-bundle
DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php
FormFieldExtension.getForm
protected function getForm(FieldTypeInterface $field, $force = false) { $datasource = $field->getDataSource(); if ($datasource === null) { return null; } if (!$field->getOption('form_filter')) { return null; } $field_oid = spl_object_hash($f...
php
protected function getForm(FieldTypeInterface $field, $force = false) { $datasource = $field->getDataSource(); if ($datasource === null) { return null; } if (!$field->getOption('form_filter')) { return null; } $field_oid = spl_object_hash($f...
[ "protected", "function", "getForm", "(", "FieldTypeInterface", "$", "field", ",", "$", "force", "=", "false", ")", "{", "$", "datasource", "=", "$", "field", "->", "getDataSource", "(", ")", ";", "if", "(", "$", "datasource", "===", "null", ")", "{", "...
Builds form. @param FieldTypeInterface $field @param bool $force @return FormInterface|null
[ "Builds", "form", "." ]
train
https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php#L175-L238
codezero-be/cookie
src/VanillaCookie.php
VanillaCookie.get
public function get($cookieName) { $cookieValue = $this->cookie->get($cookieName); return $this->decrypt($cookieValue); }
php
public function get($cookieName) { $cookieValue = $this->cookie->get($cookieName); return $this->decrypt($cookieValue); }
[ "public", "function", "get", "(", "$", "cookieName", ")", "{", "$", "cookieValue", "=", "$", "this", "->", "cookie", "->", "get", "(", "$", "cookieName", ")", ";", "return", "$", "this", "->", "decrypt", "(", "$", "cookieValue", ")", ";", "}" ]
Get the value of a cookie @param string $cookieName @return null|string
[ "Get", "the", "value", "of", "a", "cookie" ]
train
https://github.com/codezero-be/cookie/blob/5300089c9dc7bd48c9865d53c3aed8bd513da6d2/src/VanillaCookie.php#L40-L45
codezero-be/cookie
src/VanillaCookie.php
VanillaCookie.store
public function store($cookieName, $cookieValue, $minutes = 60, $path = "/", $domain = null, $secure = true, $httponly = true) { return $this->cookie->set( $cookieName, $this->encrypt($cookieValue), $this->calculateExpirationTime($minutes), $path, ...
php
public function store($cookieName, $cookieValue, $minutes = 60, $path = "/", $domain = null, $secure = true, $httponly = true) { return $this->cookie->set( $cookieName, $this->encrypt($cookieValue), $this->calculateExpirationTime($minutes), $path, ...
[ "public", "function", "store", "(", "$", "cookieName", ",", "$", "cookieValue", ",", "$", "minutes", "=", "60", ",", "$", "path", "=", "\"/\"", ",", "$", "domain", "=", "null", ",", "$", "secure", "=", "true", ",", "$", "httponly", "=", "true", ")"...
Store a cookie @param string $cookieName @param string $cookieValue @param int $minutes @param string $path @param string $domain @param bool $secure @param bool $httponly @return bool
[ "Store", "a", "cookie" ]
train
https://github.com/codezero-be/cookie/blob/5300089c9dc7bd48c9865d53c3aed8bd513da6d2/src/VanillaCookie.php#L60-L71
codezero-be/cookie
src/VanillaCookie.php
VanillaCookie.decrypt
private function decrypt($cookieValue) { if ($this->encrypter && ! empty($cookieValue)) { return $this->encrypter->decrypt($cookieValue); } return $cookieValue; }
php
private function decrypt($cookieValue) { if ($this->encrypter && ! empty($cookieValue)) { return $this->encrypter->decrypt($cookieValue); } return $cookieValue; }
[ "private", "function", "decrypt", "(", "$", "cookieValue", ")", "{", "if", "(", "$", "this", "->", "encrypter", "&&", "!", "empty", "(", "$", "cookieValue", ")", ")", "{", "return", "$", "this", "->", "encrypter", "->", "decrypt", "(", "$", "cookieValu...
Decrypt a cookie @param string $cookieValue @return string
[ "Decrypt", "a", "cookie" ]
train
https://github.com/codezero-be/cookie/blob/5300089c9dc7bd48c9865d53c3aed8bd513da6d2/src/VanillaCookie.php#L135-L142
kiwiz/ecl
src/ExpressionLanguage.php
ExpressionLanguage.evaluate
public function evaluate($expression, $values=[]) { if(is_array($values)) { return parent::evaluate($expression, $values); } else { return $this->parse($expression, $values->getKeys())->getNodes()->evaluate($this->functions, $values); } }
php
public function evaluate($expression, $values=[]) { if(is_array($values)) { return parent::evaluate($expression, $values); } else { return $this->parse($expression, $values->getKeys())->getNodes()->evaluate($this->functions, $values); } }
[ "public", "function", "evaluate", "(", "$", "expression", ",", "$", "values", "=", "[", "]", ")", "{", "if", "(", "is_array", "(", "$", "values", ")", ")", "{", "return", "parent", "::", "evaluate", "(", "$", "expression", ",", "$", "values", ")", ...
Evaluate an expression. Overridden to allow passing in a SymbolTable. @param \Symfony\Component\ExpressionLanguage\Expression|string $expression @param SymbolTable|array|\ArrayAccess $values @return mixed
[ "Evaluate", "an", "expression", ".", "Overridden", "to", "allow", "passing", "in", "a", "SymbolTable", "." ]
train
https://github.com/kiwiz/ecl/blob/6536dd2a4c1905a08cf718bdbef56a22f0e9b488/src/ExpressionLanguage.php#L53-L59
Wonail/wocenter
libs/IpLocation.php
IpLocation.getstring
private function getstring($data = "") { $char = fread($this->fp, 1); while (ord($char) > 0) { // 字符串按照C格式保存,以\0结束 $data .= $char; // 将读取的字符连接到给定字符串之后 $char = fread($this->fp, 1); } return $data; }
php
private function getstring($data = "") { $char = fread($this->fp, 1); while (ord($char) > 0) { // 字符串按照C格式保存,以\0结束 $data .= $char; // 将读取的字符连接到给定字符串之后 $char = fread($this->fp, 1); } return $data; }
[ "private", "function", "getstring", "(", "$", "data", "=", "\"\"", ")", "{", "$", "char", "=", "fread", "(", "$", "this", "->", "fp", ",", "1", ")", ";", "while", "(", "ord", "(", "$", "char", ")", ">", "0", ")", "{", "// 字符串按照C格式保存,以\\0结束\r", "$...
返回读取的字符串 @access private @param string $data @return string
[ "返回读取的字符串" ]
train
https://github.com/Wonail/wocenter/blob/186c15aad008d32fbf5ad75256cf01581dccf9e6/libs/IpLocation.php#L108-L117
Wonail/wocenter
libs/IpLocation.php
IpLocation.getarea
private function getarea() { $byte = fread($this->fp, 1); // 标志字节 switch (ord($byte)) { case 0: // 没有区域信息 $area = ""; break; case 1: case 2: // 标志字节为1或2,表示区域信息被重定向 ...
php
private function getarea() { $byte = fread($this->fp, 1); // 标志字节 switch (ord($byte)) { case 0: // 没有区域信息 $area = ""; break; case 1: case 2: // 标志字节为1或2,表示区域信息被重定向 ...
[ "private", "function", "getarea", "(", ")", "{", "$", "byte", "=", "fread", "(", "$", "this", "->", "fp", ",", "1", ")", ";", "// 标志字节\r", "switch", "(", "ord", "(", "$", "byte", ")", ")", "{", "case", "0", ":", "// 没有区域信息\r", "$", "area", "=", ...
返回地区信息 @access private @return string
[ "返回地区信息" ]
train
https://github.com/Wonail/wocenter/blob/186c15aad008d32fbf5ad75256cf01581dccf9e6/libs/IpLocation.php#L125-L143
Wonail/wocenter
libs/IpLocation.php
IpLocation.getlocation
public function getlocation($ip = '') { if (!$this->fp) return null; // 如果数据文件没有被正确打开,则直接返回空 if (empty($ip)) $ip = Utils::getClientIp(); $location['ip'] = gethostbyname($ip); // 将输入的域名转化为IP地址 $ip = $this->packip($location['ip']); // 将输入的I...
php
public function getlocation($ip = '') { if (!$this->fp) return null; // 如果数据文件没有被正确打开,则直接返回空 if (empty($ip)) $ip = Utils::getClientIp(); $location['ip'] = gethostbyname($ip); // 将输入的域名转化为IP地址 $ip = $this->packip($location['ip']); // 将输入的I...
[ "public", "function", "getlocation", "(", "$", "ip", "=", "''", ")", "{", "if", "(", "!", "$", "this", "->", "fp", ")", "return", "null", ";", "// 如果数据文件没有被正确打开,则直接返回空\r", "if", "(", "empty", "(", "$", "ip", ")", ")", "$", "ip", "=", "Utils", "::",...
根据所给 IP 地址或域名返回所在地区信息 @access public @param string $ip @return array
[ "根据所给", "IP", "地址或域名返回所在地区信息" ]
train
https://github.com/Wonail/wocenter/blob/186c15aad008d32fbf5ad75256cf01581dccf9e6/libs/IpLocation.php#L154-L231
tjbp/laravel-verify-emails
src/Foundation/Auth/VerifiesEmails.php
VerifiesEmails.resend
public function resend(Request $request) { $user = Auth::user(); if ($user->getVerified()) { return redirect()->back(); } $response = VerifyEmail::sendVerificationLink($user, function (Message $message) use ($user) { $message->subject($user->getVerifyEmailSu...
php
public function resend(Request $request) { $user = Auth::user(); if ($user->getVerified()) { return redirect()->back(); } $response = VerifyEmail::sendVerificationLink($user, function (Message $message) use ($user) { $message->subject($user->getVerifyEmailSu...
[ "public", "function", "resend", "(", "Request", "$", "request", ")", "{", "$", "user", "=", "Auth", "::", "user", "(", ")", ";", "if", "(", "$", "user", "->", "getVerified", "(", ")", ")", "{", "return", "redirect", "(", ")", "->", "back", "(", "...
Send another verification email. @param \Illuminate\Http\Request $request @return \Illuminate\Http\Response
[ "Send", "another", "verification", "email", "." ]
train
https://github.com/tjbp/laravel-verify-emails/blob/1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6/src/Foundation/Auth/VerifiesEmails.php#L28-L44
tjbp/laravel-verify-emails
src/Foundation/Auth/VerifiesEmails.php
VerifiesEmails.verify
public function verify($token) { $response = VerifyEmail::verify(Auth::user(), $token); switch ($response) { case VerifyEmail::EMAIL_VERIFIED: return redirect($this->redirectPath())->with('status', trans($response)); default: return redirect(...
php
public function verify($token) { $response = VerifyEmail::verify(Auth::user(), $token); switch ($response) { case VerifyEmail::EMAIL_VERIFIED: return redirect($this->redirectPath())->with('status', trans($response)); default: return redirect(...
[ "public", "function", "verify", "(", "$", "token", ")", "{", "$", "response", "=", "VerifyEmail", "::", "verify", "(", "Auth", "::", "user", "(", ")", ",", "$", "token", ")", ";", "switch", "(", "$", "response", ")", "{", "case", "VerifyEmail", "::",...
Attempt to verify a user. @param string $token @return \Illuminate\Http\Response
[ "Attempt", "to", "verify", "a", "user", "." ]
train
https://github.com/tjbp/laravel-verify-emails/blob/1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6/src/Foundation/Auth/VerifiesEmails.php#L52-L64
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addColumn
public function addColumn(Column\Column $column) { // Join column to the table $column->setTable($this); // Add renderer to column if it didn't has one if (!$column->hasRenderer()) { $column->setRenderer($this->getRenderer()); } $this->columns[$column->g...
php
public function addColumn(Column\Column $column) { // Join column to the table $column->setTable($this); // Add renderer to column if it didn't has one if (!$column->hasRenderer()) { $column->setRenderer($this->getRenderer()); } $this->columns[$column->g...
[ "public", "function", "addColumn", "(", "Column", "\\", "Column", "$", "column", ")", "{", "// Join column to the table", "$", "column", "->", "setTable", "(", "$", "this", ")", ";", "// Add renderer to column if it didn't has one", "if", "(", "!", "$", "column", ...
Add a single column to the column container @param Column\Column $column @return $this
[ "Add", "a", "single", "column", "to", "the", "column", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L52-L65
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.removeColumn
public function removeColumn($name) { if (isset($this->columns[$name])){ unset($this->columns[$name]); } return $this; }
php
public function removeColumn($name) { if (isset($this->columns[$name])){ unset($this->columns[$name]); } return $this; }
[ "public", "function", "removeColumn", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "columns", "[", "$", "name", "]", ")", ")", "{", "unset", "(", "$", "this", "->", "columns", "[", "$", "name", "]", ")", ";", "}", "re...
Remove $name columns from the $columns container @param $name @return $this
[ "Remove", "$name", "columns", "from", "the", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L73-L81
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.getColumn
public function getColumn($name) { // check all the columns foreach ($this->columns as $index => $column) { if ($name == $index) { return $column; } // recursivity if (method_exists($column, 'hasColumn')) { if ($column-...
php
public function getColumn($name) { // check all the columns foreach ($this->columns as $index => $column) { if ($name == $index) { return $column; } // recursivity if (method_exists($column, 'hasColumn')) { if ($column-...
[ "public", "function", "getColumn", "(", "$", "name", ")", "{", "// check all the columns", "foreach", "(", "$", "this", "->", "columns", "as", "$", "index", "=>", "$", "column", ")", "{", "if", "(", "$", "name", "==", "$", "index", ")", "{", "return", ...
Return the $name column from $column container @param $name @return Column\Column $column
[ "Return", "the", "$name", "column", "from", "$column", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L101-L119
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.getColumnByIndex
public function getColumnByIndex($index) { $keys = array_keys($this->columns); if (empty($keys[$index]) || empty($column = $this->columns[$keys[$index]])) { throw new \InvalidArgumentException('Table don\'t have a column index : ' . $index); } return $column; }
php
public function getColumnByIndex($index) { $keys = array_keys($this->columns); if (empty($keys[$index]) || empty($column = $this->columns[$keys[$index]])) { throw new \InvalidArgumentException('Table don\'t have a column index : ' . $index); } return $column; }
[ "public", "function", "getColumnByIndex", "(", "$", "index", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "this", "->", "columns", ")", ";", "if", "(", "empty", "(", "$", "keys", "[", "$", "index", "]", ")", "||", "empty", "(", "$", "column"...
Return the column from his index @return Column\Column $column
[ "Return", "the", "column", "from", "his", "index" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L126-L134
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addText
public function addText($name, $label = '', $attr = []) { $c = new Column\Text($name, $label, $attr); $this->addColumn($c); return $c; }
php
public function addText($name, $label = '', $attr = []) { $c = new Column\Text($name, $label, $attr); $this->addColumn($c); return $c; }
[ "public", "function", "addText", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "c", "=", "new", "Column", "\\", "Text", "(", "$", "name", ",", "$", "label", ",", "$", "attr", ")", ";", "$", ...
Add Text column to $columns container @param $name @param string $label @param array $attr @return \FrenchFrogs\Table\Column\Text
[ "Add", "Text", "column", "to", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L145-L150
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addNumber
public function addNumber($name, $label = '', $decimal = 2) { $c = new Column\Number($name, $label, $decimal); $this->addColumn($c); return $c; }
php
public function addNumber($name, $label = '', $decimal = 2) { $c = new Column\Number($name, $label, $decimal); $this->addColumn($c); return $c; }
[ "public", "function", "addNumber", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "decimal", "=", "2", ")", "{", "$", "c", "=", "new", "Column", "\\", "Number", "(", "$", "name", ",", "$", "label", ",", "$", "decimal", ")", ";", "$",...
Add number column to $columns container @param $name @param string $label @param int $decimal @return \FrenchFrogs\Table\Column\Number
[ "Add", "number", "column", "to", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L160-L165
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addCode
public function addCode($name, $label = '', $attr = []) { $c = new Column\Code($name, $label, $attr); $this->addColumn($c); return $c; }
php
public function addCode($name, $label = '', $attr = []) { $c = new Column\Code($name, $label, $attr); $this->addColumn($c); return $c; }
[ "public", "function", "addCode", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "c", "=", "new", "Column", "\\", "Code", "(", "$", "name", ",", "$", "label", ",", "$", "attr", ")", ";", "$", ...
Add Code column to $columns container @param $name @param string $label @param array $attr @return \FrenchFrogs\Table\Column\Code
[ "Add", "Code", "column", "to", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L175-L180
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addPre
public function addPre($name, $label = '', $attr = []) { $c = new Column\Pre($name, $label, $attr); $this->addColumn($c); return $c; }
php
public function addPre($name, $label = '', $attr = []) { $c = new Column\Pre($name, $label, $attr); $this->addColumn($c); return $c; }
[ "public", "function", "addPre", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "c", "=", "new", "Column", "\\", "Pre", "(", "$", "name", ",", "$", "label", ",", "$", "attr", ")", ";", "$", "t...
Add Pre column to $columns container @param $name @param string $label @param array $attr @return \FrenchFrogs\Table\Column\Code
[ "Add", "Pre", "column", "to", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L190-L195
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addDate
public function addDate($name, $label = '', $format = null, $attr = []) { $c = new Column\Date($name, $label, $format, $attr); $this->addColumn($c); return $c; }
php
public function addDate($name, $label = '', $format = null, $attr = []) { $c = new Column\Date($name, $label, $format, $attr); $this->addColumn($c); return $c; }
[ "public", "function", "addDate", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "format", "=", "null", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "c", "=", "new", "Column", "\\", "Date", "(", "$", "name", ",", "$", "label", ",...
Add Date column to $columns container @param $name @param string $label @param array $attr @return \FrenchFrogs\Table\Column\Date
[ "Add", "Date", "column", "to", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L221-L226
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addDatetime
public function addDatetime($name, $label = '', $format = null, $attr = []) { $c = new Column\Datetime($name, $label, $format, $attr); $this->addColumn($c); return $c; }
php
public function addDatetime($name, $label = '', $format = null, $attr = []) { $c = new Column\Datetime($name, $label, $format, $attr); $this->addColumn($c); return $c; }
[ "public", "function", "addDatetime", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "format", "=", "null", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "c", "=", "new", "Column", "\\", "Datetime", "(", "$", "name", ",", "$", "labe...
Add Datetime column to $columns container @param $name @param string $label @param array $attr @return \FrenchFrogs\Table\Column\Datetime
[ "Add", "Datetime", "column", "to", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L236-L241
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addBoolean
public function addBoolean($name, $label = '', $attr = []) { $c = new Column\Boolean($name, $label, $attr); $this->addColumn($c); return $c; }
php
public function addBoolean($name, $label = '', $attr = []) { $c = new Column\Boolean($name, $label, $attr); $this->addColumn($c); return $c; }
[ "public", "function", "addBoolean", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "c", "=", "new", "Column", "\\", "Boolean", "(", "$", "name", ",", "$", "label", ",", "$", "attr", ")", ";", "...
Add Boolean column to $columns container @param $name @param string $label @param array $attr @return \FrenchFrogs\Table\Column\Text
[ "Add", "Boolean", "column", "to", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L252-L259
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addRemoteBoolean
public function addRemoteBoolean($name, $label = '', $function = null) { $c = new Column\RemoteBoolean($name, $label, $function); $this->addColumn($c); return $c; }
php
public function addRemoteBoolean($name, $label = '', $function = null) { $c = new Column\RemoteBoolean($name, $label, $function); $this->addColumn($c); return $c; }
[ "public", "function", "addRemoteBoolean", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "function", "=", "null", ")", "{", "$", "c", "=", "new", "Column", "\\", "RemoteBoolean", "(", "$", "name", ",", "$", "label", ",", "$", "function", ...
Add boolean switch @param $name @param string $label @return \FrenchFrogs\Table\Column\RemoteBoolean
[ "Add", "boolean", "switch" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L268-L274
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addRemoteText
public function addRemoteText($name, $label = '', $function = null) { $c = new Column\RemoteText($name, $label, $function); $this->addColumn($c); return $c; }
php
public function addRemoteText($name, $label = '', $function = null) { $c = new Column\RemoteText($name, $label, $function); $this->addColumn($c); return $c; }
[ "public", "function", "addRemoteText", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "function", "=", "null", ")", "{", "$", "c", "=", "new", "Column", "\\", "RemoteText", "(", "$", "name", ",", "$", "label", ",", "$", "function", ")", ...
Add remote text @param $name @param string $label @return \FrenchFrogs\Table\Column\RemoteText
[ "Add", "remote", "text" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L284-L290
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addRemoteSelect
public function addRemoteSelect($name, $label = '', $index = null, $option = [], $function = null) { $c = new Column\RemoteSelect($name, $label, $index, $option, $function); $this->addColumn($c); return $c; }
php
public function addRemoteSelect($name, $label = '', $index = null, $option = [], $function = null) { $c = new Column\RemoteSelect($name, $label, $index, $option, $function); $this->addColumn($c); return $c; }
[ "public", "function", "addRemoteSelect", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "index", "=", "null", ",", "$", "option", "=", "[", "]", ",", "$", "function", "=", "null", ")", "{", "$", "c", "=", "new", "Column", "\\", "Remote...
Add remote select @param $name @param string $label @return \FrenchFrogs\Table\Column\RemoteSelect
[ "Add", "remote", "select" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L299-L305
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addIcon
public function addIcon($name, $label = '', $mapping = []) { $c = new Column\Icon($name, $label, $mapping); $this->addColumn($c); return $c; }
php
public function addIcon($name, $label = '', $mapping = []) { $c = new Column\Icon($name, $label, $mapping); $this->addColumn($c); return $c; }
[ "public", "function", "addIcon", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "mapping", "=", "[", "]", ")", "{", "$", "c", "=", "new", "Column", "\\", "Icon", "(", "$", "name", ",", "$", "label", ",", "$", "mapping", ")", ";", "...
Add Boolean column to $columns container @param $name @param string $label @param array $attr @return \FrenchFrogs\Table\Column\Text
[ "Add", "Boolean", "column", "to", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L315-L322
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addLink
public function addLink($name, $label = '', $link = '#', $binds = [], $attr = [] ) { $c = new Column\Link($name, $label, $link, $binds, $attr); $this->addColumn($c); return $c; }
php
public function addLink($name, $label = '', $link = '#', $binds = [], $attr = [] ) { $c = new Column\Link($name, $label, $link, $binds, $attr); $this->addColumn($c); return $c; }
[ "public", "function", "addLink", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "link", "=", "'#'", ",", "$", "binds", "=", "[", "]", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "c", "=", "new", "Column", "\\", "Link", "(", "...
Add Link columns to $columns container @param $name @param string $label @param string $link @param array $binds @param array $attr @return \FrenchFrogs\Table\Column\Link
[ "Add", "Link", "columns", "to", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L335-L341
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addMedia
public function addMedia($name, $label, $link = '#', $binds = [], $width = 320, $height = 180) { $c = new Column\Media($name, $label, $link, $binds, $width, $height); $this->addColumn($c); return $c; }
php
public function addMedia($name, $label, $link = '#', $binds = [], $width = 320, $height = 180) { $c = new Column\Media($name, $label, $link, $binds, $width, $height); $this->addColumn($c); return $c; }
[ "public", "function", "addMedia", "(", "$", "name", ",", "$", "label", ",", "$", "link", "=", "'#'", ",", "$", "binds", "=", "[", "]", ",", "$", "width", "=", "320", ",", "$", "height", "=", "180", ")", "{", "$", "c", "=", "new", "Column", "\...
Add Link columns to $columns container @param $name @param string $label @param string $link @param array $binds @param array $attr @return \FrenchFrogs\Table\Column\Link
[ "Add", "Link", "columns", "to", "$columns", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L353-L359
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addButton
public function addButton($name, $label = '%s', $link = '#', $binds = [], $attr = [] ) { $c = new Column\Button($name, $label, $link, $binds, $attr); $c->setOptionAsDefault(); $this->addColumn($c); return $c; }
php
public function addButton($name, $label = '%s', $link = '#', $binds = [], $attr = [] ) { $c = new Column\Button($name, $label, $link, $binds, $attr); $c->setOptionAsDefault(); $this->addColumn($c); return $c; }
[ "public", "function", "addButton", "(", "$", "name", ",", "$", "label", "=", "'%s'", ",", "$", "link", "=", "'#'", ",", "$", "binds", "=", "[", "]", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "c", "=", "new", "Column", "\\", "Button", "(...
Add as Button Column @param $name @param string $label @param string $link @param array $binds @param array $attr @return \FrenchFrogs\Table\Column\Button
[ "Add", "as", "Button", "Column" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L372-L379
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addButtonRemote
public function addButtonRemote($name, $label = '%s', $link = '#', $binds = [], $method = 'post' ) { return $this->addButton($name, $label, $link, $binds)->enableRemote($method); }
php
public function addButtonRemote($name, $label = '%s', $link = '#', $binds = [], $method = 'post' ) { return $this->addButton($name, $label, $link, $binds)->enableRemote($method); }
[ "public", "function", "addButtonRemote", "(", "$", "name", ",", "$", "label", "=", "'%s'", ",", "$", "link", "=", "'#'", ",", "$", "binds", "=", "[", "]", ",", "$", "method", "=", "'post'", ")", "{", "return", "$", "this", "->", "addButton", "(", ...
Add remote button as column @param $name @param string $label @param string $link @param array $binds @param array $attr @return \FrenchFrogs\Table\Column\Button
[ "Add", "remote", "button", "as", "column" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L391-L394
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addButtonCallback
public function addButtonCallback($name, $label = '%s', $link = '#', $binds = [], $method = 'post' ) { return $this->addButton($name, $label, $link, $binds)->enableCallback($method); }
php
public function addButtonCallback($name, $label = '%s', $link = '#', $binds = [], $method = 'post' ) { return $this->addButton($name, $label, $link, $binds)->enableCallback($method); }
[ "public", "function", "addButtonCallback", "(", "$", "name", ",", "$", "label", "=", "'%s'", ",", "$", "link", "=", "'#'", ",", "$", "binds", "=", "[", "]", ",", "$", "method", "=", "'post'", ")", "{", "return", "$", "this", "->", "addButton", "(",...
Add remote button as column @param $name @param string $label @param string $link @param array $binds @param array $attr @return \FrenchFrogs\Table\Column\Button
[ "Add", "remote", "button", "as", "column" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L406-L409
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addButtonEdit
public function addButtonEdit($link = '#', $binds = [], $is_remote = true, $method = 'post') { $c = new Column\Button(configurator()->get('button.edit.name'), configurator()->get('button.edit.label'), $link, $binds); $c->setOptionAsPrimary(); $c->icon(configurator()->get('button.edit.icon'...
php
public function addButtonEdit($link = '#', $binds = [], $is_remote = true, $method = 'post') { $c = new Column\Button(configurator()->get('button.edit.name'), configurator()->get('button.edit.label'), $link, $binds); $c->setOptionAsPrimary(); $c->icon(configurator()->get('button.edit.icon'...
[ "public", "function", "addButtonEdit", "(", "$", "link", "=", "'#'", ",", "$", "binds", "=", "[", "]", ",", "$", "is_remote", "=", "true", ",", "$", "method", "=", "'post'", ")", "{", "$", "c", "=", "new", "Column", "\\", "Button", "(", "configurat...
Add default edit button @param string $link @param array $binds @param array $attr @return \FrenchFrogs\Table\Column\Button
[ "Add", "default", "edit", "button" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L420-L433
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addButtonDelete
public function addButtonDelete($link = '#', $binds = [], $is_remote = true, $method = 'delete') { $c = new Column\Button(configurator()->get('button.delete.name'), configurator()->get('button.delete.label'), $link, $binds); $c->setOptionAsDanger(); $c->icon(configurator()->get('button.delet...
php
public function addButtonDelete($link = '#', $binds = [], $is_remote = true, $method = 'delete') { $c = new Column\Button(configurator()->get('button.delete.name'), configurator()->get('button.delete.label'), $link, $binds); $c->setOptionAsDanger(); $c->icon(configurator()->get('button.delet...
[ "public", "function", "addButtonDelete", "(", "$", "link", "=", "'#'", ",", "$", "binds", "=", "[", "]", ",", "$", "is_remote", "=", "true", ",", "$", "method", "=", "'delete'", ")", "{", "$", "c", "=", "new", "Column", "\\", "Button", "(", "config...
Add default delete button @param string $link @param array $binds @param array $attr @return \FrenchFrogs\Table\Column\Button
[ "Add", "default", "delete", "button" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L443-L453
FrenchFrogs/framework
src/Table/Table/Columns.php
Columns.addContainer
public function addContainer($name, $label = '', $attr = []) { $c = new Column\Container($name, $label, $attr); $this->addColumn($c); return $c; }
php
public function addContainer($name, $label = '', $attr = []) { $c = new Column\Container($name, $label, $attr); $this->addColumn($c); return $c; }
[ "public", "function", "addContainer", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "c", "=", "new", "Column", "\\", "Container", "(", "$", "name", ",", "$", "label", ",", "$", "attr", ")", ";",...
Add a container columns @param $name @param string $label @param array $attr @return \FrenchFrogs\Table\Column\Container
[ "Add", "a", "container", "columns" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L465-L470
jpuck/color-mixer
src/Mixer.php
Mixer.addColor
public function addColor($color) { if ( ! $color instanceof Color ) { $color = new Color($color); } $this->colors []= $color; }
php
public function addColor($color) { if ( ! $color instanceof Color ) { $color = new Color($color); } $this->colors []= $color; }
[ "public", "function", "addColor", "(", "$", "color", ")", "{", "if", "(", "!", "$", "color", "instanceof", "Color", ")", "{", "$", "color", "=", "new", "Color", "(", "$", "color", ")", ";", "}", "$", "this", "->", "colors", "[", "]", "=", "$", ...
Adds a color to the Mixer. @param mixed Color object or string @return null
[ "Adds", "a", "color", "to", "the", "Mixer", "." ]
train
https://github.com/jpuck/color-mixer/blob/cea01c3082a921a35e00ae0a287c795d9fd73ada/src/Mixer.php#L28-L35
jpuck/color-mixer
src/Mixer.php
Mixer.mix
public function mix() : Color { foreach ($this->colors as $color) { $colors = $color->dec(); $reds []= $colors[0]; $greens[]= $colors[1]; $blues []= $colors[2]; } $red = dechex( round(array_sum($reds) / count($reds) ) ); $green =...
php
public function mix() : Color { foreach ($this->colors as $color) { $colors = $color->dec(); $reds []= $colors[0]; $greens[]= $colors[1]; $blues []= $colors[2]; } $red = dechex( round(array_sum($reds) / count($reds) ) ); $green =...
[ "public", "function", "mix", "(", ")", ":", "Color", "{", "foreach", "(", "$", "this", "->", "colors", "as", "$", "color", ")", "{", "$", "colors", "=", "$", "color", "->", "dec", "(", ")", ";", "$", "reds", "[", "]", "=", "$", "colors", "[", ...
Get the mixed color. @return Color Returns a new Color object from the Mixer.
[ "Get", "the", "mixed", "color", "." ]
train
https://github.com/jpuck/color-mixer/blob/cea01c3082a921a35e00ae0a287c795d9fd73ada/src/Mixer.php#L52-L73
FrenchFrogs/framework
src/Table/Table/Table.php
Table.extractRows
protected function extractRows() { $source = $this->source; // Laravel query builder case if( $this->isSourceQueryBuilder()) { /** @var $source \Illuminate\Database\Query\Builder */ $count = query(raw("({$source->toSql()}) as a"), [raw('COUNT(*) as _num_rows')], $...
php
protected function extractRows() { $source = $this->source; // Laravel query builder case if( $this->isSourceQueryBuilder()) { /** @var $source \Illuminate\Database\Query\Builder */ $count = query(raw("({$source->toSql()}) as a"), [raw('COUNT(*) as _num_rows')], $...
[ "protected", "function", "extractRows", "(", ")", "{", "$", "source", "=", "$", "this", "->", "source", ";", "// Laravel query builder case", "if", "(", "$", "this", "->", "isSourceQueryBuilder", "(", ")", ")", "{", "/** @var $source \\Illuminate\\Database\\Query\\B...
Extract rows from $source attribute @return $this
[ "Extract", "rows", "from", "$source", "attribute" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Table.php#L218-L254
FrenchFrogs/framework
src/Table/Table/Table.php
Table.isSourceQueryBuilder
public function isSourceQueryBuilder() { return is_object($this->getSource()) && get_class($this->getSource()) == \Illuminate\Database\Query\Builder::class; }
php
public function isSourceQueryBuilder() { return is_object($this->getSource()) && get_class($this->getSource()) == \Illuminate\Database\Query\Builder::class; }
[ "public", "function", "isSourceQueryBuilder", "(", ")", "{", "return", "is_object", "(", "$", "this", "->", "getSource", "(", ")", ")", "&&", "get_class", "(", "$", "this", "->", "getSource", "(", ")", ")", "==", "\\", "Illuminate", "\\", "Database", "\\...
Return true if the source is an instance of \Illuminate\Database\Query\Builder @return bool
[ "Return", "true", "if", "the", "source", "is", "an", "instance", "of", "\\", "Illuminate", "\\", "Database", "\\", "Query", "\\", "Builder" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Table.php#L261-L264
FrenchFrogs/framework
src/Table/Table/Table.php
Table.removeJsonField
public function removeJsonField($field) { $i = array_search($field, $this->jsonField); if ($i !== false) { unset($this->jsonField[$i]); } return $this; }
php
public function removeJsonField($field) { $i = array_search($field, $this->jsonField); if ($i !== false) { unset($this->jsonField[$i]); } return $this; }
[ "public", "function", "removeJsonField", "(", "$", "field", ")", "{", "$", "i", "=", "array_search", "(", "$", "field", ",", "$", "this", "->", "jsonField", ")", ";", "if", "(", "$", "i", "!==", "false", ")", "{", "unset", "(", "$", "this", "->", ...
Remove $field from $jsonField @param $field @return $this
[ "Remove", "$field", "from", "$jsonField" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Table.php#L359-L369
FrenchFrogs/framework
src/Table/Table/Table.php
Table.extractJson
public function extractJson() { foreach($this->getRows() as &$row) { foreach($this->getJsonFields() as $field) { if (isset($row[$field])) { $data = json_decode($row[$field], JSON_OBJECT_AS_ARRAY); foreach((array) $data as $k => $v) { ...
php
public function extractJson() { foreach($this->getRows() as &$row) { foreach($this->getJsonFields() as $field) { if (isset($row[$field])) { $data = json_decode($row[$field], JSON_OBJECT_AS_ARRAY); foreach((array) $data as $k => $v) { ...
[ "public", "function", "extractJson", "(", ")", "{", "foreach", "(", "$", "this", "->", "getRows", "(", ")", "as", "&", "$", "row", ")", "{", "foreach", "(", "$", "this", "->", "getJsonFields", "(", ")", "as", "$", "field", ")", "{", "if", "(", "i...
Extract json data @return $this
[ "Extract", "json", "data" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Table.php#L409-L425
WellCommerce/CoreBundle
DependencyInjection/Compiler/DataSetTransformerPass.php
DataSetTransformerPass.process
public function process(ContainerBuilder $container) { $tag = 'dataset.transformer'; $interface = DataSetTransformerInterface::class; $definition = $container->getDefinition('dataset.transformer.collection'); foreach ($container->findTaggedServiceIds($tag) as $id => $attribu...
php
public function process(ContainerBuilder $container) { $tag = 'dataset.transformer'; $interface = DataSetTransformerInterface::class; $definition = $container->getDefinition('dataset.transformer.collection'); foreach ($container->findTaggedServiceIds($tag) as $id => $attribu...
[ "public", "function", "process", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "tag", "=", "'dataset.transformer'", ";", "$", "interface", "=", "DataSetTransformerInterface", "::", "class", ";", "$", "definition", "=", "$", "container", "->", "getDef...
Processes the container @param ContainerBuilder $container
[ "Processes", "the", "container" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/DependencyInjection/Compiler/DataSetTransformerPass.php#L32-L53
axelitus/php-base
src/BigFloat.php
BigFloat.isEven
public static function isEven($value, $scale = null) { if (!static::is($value)) { throw new \InvalidArgumentException( "The \$value parameter must be of type float (or string representing a big float)." ); } return static::equals(static::mod($value, 2...
php
public static function isEven($value, $scale = null) { if (!static::is($value)) { throw new \InvalidArgumentException( "The \$value parameter must be of type float (or string representing a big float)." ); } return static::equals(static::mod($value, 2...
[ "public", "static", "function", "isEven", "(", "$", "value", ",", "$", "scale", "=", "null", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "value", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"The \\$value paramete...
Tests if the given value is even. @param float|string $value The value to test. @param null|int $scale The scale to use for BCMath functions. If null is given the value set by {@link bcscale()} is used. @throws \InvalidArgumentException @return bool Returns true if the given value is even, false otherwise.
[ "Tests", "if", "the", "given", "value", "is", "even", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L53-L62
axelitus/php-base
src/BigFloat.php
BigFloat.isOdd
public static function isOdd($value, $scale = null) { if (!static::is($value)) { throw new \InvalidArgumentException( "The \$value parameter must be of type float (or string representing a big float)." ); } return static::equals(static::abs(static::mo...
php
public static function isOdd($value, $scale = null) { if (!static::is($value)) { throw new \InvalidArgumentException( "The \$value parameter must be of type float (or string representing a big float)." ); } return static::equals(static::abs(static::mo...
[ "public", "static", "function", "isOdd", "(", "$", "value", ",", "$", "scale", "=", "null", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "value", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"The \\$value parameter...
Tests if the given value is odd. @param float|string $value The value to test. @param null|int $scale The scale to use for BCMath functions. If null is given the value set by {@link bcscale()} is used. @throws \InvalidArgumentException @return bool Returns true if the given value is odd, false otherwise.
[ "Tests", "if", "the", "given", "value", "is", "odd", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L74-L83
axelitus/php-base
src/BigFloat.php
BigFloat.inRange
public static function inRange($value, $lower, $upper, $lowerExclusive = false, $upperExclusive = false) { if (!static::is($value) || !static::is($lower) || !static::is($upper)) { throw new \InvalidArgumentException( "The \$value, \$lower and \$upper parameters must be of type fl...
php
public static function inRange($value, $lower, $upper, $lowerExclusive = false, $upperExclusive = false) { if (!static::is($value) || !static::is($lower) || !static::is($upper)) { throw new \InvalidArgumentException( "The \$value, \$lower and \$upper parameters must be of type fl...
[ "public", "static", "function", "inRange", "(", "$", "value", ",", "$", "lower", ",", "$", "upper", ",", "$", "lowerExclusive", "=", "false", ",", "$", "upperExclusive", "=", "false", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "value",...
Tests if an integer is in a range. Tests if a value is in a range. The function will correct the limits if inverted. The tested range can be set to have its lower and upper limits inclusive (bounds closed) or exclusive (bounds opened) using the $lowerExclusive and $upperExclusive parameters (all possible variations: ]...
[ "Tests", "if", "an", "integer", "is", "in", "a", "range", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L178-L198
axelitus/php-base
src/BigFloat.php
BigFloat.abs
public static function abs($float) { if (!static::is($float)) { throw new \InvalidArgumentException( "The \$float parameter must be of type float (or string representing a big float)." ); } if (Float::is($float)) { return Float::abs($float...
php
public static function abs($float) { if (!static::is($float)) { throw new \InvalidArgumentException( "The \$float parameter must be of type float (or string representing a big float)." ); } if (Float::is($float)) { return Float::abs($float...
[ "public", "static", "function", "abs", "(", "$", "float", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "float", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"The \\$float parameter must be of type float (or string representi...
Gets the absolute value of the given float. @param int|string $float The number to get the absolute value of. @return int|string Returns the absolute value of the given float.
[ "Gets", "the", "absolute", "value", "of", "the", "given", "float", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L245-L258
axelitus/php-base
src/BigFloat.php
BigFloat.add
public static function add($float1, $float2, $scale = null) { if (!static::is($float1) || !static::is($float2)) { throw new \InvalidArgumentException( "The \$float1 and \$float2 parameters must be of type float (or string representing a big float)." ); } ...
php
public static function add($float1, $float2, $scale = null) { if (!static::is($float1) || !static::is($float2)) { throw new \InvalidArgumentException( "The \$float1 and \$float2 parameters must be of type float (or string representing a big float)." ); } ...
[ "public", "static", "function", "add", "(", "$", "float1", ",", "$", "float2", ",", "$", "scale", "=", "null", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "float1", ")", "||", "!", "static", "::", "is", "(", "$", "float2", ")", ")...
Adds a number to another number. @param float|string $float1 The left operand. @param float|string $float2 The right operand. @param null|int $scale The scale to use for BCMath functions. If null is given the value set by {@link bcscale()} is used. @return float|string The result of the operation. @throws \Inval...
[ "Adds", "a", "number", "to", "another", "number", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L272-L289
axelitus/php-base
src/BigFloat.php
BigFloat.sub
public static function sub($float1, $float2, $scale = null) { if (!static::is($float1) || !static::is($float2)) { throw new \InvalidArgumentException( "The \$float1 and \$float2 parameters must be of type float (or string representing a big float)." ); } ...
php
public static function sub($float1, $float2, $scale = null) { if (!static::is($float1) || !static::is($float2)) { throw new \InvalidArgumentException( "The \$float1 and \$float2 parameters must be of type float (or string representing a big float)." ); } ...
[ "public", "static", "function", "sub", "(", "$", "float1", ",", "$", "float2", ",", "$", "scale", "=", "null", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "float1", ")", "||", "!", "static", "::", "is", "(", "$", "float2", ")", ")...
Subtracts a number from another number. @param float|string $float1 The left operand. @param float|string $float2 The right operand. @param null|int $scale The scale to use for BCMath functions. If null is given the value set by {@link bcscale()} is used. @return float|string The result of the operation. @throws...
[ "Subtracts", "a", "number", "from", "another", "number", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L303-L320
axelitus/php-base
src/BigFloat.php
BigFloat.mul
public static function mul($float1, $float2, $scale = null) { if (!static::is($float1) || !static::is($float2)) { throw new \InvalidArgumentException( "The \$float1 and \$float2 parameters must be of type float (or string representing a big float)." ); } ...
php
public static function mul($float1, $float2, $scale = null) { if (!static::is($float1) || !static::is($float2)) { throw new \InvalidArgumentException( "The \$float1 and \$float2 parameters must be of type float (or string representing a big float)." ); } ...
[ "public", "static", "function", "mul", "(", "$", "float1", ",", "$", "float2", ",", "$", "scale", "=", "null", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "float1", ")", "||", "!", "static", "::", "is", "(", "$", "float2", ")", ")...
Multiplies a number by another number. @param float|string $float1 The left operand. @param float|string $float2 The right operand. @param null|int $scale The scale to use for BCMath functions. If null is given the value set by {@link bcscale()} is used. @return float|string The result of the operation. @throws ...
[ "Multiplies", "a", "number", "by", "another", "number", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L334-L351
axelitus/php-base
src/BigFloat.php
BigFloat.div
public static function div($float1, $float2, $scale = null) { if (!static::is($float1) || !static::is($float2)) { throw new \InvalidArgumentException( "The \$float1 and \$float2 parameters must be of type float (or string representing a big float)." ); } ...
php
public static function div($float1, $float2, $scale = null) { if (!static::is($float1) || !static::is($float2)) { throw new \InvalidArgumentException( "The \$float1 and \$float2 parameters must be of type float (or string representing a big float)." ); } ...
[ "public", "static", "function", "div", "(", "$", "float1", ",", "$", "float2", ",", "$", "scale", "=", "null", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "float1", ")", "||", "!", "static", "::", "is", "(", "$", "float2", ")", ")...
Divides a number by another number. @param float|string $float1 The left operand. @param float|string $float2 The right operand. @param null|int $scale The scale to use for BCMath functions. If null is given the value set by {@link bcscale()} is used. @return float|string The result of the operation. @throws \In...
[ "Divides", "a", "number", "by", "another", "number", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L365-L386
axelitus/php-base
src/BigFloat.php
BigFloat.pow
public static function pow($base, $exponent, $scale = null) { if (!static::is($base) || !static::is($exponent)) { throw new \InvalidArgumentException( "The \$base and \$exponent parameters must be of type float (or string representing a big float)." ); } ...
php
public static function pow($base, $exponent, $scale = null) { if (!static::is($base) || !static::is($exponent)) { throw new \InvalidArgumentException( "The \$base and \$exponent parameters must be of type float (or string representing a big float)." ); } ...
[ "public", "static", "function", "pow", "(", "$", "base", ",", "$", "exponent", ",", "$", "scale", "=", "null", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "base", ")", "||", "!", "static", "::", "is", "(", "$", "exponent", ")", ")...
Raises a number to the power of another number. @param float|string $base The base number. @param float|string $exponent The power exponent. @param null|int $scale The scale to use for BCMath functions. If null is given the value set by {@link bcscale()} is used. @return float|string The result of the oper...
[ "Raises", "a", "number", "to", "the", "power", "of", "another", "number", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L400-L417
axelitus/php-base
src/BigFloat.php
BigFloat.mod
public static function mod($base, $modulus, $scale = null) { if (!static::is($base) || !static::is($modulus)) { throw new \InvalidArgumentException( "The \$base and \$modulus parameters must be of type float (or string representing a big float)." ); } ...
php
public static function mod($base, $modulus, $scale = null) { if (!static::is($base) || !static::is($modulus)) { throw new \InvalidArgumentException( "The \$base and \$modulus parameters must be of type float (or string representing a big float)." ); } ...
[ "public", "static", "function", "mod", "(", "$", "base", ",", "$", "modulus", ",", "$", "scale", "=", "null", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "base", ")", "||", "!", "static", "::", "is", "(", "$", "modulus", ")", ")",...
Gets the remainder of a number divided by another number. @param float|string $base The left operand. @param float|string $modulus The right operand. @param null|int $scale The scale to use for BCMath functions. If null is given the value set by {@link bcscale()} is used. @return float|string The result of t...
[ "Gets", "the", "remainder", "of", "a", "number", "divided", "by", "another", "number", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L431-L456
axelitus/php-base
src/BigFloat.php
BigFloat.sqrt
public static function sqrt($base, $scale = null) { if (!static::is($base)) { throw new \InvalidArgumentException( "The \$base parameters must be of type float (or string representing a big float)." ); } if (is_float($base)) { return sqrt(...
php
public static function sqrt($base, $scale = null) { if (!static::is($base)) { throw new \InvalidArgumentException( "The \$base parameters must be of type float (or string representing a big float)." ); } if (is_float($base)) { return sqrt(...
[ "public", "static", "function", "sqrt", "(", "$", "base", ",", "$", "scale", "=", "null", ")", "{", "if", "(", "!", "static", "::", "is", "(", "$", "base", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"The \\$base parameters mu...
Gets the square root of a number. @param float|string $base The base to use. @param null|int $scale The scale to use for BCMath functions. If null is given the value set by {@link bcscale()} is used. @return float|string The result of the operation. @throws \InvalidArgumentException @throws \RuntimeException
[ "Gets", "the", "square", "root", "of", "a", "number", "." ]
train
https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L469-L486