id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
202,200
erenmustafaozdal/laravel-modules-base
src/Repositories/FileRepository.php
FileRepository.getFileName
public function getFileName() { $filename = substr( strrchr( $this->elfinderFilePath, '/' ), 1 ); $parts = explode('.',$filename); $last = array_pop($parts); $filename = str_slug(implode('_',$parts)) . '_' . time(); return $filename . '.' . $last; }
php
public function getFileName() { $filename = substr( strrchr( $this->elfinderFilePath, '/' ), 1 ); $parts = explode('.',$filename); $last = array_pop($parts); $filename = str_slug(implode('_',$parts)) . '_' . time(); return $filename . '.' . $last; }
[ "public", "function", "getFileName", "(", ")", "{", "$", "filename", "=", "substr", "(", "strrchr", "(", "$", "this", "->", "elfinderFilePath", ",", "'/'", ")", ",", "1", ")", ";", "$", "parts", "=", "explode", "(", "'.'", ",", "$", "filename", ")", ...
get file name of the elfinder file @return string
[ "get", "file", "name", "of", "the", "elfinder", "file" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Repositories/FileRepository.php#L202-L209
202,201
erenmustafaozdal/laravel-modules-base
src/Repositories/FileRepository.php
FileRepository.getDatas
public function getDatas($request) { $relation = $this->options['relation']; $columnParams = explode('.',$this->options['column']); if ( ! $relation ) { return [ 'relation_type' => 'not', 'datas' => [ $columnParams[0...
php
public function getDatas($request) { $relation = $this->options['relation']; $columnParams = explode('.',$this->options['column']); if ( ! $relation ) { return [ 'relation_type' => 'not', 'datas' => [ $columnParams[0...
[ "public", "function", "getDatas", "(", "$", "request", ")", "{", "$", "relation", "=", "$", "this", "->", "options", "[", "'relation'", "]", ";", "$", "columnParams", "=", "explode", "(", "'.'", ",", "$", "this", "->", "options", "[", "'column'", "]", ...
get datas for save the database @param $request @return array
[ "get", "datas", "for", "save", "the", "database" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Repositories/FileRepository.php#L228-L269
202,202
erenmustafaozdal/laravel-modules-base
src/Repositories/FileRepository.php
FileRepository.deletePhoto
public function deletePhoto($model, $parentRelation = null) { $thumbs = $this->options['photo']['thumbnails']; $id = is_null($parentRelation) ? $model->id : $model->$parentRelation->id; $path = $this->options['photo']['path'] . "/{$id}"; // delete original $this->delete...
php
public function deletePhoto($model, $parentRelation = null) { $thumbs = $this->options['photo']['thumbnails']; $id = is_null($parentRelation) ? $model->id : $model->$parentRelation->id; $path = $this->options['photo']['path'] . "/{$id}"; // delete original $this->delete...
[ "public", "function", "deletePhoto", "(", "$", "model", ",", "$", "parentRelation", "=", "null", ")", "{", "$", "thumbs", "=", "$", "this", "->", "options", "[", "'photo'", "]", "[", "'thumbnails'", "]", ";", "$", "id", "=", "is_null", "(", "$", "par...
delete file with model path @param \Illuminate\Database\Eloquent\Model $model @param string|null $parentRelation
[ "delete", "file", "with", "model", "path" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Repositories/FileRepository.php#L287-L298
202,203
erenmustafaozdal/laravel-modules-base
src/Repositories/FileRepository.php
FileRepository.deleteDirectories
public function deleteDirectories($model, $parentRelation = null) { $id = is_null($parentRelation) ? $model->id : $model->$parentRelation->id; foreach($this->options as $option){ $this->deleteDirectory($option['path'] . "/{$id}"); } }
php
public function deleteDirectories($model, $parentRelation = null) { $id = is_null($parentRelation) ? $model->id : $model->$parentRelation->id; foreach($this->options as $option){ $this->deleteDirectory($option['path'] . "/{$id}"); } }
[ "public", "function", "deleteDirectories", "(", "$", "model", ",", "$", "parentRelation", "=", "null", ")", "{", "$", "id", "=", "is_null", "(", "$", "parentRelation", ")", "?", "$", "model", "->", "id", ":", "$", "model", "->", "$", "parentRelation", ...
delete multiple directories with model path @param \Illuminate\Database\Eloquent\Model $model @param string|null $parentRelation
[ "delete", "multiple", "directories", "with", "model", "path" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Repositories/FileRepository.php#L316-L322
202,204
erenmustafaozdal/laravel-modules-base
src/Repositories/FileRepository.php
FileRepository.makeDirectoryBeforeUpload
public function makeDirectoryBeforeUpload($path, $cleanDirectory = false) { if (! $this->exists($path)) { $this->makeDirectory($path, 0775, true); return true; } // tamamen silip oluşturmak istendi ise if (($this->exists($path) && $cleanDirectory) || ...
php
public function makeDirectoryBeforeUpload($path, $cleanDirectory = false) { if (! $this->exists($path)) { $this->makeDirectory($path, 0775, true); return true; } // tamamen silip oluşturmak istendi ise if (($this->exists($path) && $cleanDirectory) || ...
[ "public", "function", "makeDirectoryBeforeUpload", "(", "$", "path", ",", "$", "cleanDirectory", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "exists", "(", "$", "path", ")", ")", "{", "$", "this", "->", "makeDirectory", "(", "$", "path",...
if not exists make directory or clean directory @param string $path @param boolean $cleanDirectory @return boolean
[ "if", "not", "exists", "make", "directory", "or", "clean", "directory" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Repositories/FileRepository.php#L332-L350
202,205
Stinger-Soft/TwigExtensions
src/StingerSoft/TwigExtensions/StaticExtensions.php
StaticExtensions.staticProperty
public function staticProperty($class, $property, $args = array()) { if(!class_exists($class)) return null; if(!property_exists($class, $property)) return null; $vars = get_class_vars($class); return $vars[$property]; }
php
public function staticProperty($class, $property, $args = array()) { if(!class_exists($class)) return null; if(!property_exists($class, $property)) return null; $vars = get_class_vars($class); return $vars[$property]; }
[ "public", "function", "staticProperty", "(", "$", "class", ",", "$", "property", ",", "$", "args", "=", "array", "(", ")", ")", "{", "if", "(", "!", "class_exists", "(", "$", "class", ")", ")", "return", "null", ";", "if", "(", "!", "property_exists"...
Calls a static method on the given class @param string $class Full name of the class to execute a method on @param string $function The name of the static method @param array $args The arguments to pass to the method @return NULL|mixed
[ "Calls", "a", "static", "method", "on", "the", "given", "class" ]
7bfce337b0dd33106e22f80b221338451a02d7c5
https://github.com/Stinger-Soft/TwigExtensions/blob/7bfce337b0dd33106e22f80b221338451a02d7c5/src/StingerSoft/TwigExtensions/StaticExtensions.php#L69-L77
202,206
spiral/console
src/Console.php
Console.start
public function start(InputInterface $input = null, OutputInterface $output = null): int { return ContainerScope::runScope($this->container, function () use ($input, $output) { return $this->getApplication()->run($input, $output); }); }
php
public function start(InputInterface $input = null, OutputInterface $output = null): int { return ContainerScope::runScope($this->container, function () use ($input, $output) { return $this->getApplication()->run($input, $output); }); }
[ "public", "function", "start", "(", "InputInterface", "$", "input", "=", "null", ",", "OutputInterface", "$", "output", "=", "null", ")", ":", "int", "{", "return", "ContainerScope", "::", "runScope", "(", "$", "this", "->", "container", ",", "function", "...
Run console application. @param InputInterface|null $input @param OutputInterface|null $output @return int @throws \Throwable
[ "Run", "console", "application", "." ]
c3d99450ddd32bcc6f87e2b2ed40821054a93da3
https://github.com/spiral/console/blob/c3d99450ddd32bcc6f87e2b2ed40821054a93da3/src/Console.php#L64-L69
202,207
spiral/console
src/Console.php
Console.run
public function run( ?string $command, $input = [], OutputInterface $output = null ): CommandOutput { if (is_array($input)) { $input = new ArrayInput($input + compact('command')); } $output = $output ?? new BufferedOutput(); $command = $this->getA...
php
public function run( ?string $command, $input = [], OutputInterface $output = null ): CommandOutput { if (is_array($input)) { $input = new ArrayInput($input + compact('command')); } $output = $output ?? new BufferedOutput(); $command = $this->getA...
[ "public", "function", "run", "(", "?", "string", "$", "command", ",", "$", "input", "=", "[", "]", ",", "OutputInterface", "$", "output", "=", "null", ")", ":", "CommandOutput", "{", "if", "(", "is_array", "(", "$", "input", ")", ")", "{", "$", "in...
Run selected command. @param string $command @param InputInterface|array $input @param OutputInterface|null $output @return CommandOutput @throws \Throwable @throws CommandNotFoundException
[ "Run", "selected", "command", "." ]
c3d99450ddd32bcc6f87e2b2ed40821054a93da3
https://github.com/spiral/console/blob/c3d99450ddd32bcc6f87e2b2ed40821054a93da3/src/Console.php#L82-L102
202,208
spiral/console
src/Console.php
Console.getApplication
public function getApplication(): Application { if (!empty($this->application)) { return $this->application; } $this->application = new Application($this->config->getName(), $this->config->getVersion()); $this->application->setCatchExceptions(false); $this->appli...
php
public function getApplication(): Application { if (!empty($this->application)) { return $this->application; } $this->application = new Application($this->config->getName(), $this->config->getVersion()); $this->application->setCatchExceptions(false); $this->appli...
[ "public", "function", "getApplication", "(", ")", ":", "Application", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "application", ")", ")", "{", "return", "$", "this", "->", "application", ";", "}", "$", "this", "->", "application", "=", "new"...
Get associated Symfony Console Application. @return Application @throws \Spiral\Console\Exception\LocatorException
[ "Get", "associated", "Symfony", "Console", "Application", "." ]
c3d99450ddd32bcc6f87e2b2ed40821054a93da3
https://github.com/spiral/console/blob/c3d99450ddd32bcc6f87e2b2ed40821054a93da3/src/Console.php#L111-L134
202,209
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/NumberFilterer.php
NumberFilterer.format
protected function format() { $number = $this->getParameter('number'); if($number instanceof Meta) { $number = $number->getValue(); } if(empty($number) || !is_numeric($number)) { return 0; } $decimals = $this->getParameter('decimals'); ...
php
protected function format() { $number = $this->getParameter('number'); if($number instanceof Meta) { $number = $number->getValue(); } if(empty($number) || !is_numeric($number)) { return 0; } $decimals = $this->getParameter('decimals'); ...
[ "protected", "function", "format", "(", ")", "{", "$", "number", "=", "$", "this", "->", "getParameter", "(", "'number'", ")", ";", "if", "(", "$", "number", "instanceof", "Meta", ")", "{", "$", "number", "=", "$", "number", "->", "getValue", "(", ")...
wrapper for number_format @return int|string
[ "wrapper", "for", "number_format" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/NumberFilterer.php#L26-L42
202,210
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/NumberFilterer.php
NumberFilterer.bound
protected function bound() { $number = $this->getParameter('number'); $min = $this->getParameter('min'); $max = $this->getParameter('max'); if ($number instanceof Meta) { $number = $number->getValue(); } return NumberUtils::bound($number, $min, $max); ...
php
protected function bound() { $number = $this->getParameter('number'); $min = $this->getParameter('min'); $max = $this->getParameter('max'); if ($number instanceof Meta) { $number = $number->getValue(); } return NumberUtils::bound($number, $min, $max); ...
[ "protected", "function", "bound", "(", ")", "{", "$", "number", "=", "$", "this", "->", "getParameter", "(", "'number'", ")", ";", "$", "min", "=", "$", "this", "->", "getParameter", "(", "'min'", ")", ";", "$", "max", "=", "$", "this", "->", "getP...
Return a number within a range. @return integer
[ "Return", "a", "number", "within", "a", "range", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/NumberFilterer.php#L49-L60
202,211
pharmonic/container
src/Factory.php
Factory.create
public function create($id, ContainerInterface $container) { if (isset($this->registeredList['services'][$id])) { $data = $this->createService($id, $container); } elseif (isset($this->registeredList['params'][$id])) { $data = $this->registeredList['params'][$id]; } el...
php
public function create($id, ContainerInterface $container) { if (isset($this->registeredList['services'][$id])) { $data = $this->createService($id, $container); } elseif (isset($this->registeredList['params'][$id])) { $data = $this->registeredList['params'][$id]; } el...
[ "public", "function", "create", "(", "$", "id", ",", "ContainerInterface", "$", "container", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "registeredList", "[", "'services'", "]", "[", "$", "id", "]", ")", ")", "{", "$", "data", "=", "$", ...
Create service or parameter based on configured dependencies. @param int $id @param ContainerInterface $container @return mixed
[ "Create", "service", "or", "parameter", "based", "on", "configured", "dependencies", "." ]
100e6e1ab34d111da559fa50f40d5fef6dbb1ec3
https://github.com/pharmonic/container/blob/100e6e1ab34d111da559fa50f40d5fef6dbb1ec3/src/Factory.php#L38-L49
202,212
pharmonic/container
src/Factory.php
Factory.createResolver
public function createResolver($namespace, $resolution, $newInstance = false) { if (!$this->hasResolution($namespace)) { if ($newInstance) { $resolution = [$resolution, true]; } $this->registeredList['resolves'][$namespace] = $resolution; } }
php
public function createResolver($namespace, $resolution, $newInstance = false) { if (!$this->hasResolution($namespace)) { if ($newInstance) { $resolution = [$resolution, true]; } $this->registeredList['resolves'][$namespace] = $resolution; } }
[ "public", "function", "createResolver", "(", "$", "namespace", ",", "$", "resolution", ",", "$", "newInstance", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "hasResolution", "(", "$", "namespace", ")", ")", "{", "if", "(", "$", "newInstan...
Resolve a given namespace to given resolution. Will check whether it need new instance or pointed into already defined service according to $newInstance value (default to false) @param string $namespace @param string $resolution @param bool $newInstance
[ "Resolve", "a", "given", "namespace", "to", "given", "resolution", "." ]
100e6e1ab34d111da559fa50f40d5fef6dbb1ec3
https://github.com/pharmonic/container/blob/100e6e1ab34d111da559fa50f40d5fef6dbb1ec3/src/Factory.php#L61-L69
202,213
pharmonic/container
src/Factory.php
Factory.resolveAndCreate
public function resolveAndCreate($namespace, ContainerInterface $container) { $class = new \ReflectionClass($namespace); $arguments = $this->resolveReflectionArguments($class, $container); return $class->newInstanceArgs($arguments); }
php
public function resolveAndCreate($namespace, ContainerInterface $container) { $class = new \ReflectionClass($namespace); $arguments = $this->resolveReflectionArguments($class, $container); return $class->newInstanceArgs($arguments); }
[ "public", "function", "resolveAndCreate", "(", "$", "namespace", ",", "ContainerInterface", "$", "container", ")", "{", "$", "class", "=", "new", "\\", "ReflectionClass", "(", "$", "namespace", ")", ";", "$", "arguments", "=", "$", "this", "->", "resolveRefl...
Instantiate a new object using constructor injection. @param string $namespace @param ContainerInterface $container @return mixed
[ "Instantiate", "a", "new", "object", "using", "constructor", "injection", "." ]
100e6e1ab34d111da559fa50f40d5fef6dbb1ec3
https://github.com/pharmonic/container/blob/100e6e1ab34d111da559fa50f40d5fef6dbb1ec3/src/Factory.php#L79-L85
202,214
field-interactive/cito-bundle
Cito/Navigation.php
Navigation.processNodes
public function processNodes(DOMNode $node) { // get all link nodes $allLinkNodes = $this->xp->query('.//a', $node); $allLinkNodesSortedByLength = []; foreach ($allLinkNodes as $linkNode) { $allLinkNodesSortedByLength[] = [ 'href' => $linkNode->getAttribut...
php
public function processNodes(DOMNode $node) { // get all link nodes $allLinkNodes = $this->xp->query('.//a', $node); $allLinkNodesSortedByLength = []; foreach ($allLinkNodes as $linkNode) { $allLinkNodesSortedByLength[] = [ 'href' => $linkNode->getAttribut...
[ "public", "function", "processNodes", "(", "DOMNode", "$", "node", ")", "{", "// get all link nodes", "$", "allLinkNodes", "=", "$", "this", "->", "xp", "->", "query", "(", "'.//a'", ",", "$", "node", ")", ";", "$", "allLinkNodesSortedByLength", "=", "[", ...
Process node. @param DOMNode $node @return bool|void
[ "Process", "node", "." ]
41cab570f960d964916e278c616720b17de258c1
https://github.com/field-interactive/cito-bundle/blob/41cab570f960d964916e278c616720b17de258c1/Cito/Navigation.php#L87-L141
202,215
field-interactive/cito-bundle
Cito/Navigation.php
Navigation.filterRange
public function filterRange($range) { if (is_int($range)) { $level = $range; $depth = 0; } else { reset($range); $level = key($range); $depth = current($range); } if (1 === $level) { $nodeList = $this->xp->query...
php
public function filterRange($range) { if (is_int($range)) { $level = $range; $depth = 0; } else { reset($range); $level = key($range); $depth = current($range); } if (1 === $level) { $nodeList = $this->xp->query...
[ "public", "function", "filterRange", "(", "$", "range", ")", "{", "if", "(", "is_int", "(", "$", "range", ")", ")", "{", "$", "level", "=", "$", "range", ";", "$", "depth", "=", "0", ";", "}", "else", "{", "reset", "(", "$", "range", ")", ";", ...
Restrict navigation to given range. Examples: $range = 3, only show level 3 $range = array( 1 => 0 ), only show level 1 and 0 nested levels @param array $range @return DOMNode $nodeList
[ "Restrict", "navigation", "to", "given", "range", "." ]
41cab570f960d964916e278c616720b17de258c1
https://github.com/field-interactive/cito-bundle/blob/41cab570f960d964916e278c616720b17de258c1/Cito/Navigation.php#L154-L190
202,216
field-interactive/cito-bundle
Cito/Navigation.php
Navigation.filterBreadcrumb
public function filterBreadcrumb() { $nodeList = $this->xp->query('//li[ contains(@class, "open") or contains(@class, "active")]'); if (0 !== $nodeList->length) { $ul = $this->dom->createElement('ul'); foreach ($nodeList as $node) { $li = $this->dom->createEle...
php
public function filterBreadcrumb() { $nodeList = $this->xp->query('//li[ contains(@class, "open") or contains(@class, "active")]'); if (0 !== $nodeList->length) { $ul = $this->dom->createElement('ul'); foreach ($nodeList as $node) { $li = $this->dom->createEle...
[ "public", "function", "filterBreadcrumb", "(", ")", "{", "$", "nodeList", "=", "$", "this", "->", "xp", "->", "query", "(", "'//li[ contains(@class, \"open\") or contains(@class, \"active\")]'", ")", ";", "if", "(", "0", "!==", "$", "nodeList", "->", "length", "...
Create breadcrumb for current page. @return DOMNode $nodeList
[ "Create", "breadcrumb", "for", "current", "page", "." ]
41cab570f960d964916e278c616720b17de258c1
https://github.com/field-interactive/cito-bundle/blob/41cab570f960d964916e278c616720b17de258c1/Cito/Navigation.php#L197-L210
202,217
field-interactive/cito-bundle
Cito/Navigation.php
Navigation.render
public static function render($navigationFile, $requestedUri = false, $options = null) { $instance = new Navigation($navigationFile, $requestedUri); if ($options) { if (isset($options['breadcrumb'])) { $temp = $instance->filterBreadcrumb(); if ($temp) { ...
php
public static function render($navigationFile, $requestedUri = false, $options = null) { $instance = new Navigation($navigationFile, $requestedUri); if ($options) { if (isset($options['breadcrumb'])) { $temp = $instance->filterBreadcrumb(); if ($temp) { ...
[ "public", "static", "function", "render", "(", "$", "navigationFile", ",", "$", "requestedUri", "=", "false", ",", "$", "options", "=", "null", ")", "{", "$", "instance", "=", "new", "Navigation", "(", "$", "navigationFile", ",", "$", "requestedUri", ")", ...
Static helper function to render Navigation. @param string $navigationSource XML/HTML source, unordered list @param string $requestedUri requested URI @param string $options Navigation options @return string
[ "Static", "helper", "function", "to", "render", "Navigation", "." ]
41cab570f960d964916e278c616720b17de258c1
https://github.com/field-interactive/cito-bundle/blob/41cab570f960d964916e278c616720b17de258c1/Cito/Navigation.php#L221-L237
202,218
vainproject/vain-user
src/User/Entities/User.php
User.sites
public function sites() { if (!class_exists(\Modules\Site\Entities\Page::class, false)) { throw new \Exception('in order to use User::sites() you have to install the \'vain-sites\' module'); } return $this->hasMany(\Modules\Site\Entities\Page::class); }
php
public function sites() { if (!class_exists(\Modules\Site\Entities\Page::class, false)) { throw new \Exception('in order to use User::sites() you have to install the \'vain-sites\' module'); } return $this->hasMany(\Modules\Site\Entities\Page::class); }
[ "public", "function", "sites", "(", ")", "{", "if", "(", "!", "class_exists", "(", "\\", "Modules", "\\", "Site", "\\", "Entities", "\\", "Page", "::", "class", ",", "false", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'in order to use User::...
created static pages. todo make site module trait to include in user entity @throws \Exception @return mixed
[ "created", "static", "pages", "." ]
1c059faa61ebf289fcaea39a90b4523cfc9d6efc
https://github.com/vainproject/vain-user/blob/1c059faa61ebf289fcaea39a90b4523cfc9d6efc/src/User/Entities/User.php#L87-L94
202,219
vainproject/vain-user
src/User/Entities/User.php
User.scopeOnline
public function scopeOnline($query) { $expiryDate = Carbon::now() ->subMinutes(config('session.lifetime')); return $query->where('last_active_at', '>', $expiryDate) ->andWhere('logged_out', false); }
php
public function scopeOnline($query) { $expiryDate = Carbon::now() ->subMinutes(config('session.lifetime')); return $query->where('last_active_at', '>', $expiryDate) ->andWhere('logged_out', false); }
[ "public", "function", "scopeOnline", "(", "$", "query", ")", "{", "$", "expiryDate", "=", "Carbon", "::", "now", "(", ")", "->", "subMinutes", "(", "config", "(", "'session.lifetime'", ")", ")", ";", "return", "$", "query", "->", "where", "(", "'last_act...
queries all possible online users. @param $query @return \Illuminate\Database\Eloquent\Builder|static
[ "queries", "all", "possible", "online", "users", "." ]
1c059faa61ebf289fcaea39a90b4523cfc9d6efc
https://github.com/vainproject/vain-user/blob/1c059faa61ebf289fcaea39a90b4523cfc9d6efc/src/User/Entities/User.php#L135-L142
202,220
vainproject/vain-user
src/User/Entities/User.php
User.getOnlineAttribute
public function getOnlineAttribute($value) { $expiryDate = Carbon::now() ->subMinutes(config('session.lifetime')); return (!$this->logged_out) && $expiryDate->lt($this->last_active_at); }
php
public function getOnlineAttribute($value) { $expiryDate = Carbon::now() ->subMinutes(config('session.lifetime')); return (!$this->logged_out) && $expiryDate->lt($this->last_active_at); }
[ "public", "function", "getOnlineAttribute", "(", "$", "value", ")", "{", "$", "expiryDate", "=", "Carbon", "::", "now", "(", ")", "->", "subMinutes", "(", "config", "(", "'session.lifetime'", ")", ")", ";", "return", "(", "!", "$", "this", "->", "logged_...
accessor for current online state. @param $value @return \Illuminate\Database\Eloquent\Model
[ "accessor", "for", "current", "online", "state", "." ]
1c059faa61ebf289fcaea39a90b4523cfc9d6efc
https://github.com/vainproject/vain-user/blob/1c059faa61ebf289fcaea39a90b4523cfc9d6efc/src/User/Entities/User.php#L151-L158
202,221
vainproject/vain-user
src/User/Entities/User.php
User.saveWithoutTimestamps
public function saveWithoutTimestamps(array $options = []) { $this->timestamps = false; // don't update updated_at $this->save($options); $this->timestamps = true; // forgetting this may result in unexpected behavior }
php
public function saveWithoutTimestamps(array $options = []) { $this->timestamps = false; // don't update updated_at $this->save($options); $this->timestamps = true; // forgetting this may result in unexpected behavior }
[ "public", "function", "saveWithoutTimestamps", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "this", "->", "timestamps", "=", "false", ";", "// don't update updated_at", "$", "this", "->", "save", "(", "$", "options", ")", ";", "$", "this", ...
Save the model to the database without updating the timestamps. @param array $options @return bool
[ "Save", "the", "model", "to", "the", "database", "without", "updating", "the", "timestamps", "." ]
1c059faa61ebf289fcaea39a90b4523cfc9d6efc
https://github.com/vainproject/vain-user/blob/1c059faa61ebf289fcaea39a90b4523cfc9d6efc/src/User/Entities/User.php#L191-L197
202,222
praxigento/mobi_mod_downline
Observer/CustomerSaveAfterDataObject/A/SaveNew.php
SaveNew.getCountryCode
private function getCountryCode() { $posted = $this->appRequest->getPostValue(); if (isset($posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_COUNTRY_CODE])) { $result = $posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_COUNTRY_CODE]; } else { $resu...
php
private function getCountryCode() { $posted = $this->appRequest->getPostValue(); if (isset($posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_COUNTRY_CODE])) { $result = $posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_COUNTRY_CODE]; } else { $resu...
[ "private", "function", "getCountryCode", "(", ")", "{", "$", "posted", "=", "$", "this", "->", "appRequest", "->", "getPostValue", "(", ")", ";", "if", "(", "isset", "(", "$", "posted", "[", "'customer'", "]", "[", "ABlock", "::", "TMPL_FLDGRP", "]", "...
Extract code for customer's registration country from posted data. @return string
[ "Extract", "code", "for", "customer", "s", "registration", "country", "from", "posted", "data", "." ]
0f3c276dfff1aa029f9fd205ccfc56f207a2e75b
https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Observer/CustomerSaveAfterDataObject/A/SaveNew.php#L62-L71
202,223
praxigento/mobi_mod_downline
Observer/CustomerSaveAfterDataObject/A/SaveNew.php
SaveNew.getMlmId
private function getMlmId($customer) { $posted = $this->appRequest->getPostValue(); if ( isset($posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_OWN_MLM_ID]) && !empty($posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_OWN_MLM_ID]) ) { $...
php
private function getMlmId($customer) { $posted = $this->appRequest->getPostValue(); if ( isset($posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_OWN_MLM_ID]) && !empty($posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_OWN_MLM_ID]) ) { $...
[ "private", "function", "getMlmId", "(", "$", "customer", ")", "{", "$", "posted", "=", "$", "this", "->", "appRequest", "->", "getPostValue", "(", ")", ";", "if", "(", "isset", "(", "$", "posted", "[", "'customer'", "]", "[", "ABlock", "::", "TMPL_FLDG...
Extract customer's MLM ID from posted data or generate new one. @param \Magento\Customer\Model\Data\Customer $customer @return string
[ "Extract", "customer", "s", "MLM", "ID", "from", "posted", "data", "or", "generate", "new", "one", "." ]
0f3c276dfff1aa029f9fd205ccfc56f207a2e75b
https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Observer/CustomerSaveAfterDataObject/A/SaveNew.php#L79-L91
202,224
praxigento/mobi_mod_downline
Observer/CustomerSaveAfterDataObject/A/SaveNew.php
SaveNew.getParentId
private function getParentId() { $posted = $this->appRequest->getPostValue(); if (isset($posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_PARENT_MLM_ID])) { $mlmId = $posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_PARENT_MLM_ID]; $found = $this->daoDwnlC...
php
private function getParentId() { $posted = $this->appRequest->getPostValue(); if (isset($posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_PARENT_MLM_ID])) { $mlmId = $posted['customer'][ABlock::TMPL_FLDGRP][ABlock::TMPL_FIELD_PARENT_MLM_ID]; $found = $this->daoDwnlC...
[ "private", "function", "getParentId", "(", ")", "{", "$", "posted", "=", "$", "this", "->", "appRequest", "->", "getPostValue", "(", ")", ";", "if", "(", "isset", "(", "$", "posted", "[", "'customer'", "]", "[", "ABlock", "::", "TMPL_FLDGRP", "]", "[",...
Extract customer's parent ID from posted data or set null to extract it in service later from referral code. @return int|null
[ "Extract", "customer", "s", "parent", "ID", "from", "posted", "data", "or", "set", "null", "to", "extract", "it", "in", "service", "later", "from", "referral", "code", "." ]
0f3c276dfff1aa029f9fd205ccfc56f207a2e75b
https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Observer/CustomerSaveAfterDataObject/A/SaveNew.php#L98-L111
202,225
NukaCode/core
src/NukaCode/Core/Models/BaseModel.php
BaseModel.findExistingReferences
public static function findExistingReferences($model, $field) { $invalid = true; $uniqueString = null; while ($invalid == true) { // Create a new random string. $uniqueString = Str::random($model::$uniqueStringLimit); // Look for any instances of th...
php
public static function findExistingReferences($model, $field) { $invalid = true; $uniqueString = null; while ($invalid == true) { // Create a new random string. $uniqueString = Str::random($model::$uniqueStringLimit); // Look for any instances of th...
[ "public", "static", "function", "findExistingReferences", "(", "$", "model", ",", "$", "field", ")", "{", "$", "invalid", "=", "true", ";", "$", "uniqueString", "=", "null", ";", "while", "(", "$", "invalid", "==", "true", ")", "{", "// Create a new random...
Make sure the uniqueId is always unique. @param string $model The model to search on. @param $field The field to search on. @return string
[ "Make", "sure", "the", "uniqueId", "is", "always", "unique", "." ]
75b20903fb068a7df22cdec34ae729279fbaab3c
https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/Models/BaseModel.php#L180-L199
202,226
FuzeWorks/Core
src/FuzeWorks/TemplateEngine/LatteEngine.php
LatteEngine.setDirectory
public function setDirectory($directory) { if (class_exists('\Latte\Engine', true)) { // If possible, load Latte\Engine $this->latte = new Latte; $this->latte->setTempDirectory(realpath(Core::$tempDir . DS . 'Latte')); } else { ...
php
public function setDirectory($directory) { if (class_exists('\Latte\Engine', true)) { // If possible, load Latte\Engine $this->latte = new Latte; $this->latte->setTempDirectory(realpath(Core::$tempDir . DS . 'Latte')); } else { ...
[ "public", "function", "setDirectory", "(", "$", "directory", ")", "{", "if", "(", "class_exists", "(", "'\\Latte\\Engine'", ",", "true", ")", ")", "{", "// If possible, load Latte\\Engine", "$", "this", "->", "latte", "=", "new", "Latte", ";", "$", "this", "...
Set the directory of the current template. @param string $directory Template Directory
[ "Set", "the", "directory", "of", "the", "current", "template", "." ]
051c64fdaa3a648174cbd54557d05ad553dd826b
https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/TemplateEngine/LatteEngine.php#L60-L72
202,227
jitesoft/php-container
src/Container.php
Container.set
public function set(string $abstract, $concrete, $singleton = false) { if ($this->has($abstract)) { throw new ContainerException( sprintf('An entry with the id "%s" already exists.', $abstract) ); } $this->bindings[$abstract] = new ContainerEntry($abstrac...
php
public function set(string $abstract, $concrete, $singleton = false) { if ($this->has($abstract)) { throw new ContainerException( sprintf('An entry with the id "%s" already exists.', $abstract) ); } $this->bindings[$abstract] = new ContainerEntry($abstrac...
[ "public", "function", "set", "(", "string", "$", "abstract", ",", "$", "concrete", ",", "$", "singleton", "=", "false", ")", "{", "if", "(", "$", "this", "->", "has", "(", "$", "abstract", ")", ")", "{", "throw", "new", "ContainerException", "(", "sp...
Bind a abstract to a concrete. If the concrete is a object and not a string, it will be stored as it is. @param string $abstract @param object|string $concrete @param bool $singleton If the created object is intended to be treated as a single instance on creation. @return bool @throws ContainerException
[ "Bind", "a", "abstract", "to", "a", "concrete", ".", "If", "the", "concrete", "is", "a", "object", "and", "not", "a", "string", "it", "will", "be", "stored", "as", "it", "is", "." ]
e24af8e089f5b46219316f9a9c0e0b2193c256b7
https://github.com/jitesoft/php-container/blob/e24af8e089f5b46219316f9a9c0e0b2193c256b7/src/Container.php#L61-L70
202,228
phpffcms/ffcms-core
src/Helper/Text.php
Text.snippet
public static function snippet(string $text, int $length = 150) { $breakerPos = mb_strpos($text, self::WYSIWYG_BREAK_HTML, null, 'UTF-8'); // offset is founded, try to split preview from full text if ($breakerPos !== false) { $text = Str::sub($text, 0, $breakerPos); } els...
php
public static function snippet(string $text, int $length = 150) { $breakerPos = mb_strpos($text, self::WYSIWYG_BREAK_HTML, null, 'UTF-8'); // offset is founded, try to split preview from full text if ($breakerPos !== false) { $text = Str::sub($text, 0, $breakerPos); } els...
[ "public", "static", "function", "snippet", "(", "string", "$", "text", ",", "int", "$", "length", "=", "150", ")", "{", "$", "breakerPos", "=", "mb_strpos", "(", "$", "text", ",", "self", "::", "WYSIWYG_BREAK_HTML", ",", "null", ",", "'UTF-8'", ")", ";...
Make snippet from text or html-text content. @param string $text @param int $length @return string
[ "Make", "snippet", "from", "text", "or", "html", "-", "text", "content", "." ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Text.php#L17-L46
202,229
mossphp/moss-storage
Moss/Storage/Query/AbstractEntityQuery.php
AbstractEntityQuery.assignEntity
protected function assignEntity($entity) { $entityClass = $this->model->entity(); if ($entity === null) { throw new QueryException(sprintf('Missing required entity of class "%s"', $entityClass)); } if (!is_array($entity) && !$entity instanceof $entityClass) { ...
php
protected function assignEntity($entity) { $entityClass = $this->model->entity(); if ($entity === null) { throw new QueryException(sprintf('Missing required entity of class "%s"', $entityClass)); } if (!is_array($entity) && !$entity instanceof $entityClass) { ...
[ "protected", "function", "assignEntity", "(", "$", "entity", ")", "{", "$", "entityClass", "=", "$", "this", "->", "model", "->", "entity", "(", ")", ";", "if", "(", "$", "entity", "===", "null", ")", "{", "throw", "new", "QueryException", "(", "sprint...
Assigns entity instance Asserts if entity instance is of expected type @param array|object $entity @throws QueryException
[ "Assigns", "entity", "instance", "Asserts", "if", "entity", "instance", "is", "of", "expected", "type" ]
0d123e7ae6bbfce1e2a18e73bf70997277b430c1
https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/AbstractEntityQuery.php#L55-L68
202,230
mossphp/moss-storage
Moss/Storage/Query/AbstractEntityQuery.php
AbstractEntityQuery.setPrimaryKeyConditions
protected function setPrimaryKeyConditions() { foreach ($this->model->primaryFields() as $field) { $value = $this->accessor->getPropertyValue($this->instance, $field->name()); $this->builder->andWhere( sprintf( '%s = %s', $this-...
php
protected function setPrimaryKeyConditions() { foreach ($this->model->primaryFields() as $field) { $value = $this->accessor->getPropertyValue($this->instance, $field->name()); $this->builder->andWhere( sprintf( '%s = %s', $this-...
[ "protected", "function", "setPrimaryKeyConditions", "(", ")", "{", "foreach", "(", "$", "this", "->", "model", "->", "primaryFields", "(", ")", "as", "$", "field", ")", "{", "$", "value", "=", "$", "this", "->", "accessor", "->", "getPropertyValue", "(", ...
Assigns primary condition @throws QueryException
[ "Assigns", "primary", "condition" ]
0d123e7ae6bbfce1e2a18e73bf70997277b430c1
https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/AbstractEntityQuery.php#L75-L87
202,231
vegas-cmf/oauth
src/OAuth/Storage/Session.php
Session.clearToken
public function clearToken($service) { $service = $this->normalizeServiceName($service); $tokens = $this->sessionScope->get(self::SESSION_TOKEN); if (array_key_exists($service, $tokens)) { unset($tokens, $service); } $this->sessionScope->set(self::SESSION_TOKEN, ...
php
public function clearToken($service) { $service = $this->normalizeServiceName($service); $tokens = $this->sessionScope->get(self::SESSION_TOKEN); if (array_key_exists($service, $tokens)) { unset($tokens, $service); } $this->sessionScope->set(self::SESSION_TOKEN, ...
[ "public", "function", "clearToken", "(", "$", "service", ")", "{", "$", "service", "=", "$", "this", "->", "normalizeServiceName", "(", "$", "service", ")", ";", "$", "tokens", "=", "$", "this", "->", "sessionScope", "->", "get", "(", "self", "::", "SE...
Delete the users token. Aka, log out. @param string $service @return TokenStorageInterface
[ "Delete", "the", "users", "token", ".", "Aka", "log", "out", "." ]
5183a60d02cdf3b7db9f3168be1c0bbe1306cddf
https://github.com/vegas-cmf/oauth/blob/5183a60d02cdf3b7db9f3168be1c0bbe1306cddf/src/OAuth/Storage/Session.php#L115-L126
202,232
vegas-cmf/oauth
src/OAuth/Storage/Session.php
Session.hasAuthorizationState
public function hasAuthorizationState($service) { $service = $this->normalizeServiceName($service); $states = $this->sessionScope->get(self::SESSION_STATE); return isset($states[$service]); }
php
public function hasAuthorizationState($service) { $service = $this->normalizeServiceName($service); $states = $this->sessionScope->get(self::SESSION_STATE); return isset($states[$service]); }
[ "public", "function", "hasAuthorizationState", "(", "$", "service", ")", "{", "$", "service", "=", "$", "this", "->", "normalizeServiceName", "(", "$", "service", ")", ";", "$", "states", "=", "$", "this", "->", "sessionScope", "->", "get", "(", "self", ...
Check if an authorization state for a given service exists @param string $service @return bool
[ "Check", "if", "an", "authorization", "state", "for", "a", "given", "service", "exists" ]
5183a60d02cdf3b7db9f3168be1c0bbe1306cddf
https://github.com/vegas-cmf/oauth/blob/5183a60d02cdf3b7db9f3168be1c0bbe1306cddf/src/OAuth/Storage/Session.php#L167-L173
202,233
vegas-cmf/oauth
src/OAuth/Storage/Session.php
Session.clearAuthorizationState
public function clearAuthorizationState($service) { $service = $this->normalizeServiceName($service); $states = $this->sessionScope->get(self::SESSION_STATE); if (array_key_exists($service, $states)) { unset($states, $service); } $this->sessionScope->set(self::SE...
php
public function clearAuthorizationState($service) { $service = $this->normalizeServiceName($service); $states = $this->sessionScope->get(self::SESSION_STATE); if (array_key_exists($service, $states)) { unset($states, $service); } $this->sessionScope->set(self::SE...
[ "public", "function", "clearAuthorizationState", "(", "$", "service", ")", "{", "$", "service", "=", "$", "this", "->", "normalizeServiceName", "(", "$", "service", ")", ";", "$", "states", "=", "$", "this", "->", "sessionScope", "->", "get", "(", "self", ...
Clear the authorization state of a given service @param string $service @return TokenStorageInterface
[ "Clear", "the", "authorization", "state", "of", "a", "given", "service" ]
5183a60d02cdf3b7db9f3168be1c0bbe1306cddf
https://github.com/vegas-cmf/oauth/blob/5183a60d02cdf3b7db9f3168be1c0bbe1306cddf/src/OAuth/Storage/Session.php#L202-L213
202,234
kambalabs/KmbPmProxy
src/KmbPmProxy/Model/PuppetClass.php
PuppetClass.getParameterDefinition
public function getParameterDefinition($name) { if ($this->hasParametersDefinitions()) { foreach ($this->getParametersDefinitions() as $parameterDefinition) { if ($parameterDefinition->name === $name) { return $parameterDefinition; } ...
php
public function getParameterDefinition($name) { if ($this->hasParametersDefinitions()) { foreach ($this->getParametersDefinitions() as $parameterDefinition) { if ($parameterDefinition->name === $name) { return $parameterDefinition; } ...
[ "public", "function", "getParameterDefinition", "(", "$", "name", ")", "{", "if", "(", "$", "this", "->", "hasParametersDefinitions", "(", ")", ")", "{", "foreach", "(", "$", "this", "->", "getParametersDefinitions", "(", ")", "as", "$", "parameterDefinition",...
Get specified parameter definition. @param string $name @return \stdClass
[ "Get", "specified", "parameter", "definition", "." ]
b4c664ae8b6f29e4e8768461ed99e1b0b80bde18
https://github.com/kambalabs/KmbPmProxy/blob/b4c664ae8b6f29e4e8768461ed99e1b0b80bde18/src/KmbPmProxy/Model/PuppetClass.php#L116-L126
202,235
kambalabs/KmbPmProxy
src/KmbPmProxy/Model/PuppetClass.php
PuppetClass.getParameterTemplate
public function getParameterTemplate($name) { if ($this->hasParametersTemplates()) { foreach ($this->getParametersTemplates() as $parameterTemplate) { if ($parameterTemplate->name === $name) { return $parameterTemplate; } } ...
php
public function getParameterTemplate($name) { if ($this->hasParametersTemplates()) { foreach ($this->getParametersTemplates() as $parameterTemplate) { if ($parameterTemplate->name === $name) { return $parameterTemplate; } } ...
[ "public", "function", "getParameterTemplate", "(", "$", "name", ")", "{", "if", "(", "$", "this", "->", "hasParametersTemplates", "(", ")", ")", "{", "foreach", "(", "$", "this", "->", "getParametersTemplates", "(", ")", "as", "$", "parameterTemplate", ")", ...
Get specified parameter template. @param string $name @return \stdClass
[ "Get", "specified", "parameter", "template", "." ]
b4c664ae8b6f29e4e8768461ed99e1b0b80bde18
https://github.com/kambalabs/KmbPmProxy/blob/b4c664ae8b6f29e4e8768461ed99e1b0b80bde18/src/KmbPmProxy/Model/PuppetClass.php#L183-L193
202,236
WellCommerce/PageBundle
Form/Admin/PageFormBuilder.php
PageFormBuilder.addShopFieldset
private function addShopFieldset(FormInterface $form) { $shopsData = $form->addChild($this->getElement('nested_fieldset', [ 'name' => 'shops_data', 'label' => $this->trans('common.fieldset.shops') ])); $shopsData->addChild($this->getElement('multi_select', [ ...
php
private function addShopFieldset(FormInterface $form) { $shopsData = $form->addChild($this->getElement('nested_fieldset', [ 'name' => 'shops_data', 'label' => $this->trans('common.fieldset.shops') ])); $shopsData->addChild($this->getElement('multi_select', [ ...
[ "private", "function", "addShopFieldset", "(", "FormInterface", "$", "form", ")", "{", "$", "shopsData", "=", "$", "form", "->", "addChild", "(", "$", "this", "->", "getElement", "(", "'nested_fieldset'", ",", "[", "'name'", "=>", "'shops_data'", ",", "'labe...
Adds shop selector fieldset to form @param FormInterface $form
[ "Adds", "shop", "selector", "fieldset", "to", "form" ]
c9a1e8c8c52177e3b82f246fd38a4598214aa222
https://github.com/WellCommerce/PageBundle/blob/c9a1e8c8c52177e3b82f246fd38a4598214aa222/Form/Admin/PageFormBuilder.php#L194-L207
202,237
horntell/php-sdk
lib/guzzle/GuzzleHttp/Message/MessageFactory.php
MessageFactory.fromMessage
public function fromMessage($message) { static $parser; if (!$parser) { $parser = new MessageParser(); } // Parse a response if (strtoupper(substr($message, 0, 4)) == 'HTTP') { $data = $parser->parseResponse($message); return $this->create...
php
public function fromMessage($message) { static $parser; if (!$parser) { $parser = new MessageParser(); } // Parse a response if (strtoupper(substr($message, 0, 4)) == 'HTTP') { $data = $parser->parseResponse($message); return $this->create...
[ "public", "function", "fromMessage", "(", "$", "message", ")", "{", "static", "$", "parser", ";", "if", "(", "!", "$", "parser", ")", "{", "$", "parser", "=", "new", "MessageParser", "(", ")", ";", "}", "// Parse a response", "if", "(", "strtoupper", "...
Create a request or response object from an HTTP message string @param string $message Message to parse @return RequestInterface|ResponseInterface @throws \InvalidArgumentException if unable to parse a message
[ "Create", "a", "request", "or", "response", "object", "from", "an", "HTTP", "message", "string" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Message/MessageFactory.php#L89-L123
202,238
horntell/php-sdk
lib/guzzle/GuzzleHttp/Message/MessageFactory.php
MessageFactory.addPostData
protected function addPostData(RequestInterface $request, array $body) { static $fields = ['string' => true, 'array' => true, 'NULL' => true, 'boolean' => true, 'double' => true, 'integer' => true]; $post = new PostBody(); foreach ($body as $key => $value) { if (isse...
php
protected function addPostData(RequestInterface $request, array $body) { static $fields = ['string' => true, 'array' => true, 'NULL' => true, 'boolean' => true, 'double' => true, 'integer' => true]; $post = new PostBody(); foreach ($body as $key => $value) { if (isse...
[ "protected", "function", "addPostData", "(", "RequestInterface", "$", "request", ",", "array", "$", "body", ")", "{", "static", "$", "fields", "=", "[", "'string'", "=>", "true", ",", "'array'", "=>", "true", ",", "'NULL'", "=>", "true", ",", "'boolean'", ...
Apply POST fields and files to a request to attempt to give an accurate representation. @param RequestInterface $request Request to update @param array $body Body to apply
[ "Apply", "POST", "fields", "and", "files", "to", "a", "request", "to", "attempt", "to", "give", "an", "accurate", "representation", "." ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Message/MessageFactory.php#L132-L153
202,239
bheisig/cli
src/JSONFile.php
JSONFile.read
public static function read($file, $force = false) { if (!is_readable($file)) { if ($force === true) { return []; } else { throw new Exception(sprintf( 'Unable to read file "%s"', $file ), ExitApp::RU...
php
public static function read($file, $force = false) { if (!is_readable($file)) { if ($force === true) { return []; } else { throw new Exception(sprintf( 'Unable to read file "%s"', $file ), ExitApp::RU...
[ "public", "static", "function", "read", "(", "$", "file", ",", "$", "force", "=", "false", ")", "{", "if", "(", "!", "is_readable", "(", "$", "file", ")", ")", "{", "if", "(", "$", "force", "===", "true", ")", "{", "return", "[", "]", ";", "}",...
Parse a JSON file @param string $file File path @param bool $force If "true" and file is not readable ignore it, otherwise throw an exception. Defaults to "false". @return array Return content as an array @throws Exception on error
[ "Parse", "a", "JSON", "file" ]
ee77266e173335950357899cdfe86b43c00a6776
https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/JSONFile.php#L45-L79
202,240
bheisig/cli
src/JSONFile.php
JSONFile.write
public static function write($file, array $content) { $jsonString = json_encode($content, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); if ($jsonString === false) { throw new Exception('Unable to convert array to JSON string', ExitApp::RUNTIME_ERROR); } $status = file_put_co...
php
public static function write($file, array $content) { $jsonString = json_encode($content, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); if ($jsonString === false) { throw new Exception('Unable to convert array to JSON string', ExitApp::RUNTIME_ERROR); } $status = file_put_co...
[ "public", "static", "function", "write", "(", "$", "file", ",", "array", "$", "content", ")", "{", "$", "jsonString", "=", "json_encode", "(", "$", "content", ",", "JSON_PRETTY_PRINT", "|", "JSON_UNESCAPED_SLASHES", ")", ";", "if", "(", "$", "jsonString", ...
Write JSON-formatted content to file @param string $file File path @param array $content Content @throws Exception on error
[ "Write", "JSON", "-", "formatted", "content", "to", "file" ]
ee77266e173335950357899cdfe86b43c00a6776
https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/JSONFile.php#L89-L107
202,241
railken/lem
src/Generator.php
Generator.generate
public function generate(string $path, string $namespace, string $name) { $name = $this->camelize($name); $vars = [ 'NAMESPACE' => $namespace, 'NAME' => $name, 'NAME:CAMELIZED' => $name, 'NAME:UNDERSCORE' => $this->underscore($name),...
php
public function generate(string $path, string $namespace, string $name) { $name = $this->camelize($name); $vars = [ 'NAMESPACE' => $namespace, 'NAME' => $name, 'NAME:CAMELIZED' => $name, 'NAME:UNDERSCORE' => $this->underscore($name),...
[ "public", "function", "generate", "(", "string", "$", "path", ",", "string", "$", "namespace", ",", "string", "$", "name", ")", "{", "$", "name", "=", "$", "this", "->", "camelize", "(", "$", "name", ")", ";", "$", "vars", "=", "[", "'NAMESPACE'", ...
Generate a new ModelStructure folder. @param string $path @param string $namespace @param string $name
[ "Generate", "a", "new", "ModelStructure", "folder", "." ]
cff1efcd090a9504b2faf5594121885786dea67a
https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Generator.php#L45-L65
202,242
pryley/castor-framework
src/Forms/Field.php
Field.getField
public function getField( array $args = [] ) { if( empty( $args )) { $args = $this->args; } $className = sprintf( 'GeminiLabs\Castor\Forms\Fields\%s', ucfirst( $args['type'] )); if( !class_exists( $className )) { throw new ReflectionException( "Class does not exist: {$className}" ); } return (new ...
php
public function getField( array $args = [] ) { if( empty( $args )) { $args = $this->args; } $className = sprintf( 'GeminiLabs\Castor\Forms\Fields\%s', ucfirst( $args['type'] )); if( !class_exists( $className )) { throw new ReflectionException( "Class does not exist: {$className}" ); } return (new ...
[ "public", "function", "getField", "(", "array", "$", "args", "=", "[", "]", ")", "{", "if", "(", "empty", "(", "$", "args", ")", ")", "{", "$", "args", "=", "$", "this", "->", "args", ";", "}", "$", "className", "=", "sprintf", "(", "'GeminiLabs\...
Get a specific Field @return mixed GeminiLabs\SiteReviews\Html\Fields\*
[ "Get", "a", "specific", "Field" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Field.php#L48-L61
202,243
pryley/castor-framework
src/Forms/Field.php
Field.normalize
public function normalize( array $args = [] ) { $defaults = [ 'after' => '', 'attributes' => '', 'before' => '', 'class' => '', 'default' => null, 'depends' => null, 'desc' => '', 'errors' => [], 'inline' => false, 'label' => '', 'name...
php
public function normalize( array $args = [] ) { $defaults = [ 'after' => '', 'attributes' => '', 'before' => '', 'class' => '', 'default' => null, 'depends' => null, 'desc' => '', 'errors' => [], 'inline' => false, 'label' => '', 'name...
[ "public", "function", "normalize", "(", "array", "$", "args", "=", "[", "]", ")", "{", "$", "defaults", "=", "[", "'after'", "=>", "''", ",", "'attributes'", "=>", "''", ",", "'before'", "=>", "''", ",", "'class'", "=>", "''", ",", "'default'", "=>",...
Normalize the field arguments @return $this
[ "Normalize", "the", "field", "arguments" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Field.php#L68-L111
202,244
pryley/castor-framework
src/Forms/Field.php
Field.render
public function render( $print = true ) { if( $this->args['render'] === false )return; $field = $this->getField(); $class = 'glsr-field'; $class .= $this->args['errors'] ? ' glsr-has-error' : ''; $renderedString = '%s'; if( ( isset( $field->args['required'] ) && $field->args['required'] ) || ( isse...
php
public function render( $print = true ) { if( $this->args['render'] === false )return; $field = $this->getField(); $class = 'glsr-field'; $class .= $this->args['errors'] ? ' glsr-has-error' : ''; $renderedString = '%s'; if( ( isset( $field->args['required'] ) && $field->args['required'] ) || ( isse...
[ "public", "function", "render", "(", "$", "print", "=", "true", ")", "{", "if", "(", "$", "this", "->", "args", "[", "'render'", "]", "===", "false", ")", "return", ";", "$", "field", "=", "$", "this", "->", "getField", "(", ")", ";", "$", "class...
Render the field @param mixed $print @return string|void
[ "Render", "the", "field" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Field.php#L120-L155
202,245
pryley/castor-framework
src/Forms/Field.php
Field.checkForErrors
protected function checkForErrors( array $atts ) { $args = $this->args; if( !array_key_exists( $atts['name'], $args['errors'] )) { $this->args['errors'] = ''; // set to an empty string return; } $field_errors = $args['errors'][ $atts['name'] ]; $errors = array_reduce( $field_errors['errors'], functi...
php
protected function checkForErrors( array $atts ) { $args = $this->args; if( !array_key_exists( $atts['name'], $args['errors'] )) { $this->args['errors'] = ''; // set to an empty string return; } $field_errors = $args['errors'][ $atts['name'] ]; $errors = array_reduce( $field_errors['errors'], functi...
[ "protected", "function", "checkForErrors", "(", "array", "$", "atts", ")", "{", "$", "args", "=", "$", "this", "->", "args", ";", "if", "(", "!", "array_key_exists", "(", "$", "atts", "[", "'name'", "]", ",", "$", "args", "[", "'errors'", "]", ")", ...
Check for form submission field errors @return void
[ "Check", "for", "form", "submission", "field", "errors" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Field.php#L174-L190
202,246
pryley/castor-framework
src/Forms/Field.php
Field.parseAttributes
protected function parseAttributes( array $args ) { if( empty( $args['attributes'] )) { return []; } $attributes = (array) $args['attributes']; foreach( $attributes as $key => $value ) { if( is_string( $key ))continue; unset( $attributes[ $key ] ); if( !isset( $attributes[ $value ] )) { $attr...
php
protected function parseAttributes( array $args ) { if( empty( $args['attributes'] )) { return []; } $attributes = (array) $args['attributes']; foreach( $attributes as $key => $value ) { if( is_string( $key ))continue; unset( $attributes[ $key ] ); if( !isset( $attributes[ $value ] )) { $attr...
[ "protected", "function", "parseAttributes", "(", "array", "$", "args", ")", "{", "if", "(", "empty", "(", "$", "args", "[", "'attributes'", "]", ")", ")", "{", "return", "[", "]", ";", "}", "$", "attributes", "=", "(", "array", ")", "$", "args", "[...
Parse the field attributes and convert to an array if needed @return array
[ "Parse", "the", "field", "attributes", "and", "convert", "to", "an", "array", "if", "needed" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Field.php#L197-L214
202,247
pryley/castor-framework
src/Forms/Field.php
Field.parseId
protected function parseId( array $args ) { if( isset( $args['id'] ) && !$args['id'] )return; !$args['suffix'] ?: $args['suffix'] = "-{$args['suffix']}"; return str_replace( ['[]','[',']','.'], ['','-','','-'], $this->parseName( $args ) . $args['suffix'] ); }
php
protected function parseId( array $args ) { if( isset( $args['id'] ) && !$args['id'] )return; !$args['suffix'] ?: $args['suffix'] = "-{$args['suffix']}"; return str_replace( ['[]','[',']','.'], ['','-','','-'], $this->parseName( $args ) . $args['suffix'] ); }
[ "protected", "function", "parseId", "(", "array", "$", "args", ")", "{", "if", "(", "isset", "(", "$", "args", "[", "'id'", "]", ")", "&&", "!", "$", "args", "[", "'id'", "]", ")", "return", ";", "!", "$", "args", "[", "'suffix'", "]", "?", ":"...
Parse the field ID from the field path @return null|string
[ "Parse", "the", "field", "ID", "from", "the", "field", "path" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Field.php#L221-L228
202,248
pryley/castor-framework
src/Forms/Field.php
Field.parseName
protected function parseName( array $args ) { $name = $args['name']; $prefix = $this->parsePrefix( $args ); if( $prefix === false ) { return $name; } $paths = explode( '.', $name ); return array_reduce( $paths, function( $result, $value ) { return $result .= "[$value]"; }, $prefix ); }
php
protected function parseName( array $args ) { $name = $args['name']; $prefix = $this->parsePrefix( $args ); if( $prefix === false ) { return $name; } $paths = explode( '.', $name ); return array_reduce( $paths, function( $result, $value ) { return $result .= "[$value]"; }, $prefix ); }
[ "protected", "function", "parseName", "(", "array", "$", "args", ")", "{", "$", "name", "=", "$", "args", "[", "'name'", "]", ";", "$", "prefix", "=", "$", "this", "->", "parsePrefix", "(", "$", "args", ")", ";", "if", "(", "$", "prefix", "===", ...
Parse the field name @return string
[ "Parse", "the", "field", "name" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Field.php#L247-L261
202,249
pryley/castor-framework
src/Forms/Field.php
Field.parseType
protected function parseType( array $args ) { $type = $args['type']; return false !== stripos( $type, '_inline' ) ? str_replace( '_inline', '', $type ) : $type; }
php
protected function parseType( array $args ) { $type = $args['type']; return false !== stripos( $type, '_inline' ) ? str_replace( '_inline', '', $type ) : $type; }
[ "protected", "function", "parseType", "(", "array", "$", "args", ")", "{", "$", "type", "=", "$", "args", "[", "'type'", "]", ";", "return", "false", "!==", "stripos", "(", "$", "type", ",", "'_inline'", ")", "?", "str_replace", "(", "'_inline'", ",", ...
Parse the field type @return string
[ "Parse", "the", "field", "type" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Field.php#L278-L285
202,250
pryley/castor-framework
src/Forms/Field.php
Field.parseValue
protected function parseValue( array $args ) { $default = $args['default']; $name = $args['name']; $prefix = $args['prefix']; $value = $args['value']; if( $default == ':placeholder' ) { $default = ''; } return ( !empty( $value ) || !$name || $prefix === false ) ? $value : $default; }
php
protected function parseValue( array $args ) { $default = $args['default']; $name = $args['name']; $prefix = $args['prefix']; $value = $args['value']; if( $default == ':placeholder' ) { $default = ''; } return ( !empty( $value ) || !$name || $prefix === false ) ? $value : $default; }
[ "protected", "function", "parseValue", "(", "array", "$", "args", ")", "{", "$", "default", "=", "$", "args", "[", "'default'", "]", ";", "$", "name", "=", "$", "args", "[", "'name'", "]", ";", "$", "prefix", "=", "$", "args", "[", "'prefix'", "]",...
Parse the field value @return string
[ "Parse", "the", "field", "value" ]
cbc137d02625cd05f4cc96414d6f70e451cb821f
https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Forms/Field.php#L292-L306
202,251
nicodevs/laito
src/Laito/Http/Response.php
Response.output
public function output($response) { // Set format switch ($this->format) { case 'json': $response = array_merge_recursive($response, $this->extra); $this->header('Content-type: application/json; charset=utf-8'); $response = json_encode($res...
php
public function output($response) { // Set format switch ($this->format) { case 'json': $response = array_merge_recursive($response, $this->extra); $this->header('Content-type: application/json; charset=utf-8'); $response = json_encode($res...
[ "public", "function", "output", "(", "$", "response", ")", "{", "// Set format", "switch", "(", "$", "this", "->", "format", ")", "{", "case", "'json'", ":", "$", "response", "=", "array_merge_recursive", "(", "$", "response", ",", "$", "this", "->", "ex...
Echoes out the response @param array $response Response data @return string HTTP Response
[ "Echoes", "out", "the", "response" ]
d2d28abfcbf981c4decfec28ce94f8849600e9fe
https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Http/Response.php#L99-L130
202,252
nicodevs/laito
src/Laito/Http/Response.php
Response.error
public function error($code, $message, $extra = []) { $response['success'] = false; $this->extra($extra); if (!in_array($code, array_keys($this->errors))) { $code = 500; } $response['error']['code'] = $code; $this->header($this->errors[$code]); $re...
php
public function error($code, $message, $extra = []) { $response['success'] = false; $this->extra($extra); if (!in_array($code, array_keys($this->errors))) { $code = 500; } $response['error']['code'] = $code; $this->header($this->errors[$code]); $re...
[ "public", "function", "error", "(", "$", "code", ",", "$", "message", ",", "$", "extra", "=", "[", "]", ")", "{", "$", "response", "[", "'success'", "]", "=", "false", ";", "$", "this", "->", "extra", "(", "$", "extra", ")", ";", "if", "(", "!"...
Sets an error header and echoes out the response @param int $code Error code @param string $message Error message @return string HTTP Response
[ "Sets", "an", "error", "header", "and", "echoes", "out", "the", "response" ]
d2d28abfcbf981c4decfec28ce94f8849600e9fe
https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Http/Response.php#L139-L151
202,253
nicodevs/laito
src/Laito/Http/Response.php
Response.html
private function html($data) { if (!is_array($data)) { return $data; } $return = ''; foreach ($data as $key => $value) { $return .= '<li>' . $key . ': ' . (is_array($value) ? $this->html($value) : $value) . '</li>'; } return '<ul>' . $return . ...
php
private function html($data) { if (!is_array($data)) { return $data; } $return = ''; foreach ($data as $key => $value) { $return .= '<li>' . $key . ': ' . (is_array($value) ? $this->html($value) : $value) . '</li>'; } return '<ul>' . $return . ...
[ "private", "function", "html", "(", "$", "data", ")", "{", "if", "(", "!", "is_array", "(", "$", "data", ")", ")", "{", "return", "$", "data", ";", "}", "$", "return", "=", "''", ";", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", ...
Transforms an array into an HTML list @param array $data Array of data to transform @return string HTML list
[ "Transforms", "an", "array", "into", "an", "HTML", "list" ]
d2d28abfcbf981c4decfec28ce94f8849600e9fe
https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Http/Response.php#L159-L169
202,254
zewadesign/framework
Zewa/HTTP/Session.php
Session.flashManagement
private function flashManagement() { $flashdata = $_SESSION[$this->flashdataId] ?? null; if ($flashdata !== null) { $flashdata = unserialize(base64_decode($flashdata)); unset($_SESSION[$this->flashdataId]); if (!empty($flashdata)) { $this->flashda...
php
private function flashManagement() { $flashdata = $_SESSION[$this->flashdataId] ?? null; if ($flashdata !== null) { $flashdata = unserialize(base64_decode($flashdata)); unset($_SESSION[$this->flashdataId]); if (!empty($flashdata)) { $this->flashda...
[ "private", "function", "flashManagement", "(", ")", "{", "$", "flashdata", "=", "$", "_SESSION", "[", "$", "this", "->", "flashdataId", "]", "??", "null", ";", "if", "(", "$", "flashdata", "!==", "null", ")", "{", "$", "flashdata", "=", "unserialize", ...
Processes current requests flashdata, recycles old. @access private
[ "Processes", "current", "requests", "flashdata", "recycles", "old", "." ]
be74e41c674ac2c2ef924752ed310cfbaafe33b8
https://github.com/zewadesign/framework/blob/be74e41c674ac2c2ef924752ed310cfbaafe33b8/Zewa/HTTP/Session.php#L33-L45
202,255
zewadesign/framework
Zewa/HTTP/Session.php
Session.set
public function set(string $key, $value) { $key = $this->security->normalize($key); $value = $this->security->normalize($value); parent::set($key, $value); // TODO: Change the autogenerated stub $_SESSION[$key] = $value; }
php
public function set(string $key, $value) { $key = $this->security->normalize($key); $value = $this->security->normalize($value); parent::set($key, $value); // TODO: Change the autogenerated stub $_SESSION[$key] = $value; }
[ "public", "function", "set", "(", "string", "$", "key", ",", "$", "value", ")", "{", "$", "key", "=", "$", "this", "->", "security", "->", "normalize", "(", "$", "key", ")", ";", "$", "value", "=", "$", "this", "->", "security", "->", "normalize", ...
In addition, most superglobals are immuteable, whereas session is not
[ "In", "addition", "most", "superglobals", "are", "immuteable", "whereas", "session", "is", "not" ]
be74e41c674ac2c2ef924752ed310cfbaafe33b8
https://github.com/zewadesign/framework/blob/be74e41c674ac2c2ef924752ed310cfbaafe33b8/Zewa/HTTP/Session.php#L66-L72
202,256
zewadesign/framework
Zewa/HTTP/Session.php
Session.destroy
public function destroy() { $_SESSION = []; if (ini_get("session.use_cookies")) { $params = session_get_cookie_params(); $time = time() - 42000; $path = $params['path']; $domain = $params['domain']; $secure = $params['secure']; ...
php
public function destroy() { $_SESSION = []; if (ini_get("session.use_cookies")) { $params = session_get_cookie_params(); $time = time() - 42000; $path = $params['path']; $domain = $params['domain']; $secure = $params['secure']; ...
[ "public", "function", "destroy", "(", ")", "{", "$", "_SESSION", "=", "[", "]", ";", "if", "(", "ini_get", "(", "\"session.use_cookies\"", ")", ")", "{", "$", "params", "=", "session_get_cookie_params", "(", ")", ";", "$", "time", "=", "time", "(", ")"...
destroys a session and related cookies
[ "destroys", "a", "session", "and", "related", "cookies" ]
be74e41c674ac2c2ef924752ed310cfbaafe33b8
https://github.com/zewadesign/framework/blob/be74e41c674ac2c2ef924752ed310cfbaafe33b8/Zewa/HTTP/Session.php#L102-L120
202,257
itcreator/custom-cmf
Module/Component/src/Cmf/Component/Grid/Pager.php
Pager.loadItemsForCurrentPage
protected function loadItemsForCurrentPage() { $items = $this->adapter->getItems($this->getOffset(), $this->itemsCountPerPage, $this->sort); if (!($items instanceof \Traversable)) { $this->items = new \ArrayIterator($items); } else { $this->items = $items; } ...
php
protected function loadItemsForCurrentPage() { $items = $this->adapter->getItems($this->getOffset(), $this->itemsCountPerPage, $this->sort); if (!($items instanceof \Traversable)) { $this->items = new \ArrayIterator($items); } else { $this->items = $items; } ...
[ "protected", "function", "loadItemsForCurrentPage", "(", ")", "{", "$", "items", "=", "$", "this", "->", "adapter", "->", "getItems", "(", "$", "this", "->", "getOffset", "(", ")", ",", "$", "this", "->", "itemsCountPerPage", ",", "$", "this", "->", "sor...
Method load items for current page @return void
[ "Method", "load", "items", "for", "current", "page" ]
42fc0535dfa0f641856f06673f6ab596b2020c40
https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/Component/src/Cmf/Component/Grid/Pager.php#L102-L110
202,258
brightnucleus/options-store
src/OptionRepository/AbstractOptionRepository.php
AbstractOptionRepository.initialize
protected function initialize(array $options) { foreach ($options as $option) { if (! $option instanceof Option) { throw InvalidOption::fromOption($option); } $option = $this->identityMap->put($option, $this); $this->schema[$option->getKey()]...
php
protected function initialize(array $options) { foreach ($options as $option) { if (! $option instanceof Option) { throw InvalidOption::fromOption($option); } $option = $this->identityMap->put($option, $this); $this->schema[$option->getKey()]...
[ "protected", "function", "initialize", "(", "array", "$", "options", ")", "{", "foreach", "(", "$", "options", "as", "$", "option", ")", "{", "if", "(", "!", "$", "option", "instanceof", "Option", ")", "{", "throw", "InvalidOption", "::", "fromOption", "...
Initialize the internal state of the repository. @since 0.1.0 @param array $options
[ "Initialize", "the", "internal", "state", "of", "the", "repository", "." ]
9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1
https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/OptionRepository/AbstractOptionRepository.php#L82-L93
202,259
squareproton/Bond
src/Bond/Pg/ConnectionSettings.php
ConnectionSettings.getConnectionString
public function getConnectionString() { $settings = $this->connectionInfo; unset( $settings['search_path'] ); foreach ($settings as $key => &$value) { $value = sprintf( "%s='%s'", $key, $value ); } ret...
php
public function getConnectionString() { $settings = $this->connectionInfo; unset( $settings['search_path'] ); foreach ($settings as $key => &$value) { $value = sprintf( "%s='%s'", $key, $value ); } ret...
[ "public", "function", "getConnectionString", "(", ")", "{", "$", "settings", "=", "$", "this", "->", "connectionInfo", ";", "unset", "(", "$", "settings", "[", "'search_path'", "]", ")", ";", "foreach", "(", "$", "settings", "as", "$", "key", "=>", "&", ...
Generate a property formatted postgres connection string @param array $settings array( 'host' =>, 'port' =>, 'dbname' =>, 'user' => , 'password' => ) @return string a pg_connect compatable connectio string
[ "Generate", "a", "property", "formatted", "postgres", "connection", "string" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/ConnectionSettings.php#L41-L57
202,260
fulgurio/LightCMSBundle
Repository/MediaRepository.php
MediaRepository.findAllWithPagination
public function findAllWithPagination($filters, $limit, $offset, $resultInArray = FALSE) { $where = $this->getQueryFilter($filters); $query = $this->getEntityManager()->createQuery('SELECT m FROM FulgurioLightCMSBundle:Media m ' . $where . ' ORDER BY m.created_at DESC')->setMaxResults($limit)->setFi...
php
public function findAllWithPagination($filters, $limit, $offset, $resultInArray = FALSE) { $where = $this->getQueryFilter($filters); $query = $this->getEntityManager()->createQuery('SELECT m FROM FulgurioLightCMSBundle:Media m ' . $where . ' ORDER BY m.created_at DESC')->setMaxResults($limit)->setFi...
[ "public", "function", "findAllWithPagination", "(", "$", "filters", ",", "$", "limit", ",", "$", "offset", ",", "$", "resultInArray", "=", "FALSE", ")", "{", "$", "where", "=", "$", "this", "->", "getQueryFilter", "(", "$", "filters", ")", ";", "$", "q...
Find media with pagination @param array $filters @param number $limit @param number $offset @param boolean $resultInArray @return array
[ "Find", "media", "with", "pagination" ]
66319af52b97b6552b7c391ee370538263f42d10
https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Repository/MediaRepository.php#L33-L49
202,261
fulgurio/LightCMSBundle
Repository/MediaRepository.php
MediaRepository.count
public function count($filters) { $where = $this->getQueryFilter($filters); $query = $this->getEntityManager()->createQuery('SELECT COUNT(m) FROM FulgurioLightCMSBundle:Media m' . $where); if (!empty($filters)) { foreach ($filters as $filterKey => $filterValue) ...
php
public function count($filters) { $where = $this->getQueryFilter($filters); $query = $this->getEntityManager()->createQuery('SELECT COUNT(m) FROM FulgurioLightCMSBundle:Media m' . $where); if (!empty($filters)) { foreach ($filters as $filterKey => $filterValue) ...
[ "public", "function", "count", "(", "$", "filters", ")", "{", "$", "where", "=", "$", "this", "->", "getQueryFilter", "(", "$", "filters", ")", ";", "$", "query", "=", "$", "this", "->", "getEntityManager", "(", ")", "->", "createQuery", "(", "'SELECT ...
Count number of result @param array $filters @return Ambigous <\Doctrine\ORM\mixed, mixed, \Doctrine\ORM\Internal\Hydration\mixed, \Doctrine\DBAL\Driver\Statement>
[ "Count", "number", "of", "result" ]
66319af52b97b6552b7c391ee370538263f42d10
https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Repository/MediaRepository.php#L57-L69
202,262
fulgurio/LightCMSBundle
Repository/MediaRepository.php
MediaRepository.getQueryFilter
private function getQueryFilter($filters) { $where = ''; if (!empty($filters)) { foreach ($filters as $filterKey => $filterValue) { $where .= ' AND m.' . $filterKey . ' LIKE :' . $filterKey; } $where = ' WHERE ' . substr($where,...
php
private function getQueryFilter($filters) { $where = ''; if (!empty($filters)) { foreach ($filters as $filterKey => $filterValue) { $where .= ' AND m.' . $filterKey . ' LIKE :' . $filterKey; } $where = ' WHERE ' . substr($where,...
[ "private", "function", "getQueryFilter", "(", "$", "filters", ")", "{", "$", "where", "=", "''", ";", "if", "(", "!", "empty", "(", "$", "filters", ")", ")", "{", "foreach", "(", "$", "filters", "as", "$", "filterKey", "=>", "$", "filterValue", ")", ...
Make query filter string, from given filters @param array $filters @return string
[ "Make", "query", "filter", "string", "from", "given", "filters" ]
66319af52b97b6552b7c391ee370538263f42d10
https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Repository/MediaRepository.php#L77-L89
202,263
mtils/file-db
src/FileDB/Model/EmsFileDBModel.php
EmsFileDBModel.removeDeletedFsChildrenFromDb
protected function removeDeletedFsChildrenFromDb($dbChildren) { $existingChildren = []; // First delete all children that do not exist in fs foreach ($dbChildren as $child) { if (!$this->filesystem->exists($child->getPath())) { $this->nodeRepository->delete($chi...
php
protected function removeDeletedFsChildrenFromDb($dbChildren) { $existingChildren = []; // First delete all children that do not exist in fs foreach ($dbChildren as $child) { if (!$this->filesystem->exists($child->getPath())) { $this->nodeRepository->delete($chi...
[ "protected", "function", "removeDeletedFsChildrenFromDb", "(", "$", "dbChildren", ")", "{", "$", "existingChildren", "=", "[", "]", ";", "// First delete all children that do not exist in fs", "foreach", "(", "$", "dbChildren", "as", "$", "child", ")", "{", "if", "(...
Delete the non existing @param CanHaveParent[] $dbChildren @return array
[ "Delete", "the", "non", "existing" ]
270ebc26b0fa3d2c996ca8861507fa63d2db6814
https://github.com/mtils/file-db/blob/270ebc26b0fa3d2c996ca8861507fa63d2db6814/src/FileDB/Model/EmsFileDBModel.php#L414-L429
202,264
mtils/file-db
src/FileDB/Model/EmsFileDBModel.php
EmsFileDBModel.absoluteToFilesystemPath
protected function absoluteToFilesystemPath($filePath) { if (!$this->isWithinFilesystem($filePath)) { return $filePath; } $fsPath = (string)$this->filesystem->url()->path; return str_replace($fsPath,'', $filePath); }
php
protected function absoluteToFilesystemPath($filePath) { if (!$this->isWithinFilesystem($filePath)) { return $filePath; } $fsPath = (string)$this->filesystem->url()->path; return str_replace($fsPath,'', $filePath); }
[ "protected", "function", "absoluteToFilesystemPath", "(", "$", "filePath", ")", "{", "if", "(", "!", "$", "this", "->", "isWithinFilesystem", "(", "$", "filePath", ")", ")", "{", "return", "$", "filePath", ";", "}", "$", "fsPath", "=", "(", "string", ")"...
Cat the absolute part of a file path off to make a relative filesystem path @param string $filePath @return string
[ "Cat", "the", "absolute", "part", "of", "a", "file", "path", "off", "to", "make", "a", "relative", "filesystem", "path" ]
270ebc26b0fa3d2c996ca8861507fa63d2db6814
https://github.com/mtils/file-db/blob/270ebc26b0fa3d2c996ca8861507fa63d2db6814/src/FileDB/Model/EmsFileDBModel.php#L538-L549
202,265
mtils/file-db
src/FileDB/Model/EmsFileDBModel.php
EmsFileDBModel.isExcludedFromDb
protected function isExcludedFromDb($basename) { if (in_array(mb_strtolower($basename), $this->excludeFromDb)) { return true; } return Helper::startsWith($basename, '.') || Helper::startsWith($basename, '_'); }
php
protected function isExcludedFromDb($basename) { if (in_array(mb_strtolower($basename), $this->excludeFromDb)) { return true; } return Helper::startsWith($basename, '.') || Helper::startsWith($basename, '_'); }
[ "protected", "function", "isExcludedFromDb", "(", "$", "basename", ")", "{", "if", "(", "in_array", "(", "mb_strtolower", "(", "$", "basename", ")", ",", "$", "this", "->", "excludeFromDb", ")", ")", "{", "return", "true", ";", "}", "return", "Helper", "...
Return true if the passed file should not be mirrored in the db. @param string $basename @return bool
[ "Return", "true", "if", "the", "passed", "file", "should", "not", "be", "mirrored", "in", "the", "db", "." ]
270ebc26b0fa3d2c996ca8861507fa63d2db6814
https://github.com/mtils/file-db/blob/270ebc26b0fa3d2c996ca8861507fa63d2db6814/src/FileDB/Model/EmsFileDBModel.php#L801-L809
202,266
mtils/cmsable
src/Cmsable/Routing/ControllerCreator.php
ControllerCreator.createController
public function createController($name, SiteTreeNodeInterface $page=null) { $this->page = $page; $controller = $this->makeController($name); $this->modifyController($controller, $page); return $controller; }
php
public function createController($name, SiteTreeNodeInterface $page=null) { $this->page = $page; $controller = $this->makeController($name); $this->modifyController($controller, $page); return $controller; }
[ "public", "function", "createController", "(", "$", "name", ",", "SiteTreeNodeInterface", "$", "page", "=", "null", ")", "{", "$", "this", "->", "page", "=", "$", "page", ";", "$", "controller", "=", "$", "this", "->", "makeController", "(", "$", "name",...
Creates a controller while routing to a page. This method is used to configure dependencies of you controller according to a page. You can also configure your controller directly like setting a a layout @param string $controllerName The classname of the routed controller @param \Cmsable\Model\SiteTreeNodeInterface $pa...
[ "Creates", "a", "controller", "while", "routing", "to", "a", "page", ".", "This", "method", "is", "used", "to", "configure", "dependencies", "of", "you", "controller", "according", "to", "a", "page", ".", "You", "can", "also", "configure", "your", "controlle...
03ae84ee3c7d46146f2a1cf687e5c29d6de4286d
https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Routing/ControllerCreator.php#L42-L53
202,267
battis/simplecache
src/HierarchicalSimpleCache.php
HierarchicalSimpleCache.pushKey
public function pushKey($layer) { $this->base .= $this->delimiter . str_replace($this->delimiter, $this->placeholder, $layer); return $this->getBase(); }
php
public function pushKey($layer) { $this->base .= $this->delimiter . str_replace($this->delimiter, $this->placeholder, $layer); return $this->getBase(); }
[ "public", "function", "pushKey", "(", "$", "layer", ")", "{", "$", "this", "->", "base", ".=", "$", "this", "->", "delimiter", ".", "str_replace", "(", "$", "this", "->", "delimiter", ",", "$", "this", "->", "placeholder", ",", "$", "layer", ")", ";"...
Add a layer of depth to the key hierarchy @param string $layer @return string The new base key
[ "Add", "a", "layer", "of", "depth", "to", "the", "key", "hierarchy" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/HierarchicalSimpleCache.php#L64-L68
202,268
battis/simplecache
src/HierarchicalSimpleCache.php
HierarchicalSimpleCache.popKey
public function popKey() { if (strlen($this->base)) { $layers = explode($this->delimiter, $this->base); $last = count($layers) - 1; $layer = $layers[$last]; if ($last > 0) { unset ($layers[$last]); $this->base = implode($this->d...
php
public function popKey() { if (strlen($this->base)) { $layers = explode($this->delimiter, $this->base); $last = count($layers) - 1; $layer = $layers[$last]; if ($last > 0) { unset ($layers[$last]); $this->base = implode($this->d...
[ "public", "function", "popKey", "(", ")", "{", "if", "(", "strlen", "(", "$", "this", "->", "base", ")", ")", "{", "$", "layers", "=", "explode", "(", "$", "this", "->", "delimiter", ",", "$", "this", "->", "base", ")", ";", "$", "last", "=", "...
Remove a layer of depth from the key hierarchy @return string|null The layer that was removed from the hierarchy (`NULL` if no layers exist)
[ "Remove", "a", "layer", "of", "depth", "from", "the", "key", "hierarchy" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/HierarchicalSimpleCache.php#L76-L92
202,269
togucms/MediaBundle
Controller/GalleryController.php
GalleryController.postGalleryAction
public function postGalleryAction() { $serializer = $this->get("tpg_extjs.phpcr_serializer"); $entity = $serializer->deserialize( $this->getRequest()->getContent(), 'Togu\MediaBundle\Document\Gallery', 'json', DeserializationContext::create()->setGroups(ar...
php
public function postGalleryAction() { $serializer = $this->get("tpg_extjs.phpcr_serializer"); $entity = $serializer->deserialize( $this->getRequest()->getContent(), 'Togu\MediaBundle\Document\Gallery', 'json', DeserializationContext::create()->setGroups(ar...
[ "public", "function", "postGalleryAction", "(", ")", "{", "$", "serializer", "=", "$", "this", "->", "get", "(", "\"tpg_extjs.phpcr_serializer\"", ")", ";", "$", "entity", "=", "$", "serializer", "->", "deserialize", "(", "$", "this", "->", "getRequest", "("...
Create a new Gallery record @return \Symfony\Component\HttpFoundation\Response
[ "Create", "a", "new", "Gallery", "record" ]
42065d5fa419654540a52ae8f0047708eac9930b
https://github.com/togucms/MediaBundle/blob/42065d5fa419654540a52ae8f0047708eac9930b/Controller/GalleryController.php#L225-L256
202,270
stellaqua/Waltz.Stagehand
src/Waltz/Stagehand/CuiUtility/DecorationsObject.php
DecorationsObject.getBackgroundColorEscapeSequence
public function getBackgroundColorEscapeSequence ( $colorName = '' ) { if ( $this->_isDefinedColor($colorName) === true ) { $colors = self::getDefinedColors(); list($textColor, $backgroundColor) = $colors[$colorName]; return $backgroundColor; } return ''; ...
php
public function getBackgroundColorEscapeSequence ( $colorName = '' ) { if ( $this->_isDefinedColor($colorName) === true ) { $colors = self::getDefinedColors(); list($textColor, $backgroundColor) = $colors[$colorName]; return $backgroundColor; } return ''; ...
[ "public", "function", "getBackgroundColorEscapeSequence", "(", "$", "colorName", "=", "''", ")", "{", "if", "(", "$", "this", "->", "_isDefinedColor", "(", "$", "colorName", ")", "===", "true", ")", "{", "$", "colors", "=", "self", "::", "getDefinedColors", ...
Get Background color escape sequence @param string $color Color name @return string background color escape sequence
[ "Get", "Background", "color", "escape", "sequence" ]
01df286751f5b9a5c90c47138dca3709e5bc383b
https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/DecorationsObject.php#L117-L124
202,271
stellaqua/Waltz.Stagehand
src/Waltz/Stagehand/CuiUtility/DecorationsObject.php
DecorationsObject.setIsBold
public function setIsBold ( $isBold ) { if ( $isBold === true ) { $this->_isBold = true; } else { $this->_isBold = false; } }
php
public function setIsBold ( $isBold ) { if ( $isBold === true ) { $this->_isBold = true; } else { $this->_isBold = false; } }
[ "public", "function", "setIsBold", "(", "$", "isBold", ")", "{", "if", "(", "$", "isBold", "===", "true", ")", "{", "$", "this", "->", "_isBold", "=", "true", ";", "}", "else", "{", "$", "this", "->", "_isBold", "=", "false", ";", "}", "}" ]
Set which is bold @param bool $isBold
[ "Set", "which", "is", "bold" ]
01df286751f5b9a5c90c47138dca3709e5bc383b
https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/DecorationsObject.php#L161-L167
202,272
stellaqua/Waltz.Stagehand
src/Waltz/Stagehand/CuiUtility/DecorationsObject.php
DecorationsObject.setIsUnderlined
public function setIsUnderlined ( $isUnderlined ) { if ( $isUnderlined === true ) { $this->_isUnderlined = true; } else { $this->_isUnderlined = false; } }
php
public function setIsUnderlined ( $isUnderlined ) { if ( $isUnderlined === true ) { $this->_isUnderlined = true; } else { $this->_isUnderlined = false; } }
[ "public", "function", "setIsUnderlined", "(", "$", "isUnderlined", ")", "{", "if", "(", "$", "isUnderlined", "===", "true", ")", "{", "$", "this", "->", "_isUnderlined", "=", "true", ";", "}", "else", "{", "$", "this", "->", "_isUnderlined", "=", "false"...
Set which is underlined @param bool $isUnderlined
[ "Set", "which", "is", "underlined" ]
01df286751f5b9a5c90c47138dca3709e5bc383b
https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/DecorationsObject.php#L193-L199
202,273
stellaqua/Waltz.Stagehand
src/Waltz/Stagehand/CuiUtility/DecorationsObject.php
DecorationsObject._isDefinedColor
private function _isDefinedColor ( $colorName ) { $colors = self::getDefinedColors(); $colorNames = array_keys($colors); return in_array($colorName, $colorNames); }
php
private function _isDefinedColor ( $colorName ) { $colors = self::getDefinedColors(); $colorNames = array_keys($colors); return in_array($colorName, $colorNames); }
[ "private", "function", "_isDefinedColor", "(", "$", "colorName", ")", "{", "$", "colors", "=", "self", "::", "getDefinedColors", "(", ")", ";", "$", "colorNames", "=", "array_keys", "(", "$", "colors", ")", ";", "return", "in_array", "(", "$", "colorName",...
Which is defined color @param string $colorName Color name @return bool Which is defined color
[ "Which", "is", "defined", "color" ]
01df286751f5b9a5c90c47138dca3709e5bc383b
https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility/DecorationsObject.php#L217-L221
202,274
shgysk8zer0/core_api
traits/events.php
Events.triggerEvent
final protected static function triggerEvent($event, array $context = array()) { if (array_key_exists($event, static::$registered_events)) { array_map(function($handler) use ($context) { call_user_func($handler, $context); }, static::$registered_events[$event]); } }
php
final protected static function triggerEvent($event, array $context = array()) { if (array_key_exists($event, static::$registered_events)) { array_map(function($handler) use ($context) { call_user_func($handler, $context); }, static::$registered_events[$event]); } }
[ "final", "protected", "static", "function", "triggerEvent", "(", "$", "event", ",", "array", "$", "context", "=", "array", "(", ")", ")", "{", "if", "(", "array_key_exists", "(", "$", "event", ",", "static", "::", "$", "registered_events", ")", ")", "{",...
Trigger an event an call its callback if any exist. Otherwise, nothing @param string $event Name of event. E.G. "Error" @param array $context An array of paramaters to pass to the callback @return void
[ "Trigger", "an", "event", "an", "call", "its", "callback", "if", "any", "exist", ".", "Otherwise", "nothing" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/events.php#L60-L68
202,275
lanfisis/deflection
src/Deflection/Element/Param.php
Param.getElement
public function getElement() { if ($this->getDocblock()) { $this->setLines($this->getDocblock()->getElement()); } $name = ''; if ($this->getName() and !is_array($this->getValue())) { $name = ($this->getType() ? $this->getType().' ' : '') .'$'....
php
public function getElement() { if ($this->getDocblock()) { $this->setLines($this->getDocblock()->getElement()); } $name = ''; if ($this->getName() and !is_array($this->getValue())) { $name = ($this->getType() ? $this->getType().' ' : '') .'$'....
[ "public", "function", "getElement", "(", ")", "{", "if", "(", "$", "this", "->", "getDocblock", "(", ")", ")", "{", "$", "this", "->", "setLines", "(", "$", "this", "->", "getDocblock", "(", ")", "->", "getElement", "(", ")", ")", ";", "}", "$", ...
Return param content @return array
[ "Return", "param", "content" ]
31deaf7f085d6456d8a323e7ac3cc9914fbe49a9
https://github.com/lanfisis/deflection/blob/31deaf7f085d6456d8a323e7ac3cc9914fbe49a9/src/Deflection/Element/Param.php#L163-L186
202,276
buflix/SimpleCollection
src/SimpleCollection/Entity/AbstractEntityCollection.php
AbstractEntityCollection.offsetSet
public function offsetSet($mOffset, $oEntity) { $this->checkClass($oEntity); return parent::offsetSet($mOffset, $oEntity); }
php
public function offsetSet($mOffset, $oEntity) { $this->checkClass($oEntity); return parent::offsetSet($mOffset, $oEntity); }
[ "public", "function", "offsetSet", "(", "$", "mOffset", ",", "$", "oEntity", ")", "{", "$", "this", "->", "checkClass", "(", "$", "oEntity", ")", ";", "return", "parent", "::", "offsetSet", "(", "$", "mOffset", ",", "$", "oEntity", ")", ";", "}" ]
set the entity by the given offset @param string|int $mOffset Offset @param EntityInterface $oEntity ProxyServer @return $this @throws \InvalidArgumentException
[ "set", "the", "entity", "by", "the", "given", "offset" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/Entity/AbstractEntityCollection.php#L38-L43
202,277
buflix/SimpleCollection
src/SimpleCollection/Entity/AbstractEntityCollection.php
AbstractEntityCollection.toArray
public function toArray() { $aReturn = array(); foreach ($this->values as $sKey => $oEntity) { /* @var EntityInterface $oEntity */ $aReturn[$sKey] = $oEntity->toArray(); } return $aReturn; }
php
public function toArray() { $aReturn = array(); foreach ($this->values as $sKey => $oEntity) { /* @var EntityInterface $oEntity */ $aReturn[$sKey] = $oEntity->toArray(); } return $aReturn; }
[ "public", "function", "toArray", "(", ")", "{", "$", "aReturn", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "values", "as", "$", "sKey", "=>", "$", "oEntity", ")", "{", "/* @var EntityInterface $oEntity */", "$", "aReturn", "[", "$", ...
return this collection as array @return array
[ "return", "this", "collection", "as", "array" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/Entity/AbstractEntityCollection.php#L65-L75
202,278
drdplusinfo/drdplus-profession-levels
DrdPlus/Person/ProfessionLevels/ProfessionFirstLevel.php
ProfessionFirstLevel.checkPropertyIncrement
protected function checkPropertyIncrement(BaseProperty $baseProperty, Profession $profession) { $propertyFirstLevelModifier = static::getBasePropertyFirstLevelModifier( PropertyCode::getIt($baseProperty->getCode()), $profession ); if ($baseProperty->getValue() !== $pr...
php
protected function checkPropertyIncrement(BaseProperty $baseProperty, Profession $profession) { $propertyFirstLevelModifier = static::getBasePropertyFirstLevelModifier( PropertyCode::getIt($baseProperty->getCode()), $profession ); if ($baseProperty->getValue() !== $pr...
[ "protected", "function", "checkPropertyIncrement", "(", "BaseProperty", "$", "baseProperty", ",", "Profession", "$", "profession", ")", "{", "$", "propertyFirstLevelModifier", "=", "static", "::", "getBasePropertyFirstLevelModifier", "(", "PropertyCode", "::", "getIt", ...
It is only the increment based on first level of specific profession. There are other increments like race, size etc., solved in different library. @param BaseProperty $baseProperty @param Profession $profession @throws \DrdPlus\Person\ProfessionLevels\Exceptions\InvalidFirstLevelPropertyValue
[ "It", "is", "only", "the", "increment", "based", "on", "first", "level", "of", "specific", "profession", ".", "There", "are", "other", "increments", "like", "race", "size", "etc", ".", "solved", "in", "different", "library", "." ]
c8c07b98dd47412f9770456a97e4728106d2c5fc
https://github.com/drdplusinfo/drdplus-profession-levels/blob/c8c07b98dd47412f9770456a97e4728106d2c5fc/DrdPlus/Person/ProfessionLevels/ProfessionFirstLevel.php#L67-L79
202,279
Waryway/PhpTraitsLibrary
src/Singleton.php
Singleton.instance
final public static function instance() { $c = get_called_class(); if( ! isset( self::$instances[$c] ) ) { self::$instances[$c] = new $c; } return self::$instances[$c]; }
php
final public static function instance() { $c = get_called_class(); if( ! isset( self::$instances[$c] ) ) { self::$instances[$c] = new $c; } return self::$instances[$c]; }
[ "final", "public", "static", "function", "instance", "(", ")", "{", "$", "c", "=", "get_called_class", "(", ")", ";", "if", "(", "!", "isset", "(", "self", "::", "$", "instances", "[", "$", "c", "]", ")", ")", "{", "self", "::", "$", "instances", ...
Grab an instance of the singleton. @return self
[ "Grab", "an", "instance", "of", "the", "singleton", "." ]
90c02e09b92e94664669b020b47a20a1590c4a4a
https://github.com/Waryway/PhpTraitsLibrary/blob/90c02e09b92e94664669b020b47a20a1590c4a4a/src/Singleton.php#L39-L48
202,280
bheisig/cli
src/IO.php
IO.out
public static function out($line, ...$args) { if (count($args) > 0) { $line = call_user_func_array( 'sprintf', array_merge([$line], $args) ); } fwrite(STDOUT, $line . PHP_EOL); }
php
public static function out($line, ...$args) { if (count($args) > 0) { $line = call_user_func_array( 'sprintf', array_merge([$line], $args) ); } fwrite(STDOUT, $line . PHP_EOL); }
[ "public", "static", "function", "out", "(", "$", "line", ",", "...", "$", "args", ")", "{", "if", "(", "count", "(", "$", "args", ")", ">", "0", ")", "{", "$", "line", "=", "call_user_func_array", "(", "'sprintf'", ",", "array_merge", "(", "[", "$"...
Write line to STDOUT @param string $line Line @param mixed ...$args (Optional) One or more arguments
[ "Write", "line", "to", "STDOUT" ]
ee77266e173335950357899cdfe86b43c00a6776
https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/IO.php#L40-L49
202,281
bheisig/cli
src/IO.php
IO.err
public static function err($message, ...$args) { if (count($args) > 0) { $message = call_user_func_array( 'sprintf', array_merge([$message], $args) ); } fwrite(STDERR, $message . PHP_EOL); }
php
public static function err($message, ...$args) { if (count($args) > 0) { $message = call_user_func_array( 'sprintf', array_merge([$message], $args) ); } fwrite(STDERR, $message . PHP_EOL); }
[ "public", "static", "function", "err", "(", "$", "message", ",", "...", "$", "args", ")", "{", "if", "(", "count", "(", "$", "args", ")", ">", "0", ")", "{", "$", "message", "=", "call_user_func_array", "(", "'sprintf'", ",", "array_merge", "(", "[",...
Write message to STDERR @param string $message Message @param mixed ...$args (Optional) One or more arguments
[ "Write", "message", "to", "STDERR" ]
ee77266e173335950357899cdfe86b43c00a6776
https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/IO.php#L57-L66
202,282
bheisig/cli
src/IO.php
IO.in
public static function in($message, ...$args) { if ($message !== '') { if (count($args) > 0) { $message = call_user_func_array( 'sprintf', array_merge([$message], $args) ); } $message .= ' '; } ...
php
public static function in($message, ...$args) { if ($message !== '') { if (count($args) > 0) { $message = call_user_func_array( 'sprintf', array_merge([$message], $args) ); } $message .= ' '; } ...
[ "public", "static", "function", "in", "(", "$", "message", ",", "...", "$", "args", ")", "{", "if", "(", "$", "message", "!==", "''", ")", "{", "if", "(", "count", "(", "$", "args", ")", ">", "0", ")", "{", "$", "message", "=", "call_user_func_ar...
Read from STDIN @param string $message Message @param mixed ...$args (Optional) One or more arguments @return string User input @throws Exception on error
[ "Read", "from", "STDIN" ]
ee77266e173335950357899cdfe86b43c00a6776
https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/IO.php#L78-L99
202,283
SergioMadness/pwf-helpers
src/Validator.php
Validator.validate
public static function validate($type, $paramName, $data, array $params = []) { $data = (array) $data; switch ($type) { case self::VALIDATOR_USER: return static::validateByCallback($paramName, $data, $params); case self::VALIDATOR_EMAIL: return...
php
public static function validate($type, $paramName, $data, array $params = []) { $data = (array) $data; switch ($type) { case self::VALIDATOR_USER: return static::validateByCallback($paramName, $data, $params); case self::VALIDATOR_EMAIL: return...
[ "public", "static", "function", "validate", "(", "$", "type", ",", "$", "paramName", ",", "$", "data", ",", "array", "$", "params", "=", "[", "]", ")", "{", "$", "data", "=", "(", "array", ")", "$", "data", ";", "switch", "(", "$", "type", ")", ...
Validate by type @param string $type @param string $paramName @param array $data @param array $params @return mixed @throws \Exception
[ "Validate", "by", "type" ]
d6cd44807c120356d60618cb08f237841c35e293
https://github.com/SergioMadness/pwf-helpers/blob/d6cd44807c120356d60618cb08f237841c35e293/src/Validator.php#L37-L52
202,284
SergioMadness/pwf-helpers
src/Validator.php
Validator.validateEmail
public static function validateEmail($paramName, array $data) { $result = false; if (isset($data[$paramName])) { $result = filter_var($data[$paramName], FILTER_VALIDATE_EMAIL) !== false; } else { throw new \Exception('Parameter is not set'); } return $...
php
public static function validateEmail($paramName, array $data) { $result = false; if (isset($data[$paramName])) { $result = filter_var($data[$paramName], FILTER_VALIDATE_EMAIL) !== false; } else { throw new \Exception('Parameter is not set'); } return $...
[ "public", "static", "function", "validateEmail", "(", "$", "paramName", ",", "array", "$", "data", ")", "{", "$", "result", "=", "false", ";", "if", "(", "isset", "(", "$", "data", "[", "$", "paramName", "]", ")", ")", "{", "$", "result", "=", "fil...
Validate e-mail @param string $paramName @param array $data @return bool @throws \Exception
[ "Validate", "e", "-", "mail" ]
d6cd44807c120356d60618cb08f237841c35e293
https://github.com/SergioMadness/pwf-helpers/blob/d6cd44807c120356d60618cb08f237841c35e293/src/Validator.php#L119-L128
202,285
SergioMadness/pwf-helpers
src/Validator.php
Validator.validateByCallback
public static function validateByCallback($paramName, array $data, array $params) { if (isset($params['callback'])) { return $params['callback']($paramName, $data); } else { throw new \Exception('Callback parameter is required'); ...
php
public static function validateByCallback($paramName, array $data, array $params) { if (isset($params['callback'])) { return $params['callback']($paramName, $data); } else { throw new \Exception('Callback parameter is required'); ...
[ "public", "static", "function", "validateByCallback", "(", "$", "paramName", ",", "array", "$", "data", ",", "array", "$", "params", ")", "{", "if", "(", "isset", "(", "$", "params", "[", "'callback'", "]", ")", ")", "{", "return", "$", "params", "[", ...
Validate by user function @param string $paramName @param mixed $data @param array $params @return mixed @throws \Exception
[ "Validate", "by", "user", "function" ]
d6cd44807c120356d60618cb08f237841c35e293
https://github.com/SergioMadness/pwf-helpers/blob/d6cd44807c120356d60618cb08f237841c35e293/src/Validator.php#L139-L147
202,286
kambalabs/KmbZendDbInfrastructure
src/KmbZendDbInfrastructure/Service/RevisionService.php
RevisionService.release
public function release(RevisionInterface $revision, UserInterface $user, $comment) { $connection = $this->revisionRepository->getDbAdapter()->getDriver()->getConnection()->beginTransaction(); try { if ($revision->getReleasedAt() != null) { $this->revisionRepository->remo...
php
public function release(RevisionInterface $revision, UserInterface $user, $comment) { $connection = $this->revisionRepository->getDbAdapter()->getDriver()->getConnection()->beginTransaction(); try { if ($revision->getReleasedAt() != null) { $this->revisionRepository->remo...
[ "public", "function", "release", "(", "RevisionInterface", "$", "revision", ",", "UserInterface", "$", "user", ",", "$", "comment", ")", "{", "$", "connection", "=", "$", "this", "->", "revisionRepository", "->", "getDbAdapter", "(", ")", "->", "getDriver", ...
Release specified revision and create a current revision from it. If the revision had already been released, the current revision should be removed first. @param RevisionInterface $revision @param UserInterface $user @param string $comment @throws \Zend\Db\Exception\ExceptionInterface @return RevisionSe...
[ "Release", "specified", "revision", "and", "create", "a", "current", "revision", "from", "it", ".", "If", "the", "revision", "had", "already", "been", "released", "the", "current", "revision", "should", "be", "removed", "first", "." ]
9bf4df4272d2064965202d0e689f944d56a4c6bb
https://github.com/kambalabs/KmbZendDbInfrastructure/blob/9bf4df4272d2064965202d0e689f944d56a4c6bb/src/KmbZendDbInfrastructure/Service/RevisionService.php#L47-L72
202,287
kambalabs/KmbZendDbInfrastructure
src/KmbZendDbInfrastructure/Service/RevisionService.php
RevisionService.remove
public function remove(RevisionInterface $revision) { $connection = $this->revisionRepository->getDbAdapter()->getDriver()->getConnection()->beginTransaction(); try { $this->revisionRepository->remove($revision); if ($revision->getReleasedAt() == null) { $last...
php
public function remove(RevisionInterface $revision) { $connection = $this->revisionRepository->getDbAdapter()->getDriver()->getConnection()->beginTransaction(); try { $this->revisionRepository->remove($revision); if ($revision->getReleasedAt() == null) { $last...
[ "public", "function", "remove", "(", "RevisionInterface", "$", "revision", ")", "{", "$", "connection", "=", "$", "this", "->", "revisionRepository", "->", "getDbAdapter", "(", ")", "->", "getDriver", "(", ")", "->", "getConnection", "(", ")", "->", "beginTr...
Remove specified revision. If it's the current revision, another current revision should be recreate from last released revision. @param RevisionInterface $revision @throws \Zend\Db\Exception\ExceptionInterface @return RevisionService
[ "Remove", "specified", "revision", ".", "If", "it", "s", "the", "current", "revision", "another", "current", "revision", "should", "be", "recreate", "from", "last", "released", "revision", "." ]
9bf4df4272d2064965202d0e689f944d56a4c6bb
https://github.com/kambalabs/KmbZendDbInfrastructure/blob/9bf4df4272d2064965202d0e689f944d56a4c6bb/src/KmbZendDbInfrastructure/Service/RevisionService.php#L82-L97
202,288
DreadLabs/typo3-cms-phing-helper
Classes/Tasks/GenerateLocalConfigurationTask.php
GenerateLocalConfigurationTask.transformPropertiesToArray
protected function transformPropertiesToArray() { $properties = $this->project->getProperties(); foreach ($properties as $propertyName => $propertyValue) { if (0 !== strpos($propertyName, $this->propertyPrefix . '.')) { continue; } list(, $mainKe...
php
protected function transformPropertiesToArray() { $properties = $this->project->getProperties(); foreach ($properties as $propertyName => $propertyValue) { if (0 !== strpos($propertyName, $this->propertyPrefix . '.')) { continue; } list(, $mainKe...
[ "protected", "function", "transformPropertiesToArray", "(", ")", "{", "$", "properties", "=", "$", "this", "->", "project", "->", "getProperties", "(", ")", ";", "foreach", "(", "$", "properties", "as", "$", "propertyName", "=>", "$", "propertyValue", ")", "...
transforms the flat property list into a local configuration array Example Given LocalConfiguration.DB.database=my_database_name Result $this->localConfiguration = array( 'DB' => array( 'database' => 'my_database_name' ) ); @return void
[ "transforms", "the", "flat", "property", "list", "into", "a", "local", "configuration", "array" ]
b6606102c4702a92bc1872eba962febceaa0e645
https://github.com/DreadLabs/typo3-cms-phing-helper/blob/b6606102c4702a92bc1872eba962febceaa0e645/Classes/Tasks/GenerateLocalConfigurationTask.php#L153-L166
202,289
ZFury/framework
library/Grid/AbstractGrid.php
AbstractGrid.processRequest
protected function processRequest() { /** @var \Zend\Http\PhpEnvironment\Request $request */ $request = $this->sm->get('Request'); $url = explode('?', $request->getRequestUri()); $this->url = $url[0]; $params = $request->getQuery(); if ($params->get('page')) { ...
php
protected function processRequest() { /** @var \Zend\Http\PhpEnvironment\Request $request */ $request = $this->sm->get('Request'); $url = explode('?', $request->getRequestUri()); $this->url = $url[0]; $params = $request->getQuery(); if ($params->get('page')) { ...
[ "protected", "function", "processRequest", "(", ")", "{", "/** @var \\Zend\\Http\\PhpEnvironment\\Request $request */", "$", "request", "=", "$", "this", "->", "sm", "->", "get", "(", "'Request'", ")", ";", "$", "url", "=", "explode", "(", "'?'", ",", "$", "re...
Parses request and sets grid params
[ "Parses", "request", "and", "sets", "grid", "params" ]
eee4ca2a64d2d65490777b08be56c4c9b67bc892
https://github.com/ZFury/framework/blob/eee4ca2a64d2d65490777b08be56c4c9b67bc892/library/Grid/AbstractGrid.php#L151-L186
202,290
ZFury/framework
library/Grid/AbstractGrid.php
AbstractGrid.countTotalRows
protected function countTotalRows() { $source = $this->getSource(); /** @var \Doctrine\ORM\Query\Expr\Select $select */ $source->resetDQLPart('select')->setFirstResult(0)->select('count(' . $this->entityAlias . ')'); return (int)$source->getQuery()->getSingleScalarResult(); }
php
protected function countTotalRows() { $source = $this->getSource(); /** @var \Doctrine\ORM\Query\Expr\Select $select */ $source->resetDQLPart('select')->setFirstResult(0)->select('count(' . $this->entityAlias . ')'); return (int)$source->getQuery()->getSingleScalarResult(); }
[ "protected", "function", "countTotalRows", "(", ")", "{", "$", "source", "=", "$", "this", "->", "getSource", "(", ")", ";", "/** @var \\Doctrine\\ORM\\Query\\Expr\\Select $select */", "$", "source", "->", "resetDQLPart", "(", "'select'", ")", "->", "setFirstResult"...
Get total rows in result ignoring limit @return int
[ "Get", "total", "rows", "in", "result", "ignoring", "limit" ]
eee4ca2a64d2d65490777b08be56c4c9b67bc892
https://github.com/ZFury/framework/blob/eee4ca2a64d2d65490777b08be56c4c9b67bc892/library/Grid/AbstractGrid.php#L491-L497
202,291
ZFury/framework
library/Grid/AbstractGrid.php
AbstractGrid.order
public function order($column) { if (!in_array($column, $this->allowedOrders)) { return null; } if (isset($this->order[$column])) { $order = strtolower($this->order[$column]) == self::ORDER_ASC ? self::ORDER_DESC : self::ORDER_ASC; } else { ...
php
public function order($column) { if (!in_array($column, $this->allowedOrders)) { return null; } if (isset($this->order[$column])) { $order = strtolower($this->order[$column]) == self::ORDER_ASC ? self::ORDER_DESC : self::ORDER_ASC; } else { ...
[ "public", "function", "order", "(", "$", "column", ")", "{", "if", "(", "!", "in_array", "(", "$", "column", ",", "$", "this", "->", "allowedOrders", ")", ")", "{", "return", "null", ";", "}", "if", "(", "isset", "(", "$", "this", "->", "order", ...
Get url for order by column name @param $column @return string
[ "Get", "url", "for", "order", "by", "column", "name" ]
eee4ca2a64d2d65490777b08be56c4c9b67bc892
https://github.com/ZFury/framework/blob/eee4ca2a64d2d65490777b08be56c4c9b67bc892/library/Grid/AbstractGrid.php#L643-L656
202,292
ptlis/grep-db
src/Metadata/MySQL/MetadataFactory.php
MetadataFactory.getServerMetadata
public function getServerMetadata( Connection $connection ) { // Attempt to list databases, ignoring internal databases try { $statement = $connection->query('SHOW DATABASES WHERE `Database` NOT IN ("information_schema", "performance_schema", "sys", "mysql");'); } catch (...
php
public function getServerMetadata( Connection $connection ) { // Attempt to list databases, ignoring internal databases try { $statement = $connection->query('SHOW DATABASES WHERE `Database` NOT IN ("information_schema", "performance_schema", "sys", "mysql");'); } catch (...
[ "public", "function", "getServerMetadata", "(", "Connection", "$", "connection", ")", "{", "// Attempt to list databases, ignoring internal databases", "try", "{", "$", "statement", "=", "$", "connection", "->", "query", "(", "'SHOW DATABASES WHERE `Database` NOT IN (\"inform...
Query the server and build server metadata DTO.
[ "Query", "the", "server", "and", "build", "server", "metadata", "DTO", "." ]
7abff68982d426690d0515ccd7adc7a2e3d72a3f
https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Metadata/MySQL/MetadataFactory.php#L21-L38
202,293
ptlis/grep-db
src/Metadata/MySQL/MetadataFactory.php
MetadataFactory.getDatabaseMetadata
public function getDatabaseMetadata( Connection $connection, string $databaseName ): DatabaseMetadata { // Get a list of table names $tableNameStatement = $connection ->createQueryBuilder() ->select([ 'tables.TABLE_NAME AS name' ]) ...
php
public function getDatabaseMetadata( Connection $connection, string $databaseName ): DatabaseMetadata { // Get a list of table names $tableNameStatement = $connection ->createQueryBuilder() ->select([ 'tables.TABLE_NAME AS name' ]) ...
[ "public", "function", "getDatabaseMetadata", "(", "Connection", "$", "connection", ",", "string", "$", "databaseName", ")", ":", "DatabaseMetadata", "{", "// Get a list of table names", "$", "tableNameStatement", "=", "$", "connection", "->", "createQueryBuilder", "(", ...
Query the server and build database metadata DTO.
[ "Query", "the", "server", "and", "build", "database", "metadata", "DTO", "." ]
7abff68982d426690d0515ccd7adc7a2e3d72a3f
https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Metadata/MySQL/MetadataFactory.php#L43-L66
202,294
ptlis/grep-db
src/Metadata/MySQL/MetadataFactory.php
MetadataFactory.getTableMetadata
public function getTableMetadata( Connection $connection, string $databaseName, string $tableName ): TableMetadata { // Get top-level table information $tableStatement = $connection ->createQueryBuilder() ->select([ 'tables.TABLE_NAME A...
php
public function getTableMetadata( Connection $connection, string $databaseName, string $tableName ): TableMetadata { // Get top-level table information $tableStatement = $connection ->createQueryBuilder() ->select([ 'tables.TABLE_NAME A...
[ "public", "function", "getTableMetadata", "(", "Connection", "$", "connection", ",", "string", "$", "databaseName", ",", "string", "$", "tableName", ")", ":", "TableMetadata", "{", "// Get top-level table information", "$", "tableStatement", "=", "$", "connection", ...
Query the server and build table metadata DTO.
[ "Query", "the", "server", "and", "build", "table", "metadata", "DTO", "." ]
7abff68982d426690d0515ccd7adc7a2e3d72a3f
https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Metadata/MySQL/MetadataFactory.php#L71-L149
202,295
rzajac/phptools
src/Helper/Debug.php
Debug.getCallStack
public static function getCallStack($asArray = false) { $i = 0; $resp = []; if (!$asArray) { $resp[] = str_repeat('=', 50); } foreach (debug_backtrace() as $node) { $file = Arr::get($node, 'file', ''); $file = $file ?: 'no_file'; ...
php
public static function getCallStack($asArray = false) { $i = 0; $resp = []; if (!$asArray) { $resp[] = str_repeat('=', 50); } foreach (debug_backtrace() as $node) { $file = Arr::get($node, 'file', ''); $file = $file ?: 'no_file'; ...
[ "public", "static", "function", "getCallStack", "(", "$", "asArray", "=", "false", ")", "{", "$", "i", "=", "0", ";", "$", "resp", "=", "[", "]", ";", "if", "(", "!", "$", "asArray", ")", "{", "$", "resp", "[", "]", "=", "str_repeat", "(", "'='...
Prints stack trace. @param bool $asArray @return string
[ "Prints", "stack", "trace", "." ]
3cbece7645942d244603c14ba897d8a676ee3088
https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Helper/Debug.php#L34-L57
202,296
vaniocz/stdlib
src/LinkedHashSet.php
LinkedHashSet.add
public function add($value): bool { if (isset($this->hashMap[$value])) { return false; } $this->hashMap[$value] = 1; return true; }
php
public function add($value): bool { if (isset($this->hashMap[$value])) { return false; } $this->hashMap[$value] = 1; return true; }
[ "public", "function", "add", "(", "$", "value", ")", ":", "bool", "{", "if", "(", "isset", "(", "$", "this", "->", "hashMap", "[", "$", "value", "]", ")", ")", "{", "return", "false", ";", "}", "$", "this", "->", "hashMap", "[", "$", "value", "...
Add the given value to the set if it is not already present. @param mixed $value The value to be added. @return bool True if the value was not present in the set, false otherwise.
[ "Add", "the", "given", "value", "to", "the", "set", "if", "it", "is", "not", "already", "present", "." ]
06a8343c42829d8fdeecad2bb5c30946fbd73e74
https://github.com/vaniocz/stdlib/blob/06a8343c42829d8fdeecad2bb5c30946fbd73e74/src/LinkedHashSet.php#L29-L38
202,297
vaniocz/stdlib
src/LinkedHashSet.php
LinkedHashSet.remove
public function remove($value): bool { if (!isset($this->hashMap[$value])) { return false; } unset($this->hashMap[$value]); return true; }
php
public function remove($value): bool { if (!isset($this->hashMap[$value])) { return false; } unset($this->hashMap[$value]); return true; }
[ "public", "function", "remove", "(", "$", "value", ")", ":", "bool", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "hashMap", "[", "$", "value", "]", ")", ")", "{", "return", "false", ";", "}", "unset", "(", "$", "this", "->", "hashMap", ...
Remove the given value if it's present in the set. @param mixed $value The value to be removed. @return bool True if the value was present in the set, false otherwise.
[ "Remove", "the", "given", "value", "if", "it", "s", "present", "in", "the", "set", "." ]
06a8343c42829d8fdeecad2bb5c30946fbd73e74
https://github.com/vaniocz/stdlib/blob/06a8343c42829d8fdeecad2bb5c30946fbd73e74/src/LinkedHashSet.php#L59-L68
202,298
agentmedia/phine-core
src/Core/Modules/Backend/AjaxSelectPage.php
AjaxSelectPage.HasPages
protected function HasPages(Site $site) { $this->site = $site; $this->tree = new PageTreeProvider($site); $this->page = $this->tree->TopMost(); return (bool) $this->page; }
php
protected function HasPages(Site $site) { $this->site = $site; $this->tree = new PageTreeProvider($site); $this->page = $this->tree->TopMost(); return (bool) $this->page; }
[ "protected", "function", "HasPages", "(", "Site", "$", "site", ")", "{", "$", "this", "->", "site", "=", "$", "site", ";", "$", "this", "->", "tree", "=", "new", "PageTreeProvider", "(", "$", "site", ")", ";", "$", "this", "->", "page", "=", "$", ...
Sets the site as current site and returns true if it has pages below @param Site $site The site to set and check for pages @return boolean Returns true if the site has pages
[ "Sets", "the", "site", "as", "current", "site", "and", "returns", "true", "if", "it", "has", "pages", "below" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/AjaxSelectPage.php#L100-L106
202,299
Kris-Kuiper/sFire-Framework
src/DB/Driver/MySQLi/TableGateway.php
TableGateway.getTable
public function getTable() { if(false === isset($this -> table)) { $cl = new \ReflectionClass($this); return trigger_error(sprintf('No table specified in "%s" class', $cl -> getFileName()), E_USER_ERROR); } return $this -> table; }
php
public function getTable() { if(false === isset($this -> table)) { $cl = new \ReflectionClass($this); return trigger_error(sprintf('No table specified in "%s" class', $cl -> getFileName()), E_USER_ERROR); } return $this -> table; }
[ "public", "function", "getTable", "(", ")", "{", "if", "(", "false", "===", "isset", "(", "$", "this", "->", "table", ")", ")", "{", "$", "cl", "=", "new", "\\", "ReflectionClass", "(", "$", "this", ")", ";", "return", "trigger_error", "(", "sprintf"...
Returns the table @return string
[ "Returns", "the", "table" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/TableGateway.php#L63-L72