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
205,300
drmvc/router
src/Router/Router.php
Router.setRoute
public function setRoute(RouteInterface $route): RouterInterface { $regexp = $route->getRegexp(); $this->_routes[$regexp] = $route; return $this; }
php
public function setRoute(RouteInterface $route): RouterInterface { $regexp = $route->getRegexp(); $this->_routes[$regexp] = $route; return $this; }
[ "public", "function", "setRoute", "(", "RouteInterface", "$", "route", ")", ":", "RouterInterface", "{", "$", "regexp", "=", "$", "route", "->", "getRegexp", "(", ")", ";", "$", "this", "->", "_routes", "[", "$", "regexp", "]", "=", "$", "route", ";", ...
Add route into the array of routes @param RouteInterface $route @return RouterInterface
[ "Add", "route", "into", "the", "array", "of", "routes" ]
ecbf5f4380a060af83af23334b9f81054bc6c64c
https://github.com/drmvc/router/blob/ecbf5f4380a060af83af23334b9f81054bc6c64c/src/Router/Router.php#L225-L230
205,301
drmvc/router
src/Router/Router.php
Router.checkMatches
private function checkMatches(string $uri, string $method): array { return array_map( function($regexp, $route) use ($uri, $method) { $match = preg_match_all($regexp, $uri, $matches); // If something found and method is correct if ($match && $rout...
php
private function checkMatches(string $uri, string $method): array { return array_map( function($regexp, $route) use ($uri, $method) { $match = preg_match_all($regexp, $uri, $matches); // If something found and method is correct if ($match && $rout...
[ "private", "function", "checkMatches", "(", "string", "$", "uri", ",", "string", "$", "method", ")", ":", "array", "{", "return", "array_map", "(", "function", "(", "$", "regexp", ",", "$", "route", ")", "use", "(", "$", "uri", ",", "$", "method", ")...
Find route object by URL nad method @param string $uri @param string $method @return array
[ "Find", "route", "object", "by", "URL", "nad", "method" ]
ecbf5f4380a060af83af23334b9f81054bc6c64c
https://github.com/drmvc/router/blob/ecbf5f4380a060af83af23334b9f81054bc6c64c/src/Router/Router.php#L239-L258
205,302
drmvc/router
src/Router/Router.php
Router.getMatches
private function getMatches(): array { // Extract URI of current query $uri = $this->getRequest()->getUri()->getPath(); // Extract method of current request $method = $this->getRequest()->getMethod(); $method = strtolower($method); // Foreach emulation retur...
php
private function getMatches(): array { // Extract URI of current query $uri = $this->getRequest()->getUri()->getPath(); // Extract method of current request $method = $this->getRequest()->getMethod(); $method = strtolower($method); // Foreach emulation retur...
[ "private", "function", "getMatches", "(", ")", ":", "array", "{", "// Extract URI of current query", "$", "uri", "=", "$", "this", "->", "getRequest", "(", ")", "->", "getUri", "(", ")", "->", "getPath", "(", ")", ";", "// Extract method of current request", "...
Find optimal route from array of routes by regexp and uri @return array
[ "Find", "optimal", "route", "from", "array", "of", "routes", "by", "regexp", "and", "uri" ]
ecbf5f4380a060af83af23334b9f81054bc6c64c
https://github.com/drmvc/router/blob/ecbf5f4380a060af83af23334b9f81054bc6c64c/src/Router/Router.php#L265-L276
205,303
drmvc/router
src/Router/Router.php
Router.getRoute
public function getRoute(): RouteInterface { // Find route by regexp and URI $matches = $this->getMatches(); // Cleanup the array of matches, then reindex array $matches = array_values(array_filter($matches)); // If we have some classes in result of regexp $result =...
php
public function getRoute(): RouteInterface { // Find route by regexp and URI $matches = $this->getMatches(); // Cleanup the array of matches, then reindex array $matches = array_values(array_filter($matches)); // If we have some classes in result of regexp $result =...
[ "public", "function", "getRoute", "(", ")", ":", "RouteInterface", "{", "// Find route by regexp and URI", "$", "matches", "=", "$", "this", "->", "getMatches", "(", ")", ";", "// Cleanup the array of matches, then reindex array", "$", "matches", "=", "array_values", ...
Parse URI by Regexp from routes and return single route @return RouteInterface
[ "Parse", "URI", "by", "Regexp", "from", "routes", "and", "return", "single", "route" ]
ecbf5f4380a060af83af23334b9f81054bc6c64c
https://github.com/drmvc/router/blob/ecbf5f4380a060af83af23334b9f81054bc6c64c/src/Router/Router.php#L283-L299
205,304
drmvc/router
src/Router/Router.php
Router.getRoutes
public function getRoutes(bool $keys = false): array { return $keys ? array_keys($this->_routes) : $this->_routes; }
php
public function getRoutes(bool $keys = false): array { return $keys ? array_keys($this->_routes) : $this->_routes; }
[ "public", "function", "getRoutes", "(", "bool", "$", "keys", "=", "false", ")", ":", "array", "{", "return", "$", "keys", "?", "array_keys", "(", "$", "this", "->", "_routes", ")", ":", "$", "this", "->", "_routes", ";", "}" ]
Get all available routes @param bool $keys - Return only keys @return array
[ "Get", "all", "available", "routes" ]
ecbf5f4380a060af83af23334b9f81054bc6c64c
https://github.com/drmvc/router/blob/ecbf5f4380a060af83af23334b9f81054bc6c64c/src/Router/Router.php#L307-L312
205,305
wigedev/farm
src/Utility/ValueMap.php
ValueMap.get
public function get(string $index) : string { if (!$this->isValid($index)) { throw new \InvalidArgumentException('The specified value does not exist'); } return $this->map[$index]; }
php
public function get(string $index) : string { if (!$this->isValid($index)) { throw new \InvalidArgumentException('The specified value does not exist'); } return $this->map[$index]; }
[ "public", "function", "get", "(", "string", "$", "index", ")", ":", "string", "{", "if", "(", "!", "$", "this", "->", "isValid", "(", "$", "index", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'The specified value does not exist'", ...
Retrieve a value @param string $index @return string
[ "Retrieve", "a", "value" ]
7a1729ec78628b7e5435e4a42e42d547a07af851
https://github.com/wigedev/farm/blob/7a1729ec78628b7e5435e4a42e42d547a07af851/src/Utility/ValueMap.php#L22-L28
205,306
wigedev/farm
src/Utility/ValueMap.php
ValueMap.addValue
public function addValue(string $key, string $value) : void { $this->map[$key] = $value; }
php
public function addValue(string $key, string $value) : void { $this->map[$key] = $value; }
[ "public", "function", "addValue", "(", "string", "$", "key", ",", "string", "$", "value", ")", ":", "void", "{", "$", "this", "->", "map", "[", "$", "key", "]", "=", "$", "value", ";", "}" ]
Add a new value to the map @param string $key @param string $value
[ "Add", "a", "new", "value", "to", "the", "map" ]
7a1729ec78628b7e5435e4a42e42d547a07af851
https://github.com/wigedev/farm/blob/7a1729ec78628b7e5435e4a42e42d547a07af851/src/Utility/ValueMap.php#L47-L50
205,307
wigedev/farm
src/Utility/ValueMap.php
ValueMap.deleteValue
public function deleteValue(string $key) : void { if (isset($this->map[$key])) { unset($this->map[$key]); } }
php
public function deleteValue(string $key) : void { if (isset($this->map[$key])) { unset($this->map[$key]); } }
[ "public", "function", "deleteValue", "(", "string", "$", "key", ")", ":", "void", "{", "if", "(", "isset", "(", "$", "this", "->", "map", "[", "$", "key", "]", ")", ")", "{", "unset", "(", "$", "this", "->", "map", "[", "$", "key", "]", ")", ...
Delete a value from the map based on the key @param string $key
[ "Delete", "a", "value", "from", "the", "map", "based", "on", "the", "key" ]
7a1729ec78628b7e5435e4a42e42d547a07af851
https://github.com/wigedev/farm/blob/7a1729ec78628b7e5435e4a42e42d547a07af851/src/Utility/ValueMap.php#L56-L61
205,308
valu-digital/valuso
src/ValuSo/Broker/ServiceBrokerFactory.php
ServiceBrokerFactory.createService
public function createService(ServiceLocatorInterface $serviceLocator) { $evm = $serviceLocator->get('EventManager'); $config = $serviceLocator->get('Config'); $config = empty($config['valu_so']) ? [] : $config['valu_so']; $cacheConfig = isset($config['cache']) ? $config[...
php
public function createService(ServiceLocatorInterface $serviceLocator) { $evm = $serviceLocator->get('EventManager'); $config = $serviceLocator->get('Config'); $config = empty($config['valu_so']) ? [] : $config['valu_so']; $cacheConfig = isset($config['cache']) ? $config[...
[ "public", "function", "createService", "(", "ServiceLocatorInterface", "$", "serviceLocator", ")", "{", "$", "evm", "=", "$", "serviceLocator", "->", "get", "(", "'EventManager'", ")", ";", "$", "config", "=", "$", "serviceLocator", "->", "get", "(", "'Config'...
Create a ServiceBroker {@see ValuSo\Broker\ServiceBroker} uses {@see Zend\ServiceManager\ServiceManager} internally to initialize service instances. {@see Zend\Mvc\Service\ServiceManagerConfig} for how to configure service manager. This factory uses following configuration scheme: <code> [ 'valu_so' => [ // See Zend\...
[ "Create", "a", "ServiceBroker" ]
c96bed0f6bd21551822334fe6cfe913a7436dd17
https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceBrokerFactory.php#L76-L144
205,309
IftekherSunny/Planet-Framework
src/Sun/Filesystem/Filesystem.php
Filesystem.create
public function create($filename, $content) { $filename = str::path($filename); $this->createDirectory(dirname($filename)); return file_put_contents($filename, $content); }
php
public function create($filename, $content) { $filename = str::path($filename); $this->createDirectory(dirname($filename)); return file_put_contents($filename, $content); }
[ "public", "function", "create", "(", "$", "filename", ",", "$", "content", ")", "{", "$", "filename", "=", "str", "::", "path", "(", "$", "filename", ")", ";", "$", "this", "->", "createDirectory", "(", "dirname", "(", "$", "filename", ")", ")", ";",...
To create file @param string $filename @param string $content @return int
[ "To", "create", "file" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Filesystem/Filesystem.php#L20-L27
205,310
IftekherSunny/Planet-Framework
src/Sun/Filesystem/Filesystem.php
Filesystem.delete
public function delete($filename) { if ($this->exists($filename) && $this->isFile($filename)) { return @unlink($filename); } throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].'); }
php
public function delete($filename) { if ($this->exists($filename) && $this->isFile($filename)) { return @unlink($filename); } throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].'); }
[ "public", "function", "delete", "(", "$", "filename", ")", "{", "if", "(", "$", "this", "->", "exists", "(", "$", "filename", ")", "&&", "$", "this", "->", "isFile", "(", "$", "filename", ")", ")", "{", "return", "@", "unlink", "(", "$", "filename"...
To delete file @param string $filename @return bool @throws FileNotFoundException
[ "To", "delete", "file" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Filesystem/Filesystem.php#L37-L44
205,311
IftekherSunny/Planet-Framework
src/Sun/Filesystem/Filesystem.php
Filesystem.update
public function update($filename, $content) { if ($this->exists($filename) && $this->isFile($filename)) { return $this->create($filename, $content); } throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].'); }
php
public function update($filename, $content) { if ($this->exists($filename) && $this->isFile($filename)) { return $this->create($filename, $content); } throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].'); }
[ "public", "function", "update", "(", "$", "filename", ",", "$", "content", ")", "{", "if", "(", "$", "this", "->", "exists", "(", "$", "filename", ")", "&&", "$", "this", "->", "isFile", "(", "$", "filename", ")", ")", "{", "return", "$", "this", ...
To update file @param string $filename @param string $content @return int @throws FileNotFoundException
[ "To", "update", "file" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Filesystem/Filesystem.php#L71-L78
205,312
IftekherSunny/Planet-Framework
src/Sun/Filesystem/Filesystem.php
Filesystem.get
public function get($filename) { if ($this->exists($filename) && $this->isFile($filename)) { return file_get_contents($filename); } throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].'); }
php
public function get($filename) { if ($this->exists($filename) && $this->isFile($filename)) { return file_get_contents($filename); } throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].'); }
[ "public", "function", "get", "(", "$", "filename", ")", "{", "if", "(", "$", "this", "->", "exists", "(", "$", "filename", ")", "&&", "$", "this", "->", "isFile", "(", "$", "filename", ")", ")", "{", "return", "file_get_contents", "(", "$", "filename...
To get file content @param string $filename @return string @throws FileNotFoundException
[ "To", "get", "file", "content" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Filesystem/Filesystem.php#L88-L95
205,313
IftekherSunny/Planet-Framework
src/Sun/Filesystem/Filesystem.php
Filesystem.append
public function append($filename, $content) { if ($this->exists($filename) && $this->isFile($filename)) { return file_put_contents($filename, $content, FILE_APPEND); } throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].'); }
php
public function append($filename, $content) { if ($this->exists($filename) && $this->isFile($filename)) { return file_put_contents($filename, $content, FILE_APPEND); } throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].'); }
[ "public", "function", "append", "(", "$", "filename", ",", "$", "content", ")", "{", "if", "(", "$", "this", "->", "exists", "(", "$", "filename", ")", "&&", "$", "this", "->", "isFile", "(", "$", "filename", ")", ")", "{", "return", "file_put_conten...
To append file @param string $filename @param string $content @return int @throws FileNotFoundException
[ "To", "append", "file" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Filesystem/Filesystem.php#L106-L113
205,314
IftekherSunny/Planet-Framework
src/Sun/Filesystem/Filesystem.php
Filesystem.size
public function size($filename) { if ($this->exists($filename) && $this->isFile($filename)) { return filesize($filename); } throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].'); }
php
public function size($filename) { if ($this->exists($filename) && $this->isFile($filename)) { return filesize($filename); } throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].'); }
[ "public", "function", "size", "(", "$", "filename", ")", "{", "if", "(", "$", "this", "->", "exists", "(", "$", "filename", ")", "&&", "$", "this", "->", "isFile", "(", "$", "filename", ")", ")", "{", "return", "filesize", "(", "$", "filename", ")"...
To get a filesize in byte @param string $filename @return int @throws FileNotFoundException
[ "To", "get", "a", "filesize", "in", "byte" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Filesystem/Filesystem.php#L149-L155
205,315
IftekherSunny/Planet-Framework
src/Sun/Filesystem/Filesystem.php
Filesystem.files
public function files($directoryName) { if (!$this->isDir($directoryName)) { throw new FileNotFoundException('Directory not found in the path [ ' . $directoryName . ' ].'); } $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directoryName...
php
public function files($directoryName) { if (!$this->isDir($directoryName)) { throw new FileNotFoundException('Directory not found in the path [ ' . $directoryName . ' ].'); } $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directoryName...
[ "public", "function", "files", "(", "$", "directoryName", ")", "{", "if", "(", "!", "$", "this", "->", "isDir", "(", "$", "directoryName", ")", ")", "{", "throw", "new", "FileNotFoundException", "(", "'Directory not found in the path [ '", ".", "$", "directory...
To get all files in a directory @param string $directoryName @return array @throws FileNotFoundException
[ "To", "get", "all", "files", "in", "a", "directory" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Filesystem/Filesystem.php#L165-L178
205,316
IftekherSunny/Planet-Framework
src/Sun/Filesystem/Filesystem.php
Filesystem.directories
public function directories($directoryName) { if (!$this->isDir($directoryName)) { throw new FileNotFoundException('Directory not found in the path [ ' . $directoryName . ' ].'); } $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dire...
php
public function directories($directoryName) { if (!$this->isDir($directoryName)) { throw new FileNotFoundException('Directory not found in the path [ ' . $directoryName . ' ].'); } $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dire...
[ "public", "function", "directories", "(", "$", "directoryName", ")", "{", "if", "(", "!", "$", "this", "->", "isDir", "(", "$", "directoryName", ")", ")", "{", "throw", "new", "FileNotFoundException", "(", "'Directory not found in the path [ '", ".", "$", "dir...
To get all directories in a directory @param string $directoryName @return array @throws FileNotFoundException
[ "To", "get", "all", "directories", "in", "a", "directory" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Filesystem/Filesystem.php#L188-L212
205,317
IftekherSunny/Planet-Framework
src/Sun/Filesystem/Filesystem.php
Filesystem.cleanDirectory
public function cleanDirectory($directoryName, $deleteRootDirectory = false) { if(is_dir($directoryName)){ $files = glob( $directoryName . '/*', GLOB_NOSORT ); foreach( $files as $file ) { $this->cleanDirectory( $file, true ); } ...
php
public function cleanDirectory($directoryName, $deleteRootDirectory = false) { if(is_dir($directoryName)){ $files = glob( $directoryName . '/*', GLOB_NOSORT ); foreach( $files as $file ) { $this->cleanDirectory( $file, true ); } ...
[ "public", "function", "cleanDirectory", "(", "$", "directoryName", ",", "$", "deleteRootDirectory", "=", "false", ")", "{", "if", "(", "is_dir", "(", "$", "directoryName", ")", ")", "{", "$", "files", "=", "glob", "(", "$", "directoryName", ".", "'/*'", ...
To clean a directory @param string $directoryName @param bool $deleteRootDirectory @return bool
[ "To", "clean", "a", "directory" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Filesystem/Filesystem.php#L250-L272
205,318
ARCANEDEV/Markup
src/Entities/Tag.php
Tag.addElement
public function addElement($tag, array $attributes = []) { if ($tag instanceof self) { $htmlTag = $tag; $htmlTag->top = $this->top; $htmlTag->attrs($attributes); $this->elements->add($htmlTag); return $htmlTag; } return self:...
php
public function addElement($tag, array $attributes = []) { if ($tag instanceof self) { $htmlTag = $tag; $htmlTag->top = $this->top; $htmlTag->attrs($attributes); $this->elements->add($htmlTag); return $htmlTag; } return self:...
[ "public", "function", "addElement", "(", "$", "tag", ",", "array", "$", "attributes", "=", "[", "]", ")", "{", "if", "(", "$", "tag", "instanceof", "self", ")", "{", "$", "htmlTag", "=", "$", "tag", ";", "$", "htmlTag", "->", "top", "=", "$", "th...
Add element at an existing Markup @param Tag|string $tag @param array $attributes @return Tag
[ "Add", "element", "at", "an", "existing", "Markup" ]
881331df74b27614d025c365daacbae6aa865612
https://github.com/ARCANEDEV/Markup/blob/881331df74b27614d025c365daacbae6aa865612/src/Entities/Tag.php#L187-L203
205,319
ARCANEDEV/Markup
src/Entities/Tag.php
Tag.getFirst
public function getFirst() { $element = null; if ( $this->hasParent() and $this->parent->hasElements() ) { $element = $this->parent->elements[0]; } return $element; }
php
public function getFirst() { $element = null; if ( $this->hasParent() and $this->parent->hasElements() ) { $element = $this->parent->elements[0]; } return $element; }
[ "public", "function", "getFirst", "(", ")", "{", "$", "element", "=", "null", ";", "if", "(", "$", "this", "->", "hasParent", "(", ")", "and", "$", "this", "->", "parent", "->", "hasElements", "(", ")", ")", "{", "$", "element", "=", "$", "this", ...
Return first child of parent of current object @return Tag|null
[ "Return", "first", "child", "of", "parent", "of", "current", "object" ]
881331df74b27614d025c365daacbae6aa865612
https://github.com/ARCANEDEV/Markup/blob/881331df74b27614d025c365daacbae6aa865612/src/Entities/Tag.php#L220-L232
205,320
phossa2/storage
src/Storage/Traits/MountableTrait.php
MountableTrait.getMountPoint
protected function getMountPoint(/*# string */ $path)/*# : string */ { while ($path !== '') { if (isset($this->filesystems[$path])) { return $path; } $path = substr($path, 0, strrpos($path, '/')); } return '/'; }
php
protected function getMountPoint(/*# string */ $path)/*# : string */ { while ($path !== '') { if (isset($this->filesystems[$path])) { return $path; } $path = substr($path, 0, strrpos($path, '/')); } return '/'; }
[ "protected", "function", "getMountPoint", "(", "/*# string */", "$", "path", ")", "/*# : string */", "{", "while", "(", "$", "path", "!==", "''", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "filesystems", "[", "$", "path", "]", ")", ")", "{",...
Find mount point of the path @param string $path @return string @access protected
[ "Find", "mount", "point", "of", "the", "path" ]
777f174559359deb56e63101c4962750eb15cfde
https://github.com/phossa2/storage/blob/777f174559359deb56e63101c4962750eb15cfde/src/Storage/Traits/MountableTrait.php#L119-L128
205,321
schpill/thin
src/Hash.php
Hash.make
public static function make($value, $rounds = 8) { $work = str_pad($rounds, 2, '0', STR_PAD_LEFT); // Bcrypt expects the salt to be 22 base64 encoded characters including // dots and slashes. We will get rid of the plus signs included in the // base64 data and re...
php
public static function make($value, $rounds = 8) { $work = str_pad($rounds, 2, '0', STR_PAD_LEFT); // Bcrypt expects the salt to be 22 base64 encoded characters including // dots and slashes. We will get rid of the plus signs included in the // base64 data and re...
[ "public", "static", "function", "make", "(", "$", "value", ",", "$", "rounds", "=", "8", ")", "{", "$", "work", "=", "str_pad", "(", "$", "rounds", ",", "2", ",", "'0'", ",", "STR_PAD_LEFT", ")", ";", "// Bcrypt expects the salt to be 22 base64 encoded chara...
Hash a password using the Bcrypt hashing scheme. <code> // Create a Bcrypt hash of a value $hash = Hash::make('secret'); // Use a specified number of iterations when creating the hash $hash = Hash::make('secret', 12); </code> @param string $value @param int $rounds @return string
[ "Hash", "a", "password", "using", "the", "Bcrypt", "hashing", "scheme", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Hash.php#L25-L41
205,322
CandleLight-Project/Framework
src/Error.php
Error.registerSystemErrors
public static function registerSystemErrors(Slim $app): void{ /** @var Container $c */ $c = $app->getContainer(); // Exception Handler $c['errorHandler'] = function ($c){ /** * Custom exception cather for the slim-framework * @param Request $request ...
php
public static function registerSystemErrors(Slim $app): void{ /** @var Container $c */ $c = $app->getContainer(); // Exception Handler $c['errorHandler'] = function ($c){ /** * Custom exception cather for the slim-framework * @param Request $request ...
[ "public", "static", "function", "registerSystemErrors", "(", "Slim", "$", "app", ")", ":", "void", "{", "/** @var Container $c */", "$", "c", "=", "$", "app", "->", "getContainer", "(", ")", ";", "// Exception Handler", "$", "c", "[", "'errorHandler'", "]", ...
Injects a custom error handling into the Slim-framework @param Slim $app Slim Framework instance
[ "Injects", "a", "custom", "error", "handling", "into", "the", "Slim", "-", "framework" ]
13c5cc34bd1118601406b0129f7b61c7b78d08f4
https://github.com/CandleLight-Project/Framework/blob/13c5cc34bd1118601406b0129f7b61c7b78d08f4/src/Error.php#L32-L74
205,323
ARCANEDEV/Markup
src/Support/Builder.php
Builder.make
public static function make(TagInterface $tag) { if ( $tag->getType() === '' and $tag->getText() !== '' ) { return $tag->getText(); } return self::isAutoClosed($tag->getType()) ? self::open($tag, true) : self::open($tag) . ...
php
public static function make(TagInterface $tag) { if ( $tag->getType() === '' and $tag->getText() !== '' ) { return $tag->getText(); } return self::isAutoClosed($tag->getType()) ? self::open($tag, true) : self::open($tag) . ...
[ "public", "static", "function", "make", "(", "TagInterface", "$", "tag", ")", "{", "if", "(", "$", "tag", "->", "getType", "(", ")", "===", "''", "and", "$", "tag", "->", "getText", "(", ")", "!==", "''", ")", "{", "return", "$", "tag", "->", "ge...
Render a Tag and its elements @param TagInterface $tag @return string
[ "Render", "a", "Tag", "and", "its", "elements" ]
881331df74b27614d025c365daacbae6aa865612
https://github.com/ARCANEDEV/Markup/blob/881331df74b27614d025c365daacbae6aa865612/src/Support/Builder.php#L28-L40
205,324
ARCANEDEV/Markup
src/Support/Builder.php
Builder.open
private static function open(TagInterface $tag, $autoClosed = false) { $output = '<' . $tag->getType(); if ($tag->hasAttributes()) { $output .= ' ' . $tag->renderAttributes(); } $output .= ($autoClosed ? '/>' : '>'); return $output; }
php
private static function open(TagInterface $tag, $autoClosed = false) { $output = '<' . $tag->getType(); if ($tag->hasAttributes()) { $output .= ' ' . $tag->renderAttributes(); } $output .= ($autoClosed ? '/>' : '>'); return $output; }
[ "private", "static", "function", "open", "(", "TagInterface", "$", "tag", ",", "$", "autoClosed", "=", "false", ")", "{", "$", "output", "=", "'<'", ".", "$", "tag", "->", "getType", "(", ")", ";", "if", "(", "$", "tag", "->", "hasAttributes", "(", ...
Render open Tag @param TagInterface $tag @param bool $autoClosed @return string
[ "Render", "open", "Tag" ]
881331df74b27614d025c365daacbae6aa865612
https://github.com/ARCANEDEV/Markup/blob/881331df74b27614d025c365daacbae6aa865612/src/Support/Builder.php#L50-L61
205,325
chilimatic/chilimatic-framework
lib/database/sql/mysql/Statement.php
Statement.bindParam
public function bindParam($placeholder, &$var, $type = null) { $this->param_list[$placeholder] = &$var; if (!empty($type) && in_array($type, $this->_type_list)) { $this->type_list[$placeholder] = &$type; } return true; }
php
public function bindParam($placeholder, &$var, $type = null) { $this->param_list[$placeholder] = &$var; if (!empty($type) && in_array($type, $this->_type_list)) { $this->type_list[$placeholder] = &$type; } return true; }
[ "public", "function", "bindParam", "(", "$", "placeholder", ",", "&", "$", "var", ",", "$", "type", "=", "null", ")", "{", "$", "this", "->", "param_list", "[", "$", "placeholder", "]", "=", "&", "$", "var", ";", "if", "(", "!", "empty", "(", "$"...
binds a parameter @param string $placeholder @param mixed $var @param null $type @return bool
[ "binds", "a", "parameter" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/database/sql/mysql/Statement.php#L142-L152
205,326
chilimatic/chilimatic-framework
lib/database/sql/mysql/Statement.php
Statement.fetchAll
public function fetchAll($type = null) { try { if ($this->res === false) { throw new DatabaseException(__METHOD__ . " No ressource has been given", MySQL::NO_RESSOURCE, MySQL::SEVERITY_DEBUG, __FILE__, __LINE__); } switch ($type) { case My...
php
public function fetchAll($type = null) { try { if ($this->res === false) { throw new DatabaseException(__METHOD__ . " No ressource has been given", MySQL::NO_RESSOURCE, MySQL::SEVERITY_DEBUG, __FILE__, __LINE__); } switch ($type) { case My...
[ "public", "function", "fetchAll", "(", "$", "type", "=", "null", ")", "{", "try", "{", "if", "(", "$", "this", "->", "res", "===", "false", ")", "{", "throw", "new", "DatabaseException", "(", "__METHOD__", ".", "\" No ressource has been given\"", ",", "MyS...
fetch all option @param null $type @return array @throws DatabaseException @throws \Exception
[ "fetch", "all", "option" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/database/sql/mysql/Statement.php#L225-L249
205,327
andyburton/Sonic-Framework
src/Model/Tools/Comment.php
Comment.hasTag
public function hasTag ($tag) { foreach ($this->lines as $line) { if (strpos ($line, '@' . $tag) === 0) { return TRUE; } } return FALSE; }
php
public function hasTag ($tag) { foreach ($this->lines as $line) { if (strpos ($line, '@' . $tag) === 0) { return TRUE; } } return FALSE; }
[ "public", "function", "hasTag", "(", "$", "tag", ")", "{", "foreach", "(", "$", "this", "->", "lines", "as", "$", "line", ")", "{", "if", "(", "strpos", "(", "$", "line", ",", "'@'", ".", "$", "tag", ")", "===", "0", ")", "{", "return", "TRUE",...
Check if a tag is set in the comment @param string $tag Tag to check for e.g. ignore = @ignore @return boolean
[ "Check", "if", "a", "tag", "is", "set", "in", "the", "comment" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Model/Tools/Comment.php#L36-L49
205,328
andyburton/Sonic-Framework
src/Model/Tools/Comment.php
Comment.getTags
public function getTags ($tag) { $tags = array (); foreach ($this->lines as $line) { if (strpos ($line, '@' . $tag) === 0) { $tags[] = trim (substr ($line, strlen ('@' . $tag))); } } return $tags; }
php
public function getTags ($tag) { $tags = array (); foreach ($this->lines as $line) { if (strpos ($line, '@' . $tag) === 0) { $tags[] = trim (substr ($line, strlen ('@' . $tag))); } } return $tags; }
[ "public", "function", "getTags", "(", "$", "tag", ")", "{", "$", "tags", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "lines", "as", "$", "line", ")", "{", "if", "(", "strpos", "(", "$", "line", ",", "'@'", ".", "$", "tag", ...
Return array of matching tags @param string $tag Tags to return @return array
[ "Return", "array", "of", "matching", "tags" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Model/Tools/Comment.php#L57-L72
205,329
andyburton/Sonic-Framework
src/Model/Tools/Comment.php
Comment.getLongDescription
public function getLongDescription () { $comment = ''; foreach ($this->lines as $key => $line) { if ($key == 0 || ($line && $line[0] == '@')) { continue; } if ($comment) { $comment .= "\n"; } $comment .= $line; } return $comment; }
php
public function getLongDescription () { $comment = ''; foreach ($this->lines as $key => $line) { if ($key == 0 || ($line && $line[0] == '@')) { continue; } if ($comment) { $comment .= "\n"; } $comment .= $line; } return $comment; }
[ "public", "function", "getLongDescription", "(", ")", "{", "$", "comment", "=", "''", ";", "foreach", "(", "$", "this", "->", "lines", "as", "$", "key", "=>", "$", "line", ")", "{", "if", "(", "$", "key", "==", "0", "||", "(", "$", "line", "&&", ...
Return long description This is every other line of a comment besides the first line and any tags @return string
[ "Return", "long", "description", "This", "is", "every", "other", "line", "of", "a", "comment", "besides", "the", "first", "line", "and", "any", "tags" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Model/Tools/Comment.php#L93-L117
205,330
andyburton/Sonic-Framework
src/Model/Tools/Comment.php
Comment.starComment
public static function starComment ($strComment, $intTabs = 0) { // Set return $strReturn = ''; // Split comment into lines $arrComment = explode ("\n", $strComment); // Find the position of the first / $intFirstSlash = strpos ($arrComment[0], '/'); // Set prefix $strPrefix = ...
php
public static function starComment ($strComment, $intTabs = 0) { // Set return $strReturn = ''; // Split comment into lines $arrComment = explode ("\n", $strComment); // Find the position of the first / $intFirstSlash = strpos ($arrComment[0], '/'); // Set prefix $strPrefix = ...
[ "public", "static", "function", "starComment", "(", "$", "strComment", ",", "$", "intTabs", "=", "0", ")", "{", "// Set return", "$", "strReturn", "=", "''", ";", "// Split comment into lines", "$", "arrComment", "=", "explode", "(", "\"\\n\"", ",", "$", "st...
Return a stared comment @param string $strComment Comment @param integer $intTabs Tabs before line @return string
[ "Return", "a", "stared", "comment" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Model/Tools/Comment.php#L127-L231
205,331
andyburton/Sonic-Framework
src/Model/Tools/Comment.php
Comment.lineComment
public static function lineComment ($strComment, $intTabs = 0) { // Set return $strReturn = ''; // Split comment into lines $arrComment = explode ("\n", $strComment); // Find the position of the first / $intFirstSlash = strpos ($arrComment[0], '/'); // Set prefix $strPrefix = (...
php
public static function lineComment ($strComment, $intTabs = 0) { // Set return $strReturn = ''; // Split comment into lines $arrComment = explode ("\n", $strComment); // Find the position of the first / $intFirstSlash = strpos ($arrComment[0], '/'); // Set prefix $strPrefix = (...
[ "public", "static", "function", "lineComment", "(", "$", "strComment", ",", "$", "intTabs", "=", "0", ")", "{", "// Set return", "$", "strReturn", "=", "''", ";", "// Split comment into lines", "$", "arrComment", "=", "explode", "(", "\"\\n\"", ",", "$", "st...
Return a lined comment @param type $strComment Comment @param type $intTabs Tabs before line @return string
[ "Return", "a", "lined", "comment" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Model/Tools/Comment.php#L241-L296
205,332
pascalchevrel/vcs
src/VCS/Git.php
Git.getCommits
public function getCommits() { $log = $this->execute( "git log --no-merges --format='changeset: %H%nuser: %aN <%aE>%ndate: %ad%nsummary: %s%n' " . $this->repository_path ); $this->repository_type = 'git'; return $this->parseLog($log); }
php
public function getCommits() { $log = $this->execute( "git log --no-merges --format='changeset: %H%nuser: %aN <%aE>%ndate: %ad%nsummary: %s%n' " . $this->repository_path ); $this->repository_type = 'git'; return $this->parseLog($log); }
[ "public", "function", "getCommits", "(", ")", "{", "$", "log", "=", "$", "this", "->", "execute", "(", "\"git log --no-merges --format='changeset: %H%nuser: %aN <%aE>%ndate: %ad%nsummary: %s%n' \"", ".", "$", "this", "->", "repository_path", ")", ";", "$", "this", "->...
Get the list of Git commits for the repository as a structured array @return array List of commits
[ "Get", "the", "list", "of", "Git", "commits", "for", "the", "repository", "as", "a", "structured", "array" ]
23d4827d5f8f44f20cd9a59fdf71ee7dfc895bfa
https://github.com/pascalchevrel/vcs/blob/23d4827d5f8f44f20cd9a59fdf71ee7dfc895bfa/src/VCS/Git.php#L11-L20
205,333
schpill/thin
src/Bag.php
Bag.set
public function set($key, $value) { $this->values[$this->normalizeKey($key)] = $value; return $this; }
php
public function set($key, $value) { $this->values[$this->normalizeKey($key)] = $value; return $this; }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ")", "{", "$", "this", "->", "values", "[", "$", "this", "->", "normalizeKey", "(", "$", "key", ")", "]", "=", "$", "value", ";", "return", "$", "this", ";", "}" ]
Set data key to value @param string $key The data key @param mixed $value The data value
[ "Set", "data", "key", "to", "value" ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Bag.php#L40-L45
205,334
schpill/thin
src/Bag.php
Bag.get
public function get($key, $default = null) { if ($this->has($key)) { $isInvokable = is_object($this->values[$this->normalizeKey($key)]) && method_exists($this->values[$this->normalizeKey($key)], '__invoke'); return $isInvokable ? $this->values[$this->...
php
public function get($key, $default = null) { if ($this->has($key)) { $isInvokable = is_object($this->values[$this->normalizeKey($key)]) && method_exists($this->values[$this->normalizeKey($key)], '__invoke'); return $isInvokable ? $this->values[$this->...
[ "public", "function", "get", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "if", "(", "$", "this", "->", "has", "(", "$", "key", ")", ")", "{", "$", "isInvokable", "=", "is_object", "(", "$", "this", "->", "values", "[", "$", "th...
Get values value with key @param string $key The values key @param mixed $default The value to return if values key does not exist @return mixed The values value, or the default value
[ "Get", "values", "value", "with", "key" ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Bag.php#L53-L64
205,335
YiMAproject/yimaAdminor
src/yimaAdminor/Auth/AuthService.php
AuthService.identity
function identity() { if (!$this->identity) $this->identity = new BaseIdentity(get_class($this)); return $this->identity; }
php
function identity() { if (!$this->identity) $this->identity = new BaseIdentity(get_class($this)); return $this->identity; }
[ "function", "identity", "(", ")", "{", "if", "(", "!", "$", "this", "->", "identity", ")", "$", "this", "->", "identity", "=", "new", "BaseIdentity", "(", "get_class", "(", "$", "this", ")", ")", ";", "return", "$", "this", "->", "identity", ";", "...
Get Authorized User Identity - identities must inject into adapter by auth services @throws \Exception Not Identity Available Or Set @return BaseIdentity
[ "Get", "Authorized", "User", "Identity" ]
7a6c66e05aedaef8061c8998dfa44ac1ce9cc319
https://github.com/YiMAproject/yimaAdminor/blob/7a6c66e05aedaef8061c8998dfa44ac1ce9cc319/src/yimaAdminor/Auth/AuthService.php#L67-L73
205,336
atelierspierrot/patterns
src/Patterns/Commons/ConfigurationRegistry.php
ConfigurationRegistry.set
public function set($name, $value, $scope = null) { if (strpos($name, ':')) { list($entry, $name) = explode(':', $name); $cfg = $this->getConfig($entry, array(), $scope); $cfg[$name] = $value; return $this->setConfig($entry, $cfg, $scope); } else { ...
php
public function set($name, $value, $scope = null) { if (strpos($name, ':')) { list($entry, $name) = explode(':', $name); $cfg = $this->getConfig($entry, array(), $scope); $cfg[$name] = $value; return $this->setConfig($entry, $cfg, $scope); } else { ...
[ "public", "function", "set", "(", "$", "name", ",", "$", "value", ",", "$", "scope", "=", "null", ")", "{", "if", "(", "strpos", "(", "$", "name", ",", "':'", ")", ")", "{", "list", "(", "$", "entry", ",", "$", "name", ")", "=", "explode", "(...
Set the value of a specific option with depth @param string $name The index of the configuration value to get, with a scope using notation `index:name` @param mixed $value The value to set for $name @param string $scope The scope to use in the configuration registry if it is not defined in the `$name` pa...
[ "Set", "the", "value", "of", "a", "specific", "option", "with", "depth" ]
b7a8313e98bbfb6525e1672d0a726a1ead6f156e
https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/ConfigurationRegistry.php#L62-L72
205,337
atelierspierrot/patterns
src/Patterns/Commons/ConfigurationRegistry.php
ConfigurationRegistry.setConfigs
public function setConfigs(array $options, $scope = null) { if (!is_null($scope)) { $this->registry[$scope] = $options; } else { $this->registry = $options; } return $this; }
php
public function setConfigs(array $options, $scope = null) { if (!is_null($scope)) { $this->registry[$scope] = $options; } else { $this->registry = $options; } return $this; }
[ "public", "function", "setConfigs", "(", "array", "$", "options", ",", "$", "scope", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "scope", ")", ")", "{", "$", "this", "->", "registry", "[", "$", "scope", "]", "=", "$", "options", "...
Set an array of options @param array $options The array of values to set for the configuration entry @param string $scope The scope to use in the configuration registry (optional) @return self
[ "Set", "an", "array", "of", "options" ]
b7a8313e98bbfb6525e1672d0a726a1ead6f156e
https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/ConfigurationRegistry.php#L100-L109
205,338
atelierspierrot/patterns
src/Patterns/Commons/ConfigurationRegistry.php
ConfigurationRegistry.addConfig
public function addConfig($name, $value, $scope = null) { return $this->setConfig($name, $value, $scope); }
php
public function addConfig($name, $value, $scope = null) { return $this->setConfig($name, $value, $scope); }
[ "public", "function", "addConfig", "(", "$", "name", ",", "$", "value", ",", "$", "scope", "=", "null", ")", "{", "return", "$", "this", "->", "setConfig", "(", "$", "name", ",", "$", "value", ",", "$", "scope", ")", ";", "}" ]
Alias of the `setConfig` method @see self::setConfig()
[ "Alias", "of", "the", "setConfig", "method" ]
b7a8313e98bbfb6525e1672d0a726a1ead6f156e
https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/ConfigurationRegistry.php#L138-L141
205,339
simpleapisecurity/php
src/Entropy.php
Entropy.bytes
static function bytes($bytes = Constants::BYTES) { # Test the length for validity. Helpers::rangeCheck($bytes, Constants::BYTES_MAX, Constants::BYTES_MIN, 'Entropy', 'bytes'); return \Sodium\randombytes_buf($bytes); }
php
static function bytes($bytes = Constants::BYTES) { # Test the length for validity. Helpers::rangeCheck($bytes, Constants::BYTES_MAX, Constants::BYTES_MIN, 'Entropy', 'bytes'); return \Sodium\randombytes_buf($bytes); }
[ "static", "function", "bytes", "(", "$", "bytes", "=", "Constants", "::", "BYTES", ")", "{", "# Test the length for validity.", "Helpers", "::", "rangeCheck", "(", "$", "bytes", ",", "Constants", "::", "BYTES_MAX", ",", "Constants", "::", "BYTES_MIN", ",", "'E...
Returns a string of random bytes to the client. @param int $bytes Size of the string of bytes to be generated. @return string @throws Exceptions\InvalidTypeException @throws Exceptions\OutOfRangeException
[ "Returns", "a", "string", "of", "random", "bytes", "to", "the", "client", "." ]
e6cebf3213f4d7be54aa3a188d95a00113e3fda0
https://github.com/simpleapisecurity/php/blob/e6cebf3213f4d7be54aa3a188d95a00113e3fda0/src/Entropy.php#L25-L31
205,340
simpleapisecurity/php
src/Entropy.php
Entropy.integer
static function integer($range = Constants::RANGE) { # Test the length for validity. Helpers::rangeCheck($range, Constants::RANGE_MAX, Constants::RANGE_MIN, 'Entropy', 'integer'); return \Sodium\randombytes_uniform($range) + 1; }
php
static function integer($range = Constants::RANGE) { # Test the length for validity. Helpers::rangeCheck($range, Constants::RANGE_MAX, Constants::RANGE_MIN, 'Entropy', 'integer'); return \Sodium\randombytes_uniform($range) + 1; }
[ "static", "function", "integer", "(", "$", "range", "=", "Constants", "::", "RANGE", ")", "{", "# Test the length for validity.", "Helpers", "::", "rangeCheck", "(", "$", "range", ",", "Constants", "::", "RANGE_MAX", ",", "Constants", "::", "RANGE_MIN", ",", "...
Returns a random integer to the client. @param int $range Upper limit of random numbers to return to the client. @return int @throws Exceptions\InvalidTypeException @throws Exceptions\OutOfRangeException
[ "Returns", "a", "random", "integer", "to", "the", "client", "." ]
e6cebf3213f4d7be54aa3a188d95a00113e3fda0
https://github.com/simpleapisecurity/php/blob/e6cebf3213f4d7be54aa3a188d95a00113e3fda0/src/Entropy.php#L41-L47
205,341
luoxiaojun1992/lb_framework
controllers/console/ServerController.php
ServerController.index
public function index() { $argv = \Console_Getopt::readPHPArgv(); $opts = \Console_Getopt::getopt(array_slice($argv, 2, count($argv) - 2), 'h::p::d::r::', null, true); if (!empty($opts[0]) && is_array($opts[0])) { foreach ($opts[0] as $val) { if (!empty($val[0]) &...
php
public function index() { $argv = \Console_Getopt::readPHPArgv(); $opts = \Console_Getopt::getopt(array_slice($argv, 2, count($argv) - 2), 'h::p::d::r::', null, true); if (!empty($opts[0]) && is_array($opts[0])) { foreach ($opts[0] as $val) { if (!empty($val[0]) &...
[ "public", "function", "index", "(", ")", "{", "$", "argv", "=", "\\", "Console_Getopt", "::", "readPHPArgv", "(", ")", ";", "$", "opts", "=", "\\", "Console_Getopt", "::", "getopt", "(", "array_slice", "(", "$", "argv", ",", "2", ",", "count", "(", "...
Runs PHP built-in web server @param string $address address to serve on. Either "host" or "host:port". @return int
[ "Runs", "PHP", "built", "-", "in", "web", "server" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/controllers/console/ServerController.php#L39-L82
205,342
phramework/phramework
src/Models/Compress.php
Compress.decompress
public static function decompress( $compressedFile, $destinationFolder, $originalFilename = null, $format = 'gz', $allowedExtensions = [ 'csv', 'tsv' ] ) { //TODO ADD tar.gz $supported_formats = [ 'gz', 'zip', 'tar']; if...
php
public static function decompress( $compressedFile, $destinationFolder, $originalFilename = null, $format = 'gz', $allowedExtensions = [ 'csv', 'tsv' ] ) { //TODO ADD tar.gz $supported_formats = [ 'gz', 'zip', 'tar']; if...
[ "public", "static", "function", "decompress", "(", "$", "compressedFile", ",", "$", "destinationFolder", ",", "$", "originalFilename", "=", "null", ",", "$", "format", "=", "'gz'", ",", "$", "allowedExtensions", "=", "[", "'csv'", ",", "'tsv'", "]", ")", "...
decompress a file archive @param string $compressedFile Archive path @param string $destinationFolder Destination folder to decompress files @param string $originalFilename Original file name @param string $format Select format mode, Default is gz, gz, zip and tar are available. @param string[] $allowedExtensions @retu...
[ "decompress", "a", "file", "archive" ]
40041d1ef23b1f8cdbd26fb112448d6a3dbef012
https://github.com/phramework/phramework/blob/40041d1ef23b1f8cdbd26fb112448d6a3dbef012/src/Models/Compress.php#L42-L80
205,343
SpoonX/SxMail
src/SxMail/Service/SxMailService.php
SxMailService.getConfig
public function getConfig($configKey = null) { $default = clone $this->config->configs->default; if (null !== $configKey) { $default->merge(clone $this->config->configs->{$configKey}); } return $default->toArray(); }
php
public function getConfig($configKey = null) { $default = clone $this->config->configs->default; if (null !== $configKey) { $default->merge(clone $this->config->configs->{$configKey}); } return $default->toArray(); }
[ "public", "function", "getConfig", "(", "$", "configKey", "=", "null", ")", "{", "$", "default", "=", "clone", "$", "this", "->", "config", "->", "configs", "->", "default", ";", "if", "(", "null", "!==", "$", "configKey", ")", "{", "$", "default", "...
Get the default config, merged with an option overriding config. @param string $configKey @return array The merged configuration
[ "Get", "the", "default", "config", "merged", "with", "an", "option", "overriding", "config", "." ]
b0663169cd246ba091f7c84785c69d051a652385
https://github.com/SpoonX/SxMail/blob/b0663169cd246ba091f7c84785c69d051a652385/src/SxMail/Service/SxMailService.php#L45-L54
205,344
cyberspectrum/i18n-contao
src/Mapping/Terminal42ChangeLanguage/PageMap.php
PageMap.findRootPages
private function findRootPages(): array { $result = [ 'source' => null, 'target' => null, 'main' => null, ]; $this->logger->debug( 'Searching root pages for source "{source}" and target "{target}"', ['source' => $this->sourceLang...
php
private function findRootPages(): array { $result = [ 'source' => null, 'target' => null, 'main' => null, ]; $this->logger->debug( 'Searching root pages for source "{source}" and target "{target}"', ['source' => $this->sourceLang...
[ "private", "function", "findRootPages", "(", ")", ":", "array", "{", "$", "result", "=", "[", "'source'", "=>", "null", ",", "'target'", "=>", "null", ",", "'main'", "=>", "null", ",", "]", ";", "$", "this", "->", "logger", "->", "debug", "(", "'Sear...
Determine the root pages. @return int[] @throws \RuntimeException When a root page is missing.
[ "Determine", "the", "root", "pages", "." ]
038cf6ea9c609a734d7476fba256bc4b0db236b7
https://github.com/cyberspectrum/i18n-contao/blob/038cf6ea9c609a734d7476fba256bc4b0db236b7/src/Mapping/Terminal42ChangeLanguage/PageMap.php#L95-L136
205,345
cyberspectrum/i18n-contao
src/Mapping/Terminal42ChangeLanguage/PageMap.php
PageMap.buildPageMap
private function buildPageMap(int $mainRoot, int $otherRoot, array &$map, array &$inverse): array { // Root pages are mapped to each other. $map[$otherRoot] = $mainRoot; $inverse[$mainRoot] = $otherRoot; // Now fetch all other. $isMain = $mainRoot === $otherRoot; ...
php
private function buildPageMap(int $mainRoot, int $otherRoot, array &$map, array &$inverse): array { // Root pages are mapped to each other. $map[$otherRoot] = $mainRoot; $inverse[$mainRoot] = $otherRoot; // Now fetch all other. $isMain = $mainRoot === $otherRoot; ...
[ "private", "function", "buildPageMap", "(", "int", "$", "mainRoot", ",", "int", "$", "otherRoot", ",", "array", "&", "$", "map", ",", "array", "&", "$", "inverse", ")", ":", "array", "{", "// Root pages are mapped to each other.", "$", "map", "[", "$", "ot...
Build a map for a language and returns the map from source to main. @param int $mainRoot The main language root page. @param int $otherRoot The root page of the other language. @param array $map The mapping array to populate. @param array $inverse The inverse mapping. @return int[]
[ "Build", "a", "map", "for", "a", "language", "and", "returns", "the", "map", "from", "source", "to", "main", "." ]
038cf6ea9c609a734d7476fba256bc4b0db236b7
https://github.com/cyberspectrum/i18n-contao/blob/038cf6ea9c609a734d7476fba256bc4b0db236b7/src/Mapping/Terminal42ChangeLanguage/PageMap.php#L148-L198
205,346
cyberspectrum/i18n-contao
src/Mapping/Terminal42ChangeLanguage/PageMap.php
PageMap.determineMapFor
private function determineMapFor(int $index, int $parentId, array $inverseList): ?int { if (!isset($inverseList[$parentId])) { throw new \InvalidArgumentException( 'Page id ' . $parentId . ' has not been mapped' ); } // Lookup all children of parent p...
php
private function determineMapFor(int $index, int $parentId, array $inverseList): ?int { if (!isset($inverseList[$parentId])) { throw new \InvalidArgumentException( 'Page id ' . $parentId . ' has not been mapped' ); } // Lookup all children of parent p...
[ "private", "function", "determineMapFor", "(", "int", "$", "index", ",", "int", "$", "parentId", ",", "array", "$", "inverseList", ")", ":", "?", "int", "{", "if", "(", "!", "isset", "(", "$", "inverseList", "[", "$", "parentId", "]", ")", ")", "{", ...
Determine the mapping for the passed index. @param int $index The index to look up. @param int $parentId The parent id. @param array $inverseList The reverse lookup list. @return int|null @throws \InvalidArgumentException When the parent page has not been mapped.
[ "Determine", "the", "mapping", "for", "the", "passed", "index", "." ]
038cf6ea9c609a734d7476fba256bc4b0db236b7
https://github.com/cyberspectrum/i18n-contao/blob/038cf6ea9c609a734d7476fba256bc4b0db236b7/src/Mapping/Terminal42ChangeLanguage/PageMap.php#L211-L223
205,347
skck/SbkCronBundle
Cron/Task.php
Task.getCommandToExecute
public function getCommandToExecute() { $command = implode( " ", array( $this->bin, $this->script, $this->command, ) ); return trim(preg_replace('/\s+/', ' ', $command)); }
php
public function getCommandToExecute() { $command = implode( " ", array( $this->bin, $this->script, $this->command, ) ); return trim(preg_replace('/\s+/', ' ', $command)); }
[ "public", "function", "getCommandToExecute", "(", ")", "{", "$", "command", "=", "implode", "(", "\" \"", ",", "array", "(", "$", "this", "->", "bin", ",", "$", "this", "->", "script", ",", "$", "this", "->", "command", ",", ")", ")", ";", "return", ...
Returns the executable command for the task instance @return string
[ "Returns", "the", "executable", "command", "for", "the", "task", "instance" ]
9a3d2bedfcee76587691a19abc7c25e62039d440
https://github.com/skck/SbkCronBundle/blob/9a3d2bedfcee76587691a19abc7c25e62039d440/Cron/Task.php#L150-L161
205,348
stonedz/pff2
src/Core/ViewPHP.php
ViewPHP.preView
public function preView($output) { /** @var $purifierConfig \HTMLPurifier_Config */ $purifierConfig = \HTMLPurifier_Config::createDefault(); $purifierConfig->set('Core.Encoding', 'UTF-8'); $purifierConfig->set('HTML.TidyLevel', 'medium'); /** @var \HTMLPurifier_Config $purifierC...
php
public function preView($output) { /** @var $purifierConfig \HTMLPurifier_Config */ $purifierConfig = \HTMLPurifier_Config::createDefault(); $purifierConfig->set('Core.Encoding', 'UTF-8'); $purifierConfig->set('HTML.TidyLevel', 'medium'); /** @var \HTMLPurifier_Config $purifierC...
[ "public", "function", "preView", "(", "$", "output", ")", "{", "/** @var $purifierConfig \\HTMLPurifier_Config */", "$", "purifierConfig", "=", "\\", "HTMLPurifier_Config", "::", "createDefault", "(", ")", ";", "$", "purifierConfig", "->", "set", "(", "'Core.Encoding'...
Callback method to sanitize HTML output @param string $output HTML output string @return string
[ "Callback", "method", "to", "sanitize", "HTML", "output" ]
ec3b087d4d4732816f61ac487f0cb25511e0da88
https://github.com/stonedz/pff2/blob/ec3b087d4d4732816f61ac487f0cb25511e0da88/src/Core/ViewPHP.php#L70-L81
205,349
phavour/phavour
Phavour/Auth/Service.php
Service.login
public function login() { $result = $this->adapter->getResult(); if ($result === self::PHAVOUR_AUTH_SERVICE_SUCCESS) { $auth = Auth::getInstance(); $auth->login($this->adapter->getIdentity()); $auth->setRoles($this->adapter->getRoles()); return true; ...
php
public function login() { $result = $this->adapter->getResult(); if ($result === self::PHAVOUR_AUTH_SERVICE_SUCCESS) { $auth = Auth::getInstance(); $auth->login($this->adapter->getIdentity()); $auth->setRoles($this->adapter->getRoles()); return true; ...
[ "public", "function", "login", "(", ")", "{", "$", "result", "=", "$", "this", "->", "adapter", "->", "getResult", "(", ")", ";", "if", "(", "$", "result", "===", "self", "::", "PHAVOUR_AUTH_SERVICE_SUCCESS", ")", "{", "$", "auth", "=", "Auth", "::", ...
Log a user in using the given adapter from the construct @throws InvalidCredentialsException @throws UnrecognisedAuthenticationResultException @return boolean|throws
[ "Log", "a", "user", "in", "using", "the", "given", "adapter", "from", "the", "construct" ]
2246f78203312eb2e23fdb0f776f790e81b4d20f
https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Auth/Service.php#L77-L92
205,350
deweller/php-cliopts
src/CLIOpts/Help/HelpGenerator.php
HelpGenerator.build
public function build() { $options_data = $this->buildOptionsData(); $out_text = $this->buildUsageLine($this->arguments_spec->getUsage(), $options_data); $options_text = ''; if ($options_data['lines']) { foreach($options_data['lines'] as $option_line_data) { $options_text .= $this...
php
public function build() { $options_data = $this->buildOptionsData(); $out_text = $this->buildUsageLine($this->arguments_spec->getUsage(), $options_data); $options_text = ''; if ($options_data['lines']) { foreach($options_data['lines'] as $option_line_data) { $options_text .= $this...
[ "public", "function", "build", "(", ")", "{", "$", "options_data", "=", "$", "this", "->", "buildOptionsData", "(", ")", ";", "$", "out_text", "=", "$", "this", "->", "buildUsageLine", "(", "$", "this", "->", "arguments_spec", "->", "getUsage", "(", ")",...
Builds nicely formatted help text @return string formatted help text
[ "Builds", "nicely", "formatted", "help", "text" ]
1923f3a7ad24062c6279c725579ff3af15141dec
https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/HelpGenerator.php#L62-L81
205,351
deweller/php-cliopts
src/CLIOpts/Help/HelpGenerator.php
HelpGenerator.buildUsageLine
protected function buildUsageLine($usage_data, $options_data) { if ($usage_data['use_argv_self']) { $self_name = $_SERVER['argv'][0]; } else { $self_name = $usage_data['self']; } $has_options = (count($options_data['lines']) > 0 ? true : false); $has_named_args = (count($usage_data['nam...
php
protected function buildUsageLine($usage_data, $options_data) { if ($usage_data['use_argv_self']) { $self_name = $_SERVER['argv'][0]; } else { $self_name = $usage_data['self']; } $has_options = (count($options_data['lines']) > 0 ? true : false); $has_named_args = (count($usage_data['nam...
[ "protected", "function", "buildUsageLine", "(", "$", "usage_data", ",", "$", "options_data", ")", "{", "if", "(", "$", "usage_data", "[", "'use_argv_self'", "]", ")", "{", "$", "self_name", "=", "$", "_SERVER", "[", "'argv'", "]", "[", "0", "]", ";", "...
builds the usage line @param array $usage_data Usage line specification data @param array $options_data Options specification data @return string formatted usage line text
[ "builds", "the", "usage", "line" ]
1923f3a7ad24062c6279c725579ff3af15141dec
https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/HelpGenerator.php#L97-L115
205,352
deweller/php-cliopts
src/CLIOpts/Help/HelpGenerator.php
HelpGenerator.buildOptionLine
protected function buildOptionLine($option_line_data, $options_data) { $padding = $options_data['padding']; $required = $option_line_data['spec']['required']; $out = str_pad($option_line_data['switch_text'], $padding); $out .= (strlen($option_line_data['spec']['help']) ? ' '.$option_line_data['spec'][...
php
protected function buildOptionLine($option_line_data, $options_data) { $padding = $options_data['padding']; $required = $option_line_data['spec']['required']; $out = str_pad($option_line_data['switch_text'], $padding); $out .= (strlen($option_line_data['spec']['help']) ? ' '.$option_line_data['spec'][...
[ "protected", "function", "buildOptionLine", "(", "$", "option_line_data", ",", "$", "options_data", ")", "{", "$", "padding", "=", "$", "options_data", "[", "'padding'", "]", ";", "$", "required", "=", "$", "option_line_data", "[", "'spec'", "]", "[", "'requ...
builds an option line @param array $option_line_data Option line specification data @param array $options_data All options specification data @return string formatted option line text
[ "builds", "an", "option", "line" ]
1923f3a7ad24062c6279c725579ff3af15141dec
https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/HelpGenerator.php#L125-L140
205,353
deweller/php-cliopts
src/CLIOpts/Help/HelpGenerator.php
HelpGenerator.generateValueNamesHelp
protected function generateValueNamesHelp($named_args_spec) { $first = true; $out = ''; foreach($named_args_spec as $named_arg_spec) { $out .= ($first ? '' : ' '); if ($named_arg_spec['required']) { $out .= ConsoleFormat::applyformatToText('bold','yellow','<'.$named_arg_spec['name'].'>...
php
protected function generateValueNamesHelp($named_args_spec) { $first = true; $out = ''; foreach($named_args_spec as $named_arg_spec) { $out .= ($first ? '' : ' '); if ($named_arg_spec['required']) { $out .= ConsoleFormat::applyformatToText('bold','yellow','<'.$named_arg_spec['name'].'>...
[ "protected", "function", "generateValueNamesHelp", "(", "$", "named_args_spec", ")", "{", "$", "first", "=", "true", ";", "$", "out", "=", "''", ";", "foreach", "(", "$", "named_args_spec", "as", "$", "named_arg_spec", ")", "{", "$", "out", ".=", "(", "$...
gerenates the value names in the usage line @param array $named_args_spec value names specifications @return mixed Value.
[ "gerenates", "the", "value", "names", "in", "the", "usage", "line" ]
1923f3a7ad24062c6279c725579ff3af15141dec
https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/HelpGenerator.php#L150-L167
205,354
deweller/php-cliopts
src/CLIOpts/Help/HelpGenerator.php
HelpGenerator.buildOptionsData
protected function buildOptionsData() { $options_data = array( 'lines' => array(), 'padding' => 0, ); // build the lines foreach($this->arguments_spec as $option_line_spec) { $options_data['lines'][] = $this->buildOptionLineData($option_line_spec); } // calculate padding ...
php
protected function buildOptionsData() { $options_data = array( 'lines' => array(), 'padding' => 0, ); // build the lines foreach($this->arguments_spec as $option_line_spec) { $options_data['lines'][] = $this->buildOptionLineData($option_line_spec); } // calculate padding ...
[ "protected", "function", "buildOptionsData", "(", ")", "{", "$", "options_data", "=", "array", "(", "'lines'", "=>", "array", "(", ")", ",", "'padding'", "=>", "0", ",", ")", ";", "// build the lines", "foreach", "(", "$", "this", "->", "arguments_spec", "...
builds options data from the arguments spec @return array Options data
[ "builds", "options", "data", "from", "the", "arguments", "spec" ]
1923f3a7ad24062c6279c725579ff3af15141dec
https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/HelpGenerator.php#L174-L189
205,355
deweller/php-cliopts
src/CLIOpts/Help/HelpGenerator.php
HelpGenerator.buildOptionLineData
protected function buildOptionLineData($option_line_spec) { $data = array(); $switch_text = ''; if (strlen($option_line_spec['short'])) { $switch_text .= "-".$option_line_spec['short']; } if (strlen($option_line_spec['long'])) { $switch_text .= ($switch_text ? ", " : "")."--".$option_li...
php
protected function buildOptionLineData($option_line_spec) { $data = array(); $switch_text = ''; if (strlen($option_line_spec['short'])) { $switch_text .= "-".$option_line_spec['short']; } if (strlen($option_line_spec['long'])) { $switch_text .= ($switch_text ? ", " : "")."--".$option_li...
[ "protected", "function", "buildOptionLineData", "(", "$", "option_line_spec", ")", "{", "$", "data", "=", "array", "(", ")", ";", "$", "switch_text", "=", "''", ";", "if", "(", "strlen", "(", "$", "option_line_spec", "[", "'short'", "]", ")", ")", "{", ...
builds a line of options data from a line of the argument spec @param array $option_line_spec Data of argument specification representing an options line @return mixed Value.
[ "builds", "a", "line", "of", "options", "data", "from", "a", "line", "of", "the", "argument", "spec" ]
1923f3a7ad24062c6279c725579ff3af15141dec
https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/HelpGenerator.php#L198-L215
205,356
deweller/php-cliopts
src/CLIOpts/Help/HelpGenerator.php
HelpGenerator.buildSwitchTextPaddingLength
protected function buildSwitchTextPaddingLength($options_data) { $padding_len = 0; foreach($options_data['lines'] as $option_line_data) { $padding_len = max($padding_len, strlen($option_line_data['switch_text'])); } return $padding_len; }
php
protected function buildSwitchTextPaddingLength($options_data) { $padding_len = 0; foreach($options_data['lines'] as $option_line_data) { $padding_len = max($padding_len, strlen($option_line_data['switch_text'])); } return $padding_len; }
[ "protected", "function", "buildSwitchTextPaddingLength", "(", "$", "options_data", ")", "{", "$", "padding_len", "=", "0", ";", "foreach", "(", "$", "options_data", "[", "'lines'", "]", "as", "$", "option_line_data", ")", "{", "$", "padding_len", "=", "max", ...
calculates the maximum padding for all options @param mixed $options_data Description. @return int padding length
[ "calculates", "the", "maximum", "padding", "for", "all", "options" ]
1923f3a7ad24062c6279c725579ff3af15141dec
https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/HelpGenerator.php#L225-L231
205,357
harp-orm/harp
src/Model/Models.php
Models.addObjects
public function addObjects(SplObjectStorage $models) { foreach ($models as $model) { $this->add($model); } return $this; }
php
public function addObjects(SplObjectStorage $models) { foreach ($models as $model) { $this->add($model); } return $this; }
[ "public", "function", "addObjects", "(", "SplObjectStorage", "$", "models", ")", "{", "foreach", "(", "$", "models", "as", "$", "model", ")", "{", "$", "this", "->", "add", "(", "$", "model", ")", ";", "}", "return", "$", "this", ";", "}" ]
Link all models from the SplObjectStorage @param SplObjectStorage $models @return Models $this
[ "Link", "all", "models", "from", "the", "SplObjectStorage" ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Model/Models.php#L50-L57
205,358
harp-orm/harp
src/Model/Models.php
Models.addAll
public function addAll(Models $other) { if ($other->count() > 0) { $this->models->addAll($other->models); } return $this; }
php
public function addAll(Models $other) { if ($other->count() > 0) { $this->models->addAll($other->models); } return $this; }
[ "public", "function", "addAll", "(", "Models", "$", "other", ")", "{", "if", "(", "$", "other", "->", "count", "(", ")", ">", "0", ")", "{", "$", "this", "->", "models", "->", "addAll", "(", "$", "other", "->", "models", ")", ";", "}", "return", ...
Add all models from a different Models collection @param Models $other
[ "Add", "all", "models", "from", "a", "different", "Models", "collection" ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Model/Models.php#L64-L71
205,359
harp-orm/harp
src/Model/Models.php
Models.sort
public function sort(Closure $closure) { $sorted = clone $this; $sorted->models = Objects::sort($sorted->models, $closure); return $sorted; }
php
public function sort(Closure $closure) { $sorted = clone $this; $sorted->models = Objects::sort($sorted->models, $closure); return $sorted; }
[ "public", "function", "sort", "(", "Closure", "$", "closure", ")", "{", "$", "sorted", "=", "clone", "$", "this", ";", "$", "sorted", "->", "models", "=", "Objects", "::", "sort", "(", "$", "sorted", "->", "models", ",", "$", "closure", ")", ";", "...
Sort the models collection using a comparation closure @param Closure $closure @return array
[ "Sort", "the", "models", "collection", "using", "a", "comparation", "closure" ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Model/Models.php#L236-L243
205,360
harp-orm/harp
src/Model/Models.php
Models.byRepo
public function byRepo(Closure $yield) { $repos = Objects::groupBy($this->models, function (AbstractModel $model) { return $model->getRepo()->getRootRepo(); }); foreach ($repos as $repo) { $models = new Models(); $models->addObjects($repos->getInfo()); ...
php
public function byRepo(Closure $yield) { $repos = Objects::groupBy($this->models, function (AbstractModel $model) { return $model->getRepo()->getRootRepo(); }); foreach ($repos as $repo) { $models = new Models(); $models->addObjects($repos->getInfo()); ...
[ "public", "function", "byRepo", "(", "Closure", "$", "yield", ")", "{", "$", "repos", "=", "Objects", "::", "groupBy", "(", "$", "this", "->", "models", ",", "function", "(", "AbstractModel", "$", "model", ")", "{", "return", "$", "model", "->", "getRe...
Group models by repo, call yield for each repo @param Closure $yield Call for each repo ($repo, $models)
[ "Group", "models", "by", "repo", "call", "yield", "for", "each", "repo" ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Model/Models.php#L272-L284
205,361
harp-orm/harp
src/Model/Models.php
Models.pluckProperty
public function pluckProperty($property) { $values = []; foreach ($this->models as $model) { $values []= $model->$property; } return $values; }
php
public function pluckProperty($property) { $values = []; foreach ($this->models as $model) { $values []= $model->$property; } return $values; }
[ "public", "function", "pluckProperty", "(", "$", "property", ")", "{", "$", "values", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "models", "as", "$", "model", ")", "{", "$", "values", "[", "]", "=", "$", "model", "->", "$", "property", ...
Return the value of a property for each model @param string $property @return array
[ "Return", "the", "value", "of", "a", "property", "for", "each", "model" ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Model/Models.php#L292-L301
205,362
harp-orm/harp
src/Model/Models.php
Models.isEmptyProperty
public function isEmptyProperty($property) { foreach ($this->models as $model) { if ($model->$property) { return false; } } return true; }
php
public function isEmptyProperty($property) { foreach ($this->models as $model) { if ($model->$property) { return false; } } return true; }
[ "public", "function", "isEmptyProperty", "(", "$", "property", ")", "{", "foreach", "(", "$", "this", "->", "models", "as", "$", "model", ")", "{", "if", "(", "$", "model", "->", "$", "property", ")", "{", "return", "false", ";", "}", "}", "return", ...
Return false if there is at least one non-empty property of a model. @param string $property @return boolean
[ "Return", "false", "if", "there", "is", "at", "least", "one", "non", "-", "empty", "property", "of", "a", "model", "." ]
e0751696521164c86ccd0a76d708df490efd8306
https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Model/Models.php#L309-L318
205,363
bennybi/yii2-cza-base
components/utils/Naming.php
Naming.toSplit
public function toSplit($name, $splitor = '-', $to = self::LOWER) { switch ($to) { case self::UPPER: return strtoupper(preg_replace("/(.)([A-Z])/", "$1{$splitor}$2", $name)); default: return strtolower(preg_replace("/(.)([A-Z])/", "$1{$splitor}$2", $name))...
php
public function toSplit($name, $splitor = '-', $to = self::LOWER) { switch ($to) { case self::UPPER: return strtoupper(preg_replace("/(.)([A-Z])/", "$1{$splitor}$2", $name)); default: return strtolower(preg_replace("/(.)([A-Z])/", "$1{$splitor}$2", $name))...
[ "public", "function", "toSplit", "(", "$", "name", ",", "$", "splitor", "=", "'-'", ",", "$", "to", "=", "self", "::", "LOWER", ")", "{", "switch", "(", "$", "to", ")", "{", "case", "self", "::", "UPPER", ":", "return", "strtoupper", "(", "preg_rep...
usage example. CmsPageSort => cms-page-sort @param type $name @param type $splitor @param type $to @return type
[ "usage", "example", ".", "CmsPageSort", "=", ">", "cms", "-", "page", "-", "sort" ]
8257db8034bd948712fa469062921f210f0ba8da
https://github.com/bennybi/yii2-cza-base/blob/8257db8034bd948712fa469062921f210f0ba8da/components/utils/Naming.php#L30-L37
205,364
pmdevelopment/tool-bundle
Components/Helper/ObjectHelper.php
ObjectHelper.getConstantValuesByPrefix
public static function getConstantValuesByPrefix($className, $prefix) { $prefixLength = strlen($prefix); $result = []; $reflection = new \ReflectionClass($className); foreach ($reflection->getConstants() as $constKey => $constValue) { if ($prefix === substr($constKey, 0,...
php
public static function getConstantValuesByPrefix($className, $prefix) { $prefixLength = strlen($prefix); $result = []; $reflection = new \ReflectionClass($className); foreach ($reflection->getConstants() as $constKey => $constValue) { if ($prefix === substr($constKey, 0,...
[ "public", "static", "function", "getConstantValuesByPrefix", "(", "$", "className", ",", "$", "prefix", ")", "{", "$", "prefixLength", "=", "strlen", "(", "$", "prefix", ")", ";", "$", "result", "=", "[", "]", ";", "$", "reflection", "=", "new", "\\", ...
Get Contant Values By Prefix @param string $className @param string $prefix @return array
[ "Get", "Contant", "Values", "By", "Prefix" ]
2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129
https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Components/Helper/ObjectHelper.php#L27-L40
205,365
BenGorFile/FileBundle
src/BenGorFile/FileBundle/Form/Type/FileType.php
FileType.emptyData
public function emptyData(FormInterface $form) { $file = $form->get('bengor_file')->getData(); if (null === $file) { return; } return new UploadFileCommand( $file->getClientOriginalName(), file_get_contents($file->getPathname()), $file...
php
public function emptyData(FormInterface $form) { $file = $form->get('bengor_file')->getData(); if (null === $file) { return; } return new UploadFileCommand( $file->getClientOriginalName(), file_get_contents($file->getPathname()), $file...
[ "public", "function", "emptyData", "(", "FormInterface", "$", "form", ")", "{", "$", "file", "=", "$", "form", "->", "get", "(", "'bengor_file'", ")", "->", "getData", "(", ")", ";", "if", "(", "null", "===", "$", "file", ")", "{", "return", ";", "...
Method that encapsulates all the logic of build empty data. It returns an instance of data class object. @param FormInterface $form The form @return UploadFileCommand|null
[ "Method", "that", "encapsulates", "all", "the", "logic", "of", "build", "empty", "data", ".", "It", "returns", "an", "instance", "of", "data", "class", "object", "." ]
82c1fa952e7e7b7a188141a34053ab612b699a21
https://github.com/BenGorFile/FileBundle/blob/82c1fa952e7e7b7a188141a34053ab612b699a21/src/BenGorFile/FileBundle/Form/Type/FileType.php#L75-L87
205,366
issei-m/spike-php
src/Util/DateTimeUtil.php
DateTimeUtil.createDateTimeByUnixTime
public function createDateTimeByUnixTime($unixTime) { $dateTime = new \DateTime('@' . $unixTime); $dateTime->setTimezone($this->specifiedTimeZone); return $dateTime; }
php
public function createDateTimeByUnixTime($unixTime) { $dateTime = new \DateTime('@' . $unixTime); $dateTime->setTimezone($this->specifiedTimeZone); return $dateTime; }
[ "public", "function", "createDateTimeByUnixTime", "(", "$", "unixTime", ")", "{", "$", "dateTime", "=", "new", "\\", "DateTime", "(", "'@'", ".", "$", "unixTime", ")", ";", "$", "dateTime", "->", "setTimezone", "(", "$", "this", "->", "specifiedTimeZone", ...
Returns the created DateTime object specified the timezone. @param $unixTime @return \DateTime
[ "Returns", "the", "created", "DateTime", "object", "specified", "the", "timezone", "." ]
9205b5047a1132bcdca6731feac02fe3d5dc1023
https://github.com/issei-m/spike-php/blob/9205b5047a1132bcdca6731feac02fe3d5dc1023/src/Util/DateTimeUtil.php#L26-L32
205,367
interactivesolutions/honeycomb-scripts
src/app/commands/service/HCServiceController.php
HCServiceController.createMultiLanguageController
private function createMultiLanguageController(stdClass $data) { $this->createFileFromTemplate([ "destination" => $data->controllerDestination, "templateDestination" => __DIR__ . '/../templates/service/controller/multiLanguage.hctpl', "content" => [ ...
php
private function createMultiLanguageController(stdClass $data) { $this->createFileFromTemplate([ "destination" => $data->controllerDestination, "templateDestination" => __DIR__ . '/../templates/service/controller/multiLanguage.hctpl', "content" => [ ...
[ "private", "function", "createMultiLanguageController", "(", "stdClass", "$", "data", ")", "{", "$", "this", "->", "createFileFromTemplate", "(", "[", "\"destination\"", "=>", "$", "data", "->", "controllerDestination", ",", "\"templateDestination\"", "=>", "__DIR__",...
Creating multi language controller @param stdClass $data
[ "Creating", "multi", "language", "controller" ]
be2428ded5219dc612ecc51f43aa4dedff3d034d
https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/service/HCServiceController.php#L75-L105
205,368
interactivesolutions/honeycomb-scripts
src/app/commands/service/HCServiceController.php
HCServiceController.getAdminListHeader
private function getAdminListHeader(stdClass $data) { $output = ''; $model = $data->mainModel; //getting parameters which are not multilanguage $output .= $this->gatherHeaders($model, array_merge($this->getAutoFill(), ['id']), $data->translationsLocation, false); //getting ...
php
private function getAdminListHeader(stdClass $data) { $output = ''; $model = $data->mainModel; //getting parameters which are not multilanguage $output .= $this->gatherHeaders($model, array_merge($this->getAutoFill(), ['id']), $data->translationsLocation, false); //getting ...
[ "private", "function", "getAdminListHeader", "(", "stdClass", "$", "data", ")", "{", "$", "output", "=", "''", ";", "$", "model", "=", "$", "data", "->", "mainModel", ";", "//getting parameters which are not multilanguage", "$", "output", ".=", "$", "this", "-...
Get list header from model data @param $data @return string
[ "Get", "list", "header", "from", "model", "data" ]
be2428ded5219dc612ecc51f43aa4dedff3d034d
https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/service/HCServiceController.php#L147-L160
205,369
interactivesolutions/honeycomb-scripts
src/app/commands/service/HCServiceController.php
HCServiceController.getInputData
private function getInputData(stdClass $data) { $output = ''; $skip = array_merge($this->getAutoFill(), ['id']); if( ! empty($data->database) ) { if( isset($data->multiLanguage) ) $path = '/templates/service/controller/multilanguage/input.data.hctpl'; ...
php
private function getInputData(stdClass $data) { $output = ''; $skip = array_merge($this->getAutoFill(), ['id']); if( ! empty($data->database) ) { if( isset($data->multiLanguage) ) $path = '/templates/service/controller/multilanguage/input.data.hctpl'; ...
[ "private", "function", "getInputData", "(", "stdClass", "$", "data", ")", "{", "$", "output", "=", "''", ";", "$", "skip", "=", "array_merge", "(", "$", "this", "->", "getAutoFill", "(", ")", ",", "[", "'id'", "]", ")", ";", "if", "(", "!", "empty"...
Get input keys from model data @param $data @return string
[ "Get", "input", "keys", "from", "model", "data" ]
be2428ded5219dc612ecc51f43aa4dedff3d034d
https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/service/HCServiceController.php#L191-L217
205,370
interactivesolutions/honeycomb-scripts
src/app/commands/service/HCServiceController.php
HCServiceController.getUseFiles
private function getUseFiles(stdClass $data, bool $multiLanguage = false) { $output = ''; $list = []; $list[] = [ "nameSpace" => $data->modelNamespace, "name" => $data->mainModel->modelName, ]; if( $multiLanguage ) $list[] = [ ...
php
private function getUseFiles(stdClass $data, bool $multiLanguage = false) { $output = ''; $list = []; $list[] = [ "nameSpace" => $data->modelNamespace, "name" => $data->mainModel->modelName, ]; if( $multiLanguage ) $list[] = [ ...
[ "private", "function", "getUseFiles", "(", "stdClass", "$", "data", ",", "bool", "$", "multiLanguage", "=", "false", ")", "{", "$", "output", "=", "''", ";", "$", "list", "=", "[", "]", ";", "$", "list", "[", "]", "=", "[", "\"nameSpace\"", "=>", "...
get use files @param stdClass $data @param bool $multiLanguage @return string
[ "get", "use", "files" ]
be2428ded5219dc612ecc51f43aa4dedff3d034d
https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/service/HCServiceController.php#L226-L259
205,371
interactivesolutions/honeycomb-scripts
src/app/commands/service/HCServiceController.php
HCServiceController.getSearchableFields
private function getSearchableFields(stdClass $data, bool $multiLanguage = false) { $output = ''; $model = $data->mainModel; $whereTpl = file_get_contents(__DIR__ . '/../templates/shared/where.hctpl'); $orWhereTpl = file_get_contents(__DIR__ . '/../templates/shared/or.where.hctpl')...
php
private function getSearchableFields(stdClass $data, bool $multiLanguage = false) { $output = ''; $model = $data->mainModel; $whereTpl = file_get_contents(__DIR__ . '/../templates/shared/where.hctpl'); $orWhereTpl = file_get_contents(__DIR__ . '/../templates/shared/or.where.hctpl')...
[ "private", "function", "getSearchableFields", "(", "stdClass", "$", "data", ",", "bool", "$", "multiLanguage", "=", "false", ")", "{", "$", "output", "=", "''", ";", "$", "model", "=", "$", "data", "->", "mainModel", ";", "$", "whereTpl", "=", "file_get_...
Get searchable fields from model data @param stdClass $data @param bool $multiLanguage @return string
[ "Get", "searchable", "fields", "from", "model", "data" ]
be2428ded5219dc612ecc51f43aa4dedff3d034d
https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/service/HCServiceController.php#L268-L309
205,372
evispa/TranslationEditorBundle
Form/PropertyAccessor.php
PropertyAccessor.getPropertyPath
private function getPropertyPath($propertyPath) { if (!isset($this->propertyPaths[$propertyPath])) { $this->propertyPaths[$propertyPath] = new \Symfony\Component\Form\Util\PropertyPath($propertyPath); } return $this->propertyPaths[$propertyPath]; }
php
private function getPropertyPath($propertyPath) { if (!isset($this->propertyPaths[$propertyPath])) { $this->propertyPaths[$propertyPath] = new \Symfony\Component\Form\Util\PropertyPath($propertyPath); } return $this->propertyPaths[$propertyPath]; }
[ "private", "function", "getPropertyPath", "(", "$", "propertyPath", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "propertyPaths", "[", "$", "propertyPath", "]", ")", ")", "{", "$", "this", "->", "propertyPaths", "[", "$", "propertyPath", "]...
Get property path object. @param string $propertyPath Property path string. @return \Symfony\Component\Form\Util\PropertyPath
[ "Get", "property", "path", "object", "." ]
312040605c331fc2520f5d042bc00b05608554b5
https://github.com/evispa/TranslationEditorBundle/blob/312040605c331fc2520f5d042bc00b05608554b5/Form/PropertyAccessor.php#L32-L38
205,373
querformat/contao-layout-sections-extender
src/layout-sections-extender/dca/tl_article.php
tl_article_qf.addCustomLayoutSectionsHook
public function addCustomLayoutSectionsHook(DataContainer $dc) { $arrSections = $this->getActiveLayoutSections($dc); if (isset($GLOBALS['TL_HOOKS']['addLayoutSections']) && is_array($GLOBALS['TL_HOOKS']['addLayoutSections'])) { foreach ($GLOBALS['TL_HOOKS']['addLayoutSections'] as $arrCu...
php
public function addCustomLayoutSectionsHook(DataContainer $dc) { $arrSections = $this->getActiveLayoutSections($dc); if (isset($GLOBALS['TL_HOOKS']['addLayoutSections']) && is_array($GLOBALS['TL_HOOKS']['addLayoutSections'])) { foreach ($GLOBALS['TL_HOOKS']['addLayoutSections'] as $arrCu...
[ "public", "function", "addCustomLayoutSectionsHook", "(", "DataContainer", "$", "dc", ")", "{", "$", "arrSections", "=", "$", "this", "->", "getActiveLayoutSections", "(", "$", "dc", ")", ";", "if", "(", "isset", "(", "$", "GLOBALS", "[", "'TL_HOOKS'", "]", ...
Costum Column Hack @param DataContainer $dc @return array
[ "Costum", "Column", "Hack" ]
db75bf7d6e6e58342fdbb4d1e0ddc52b86fc7349
https://github.com/querformat/contao-layout-sections-extender/blob/db75bf7d6e6e58342fdbb4d1e0ddc52b86fc7349/src/layout-sections-extender/dca/tl_article.php#L25-L40
205,374
ideil/laravel-generic-file
src/GenericFile.php
GenericFile.saveModelData
protected function saveModelData(Model $model, \Ideil\GenericFile\Interpolator\InterpolatorResult $input) { // prepare data to fill model $model_map = $model->getFileAssignMap(); $model_fields = []; foreach ($input->getData() as $field => $value) { $model_fields[isset($...
php
protected function saveModelData(Model $model, \Ideil\GenericFile\Interpolator\InterpolatorResult $input) { // prepare data to fill model $model_map = $model->getFileAssignMap(); $model_fields = []; foreach ($input->getData() as $field => $value) { $model_fields[isset($...
[ "protected", "function", "saveModelData", "(", "Model", "$", "model", ",", "\\", "Ideil", "\\", "GenericFile", "\\", "Interpolator", "\\", "InterpolatorResult", "$", "input", ")", "{", "// prepare data to fill model", "$", "model_map", "=", "$", "model", "->", "...
Save file attributes required for interpolation to model. @param string|Illuminate\Database\Eloquent\Model $model @param Ideil\LaravelFileOre\Interpolator\InterpolatorResult $input @return Illuminate\Database\Eloquent\Model
[ "Save", "file", "attributes", "required", "for", "interpolation", "to", "model", "." ]
3eaeadf06dfb295c391dd7a88c371797c2b70ee3
https://github.com/ideil/laravel-generic-file/blob/3eaeadf06dfb295c391dd7a88c371797c2b70ee3/src/GenericFile.php#L19-L35
205,375
ideil/laravel-generic-file
src/GenericFile.php
GenericFile.moveUploadedFile
public function moveUploadedFile(File $file, $path_pattern = null, $existing_model = null) { // get model instance if available // not use models if $existing_model === false $model_class = $this->getConfig('store.model'); if (($model_class || $existing_model) && $existing_model !=...
php
public function moveUploadedFile(File $file, $path_pattern = null, $existing_model = null) { // get model instance if available // not use models if $existing_model === false $model_class = $this->getConfig('store.model'); if (($model_class || $existing_model) && $existing_model !=...
[ "public", "function", "moveUploadedFile", "(", "File", "$", "file", ",", "$", "path_pattern", "=", "null", ",", "$", "existing_model", "=", "null", ")", "{", "// get model instance if available", "// not use models if $existing_model === false", "$", "model_class", "=",...
Move uploaded file to path by pattern and update model. @param File $file @param string|null $path_pattern @param Illuminate\Database\Eloquent\Model|null|false $existing_model @return Illuminate\Database\Eloquent\Model|string|null
[ "Move", "uploaded", "file", "to", "path", "by", "pattern", "and", "update", "model", "." ]
3eaeadf06dfb295c391dd7a88c371797c2b70ee3
https://github.com/ideil/laravel-generic-file/blob/3eaeadf06dfb295c391dd7a88c371797c2b70ee3/src/GenericFile.php#L46-L73
205,376
ideil/laravel-generic-file
src/GenericFile.php
GenericFile.makeUrlToUploadedFile
public function makeUrlToUploadedFile($model, $path_pattern = null, array $model_map = array(), $domain = null) { return parent::makeUrlToUploadedFile($model, $path_pattern, $model instanceof Model ? $model->getFileAssignMap() : $model_map, $domain); }
php
public function makeUrlToUploadedFile($model, $path_pattern = null, array $model_map = array(), $domain = null) { return parent::makeUrlToUploadedFile($model, $path_pattern, $model instanceof Model ? $model->getFileAssignMap() : $model_map, $domain); }
[ "public", "function", "makeUrlToUploadedFile", "(", "$", "model", ",", "$", "path_pattern", "=", "null", ",", "array", "$", "model_map", "=", "array", "(", ")", ",", "$", "domain", "=", "null", ")", "{", "return", "parent", "::", "makeUrlToUploadedFile", "...
Make url to stored file. @param array|Illuminate\Database\Eloquent\Model $model @param string|null $path_pattern @return string
[ "Make", "url", "to", "stored", "file", "." ]
3eaeadf06dfb295c391dd7a88c371797c2b70ee3
https://github.com/ideil/laravel-generic-file/blob/3eaeadf06dfb295c391dd7a88c371797c2b70ee3/src/GenericFile.php#L99-L103
205,377
ideil/laravel-generic-file
src/GenericFile.php
GenericFile.makePathToUploadedFile
public function makePathToUploadedFile($model, $path_pattern = null, array $model_map = array()) { return parent::makePathToUploadedFile($model, $path_pattern, $model instanceof Model ? $model->getFileAssignMap() : $model_map); }
php
public function makePathToUploadedFile($model, $path_pattern = null, array $model_map = array()) { return parent::makePathToUploadedFile($model, $path_pattern, $model instanceof Model ? $model->getFileAssignMap() : $model_map); }
[ "public", "function", "makePathToUploadedFile", "(", "$", "model", ",", "$", "path_pattern", "=", "null", ",", "array", "$", "model_map", "=", "array", "(", ")", ")", "{", "return", "parent", "::", "makePathToUploadedFile", "(", "$", "model", ",", "$", "pa...
Full path to stored file. @param array|Illuminate\Database\Eloquent\Model $model @param string|null $path_pattern @return string
[ "Full", "path", "to", "stored", "file", "." ]
3eaeadf06dfb295c391dd7a88c371797c2b70ee3
https://github.com/ideil/laravel-generic-file/blob/3eaeadf06dfb295c391dd7a88c371797c2b70ee3/src/GenericFile.php#L113-L117
205,378
agilesdesign/flasher
src/Flasher/Support/Notifier.php
Notifier.flash
protected function flash(string $type, string $message, string $level) { $group = Session::get($type, new MessageBag()); Session::flash($type, $group->add($level, $message)); return $this; }
php
protected function flash(string $type, string $message, string $level) { $group = Session::get($type, new MessageBag()); Session::flash($type, $group->add($level, $message)); return $this; }
[ "protected", "function", "flash", "(", "string", "$", "type", ",", "string", "$", "message", ",", "string", "$", "level", ")", "{", "$", "group", "=", "Session", "::", "get", "(", "$", "type", ",", "new", "MessageBag", "(", ")", ")", ";", "Session", ...
Flash message to the Session. @param string $type @param string $message @param string $level @return $this
[ "Flash", "message", "to", "the", "Session", "." ]
5bf8c04d0a2df55177d3f81983982d5999b9f5b8
https://github.com/agilesdesign/flasher/blob/5bf8c04d0a2df55177d3f81983982d5999b9f5b8/src/Flasher/Support/Notifier.php#L49-L56
205,379
luxorphp/http-controller
src/Event/Executor.php
Executor.exist
public function exist() { $this->resCallback = $this->callback->filter(function (HttpCallBack $call) { return $this->rutesManager->existRutes($call->getPath(), $this->peticion); }); }
php
public function exist() { $this->resCallback = $this->callback->filter(function (HttpCallBack $call) { return $this->rutesManager->existRutes($call->getPath(), $this->peticion); }); }
[ "public", "function", "exist", "(", ")", "{", "$", "this", "->", "resCallback", "=", "$", "this", "->", "callback", "->", "filter", "(", "function", "(", "HttpCallBack", "$", "call", ")", "{", "return", "$", "this", "->", "rutesManager", "->", "existRute...
Filtrar si existe algun controlador que pueda ser ejecutado sin importar si es el solicitado, esto se verifica con la longitud de la rutas almacenada, si coinciden con la ruta de la peticion.
[ "Filtrar", "si", "existe", "algun", "controlador", "que", "pueda", "ser", "ejecutado", "sin", "importar", "si", "es", "el", "solicitado", "esto", "se", "verifica", "con", "la", "longitud", "de", "la", "rutas", "almacenada", "si", "coinciden", "con", "la", "r...
4cc60fdf2c16b2701cafcce2ba32cb672794c7e1
https://github.com/luxorphp/http-controller/blob/4cc60fdf2c16b2701cafcce2ba32cb672794c7e1/src/Event/Executor.php#L111-L119
205,380
luxorphp/http-controller
src/Event/Executor.php
Executor.compare
public function compare() { // echo '<br>'; // echo 'Se han encontrado '.$this->resCallback->lenght().' resultados del primer filtro <br>'; $this->resFilter = $this->resCallback->filter(function (HttpCallBack $call) { return $this->r...
php
public function compare() { // echo '<br>'; // echo 'Se han encontrado '.$this->resCallback->lenght().' resultados del primer filtro <br>'; $this->resFilter = $this->resCallback->filter(function (HttpCallBack $call) { return $this->r...
[ "public", "function", "compare", "(", ")", "{", "// echo '<br>';", "// echo 'Se han encontrado '.$this->resCallback->lenght().' resultados del primer filtro <br>';", "$", "this", "->", "resFilter", "=", "$", "this", "->", "resCallback", "->", "filter", "(", "fun...
Filtrar si existe alguna ruta que sea identica a la ruta de la peticion esto se realiza a travez de la verificacion de patrones en las rutas. @return null
[ "Filtrar", "si", "existe", "alguna", "ruta", "que", "sea", "identica", "a", "la", "ruta", "de", "la", "peticion", "esto", "se", "realiza", "a", "travez", "de", "la", "verificacion", "de", "patrones", "en", "las", "rutas", "." ]
4cc60fdf2c16b2701cafcce2ba32cb672794c7e1
https://github.com/luxorphp/http-controller/blob/4cc60fdf2c16b2701cafcce2ba32cb672794c7e1/src/Event/Executor.php#L127-L138
205,381
luxorphp/http-controller
src/Event/Executor.php
Executor.execute
public function execute() { // echo '<br>'; // echo 'Se han encontrado '.$this->resFilter->lenght().' resultados del segundo filtro <br>'; //Ejecutar controlador raiz por defecto, si no hay ningun resultado posible. if ($this->resFilter->isEmpty() && $this->rutesManager->...
php
public function execute() { // echo '<br>'; // echo 'Se han encontrado '.$this->resFilter->lenght().' resultados del segundo filtro <br>'; //Ejecutar controlador raiz por defecto, si no hay ningun resultado posible. if ($this->resFilter->isEmpty() && $this->rutesManager->...
[ "public", "function", "execute", "(", ")", "{", "// echo '<br>';", "// echo 'Se han encontrado '.$this->resFilter->lenght().' resultados del segundo filtro <br>';", "//Ejecutar controlador raiz por defecto, si no hay ningun resultado posible.", "if", "(", "$", "this", "->", ...
Ejecutar la ruta encontrada, en caso de no encontrar nada ejecutar una por defecto @return null
[ "Ejecutar", "la", "ruta", "encontrada", "en", "caso", "de", "no", "encontrar", "nada", "ejecutar", "una", "por", "defecto" ]
4cc60fdf2c16b2701cafcce2ba32cb672794c7e1
https://github.com/luxorphp/http-controller/blob/4cc60fdf2c16b2701cafcce2ba32cb672794c7e1/src/Event/Executor.php#L145-L169
205,382
luxorphp/http-controller
src/Event/Executor.php
Executor.default
private function default() { $this->callback->filter(function (HttpCallBack $test) { return !strcmp($test->getPath(), $this->actual.'/**'); })->each(function (HttpCallBack $test) { $test->call($this->rutesManager->getParameter()); }); }
php
private function default() { $this->callback->filter(function (HttpCallBack $test) { return !strcmp($test->getPath(), $this->actual.'/**'); })->each(function (HttpCallBack $test) { $test->call($this->rutesManager->getParameter()); }); }
[ "private", "function", "default", "(", ")", "{", "$", "this", "->", "callback", "->", "filter", "(", "function", "(", "HttpCallBack", "$", "test", ")", "{", "return", "!", "strcmp", "(", "$", "test", "->", "getPath", "(", ")", ",", "$", "this", "->",...
Metodo quen ejecuta el controlador por defecto cuando no existe una ruta posible a ejecutar.
[ "Metodo", "quen", "ejecuta", "el", "controlador", "por", "defecto", "cuando", "no", "existe", "una", "ruta", "posible", "a", "ejecutar", "." ]
4cc60fdf2c16b2701cafcce2ba32cb672794c7e1
https://github.com/luxorphp/http-controller/blob/4cc60fdf2c16b2701cafcce2ba32cb672794c7e1/src/Event/Executor.php#L175-L187
205,383
x2ts/x2ts
src/validator/Validator.php
Validator.selfValidate
protected function selfValidate() { if ($this->_isUndefined && $this->onUndefinedIgnore) { $this->_safeVar = null; $this->_isValid = true; goto finish; } if ($this->isEmpty($this->_unsafeVar)) { if ($this->onEmptyIgnore) { $this->_s...
php
protected function selfValidate() { if ($this->_isUndefined && $this->onUndefinedIgnore) { $this->_safeVar = null; $this->_isValid = true; goto finish; } if ($this->isEmpty($this->_unsafeVar)) { if ($this->onEmptyIgnore) { $this->_s...
[ "protected", "function", "selfValidate", "(", ")", "{", "if", "(", "$", "this", "->", "_isUndefined", "&&", "$", "this", "->", "onUndefinedIgnore", ")", "{", "$", "this", "->", "_safeVar", "=", "null", ";", "$", "this", "->", "_isValid", "=", "true", "...
Start validate the valley itself @return void
[ "Start", "validate", "the", "valley", "itself" ]
65e43952ab940ab05696a34d31a1c3ab91545090
https://github.com/x2ts/x2ts/blob/65e43952ab940ab05696a34d31a1c3ab91545090/src/validator/Validator.php#L382-L420
205,384
x2ts/x2ts
src/validator/Validator.php
Validator.validate
final public function validate(callable $onDataInvalid = null): Validator { $shell = $this->shell; if (count($shell->subValidators)) { $shell->_safeVar = []; /** * @var Validator $validator * @var string $key */ foreach ($shel...
php
final public function validate(callable $onDataInvalid = null): Validator { $shell = $this->shell; if (count($shell->subValidators)) { $shell->_safeVar = []; /** * @var Validator $validator * @var string $key */ foreach ($shel...
[ "final", "public", "function", "validate", "(", "callable", "$", "onDataInvalid", "=", "null", ")", ":", "Validator", "{", "$", "shell", "=", "$", "this", "->", "shell", ";", "if", "(", "count", "(", "$", "shell", "->", "subValidators", ")", ")", "{", ...
Start validate the whole chain include the sub valleys @param callable $onDataInvalid @return Validator @throws \x2ts\validator\ValidatorException
[ "Start", "validate", "the", "whole", "chain", "include", "the", "sub", "valleys" ]
65e43952ab940ab05696a34d31a1c3ab91545090
https://github.com/x2ts/x2ts/blob/65e43952ab940ab05696a34d31a1c3ab91545090/src/validator/Validator.php#L431-L473
205,385
as3io/modlr
src/Metadata/MetadataFactory.php
MetadataFactory.dispatchMetadataEvent
private function dispatchMetadataEvent($eventName, EntityMetadata $metadata) { $metadataArgs = new Events\MetadataArguments($metadata); $this->dispatcher->dispatch($eventName, $metadataArgs); }
php
private function dispatchMetadataEvent($eventName, EntityMetadata $metadata) { $metadataArgs = new Events\MetadataArguments($metadata); $this->dispatcher->dispatch($eventName, $metadataArgs); }
[ "private", "function", "dispatchMetadataEvent", "(", "$", "eventName", ",", "EntityMetadata", "$", "metadata", ")", "{", "$", "metadataArgs", "=", "new", "Events", "\\", "MetadataArguments", "(", "$", "metadata", ")", ";", "$", "this", "->", "dispatcher", "->"...
Dispatches a Metadata event @param string $eventName @param EntityMetadata $metadata
[ "Dispatches", "a", "Metadata", "event" ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Metadata/MetadataFactory.php#L176-L180
205,386
as3io/modlr
src/Metadata/MetadataFactory.php
MetadataFactory.loadPersistenceMetadata
private function loadPersistenceMetadata(EntityMetadata $metadata) { $persisterKey = $metadata->persistence->getKey(); $persistenceFactory = $this->driver->getPersistenceMetadataFactory($persisterKey); $persistenceFactory->handleLoad($metadata); $persistenceFactory->handleValidate($...
php
private function loadPersistenceMetadata(EntityMetadata $metadata) { $persisterKey = $metadata->persistence->getKey(); $persistenceFactory = $this->driver->getPersistenceMetadataFactory($persisterKey); $persistenceFactory->handleLoad($metadata); $persistenceFactory->handleValidate($...
[ "private", "function", "loadPersistenceMetadata", "(", "EntityMetadata", "$", "metadata", ")", "{", "$", "persisterKey", "=", "$", "metadata", "->", "persistence", "->", "getKey", "(", ")", ";", "$", "persistenceFactory", "=", "$", "this", "->", "driver", "->"...
Handles persistence specific metadata loading. @param EntityMetadata $metadata @return EntityMetadata
[ "Handles", "persistence", "specific", "metadata", "loading", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Metadata/MetadataFactory.php#L288-L296
205,387
as3io/modlr
src/Metadata/MetadataFactory.php
MetadataFactory.loadSearchMetadata
private function loadSearchMetadata(EntityMetadata $metadata) { if (false === $metadata->isSearchEnabled()) { return $metadata; } $clientKey = $metadata->search->getKey(); $searchFactory = $this->driver->getSearchMetadataFactory($clientKey); $searchFactory->handl...
php
private function loadSearchMetadata(EntityMetadata $metadata) { if (false === $metadata->isSearchEnabled()) { return $metadata; } $clientKey = $metadata->search->getKey(); $searchFactory = $this->driver->getSearchMetadataFactory($clientKey); $searchFactory->handl...
[ "private", "function", "loadSearchMetadata", "(", "EntityMetadata", "$", "metadata", ")", "{", "if", "(", "false", "===", "$", "metadata", "->", "isSearchEnabled", "(", ")", ")", "{", "return", "$", "metadata", ";", "}", "$", "clientKey", "=", "$", "metada...
Handles search specific metadata loading. @param EntityMetadata $metadata @return EntityMetadata
[ "Handles", "search", "specific", "metadata", "loading", "." ]
7e684b88bb22a2e18397df9402075c6533084b16
https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Metadata/MetadataFactory.php#L304-L315
205,388
malenkiki/bah
src/Malenki/Bah/N.php
N.less
public function less($num) { self::mustBeNumeric($num, 'Tested number'); if(is_object($num)){ return $this->value < $num->value; } else { return $this->value < $num; } }
php
public function less($num) { self::mustBeNumeric($num, 'Tested number'); if(is_object($num)){ return $this->value < $num->value; } else { return $this->value < $num; } }
[ "public", "function", "less", "(", "$", "num", ")", "{", "self", "::", "mustBeNumeric", "(", "$", "num", ",", "'Tested number'", ")", ";", "if", "(", "is_object", "(", "$", "num", ")", ")", "{", "return", "$", "this", "->", "value", "<", "$", "num"...
Checks whether current number is less than given one. This is equivalent of `$n < 3`. So, for example: $n = new N(M_PI); $n->less(4); // true $n->less(3); // false @see N::lt() An alias @param mixed $num N or primitive numeric value @return boolean @throws \InvalidArgumentException If argument is not numeric-like
[ "Checks", "whether", "current", "number", "is", "less", "than", "given", "one", "." ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L547-L556
205,389
malenkiki/bah
src/Malenki/Bah/N.php
N.lte
public function lte($num) { self::mustBeNumeric($num, 'Tested number'); if(is_object($num)){ return $this->value <= $num->value; } else { return $this->value <= $num; } }
php
public function lte($num) { self::mustBeNumeric($num, 'Tested number'); if(is_object($num)){ return $this->value <= $num->value; } else { return $this->value <= $num; } }
[ "public", "function", "lte", "(", "$", "num", ")", "{", "self", "::", "mustBeNumeric", "(", "$", "num", ",", "'Tested number'", ")", ";", "if", "(", "is_object", "(", "$", "num", ")", ")", "{", "return", "$", "this", "->", "value", "<=", "$", "num"...
Tests whether current number is less than or equal to given one. This is equivalent of `$n <= 3`. For example; $n = new N(3); $n->lte(3); // true $n->lte(4); // true $n->lte(1); // false @see N::le() An alias @param mixed $num N or numeric value @return boolean @throws \InvalidArgumentException If argument is not...
[ "Tests", "whether", "current", "number", "is", "less", "than", "or", "equal", "to", "given", "one", "." ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L586-L595
205,390
malenkiki/bah
src/Malenki/Bah/N.php
N.greater
public function greater($num) { self::mustBeNumeric($num, 'Tested number'); if(is_object($num)){ return $this->value > $num->value; } else { return $this->value > $num; } }
php
public function greater($num) { self::mustBeNumeric($num, 'Tested number'); if(is_object($num)){ return $this->value > $num->value; } else { return $this->value > $num; } }
[ "public", "function", "greater", "(", "$", "num", ")", "{", "self", "::", "mustBeNumeric", "(", "$", "num", ",", "'Tested number'", ")", ";", "if", "(", "is_object", "(", "$", "num", ")", ")", "{", "return", "$", "this", "->", "value", ">", "$", "n...
Tests whether current number is greater than given one. This is equivalent of `$n > 3`. For example: $n = new N(M_PI); $n->greater(2); // true $n->greater(4); // false @see N::gt() An alias @param mixed $num N or numeric value. @return boolean @throws \InvalidArgumentException If argument is not numeric-like valu...
[ "Tests", "whether", "current", "number", "is", "greater", "than", "given", "one", "." ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L625-L634
205,391
malenkiki/bah
src/Malenki/Bah/N.php
N.gte
public function gte($num) { self::mustBeNumeric($num, 'Tested number'); if(is_object($num)){ return $this->value >= $num->value; } else { return $this->value >= $num; } }
php
public function gte($num) { self::mustBeNumeric($num, 'Tested number'); if(is_object($num)){ return $this->value >= $num->value; } else { return $this->value >= $num; } }
[ "public", "function", "gte", "(", "$", "num", ")", "{", "self", "::", "mustBeNumeric", "(", "$", "num", ",", "'Tested number'", ")", ";", "if", "(", "is_object", "(", "$", "num", ")", ")", "{", "return", "$", "this", "->", "value", ">=", "$", "num"...
Tests whether current number is greater than or equal to the given number. This is equivalent of `$n >= 3`. For example: $n = new N(3); $n->gte(3); // true $n->gte(1); // true $n->gte(5); // false @throw \InvalidArgumentException If argument is not numeric or N class @param mixed $num N or numeric value @return b...
[ "Tests", "whether", "current", "number", "is", "greater", "than", "or", "equal", "to", "the", "given", "number", "." ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L663-L672
205,392
malenkiki/bah
src/Malenki/Bah/N.php
N.mod
public function mod($mod) { self::mustBeNumeric($mod, 'Divisor'); if ($mod instanceof N) { $mod = $mod->double; } if ($mod == 0) { throw new \InvalidArgumentException('Cannot divide by 0!'); } return new N(fmod($this->value, $mod)); }
php
public function mod($mod) { self::mustBeNumeric($mod, 'Divisor'); if ($mod instanceof N) { $mod = $mod->double; } if ($mod == 0) { throw new \InvalidArgumentException('Cannot divide by 0!'); } return new N(fmod($this->value, $mod)); }
[ "public", "function", "mod", "(", "$", "mod", ")", "{", "self", "::", "mustBeNumeric", "(", "$", "mod", ",", "'Divisor'", ")", ";", "if", "(", "$", "mod", "instanceof", "N", ")", "{", "$", "mod", "=", "$", "mod", "->", "double", ";", "}", "if", ...
Computes modulo of current number Computes modulo of current number using given number as divisor. Unlike `mod()` function, this can use integer or float value, into primitive PHP type or into `\Malenki\Bah\N` object. Example: $n = new N(2001); echo $n->mod(5); // '1'; echo $n->mod(3); // '0' @see N::modulo() Alias...
[ "Computes", "modulo", "of", "current", "number" ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L859-L872
205,393
malenkiki/bah
src/Malenki/Bah/N.php
N._prime
protected function _prime() { if ($this->value < 2) { return false; } if (!$this->_decimal()->zero) { throw new \RuntimeException( 'You cannot test if number is prime numer if it is not an integer' ); } $max = floor(sqrt($...
php
protected function _prime() { if ($this->value < 2) { return false; } if (!$this->_decimal()->zero) { throw new \RuntimeException( 'You cannot test if number is prime numer if it is not an integer' ); } $max = floor(sqrt($...
[ "protected", "function", "_prime", "(", ")", "{", "if", "(", "$", "this", "->", "value", "<", "2", ")", "{", "return", "false", ";", "}", "if", "(", "!", "$", "this", "->", "_decimal", "(", ")", "->", "zero", ")", "{", "throw", "new", "\\", "Ru...
Checks if current number is prime number Checks whether current number is prime number. Prime number can only by divided by itself and by one. Example: $n = new N(5); var_dump($n->prime); // true $n = new N(6); var_dump($n->prime); // false @see N::$prime Magic getter way @return boolean @throws \RuntimeException I...
[ "Checks", "if", "current", "number", "is", "prime", "number" ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L908-L929
205,394
malenkiki/bah
src/Malenki/Bah/N.php
N._divisors
protected function _divisors() { if (!$this->_decimal()->zero) { throw new \RuntimeException('You can only get divisors from integers!'); } $n = abs($this->value); $a = new A(); for ($i = 1; $i <= $n; $i++) { if ($n % $i == 0) { $a->a...
php
protected function _divisors() { if (!$this->_decimal()->zero) { throw new \RuntimeException('You can only get divisors from integers!'); } $n = abs($this->value); $a = new A(); for ($i = 1; $i <= $n; $i++) { if ($n % $i == 0) { $a->a...
[ "protected", "function", "_divisors", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_decimal", "(", ")", "->", "zero", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'You can only get divisors from integers!'", ")", ";", "}", "$", "n", "=",...
Gets divisors for the current integer numbers. If current number is negative, divisors will be based on its positive version. @throws \RuntimeException If current number is not an integer @return A Instance of A class
[ "Gets", "divisors", "for", "the", "current", "integer", "numbers", "." ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L940-L956
205,395
malenkiki/bah
src/Malenki/Bah/N.php
N.pow
public function pow($num) { self::mustBeNumeric($num, 'Power calculus'); return new N( pow( $this->value, is_object($num) ? $num->value : $num ) ); }
php
public function pow($num) { self::mustBeNumeric($num, 'Power calculus'); return new N( pow( $this->value, is_object($num) ? $num->value : $num ) ); }
[ "public", "function", "pow", "(", "$", "num", ")", "{", "self", "::", "mustBeNumeric", "(", "$", "num", ",", "'Power calculus'", ")", ";", "return", "new", "N", "(", "pow", "(", "$", "this", "->", "value", ",", "is_object", "(", "$", "num", ")", "?...
Computes current number at given power. Takes current number to raise it at given power. Example: $n = new N(3); echo $n->pow(2); // '9' echo $n->pow(3); // '27' @see N::power() Alias @see N::_square() Alias for sqaure @see N::_cube() Alias for cube @param numeric|N $num Power @return N @throws \InvalidArgumentExce...
[ "Computes", "current", "number", "at", "given", "power", "." ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L977-L987
205,396
malenkiki/bah
src/Malenki/Bah/N.php
N.root
public function root($num) { self::mustBeNumeric($num, 'Root'); $n = is_object($num) ? $num->value : $num; if ($n == 0) { throw new \InvalidArgumentException('Root must be not nul'); } return new N(pow($this->value, 1 / $n)); }
php
public function root($num) { self::mustBeNumeric($num, 'Root'); $n = is_object($num) ? $num->value : $num; if ($n == 0) { throw new \InvalidArgumentException('Root must be not nul'); } return new N(pow($this->value, 1 / $n)); }
[ "public", "function", "root", "(", "$", "num", ")", "{", "self", "::", "mustBeNumeric", "(", "$", "num", ",", "'Root'", ")", ";", "$", "n", "=", "is_object", "(", "$", "num", ")", "?", "$", "num", "->", "value", ":", "$", "num", ";", "if", "(",...
Gets nth root of current number. Gets Nth root of given number. Example: $n = new N(8); echo $n->root(3); // '2' echo $n->root(1); // '8' @see N::_sqrt() A shorthand for magic getter to get square roots. @see N::_cubeRoot() A shorthand for magic getter to get cube roots. @param numeric|N $num Root @return N @throws...
[ "Gets", "nth", "root", "of", "current", "number", "." ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L1082-L1093
205,397
malenkiki/bah
src/Malenki/Bah/N.php
N._factorial
protected function _factorial() { if ($this->value == 0) { return new N(1); } if ($this->value < 0) { throw new \RuntimeException( 'Cannot get factorial of negative number!' ); } if (!$this->_decimal()->zero) { ...
php
protected function _factorial() { if ($this->value == 0) { return new N(1); } if ($this->value < 0) { throw new \RuntimeException( 'Cannot get factorial of negative number!' ); } if (!$this->_decimal()->zero) { ...
[ "protected", "function", "_factorial", "(", ")", "{", "if", "(", "$", "this", "->", "value", "==", "0", ")", "{", "return", "new", "N", "(", "1", ")", ";", "}", "if", "(", "$", "this", "->", "value", "<", "0", ")", "{", "throw", "new", "\\", ...
Computes the factorial of current number. Computes the factorial of current number, the product form 1 to current integer number. $n = new N(1); echo $n->factorial; // 1 echo $n->incr->factorial; // 2 echo $n->incr->factorial; // 6 echo $n->incr->factorial; // 24 echo $n->incr->factorial; // 120 echo $n->incr->factor...
[ "Computes", "the", "factorial", "of", "current", "number", "." ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L1176-L1195
205,398
malenkiki/bah
src/Malenki/Bah/N.php
N.equal
public function equal($num) { self::mustBeNumeric($num, 'Test of equality'); if(is_object($num)){ return $this->value == $num->value; } else { return $this->value == $num; } }
php
public function equal($num) { self::mustBeNumeric($num, 'Test of equality'); if(is_object($num)){ return $this->value == $num->value; } else { return $this->value == $num; } }
[ "public", "function", "equal", "(", "$", "num", ")", "{", "self", "::", "mustBeNumeric", "(", "$", "num", ",", "'Test of equality'", ")", ";", "if", "(", "is_object", "(", "$", "num", ")", ")", "{", "return", "$", "this", "->", "value", "==", "$", ...
Checks if current number is equal to given argument. This tests current number with given argument, an object or primitive numeric value. Example: $n = new N(5); var_dump($n->eq(5)); // true var_dump($n->eq(5.0)); // true var_dump($n->eq(new N(5))); // true var_dump($n->eq(new N(5.0))); // true @see N::notEqual() T...
[ "Checks", "if", "current", "number", "is", "equal", "to", "given", "argument", "." ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L1299-L1308
205,399
malenkiki/bah
src/Malenki/Bah/N.php
N._decimal
protected function _decimal() { $sign = 1; if ($this->value < 0) { $sign = -1; } return new N($sign * (abs($this->value) - floor(abs($this->value)))); }
php
protected function _decimal() { $sign = 1; if ($this->value < 0) { $sign = -1; } return new N($sign * (abs($this->value) - floor(abs($this->value)))); }
[ "protected", "function", "_decimal", "(", ")", "{", "$", "sign", "=", "1", ";", "if", "(", "$", "this", "->", "value", "<", "0", ")", "{", "$", "sign", "=", "-", "1", ";", "}", "return", "new", "N", "(", "$", "sign", "*", "(", "abs", "(", "...
Gets decimal part. Gets decimal part of current number . Example: $n = new N(3.14); echo $n->decimal; // '0.14' @see N::$decimal The magic getter version `N::$decimal` @return N
[ "Gets", "decimal", "part", "." ]
23495014acec63c2790e8021c75bc97d7e04a9c7
https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L1433-L1442