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
241,000
mvccore/ext-view-helper-internationalized
src/MvcCore/Ext/Views/Helpers/InternationalizedHelper.php
InternationalizedHelper.&
public function & SetView (\MvcCore\IView & $view) { parent::SetView($view); return $this->SetLangAndLocale($this->request->GetLang(), $this->request->GetLocale()); }
php
public function & SetView (\MvcCore\IView & $view) { parent::SetView($view); return $this->SetLangAndLocale($this->request->GetLang(), $this->request->GetLocale()); }
[ "public", "function", "&", "SetView", "(", "\\", "MvcCore", "\\", "IView", "&", "$", "view", ")", "{", "parent", "::", "SetView", "(", "$", "view", ")", ";", "return", "$", "this", "->", "SetLangAndLocale", "(", "$", "this", "->", "request", "->", "G...
Set up view properties and language and locale by request object in every view rendering change. @param \MvcCore\View|\MvcCore\IView $view @return \MvcCore\Ext\Views\Helpers\InternationalizedHelper
[ "Set", "up", "view", "properties", "and", "language", "and", "locale", "by", "request", "object", "in", "every", "view", "rendering", "change", "." ]
f7013decea5c1343a66adf45f664e275772ac703
https://github.com/mvccore/ext-view-helper-internationalized/blob/f7013decea5c1343a66adf45f664e275772ac703/src/MvcCore/Ext/Views/Helpers/InternationalizedHelper.php#L182-L185
241,001
marando/phpSOFA
src/Marando/IAU/iauAtciq.php
iauAtciq.Atciq
public static function Atciq($rc, $dc, $pr, $pd, $px, $rv, iauASTROM $astrom, &$ri, &$di) { $pco = []; $pnat = []; $ppr = []; $pi = []; $w; /* Proper motion and parallax, giving BCRS coordinate direction. */ IAU::Pmpx($rc, $dc, $pr, $pd, $px, $rv, $astrom->pmt, $astrom->eb, $...
php
public static function Atciq($rc, $dc, $pr, $pd, $px, $rv, iauASTROM $astrom, &$ri, &$di) { $pco = []; $pnat = []; $ppr = []; $pi = []; $w; /* Proper motion and parallax, giving BCRS coordinate direction. */ IAU::Pmpx($rc, $dc, $pr, $pd, $px, $rv, $astrom->pmt, $astrom->eb, $...
[ "public", "static", "function", "Atciq", "(", "$", "rc", ",", "$", "dc", ",", "$", "pr", ",", "$", "pd", ",", "$", "px", ",", "$", "rv", ",", "iauASTROM", "$", "astrom", ",", "&", "$", "ri", ",", "&", "$", "di", ")", "{", "$", "pco", "=", ...
- - - - - - - - - i a u A t c i q - - - - - - - - - Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed star-independent astrometry parameters. Use of this function is appropriate when efficiency is important and where many star positions are to be transformed for one date. The star-independent para...
[ "-", "-", "-", "-", "-", "-", "-", "-", "-", "i", "a", "u", "A", "t", "c", "i", "q", "-", "-", "-", "-", "-", "-", "-", "-", "-" ]
757fa49fe335ae1210eaa7735473fd4388b13f07
https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauAtciq.php#L79-L105
241,002
jaimeeee/laravelpanel
src/LaravelPanel/models/HTML.php
HTML.tag
public static function tag($tag, $attr = [], $html = '') { // Build attributes $attributes = []; foreach ($attr as $name => $value) { $attributes[] = $name.'="'.$value.'"'; } if (in_array($tag, self::$voidElements)) { return '<'.$tag.(!empty($attribut...
php
public static function tag($tag, $attr = [], $html = '') { // Build attributes $attributes = []; foreach ($attr as $name => $value) { $attributes[] = $name.'="'.$value.'"'; } if (in_array($tag, self::$voidElements)) { return '<'.$tag.(!empty($attribut...
[ "public", "static", "function", "tag", "(", "$", "tag", ",", "$", "attr", "=", "[", "]", ",", "$", "html", "=", "''", ")", "{", "// Build attributes", "$", "attributes", "=", "[", "]", ";", "foreach", "(", "$", "attr", "as", "$", "name", "=>", "$...
Generate the HTML code for an element. @param string $tag <tag> @param array $attr The tag attributes @param string $html The tag HTML content @return string HTML code of the tag
[ "Generate", "the", "HTML", "code", "for", "an", "element", "." ]
211599ba0be7dc5ea11af292a75d4104c41512ca
https://github.com/jaimeeee/laravelpanel/blob/211599ba0be7dc5ea11af292a75d4104c41512ca/src/LaravelPanel/models/HTML.php#L21-L34
241,003
jfortunato/fortune
src/Security/Bouncer/ParentBouncer.php
ParentBouncer.routeContainsParent
protected function routeContainsParent() { // get just the base url $route = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); // lets split it into pieces $parts = explode('/', $route); // if a resource has a parent, it should be in the form /dogs/1/puppies // so t...
php
protected function routeContainsParent() { // get just the base url $route = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); // lets split it into pieces $parts = explode('/', $route); // if a resource has a parent, it should be in the form /dogs/1/puppies // so t...
[ "protected", "function", "routeContainsParent", "(", ")", "{", "// get just the base url", "$", "route", "=", "parse_url", "(", "$", "_SERVER", "[", "'REQUEST_URI'", "]", ",", "PHP_URL_PATH", ")", ";", "// lets split it into pieces", "$", "parts", "=", "explode", ...
Checks if the current route contains the parents id. @return boolean
[ "Checks", "if", "the", "current", "route", "contains", "the", "parents", "id", "." ]
3bbf66a85304070562e54a66c99145f58f32877e
https://github.com/jfortunato/fortune/blob/3bbf66a85304070562e54a66c99145f58f32877e/src/Security/Bouncer/ParentBouncer.php#L28-L41
241,004
SIBPHP/Redis
Redis.php
Redis._connection
protected function _connection(array $config) { $redis = new \Redis; $host = empty($config['host']) ? self::DEFAULT_HOST : $config['host']; $port = empty($config['port']) ? self::DEFAULT_PORT : $config['port']; $timeout = empty($config['timeout']) ? self::DEFAULT_TIMEOUT : $config['t...
php
protected function _connection(array $config) { $redis = new \Redis; $host = empty($config['host']) ? self::DEFAULT_HOST : $config['host']; $port = empty($config['port']) ? self::DEFAULT_PORT : $config['port']; $timeout = empty($config['timeout']) ? self::DEFAULT_TIMEOUT : $config['t...
[ "protected", "function", "_connection", "(", "array", "$", "config", ")", "{", "$", "redis", "=", "new", "\\", "Redis", ";", "$", "host", "=", "empty", "(", "$", "config", "[", "'host'", "]", ")", "?", "self", "::", "DEFAULT_HOST", ":", "$", "config"...
Redis connect and return the redis instance @param array $config The config @return \Redis
[ "Redis", "connect", "and", "return", "the", "redis", "instance" ]
c4293528ae55c930b4cb4f75870447ed928f6b02
https://github.com/SIBPHP/Redis/blob/c4293528ae55c930b4cb4f75870447ed928f6b02/Redis.php#L96-L105
241,005
SIBPHP/Redis
Redis.php
Redis._master
protected function _master() { if (null === $this->_master) { $this->_master = $this->_connection($this->_config_master); } return $this->_master; }
php
protected function _master() { if (null === $this->_master) { $this->_master = $this->_connection($this->_config_master); } return $this->_master; }
[ "protected", "function", "_master", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "_master", ")", "{", "$", "this", "->", "_master", "=", "$", "this", "->", "_connection", "(", "$", "this", "->", "_config_master", ")", ";", "}", "return...
Get the master connection @return \Redis
[ "Get", "the", "master", "connection" ]
c4293528ae55c930b4cb4f75870447ed928f6b02
https://github.com/SIBPHP/Redis/blob/c4293528ae55c930b4cb4f75870447ed928f6b02/Redis.php#L113-L119
241,006
SIBPHP/Redis
Redis.php
Redis._slave
protected function _slave() { if (empty($this->_config_slaves)) { return $this->_master(); } if (null === $this->_slave) { $count = count($this->_config_slaves); $index = mt_rand(0, $count-1); $config = $this->_config_slaves[$index]; ...
php
protected function _slave() { if (empty($this->_config_slaves)) { return $this->_master(); } if (null === $this->_slave) { $count = count($this->_config_slaves); $index = mt_rand(0, $count-1); $config = $this->_config_slaves[$index]; ...
[ "protected", "function", "_slave", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "_config_slaves", ")", ")", "{", "return", "$", "this", "->", "_master", "(", ")", ";", "}", "if", "(", "null", "===", "$", "this", "->", "_slave", ")", ...
Get the slave connection @return \Redis
[ "Get", "the", "slave", "connection" ]
c4293528ae55c930b4cb4f75870447ed928f6b02
https://github.com/SIBPHP/Redis/blob/c4293528ae55c930b4cb4f75870447ed928f6b02/Redis.php#L126-L138
241,007
buybrain/nervus-php
src/Buybrain/Nervus/Adapter/Adapter.php
Adapter.run
public function run() { $this->init(); // Loop forever, except when a maximum number of requests is configured $requestsHandled = 0; while ($this->maxRequests === null || $requestsHandled < $this->maxRequests) { $this->doStep(); $requestsHandled++; } ...
php
public function run() { $this->init(); // Loop forever, except when a maximum number of requests is configured $requestsHandled = 0; while ($this->maxRequests === null || $requestsHandled < $this->maxRequests) { $this->doStep(); $requestsHandled++; } ...
[ "public", "function", "run", "(", ")", "{", "$", "this", "->", "init", "(", ")", ";", "// Loop forever, except when a maximum number of requests is configured", "$", "requestsHandled", "=", "0", ";", "while", "(", "$", "this", "->", "maxRequests", "===", "null", ...
Starts the adapter and keeps handling requests in a loop. This method never returns and will typically be the last call in an adapter implementation script.
[ "Starts", "the", "adapter", "and", "keeps", "handling", "requests", "in", "a", "loop", ".", "This", "method", "never", "returns", "and", "will", "typically", "be", "the", "last", "call", "in", "an", "adapter", "implementation", "script", "." ]
96e00e30571b3ea4cf3494cd26c930ffa336c3bf
https://github.com/buybrain/nervus-php/blob/96e00e30571b3ea4cf3494cd26c930ffa336c3bf/src/Buybrain/Nervus/Adapter/Adapter.php#L98-L108
241,008
buybrain/nervus-php
src/Buybrain/Nervus/Adapter/Adapter.php
Adapter.init
private function init() { if ($this->encoder === null) { // Send the adapter config as JSON payload to the host $config = new AdapterConfig( $this->codec->getName(), $this->getAdapterType(), $this->getExtraConfig() ); ...
php
private function init() { if ($this->encoder === null) { // Send the adapter config as JSON payload to the host $config = new AdapterConfig( $this->codec->getName(), $this->getAdapterType(), $this->getExtraConfig() ); ...
[ "private", "function", "init", "(", ")", "{", "if", "(", "$", "this", "->", "encoder", "===", "null", ")", "{", "// Send the adapter config as JSON payload to the host", "$", "config", "=", "new", "AdapterConfig", "(", "$", "this", "->", "codec", "->", "getNam...
Prepare this adapter for communication. Will send the adapter configuration to the nervus host and set up an encoder and decoder for further communication.
[ "Prepare", "this", "adapter", "for", "communication", ".", "Will", "send", "the", "adapter", "configuration", "to", "the", "nervus", "host", "and", "set", "up", "an", "encoder", "and", "decoder", "for", "further", "communication", "." ]
96e00e30571b3ea4cf3494cd26c930ffa336c3bf
https://github.com/buybrain/nervus-php/blob/96e00e30571b3ea4cf3494cd26c930ffa336c3bf/src/Buybrain/Nervus/Adapter/Adapter.php#L129-L144
241,009
jsiefer/class-mocker
src/Generator/ClassGenerator.php
ClassGenerator.generateTraitMethods
protected function generateTraitMethods() { if (empty($this->_traitMethodsAliases)) { return; } $this->addProperty( '___classMocker_traitMethods', $this->_traitMethodsAliases, PropertyGenerator::FLAG_PRIVATE | PropertyGenerator::FLAG_STATIC ...
php
protected function generateTraitMethods() { if (empty($this->_traitMethodsAliases)) { return; } $this->addProperty( '___classMocker_traitMethods', $this->_traitMethodsAliases, PropertyGenerator::FLAG_PRIVATE | PropertyGenerator::FLAG_STATIC ...
[ "protected", "function", "generateTraitMethods", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "_traitMethodsAliases", ")", ")", "{", "return", ";", "}", "$", "this", "->", "addProperty", "(", "'___classMocker_traitMethods'", ",", "$", "this", "...
Generate foot print of all methods specified by all traits registered to this mock class Register all trait methods to the private static property ___classMocker_traitMethods which is accessible to the base mock object and used to call all trait methods in order @see \JSiefer\ClassMocker\Mock\BaseMock::mergeTraitMeth...
[ "Generate", "foot", "print", "of", "all", "methods", "specified", "by", "all", "traits", "registered", "to", "this", "mock", "class" ]
a355fc9bece8e6f27fbfd09b1631234f7d73a791
https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/Generator/ClassGenerator.php#L71-L102
241,010
jsiefer/class-mocker
src/Generator/ClassGenerator.php
ClassGenerator.canGenerateMethod
public function canGenerateMethod($methodName) { /** * any special methods only called by the base mock class * and therefor should not be made accessible * * @see \JSiefer\ClassMocker\Mock\BaseMock::__callTraitMethods() */ switch ($methodName) { ...
php
public function canGenerateMethod($methodName) { /** * any special methods only called by the base mock class * and therefor should not be made accessible * * @see \JSiefer\ClassMocker\Mock\BaseMock::__callTraitMethods() */ switch ($methodName) { ...
[ "public", "function", "canGenerateMethod", "(", "$", "methodName", ")", "{", "/**\n * any special methods only called by the base mock class\n * and therefor should not be made accessible\n *\n * @see \\JSiefer\\ClassMocker\\Mock\\BaseMock::__callTraitMethods()\n ...
Check if method can be generated @param string $methodName @return bool
[ "Check", "if", "method", "can", "be", "generated" ]
a355fc9bece8e6f27fbfd09b1631234f7d73a791
https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/Generator/ClassGenerator.php#L111-L128
241,011
jsiefer/class-mocker
src/Generator/ClassGenerator.php
ClassGenerator.useTrait
public function useTrait(\ReflectionClass $trait) { $alias = 'trait' . ($this->_traitsIdx++); $alias .= '_' . str_replace('\\', '__', $trait->getName()); $alias = 'Trait_' . substr(md5($alias), 0, 10) . '_' .$trait->getShortName(); $this->addUse($trait->getName(), $alias); ...
php
public function useTrait(\ReflectionClass $trait) { $alias = 'trait' . ($this->_traitsIdx++); $alias .= '_' . str_replace('\\', '__', $trait->getName()); $alias = 'Trait_' . substr(md5($alias), 0, 10) . '_' .$trait->getShortName(); $this->addUse($trait->getName(), $alias); ...
[ "public", "function", "useTrait", "(", "\\", "ReflectionClass", "$", "trait", ")", "{", "$", "alias", "=", "'trait'", ".", "(", "$", "this", "->", "_traitsIdx", "++", ")", ";", "$", "alias", ".=", "'_'", ".", "str_replace", "(", "'\\\\'", ",", "'__'", ...
Use a trait and save all methods so in case a second trait will overwrite any @param \ReflectionClass $trait @return $this
[ "Use", "a", "trait", "and", "save", "all", "methods", "so", "in", "case", "a", "second", "trait", "will", "overwrite", "any" ]
a355fc9bece8e6f27fbfd09b1631234f7d73a791
https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/Generator/ClassGenerator.php#L235-L253
241,012
jsiefer/class-mocker
src/Generator/ClassGenerator.php
ClassGenerator.registerTraitMethod
protected function registerTraitMethod($trait, \ReflectionMethod $method) { $name = $method->getName(); $this->_method[$name] = $method; $alias = '__' . lcfirst($trait) . ucfirst($name); $this->addTraitAlias($trait . '::' . $name, $alias); $this->addTraitMethod($trait, $name...
php
protected function registerTraitMethod($trait, \ReflectionMethod $method) { $name = $method->getName(); $this->_method[$name] = $method; $alias = '__' . lcfirst($trait) . ucfirst($name); $this->addTraitAlias($trait . '::' . $name, $alias); $this->addTraitMethod($trait, $name...
[ "protected", "function", "registerTraitMethod", "(", "$", "trait", ",", "\\", "ReflectionMethod", "$", "method", ")", "{", "$", "name", "=", "$", "method", "->", "getName", "(", ")", ";", "$", "this", "->", "_method", "[", "$", "name", "]", "=", "$", ...
Register magic method alias @param string $trait @param \ReflectionMethod $method @return void
[ "Register", "magic", "method", "alias" ]
a355fc9bece8e6f27fbfd09b1631234f7d73a791
https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/Generator/ClassGenerator.php#L263-L276
241,013
jsiefer/class-mocker
src/Generator/ClassGenerator.php
ClassGenerator.addTraitMethod
protected function addTraitMethod($trait, $method) { if (!isset($this->_traitMethods[$method])) { $this->_traitMethods[$method] = []; } else { foreach ($this->_traitMethods[$method] as $prefTrait) { $this->removeTraitOverride($prefTrait . '::' . $method); ...
php
protected function addTraitMethod($trait, $method) { if (!isset($this->_traitMethods[$method])) { $this->_traitMethods[$method] = []; } else { foreach ($this->_traitMethods[$method] as $prefTrait) { $this->removeTraitOverride($prefTrait . '::' . $method); ...
[ "protected", "function", "addTraitMethod", "(", "$", "trait", ",", "$", "method", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_traitMethods", "[", "$", "method", "]", ")", ")", "{", "$", "this", "->", "_traitMethods", "[", "$", "metho...
Register trait method this will overwrite all previously registered methods @param string $trait @param string $method @return void
[ "Register", "trait", "method", "this", "will", "overwrite", "all", "previously", "registered", "methods" ]
a355fc9bece8e6f27fbfd09b1631234f7d73a791
https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/Generator/ClassGenerator.php#L287-L299
241,014
oaugustus/direct-silex-provider
src/Direct/Router/Response.php
Response.encode
public function encode($result) { if ('form' == $this->type) { array_walk_recursive($result[0], array($this, 'utf8')); $response = new SfResponse("<html><body><textarea>".json_encode($result[0])."</textarea></body></html>"); $response->headers->se...
php
public function encode($result) { if ('form' == $this->type) { array_walk_recursive($result[0], array($this, 'utf8')); $response = new SfResponse("<html><body><textarea>".json_encode($result[0])."</textarea></body></html>"); $response->headers->se...
[ "public", "function", "encode", "(", "$", "result", ")", "{", "if", "(", "'form'", "==", "$", "this", "->", "type", ")", "{", "array_walk_recursive", "(", "$", "result", "[", "0", "]", ",", "array", "(", "$", "this", ",", "'utf8'", ")", ")", ";", ...
Encode the response into a valid json ExtDirect result. @param array $result @return string
[ "Encode", "the", "response", "into", "a", "valid", "json", "ExtDirect", "result", "." ]
8d92afdf5ede04c3048cde82b9879de7e1d6c153
https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Router/Response.php#L38-L58
241,015
oaugustus/direct-silex-provider
src/Direct/Router/Response.php
Response.utf8
private function utf8(&$value, &$key) { if (is_string($value)) { $value = utf8_encode($value); } if (is_array($value)) { array_walk_recursive($value, array($this, 'utf8')); } }
php
private function utf8(&$value, &$key) { if (is_string($value)) { $value = utf8_encode($value); } if (is_array($value)) { array_walk_recursive($value, array($this, 'utf8')); } }
[ "private", "function", "utf8", "(", "&", "$", "value", ",", "&", "$", "key", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", ")", "{", "$", "value", "=", "utf8_encode", "(", "$", "value", ")", ";", "}", "if", "(", "is_array", "(", "$"...
Encode the result recursivily as utf8. @param mixed $value @param string $key
[ "Encode", "the", "result", "recursivily", "as", "utf8", "." ]
8d92afdf5ede04c3048cde82b9879de7e1d6c153
https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Router/Response.php#L66-L75
241,016
apnet/AsseticImporterBundle
src/Apnet/AsseticWatcherBundle/Factory/SourceCodeWatcher.php
SourceCodeWatcher.setCompilerRoot
public function setCompilerRoot($path) { $path = realpath($path); if (is_dir($path)) { $this->root = $path; } }
php
public function setCompilerRoot($path) { $path = realpath($path); if (is_dir($path)) { $this->root = $path; } }
[ "public", "function", "setCompilerRoot", "(", "$", "path", ")", "{", "$", "path", "=", "realpath", "(", "$", "path", ")", ";", "if", "(", "is_dir", "(", "$", "path", ")", ")", "{", "$", "this", "->", "root", "=", "$", "path", ";", "}", "}" ]
Set compiler root @param string $path Path @return null
[ "Set", "compiler", "root" ]
104ad3593795c016a5b89ecc8c240d4d96d3de45
https://github.com/apnet/AsseticImporterBundle/blob/104ad3593795c016a5b89ecc8c240d4d96d3de45/src/Apnet/AsseticWatcherBundle/Factory/SourceCodeWatcher.php#L71-L77
241,017
apnet/AsseticImporterBundle
src/Apnet/AsseticWatcherBundle/Factory/SourceCodeWatcher.php
SourceCodeWatcher.addWatcher
public function addWatcher(Watcher\WatcherInterface $watcher) { $type = $watcher->getType(); $this->watchers[$type] = $watcher; }
php
public function addWatcher(Watcher\WatcherInterface $watcher) { $type = $watcher->getType(); $this->watchers[$type] = $watcher; }
[ "public", "function", "addWatcher", "(", "Watcher", "\\", "WatcherInterface", "$", "watcher", ")", "{", "$", "type", "=", "$", "watcher", "->", "getType", "(", ")", ";", "$", "this", "->", "watchers", "[", "$", "type", "]", "=", "$", "watcher", ";", ...
Add named watcher instance @param Watcher\WatcherInterface $watcher Watcher instance @return null
[ "Add", "named", "watcher", "instance" ]
104ad3593795c016a5b89ecc8c240d4d96d3de45
https://github.com/apnet/AsseticImporterBundle/blob/104ad3593795c016a5b89ecc8c240d4d96d3de45/src/Apnet/AsseticWatcherBundle/Factory/SourceCodeWatcher.php#L110-L115
241,018
apnet/AsseticImporterBundle
src/Apnet/AsseticWatcherBundle/Factory/SourceCodeWatcher.php
SourceCodeWatcher.addConfig
public function addConfig($config, $watcher) { if (!$this->root) { return; } $config = realpath($config); $filesystem = new Filesystem(); $relativePath = $filesystem->makePathRelative($config, $this->root); if (substr($relativePath, 0, 2) == "..") { return; } if (!isset($...
php
public function addConfig($config, $watcher) { if (!$this->root) { return; } $config = realpath($config); $filesystem = new Filesystem(); $relativePath = $filesystem->makePathRelative($config, $this->root); if (substr($relativePath, 0, 2) == "..") { return; } if (!isset($...
[ "public", "function", "addConfig", "(", "$", "config", ",", "$", "watcher", ")", "{", "if", "(", "!", "$", "this", "->", "root", ")", "{", "return", ";", "}", "$", "config", "=", "realpath", "(", "$", "config", ")", ";", "$", "filesystem", "=", "...
Add config path to watch @param string $config Path to config file @param string $watcher Watcher name @return null
[ "Add", "config", "path", "to", "watch" ]
104ad3593795c016a5b89ecc8c240d4d96d3de45
https://github.com/apnet/AsseticImporterBundle/blob/104ad3593795c016a5b89ecc8c240d4d96d3de45/src/Apnet/AsseticWatcherBundle/Factory/SourceCodeWatcher.php#L125-L142
241,019
apnet/AsseticImporterBundle
src/Apnet/AsseticWatcherBundle/Factory/SourceCodeWatcher.php
SourceCodeWatcher.compile
public function compile() { if (!$this->enabled || $this->env !== "dev") { return; } foreach ($this->watchers as $name => $watcher) { if (isset($this->configs[$name])) { foreach ($this->configs[$name] as $configPath) { $files = $watcher->getChildren($configPath); if...
php
public function compile() { if (!$this->enabled || $this->env !== "dev") { return; } foreach ($this->watchers as $name => $watcher) { if (isset($this->configs[$name])) { foreach ($this->configs[$name] as $configPath) { $files = $watcher->getChildren($configPath); if...
[ "public", "function", "compile", "(", ")", "{", "if", "(", "!", "$", "this", "->", "enabled", "||", "$", "this", "->", "env", "!==", "\"dev\"", ")", "{", "return", ";", "}", "foreach", "(", "$", "this", "->", "watchers", "as", "$", "name", "=>", ...
Compile watchers' files @return null
[ "Compile", "watchers", "files" ]
104ad3593795c016a5b89ecc8c240d4d96d3de45
https://github.com/apnet/AsseticImporterBundle/blob/104ad3593795c016a5b89ecc8c240d4d96d3de45/src/Apnet/AsseticWatcherBundle/Factory/SourceCodeWatcher.php#L149-L165
241,020
narrowspark/automatic-common
Installer/AbstractInstallationManager.php
AbstractInstallationManager.getInstaller
protected function getInstaller(): BaseInstaller { return Installer::create($this->io, $this->composer, $this->input); }
php
protected function getInstaller(): BaseInstaller { return Installer::create($this->io, $this->composer, $this->input); }
[ "protected", "function", "getInstaller", "(", ")", ":", "BaseInstaller", "{", "return", "Installer", "::", "create", "(", "$", "this", "->", "io", ",", "$", "this", "->", "composer", ",", "$", "this", "->", "input", ")", ";", "}" ]
Get configured installer instance. @codeCoverageIgnore @return \Composer\Installer
[ "Get", "configured", "installer", "instance", "." ]
415f0d566932847c3ca799e06f27e588bd244881
https://github.com/narrowspark/automatic-common/blob/415f0d566932847c3ca799e06f27e588bd244881/Installer/AbstractInstallationManager.php#L145-L148
241,021
narrowspark/automatic-common
Installer/AbstractInstallationManager.php
AbstractInstallationManager.findBestVersionForPackage
protected function findBestVersionForPackage(string $name): string { // find the latest version allowed in this pool $package = $this->versionSelector->findBestCandidate($name, null, null, 'stable'); if ($package === false) { throw new InvalidArgumentException(\sprintf( ...
php
protected function findBestVersionForPackage(string $name): string { // find the latest version allowed in this pool $package = $this->versionSelector->findBestCandidate($name, null, null, 'stable'); if ($package === false) { throw new InvalidArgumentException(\sprintf( ...
[ "protected", "function", "findBestVersionForPackage", "(", "string", "$", "name", ")", ":", "string", "{", "// find the latest version allowed in this pool", "$", "package", "=", "$", "this", "->", "versionSelector", "->", "findBestCandidate", "(", "$", "name", ",", ...
Try to find the best version fot the package. @param string $name @throws \Narrowspark\Automatic\Common\Contract\Exception\InvalidArgumentException @return string
[ "Try", "to", "find", "the", "best", "version", "fot", "the", "package", "." ]
415f0d566932847c3ca799e06f27e588bd244881
https://github.com/narrowspark/automatic-common/blob/415f0d566932847c3ca799e06f27e588bd244881/Installer/AbstractInstallationManager.php#L159-L174
241,022
narrowspark/automatic-common
Installer/AbstractInstallationManager.php
AbstractInstallationManager.updateRootComposerJson
protected function updateRootComposerJson(array $requires, array $devRequires, int $type): RootPackageInterface { $this->io->writeError('Updating root package'); $this->updateRootPackageRequire($requires, $type); $this->updateRootPackageDevRequire($devRequires, $type); return $this...
php
protected function updateRootComposerJson(array $requires, array $devRequires, int $type): RootPackageInterface { $this->io->writeError('Updating root package'); $this->updateRootPackageRequire($requires, $type); $this->updateRootPackageDevRequire($devRequires, $type); return $this...
[ "protected", "function", "updateRootComposerJson", "(", "array", "$", "requires", ",", "array", "$", "devRequires", ",", "int", "$", "type", ")", ":", "RootPackageInterface", "{", "$", "this", "->", "io", "->", "writeError", "(", "'Updating root package'", ")", ...
Update the root package require and dev-require. @param array $requires @param array $devRequires @param int $type @return \Composer\Package\RootPackageInterface
[ "Update", "the", "root", "package", "require", "and", "dev", "-", "require", "." ]
415f0d566932847c3ca799e06f27e588bd244881
https://github.com/narrowspark/automatic-common/blob/415f0d566932847c3ca799e06f27e588bd244881/Installer/AbstractInstallationManager.php#L185-L193
241,023
narrowspark/automatic-common
Installer/AbstractInstallationManager.php
AbstractInstallationManager.updateComposerJson
protected function updateComposerJson(array $requires, array $devRequires, int $type): void { $this->io->writeError('Updating composer.json'); if ($type === self::ADD) { $jsonManipulator = new JsonManipulator(\file_get_contents($this->jsonFile->getPath())); $sortPackages ...
php
protected function updateComposerJson(array $requires, array $devRequires, int $type): void { $this->io->writeError('Updating composer.json'); if ($type === self::ADD) { $jsonManipulator = new JsonManipulator(\file_get_contents($this->jsonFile->getPath())); $sortPackages ...
[ "protected", "function", "updateComposerJson", "(", "array", "$", "requires", ",", "array", "$", "devRequires", ",", "int", "$", "type", ")", ":", "void", "{", "$", "this", "->", "io", "->", "writeError", "(", "'Updating composer.json'", ")", ";", "if", "(...
Manipulate root composer.json with the new packages and dump it. @param array $requires @param array $devRequires @param int $type @throws \Exception happens in the JsonFile class @return void
[ "Manipulate", "root", "composer", ".", "json", "with", "the", "new", "packages", "and", "dump", "it", "." ]
415f0d566932847c3ca799e06f27e588bd244881
https://github.com/narrowspark/automatic-common/blob/415f0d566932847c3ca799e06f27e588bd244881/Installer/AbstractInstallationManager.php#L206-L236
241,024
narrowspark/automatic-common
Installer/AbstractInstallationManager.php
AbstractInstallationManager.runInstaller
protected function runInstaller(RootPackageInterface $rootPackage, array $whitelistPackages): int { $this->io->writeError('Running an update to install dependent packages'); $this->composer->setPackage($rootPackage); $installer = $this->getInstaller(); $installer->setUpdateWhitelis...
php
protected function runInstaller(RootPackageInterface $rootPackage, array $whitelistPackages): int { $this->io->writeError('Running an update to install dependent packages'); $this->composer->setPackage($rootPackage); $installer = $this->getInstaller(); $installer->setUpdateWhitelis...
[ "protected", "function", "runInstaller", "(", "RootPackageInterface", "$", "rootPackage", ",", "array", "$", "whitelistPackages", ")", ":", "int", "{", "$", "this", "->", "io", "->", "writeError", "(", "'Running an update to install dependent packages'", ")", ";", "...
Install selected packages. @param \Composer\Package\RootPackageInterface $rootPackage @param array $whitelistPackages @throws \Exception @return int
[ "Install", "selected", "packages", "." ]
415f0d566932847c3ca799e06f27e588bd244881
https://github.com/narrowspark/automatic-common/blob/415f0d566932847c3ca799e06f27e588bd244881/Installer/AbstractInstallationManager.php#L248-L258
241,025
narrowspark/automatic-common
Installer/AbstractInstallationManager.php
AbstractInstallationManager.updateRootPackageRequire
protected function updateRootPackageRequire(array $packages, int $type): void { $requires = $this->manipulateRootPackage( $packages, $type, $this->rootPackage->getRequires() ); $this->rootPackage->setRequires($requires); }
php
protected function updateRootPackageRequire(array $packages, int $type): void { $requires = $this->manipulateRootPackage( $packages, $type, $this->rootPackage->getRequires() ); $this->rootPackage->setRequires($requires); }
[ "protected", "function", "updateRootPackageRequire", "(", "array", "$", "packages", ",", "int", "$", "type", ")", ":", "void", "{", "$", "requires", "=", "$", "this", "->", "manipulateRootPackage", "(", "$", "packages", ",", "$", "type", ",", "$", "this", ...
Update the root required packages. @param array $packages @param int $type @return void
[ "Update", "the", "root", "required", "packages", "." ]
415f0d566932847c3ca799e06f27e588bd244881
https://github.com/narrowspark/automatic-common/blob/415f0d566932847c3ca799e06f27e588bd244881/Installer/AbstractInstallationManager.php#L278-L287
241,026
narrowspark/automatic-common
Installer/AbstractInstallationManager.php
AbstractInstallationManager.updateRootPackageDevRequire
protected function updateRootPackageDevRequire(array $packages, int $type): void { $devRequires = $this->manipulateRootPackage( $packages, $type, $this->rootPackage->getDevRequires() ); $this->rootPackage->setDevRequires($devRequires); }
php
protected function updateRootPackageDevRequire(array $packages, int $type): void { $devRequires = $this->manipulateRootPackage( $packages, $type, $this->rootPackage->getDevRequires() ); $this->rootPackage->setDevRequires($devRequires); }
[ "protected", "function", "updateRootPackageDevRequire", "(", "array", "$", "packages", ",", "int", "$", "type", ")", ":", "void", "{", "$", "devRequires", "=", "$", "this", "->", "manipulateRootPackage", "(", "$", "packages", ",", "$", "type", ",", "$", "t...
Update the root dev-required packages. @param array $packages @param int $type @return void
[ "Update", "the", "root", "dev", "-", "required", "packages", "." ]
415f0d566932847c3ca799e06f27e588bd244881
https://github.com/narrowspark/automatic-common/blob/415f0d566932847c3ca799e06f27e588bd244881/Installer/AbstractInstallationManager.php#L297-L306
241,027
narrowspark/automatic-common
Installer/AbstractInstallationManager.php
AbstractInstallationManager.manipulateRootPackage
protected function manipulateRootPackage(array $packages, int $type, array $requires): array { if ($type === self::ADD) { foreach ($packages as $packageName => $version) { $requires[$packageName] = new Link( '__root__', $packageName, ...
php
protected function manipulateRootPackage(array $packages, int $type, array $requires): array { if ($type === self::ADD) { foreach ($packages as $packageName => $version) { $requires[$packageName] = new Link( '__root__', $packageName, ...
[ "protected", "function", "manipulateRootPackage", "(", "array", "$", "packages", ",", "int", "$", "type", ",", "array", "$", "requires", ")", ":", "array", "{", "if", "(", "$", "type", "===", "self", "::", "ADD", ")", "{", "foreach", "(", "$", "package...
Manipulates the given requires with the new added packages. @param array $packages @param int $type @param array $requires @return array
[ "Manipulates", "the", "given", "requires", "with", "the", "new", "added", "packages", "." ]
415f0d566932847c3ca799e06f27e588bd244881
https://github.com/narrowspark/automatic-common/blob/415f0d566932847c3ca799e06f27e588bd244881/Installer/AbstractInstallationManager.php#L317-L336
241,028
cubiclab/users-cube
controllers/backend/UserController.php
UserController.actionIndex
public function actionIndex() { $searchModel = new UserSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $statusArray = User::getStatusArray(); $roleArray = ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'description'); return $t...
php
public function actionIndex() { $searchModel = new UserSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $statusArray = User::getStatusArray(); $roleArray = ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'description'); return $t...
[ "public", "function", "actionIndex", "(", ")", "{", "$", "searchModel", "=", "new", "UserSearch", "(", ")", ";", "$", "dataProvider", "=", "$", "searchModel", "->", "search", "(", "Yii", "::", "$", "app", "->", "request", "->", "queryParams", ")", ";", ...
Users list page.
[ "Users", "list", "page", "." ]
32ad7b9ae650c226078e69c14eee1d730aa24888
https://github.com/cubiclab/users-cube/blob/32ad7b9ae650c226078e69c14eee1d730aa24888/controllers/backend/UserController.php#L71-L85
241,029
cubiclab/users-cube
controllers/backend/UserController.php
UserController.actionUpdate
public function actionUpdate($id) { $roles = ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'description'); $user_permit = array_keys(Yii::$app->authManager->getRolesByUser($id)); $user = $this->findUser($id); //return $this->render('view', [ // 'user' => $us...
php
public function actionUpdate($id) { $roles = ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'description'); $user_permit = array_keys(Yii::$app->authManager->getRolesByUser($id)); $user = $this->findUser($id); //return $this->render('view', [ // 'user' => $us...
[ "public", "function", "actionUpdate", "(", "$", "id", ")", "{", "$", "roles", "=", "ArrayHelper", "::", "map", "(", "Yii", "::", "$", "app", "->", "authManager", "->", "getRoles", "(", ")", ",", "'name'", ",", "'description'", ")", ";", "$", "user_perm...
Updates an existing Users model. If update is successful, the browser will be redirected to the 'view' page. @param integer $id @return mixed
[ "Updates", "an", "existing", "Users", "model", ".", "If", "update", "is", "successful", "the", "browser", "will", "be", "redirected", "to", "the", "view", "page", "." ]
32ad7b9ae650c226078e69c14eee1d730aa24888
https://github.com/cubiclab/users-cube/blob/32ad7b9ae650c226078e69c14eee1d730aa24888/controllers/backend/UserController.php#L140-L181
241,030
cubiclab/users-cube
controllers/backend/UserController.php
UserController.actionMassDelete
public function actionMassDelete() { if (($ids = Yii::$app->request->post('ids')) !== null) { $models = $this->findUser($ids); foreach ($models as $model) { $model->delete($model); } return $this->redirect(['index']); } else { ...
php
public function actionMassDelete() { if (($ids = Yii::$app->request->post('ids')) !== null) { $models = $this->findUser($ids); foreach ($models as $model) { $model->delete($model); } return $this->redirect(['index']); } else { ...
[ "public", "function", "actionMassDelete", "(", ")", "{", "if", "(", "(", "$", "ids", "=", "Yii", "::", "$", "app", "->", "request", "->", "post", "(", "'ids'", ")", ")", "!==", "null", ")", "{", "$", "models", "=", "$", "this", "->", "findUser", ...
Delete multiple users page.
[ "Delete", "multiple", "users", "page", "." ]
32ad7b9ae650c226078e69c14eee1d730aa24888
https://github.com/cubiclab/users-cube/blob/32ad7b9ae650c226078e69c14eee1d730aa24888/controllers/backend/UserController.php#L195-L206
241,031
cubiclab/users-cube
controllers/backend/UserController.php
UserController.findUser
private function findUser($id) { if (is_array($id)) { /** @var User $user */ $model = User::findIdentities($id); } else { /** @var User $user */ $model = User::findIdentity($id); } if ($model !== null) { return $model; ...
php
private function findUser($id) { if (is_array($id)) { /** @var User $user */ $model = User::findIdentities($id); } else { /** @var User $user */ $model = User::findIdentity($id); } if ($model !== null) { return $model; ...
[ "private", "function", "findUser", "(", "$", "id", ")", "{", "if", "(", "is_array", "(", "$", "id", ")", ")", "{", "/** @var User $user */", "$", "model", "=", "User", "::", "findIdentities", "(", "$", "id", ")", ";", "}", "else", "{", "/** @var User $...
Find User model by ID @param integer|array $id User ID @return \cubiclab\users\models\User User @throws NotFoundHttpException User not found
[ "Find", "User", "model", "by", "ID" ]
32ad7b9ae650c226078e69c14eee1d730aa24888
https://github.com/cubiclab/users-cube/blob/32ad7b9ae650c226078e69c14eee1d730aa24888/controllers/backend/UserController.php#L216-L230
241,032
milkyway-multimedia/ss-mwm-core
code/Core/Extensions/Controller.php
Controller.getBackLink
public function getBackLink($fallback = '') { $url = ''; if ($this->owner->Request) { if ($this->owner->Request->requestVar('BackURL')) { $url = $this->owner->Request->requestVar('BackURL'); } else { if ($this->owner->Request->isAjax() && $thi...
php
public function getBackLink($fallback = '') { $url = ''; if ($this->owner->Request) { if ($this->owner->Request->requestVar('BackURL')) { $url = $this->owner->Request->requestVar('BackURL'); } else { if ($this->owner->Request->isAjax() && $thi...
[ "public", "function", "getBackLink", "(", "$", "fallback", "=", "''", ")", "{", "$", "url", "=", "''", ";", "if", "(", "$", "this", "->", "owner", "->", "Request", ")", "{", "if", "(", "$", "this", "->", "owner", "->", "Request", "->", "requestVar"...
Find a back link for current controller @param string $fallback @return string
[ "Find", "a", "back", "link", "for", "current", "controller" ]
e7216653b7100ead5a7d56736a124bee1c76fcd5
https://github.com/milkyway-multimedia/ss-mwm-core/blob/e7216653b7100ead5a7d56736a124bee1c76fcd5/code/Core/Extensions/Controller.php#L20-L43
241,033
milkyway-multimedia/ss-mwm-core
code/Core/Extensions/Controller.php
Controller.displayNiceView
public function displayNiceView($controller = null, $url = '', $action = '') { if (!$controller) { $controller = $this->owner; } return singleton('director')->create_view($controller, $url, $action); }
php
public function displayNiceView($controller = null, $url = '', $action = '') { if (!$controller) { $controller = $this->owner; } return singleton('director')->create_view($controller, $url, $action); }
[ "public", "function", "displayNiceView", "(", "$", "controller", "=", "null", ",", "$", "url", "=", "''", ",", "$", "action", "=", "''", ")", "{", "if", "(", "!", "$", "controller", ")", "{", "$", "controller", "=", "$", "this", "->", "owner", ";",...
Display a controller using a Page view @param null $controller @param string $url @param string $action @return @Controller
[ "Display", "a", "controller", "using", "a", "Page", "view" ]
e7216653b7100ead5a7d56736a124bee1c76fcd5
https://github.com/milkyway-multimedia/ss-mwm-core/blob/e7216653b7100ead5a7d56736a124bee1c76fcd5/code/Core/Extensions/Controller.php#L53-L60
241,034
milkyway-multimedia/ss-mwm-core
code/Core/Extensions/Controller.php
Controller.respondToFormAppropriately
public function respondToFormAppropriately(array $params, $form = null, $redirect = '') { if ($redirect && !isset($params['redirect'])) { $params['redirect'] = $redirect; } if ($this->owner->Request->isAjax()) { if (!isset($params['code'])) { $params[...
php
public function respondToFormAppropriately(array $params, $form = null, $redirect = '') { if ($redirect && !isset($params['redirect'])) { $params['redirect'] = $redirect; } if ($this->owner->Request->isAjax()) { if (!isset($params['code'])) { $params[...
[ "public", "function", "respondToFormAppropriately", "(", "array", "$", "params", ",", "$", "form", "=", "null", ",", "$", "redirect", "=", "''", ")", "{", "if", "(", "$", "redirect", "&&", "!", "isset", "(", "$", "params", "[", "'redirect'", "]", ")", ...
Respond to a form view ajax or redirect @param array $params @param \Form $form @param string $redirect @return \SS_HTTPResponse|null
[ "Respond", "to", "a", "form", "view", "ajax", "or", "redirect" ]
e7216653b7100ead5a7d56736a124bee1c76fcd5
https://github.com/milkyway-multimedia/ss-mwm-core/blob/e7216653b7100ead5a7d56736a124bee1c76fcd5/code/Core/Extensions/Controller.php#L69-L97
241,035
atelierspierrot/library
src/Library/Object/AbstractInvokable.php
AbstractInvokable._invokeIsset
protected function _invokeIsset($name) { if (!self::__isInvokable($name)) { return $this; } $is_static = self::__isStatic($name); $property = $this->findPropertyName($name); return !empty($property); }
php
protected function _invokeIsset($name) { if (!self::__isInvokable($name)) { return $this; } $is_static = self::__isStatic($name); $property = $this->findPropertyName($name); return !empty($property); }
[ "protected", "function", "_invokeIsset", "(", "$", "name", ")", "{", "if", "(", "!", "self", "::", "__isInvokable", "(", "$", "name", ")", ")", "{", "return", "$", "this", ";", "}", "$", "is_static", "=", "self", "::", "__isStatic", "(", "$", "name",...
Internal magic checker Magic method called when `issetProp()`, `isset($this->prop)` or `empty($this->prop)` are invoked. @param string $name The name of the property to get @return bool This will return `true` if the property exists, `false` otherwise
[ "Internal", "magic", "checker" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Object/AbstractInvokable.php#L238-L246
241,036
atelierspierrot/library
src/Library/Object/AbstractInvokable.php
AbstractInvokable._invokeReset
protected function _invokeReset($name) { if (!self::__isInvokable($name)) { return $this; } $is_static = self::__isStatic($name); $property = $this->findPropertyName($name); if (!empty($property)) { if ($is_static) { return $this->_invo...
php
protected function _invokeReset($name) { if (!self::__isInvokable($name)) { return $this; } $is_static = self::__isStatic($name); $property = $this->findPropertyName($name); if (!empty($property)) { if ($is_static) { return $this->_invo...
[ "protected", "function", "_invokeReset", "(", "$", "name", ")", "{", "if", "(", "!", "self", "::", "__isInvokable", "(", "$", "name", ")", ")", "{", "return", "$", "this", ";", "}", "$", "is_static", "=", "self", "::", "__isStatic", "(", "$", "name",...
Internal magic re-setter Magic method called when `resetProp(arg, value)` is invoked. As this can not work on statics, in this case it is an alias of `unset`. @param string $name The name of the property to get @return self Returns `$this` for method chaining
[ "Internal", "magic", "re", "-", "setter" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Object/AbstractInvokable.php#L282-L302
241,037
atelierspierrot/library
src/Library/Object/AbstractInvokable.php
AbstractInvokable._invokeGet
protected function _invokeGet($name, $default = null) { if (!self::__isInvokable($name)) { return null; } $is_static = self::__isStatic($name); $property = $this->findPropertyName($name); if (!empty($property)) { return $is_static ? @$this::${$property...
php
protected function _invokeGet($name, $default = null) { if (!self::__isInvokable($name)) { return null; } $is_static = self::__isStatic($name); $property = $this->findPropertyName($name); if (!empty($property)) { return $is_static ? @$this::${$property...
[ "protected", "function", "_invokeGet", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "if", "(", "!", "self", "::", "__isInvokable", "(", "$", "name", ")", ")", "{", "return", "null", ";", "}", "$", "is_static", "=", "self", "::", "_...
Internal magic getter Magic method called when `getProp(arg, default)` or `$this->prop` are invoked. @param string $name The name of the property to get @param mixed $default The default value to return if the property doesn't exist @return mixed This will return the result of a magic method, or nothing if nothing ca...
[ "Internal", "magic", "getter" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Object/AbstractInvokable.php#L313-L324
241,038
atelierspierrot/library
src/Library/Object/AbstractInvokable.php
AbstractInvokable._invokeSet
protected function _invokeSet($name, $value) { if (!self::__isInvokable($name)) { return $this; } $is_static = self::__isStatic($name); $property = $this->findPropertyName($name); if (!empty($property)) { if ($is_static) { $this::${$pro...
php
protected function _invokeSet($name, $value) { if (!self::__isInvokable($name)) { return $this; } $is_static = self::__isStatic($name); $property = $this->findPropertyName($name); if (!empty($property)) { if ($is_static) { $this::${$pro...
[ "protected", "function", "_invokeSet", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "!", "self", "::", "__isInvokable", "(", "$", "name", ")", ")", "{", "return", "$", "this", ";", "}", "$", "is_static", "=", "self", "::", "__isStatic", ...
Internal magic setter Magic method called when `setProp(arg, value)` or `$this->arg = value` are invoked. @param string $name The name of the property to get @param mixed $value The value to set for the property @return self Returns `$this` for method chaining
[ "Internal", "magic", "setter" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Object/AbstractInvokable.php#L335-L350
241,039
atelierspierrot/library
src/Library/Object/AbstractInvokable.php
AbstractInvokable.__isInvokable
private function __isInvokable($name) { if (!$this->__isCalled) { $property = $this->findPropertyName($name); if (!empty($property)) { $reflection = new ReflectionProperty(get_class($this), $property); return $reflection->isPublic(); } ...
php
private function __isInvokable($name) { if (!$this->__isCalled) { $property = $this->findPropertyName($name); if (!empty($property)) { $reflection = new ReflectionProperty(get_class($this), $property); return $reflection->isPublic(); } ...
[ "private", "function", "__isInvokable", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "__isCalled", ")", "{", "$", "property", "=", "$", "this", "->", "findPropertyName", "(", "$", "name", ")", ";", "if", "(", "!", "empty", "(", "$...
Check if a property is invokable in the final object Returns `false` if property access was direct and its scope is not public. @param string $name The property name @return bool
[ "Check", "if", "a", "property", "is", "invokable", "in", "the", "final", "object" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Object/AbstractInvokable.php#L360-L370
241,040
atelierspierrot/library
src/Library/Object/AbstractInvokable.php
AbstractInvokable.__isStatic
private function __isStatic($name) { $property = $this->findPropertyName($name); if (!empty($property)) { $reflection = new ReflectionProperty(get_class($this), $property); return $reflection->isStatic(); } return true; }
php
private function __isStatic($name) { $property = $this->findPropertyName($name); if (!empty($property)) { $reflection = new ReflectionProperty(get_class($this), $property); return $reflection->isStatic(); } return true; }
[ "private", "function", "__isStatic", "(", "$", "name", ")", "{", "$", "property", "=", "$", "this", "->", "findPropertyName", "(", "$", "name", ")", ";", "if", "(", "!", "empty", "(", "$", "property", ")", ")", "{", "$", "reflection", "=", "new", "...
Check if a property is static in the final object @param string $name The property name @return bool
[ "Check", "if", "a", "property", "is", "static", "in", "the", "final", "object" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Object/AbstractInvokable.php#L378-L386
241,041
atelierspierrot/library
src/Library/Object/AbstractInvokable.php
AbstractInvokable.__isInvokableStatic
private static function __isInvokableStatic($name) { $classname = get_called_class(); $reflection_class = new ReflectionClass($classname); $properties = $reflection_class->getStaticProperties(); $property = self::findPropertyNameStatic($name, $classname); if (!empty($property...
php
private static function __isInvokableStatic($name) { $classname = get_called_class(); $reflection_class = new ReflectionClass($classname); $properties = $reflection_class->getStaticProperties(); $property = self::findPropertyNameStatic($name, $classname); if (!empty($property...
[ "private", "static", "function", "__isInvokableStatic", "(", "$", "name", ")", "{", "$", "classname", "=", "get_called_class", "(", ")", ";", "$", "reflection_class", "=", "new", "ReflectionClass", "(", "$", "classname", ")", ";", "$", "properties", "=", "$"...
Check if a property is statically invokable in the final object Returns `false` if property access was direct and its scope is not static & public. @param string $name The property name @return bool
[ "Check", "if", "a", "property", "is", "statically", "invokable", "in", "the", "final", "object" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Object/AbstractInvokable.php#L396-L407
241,042
atelierspierrot/library
src/Library/Object/AbstractInvokable.php
AbstractInvokable.findPropertyNameStatic
public static function findPropertyNameStatic($name, $object) { $property = null; if (property_exists($object, $name)) { $property = $name; } else { // _name $underscore_name = '_'.$name; if (property_exists($object, $underscore_name)) { ...
php
public static function findPropertyNameStatic($name, $object) { $property = null; if (property_exists($object, $name)) { $property = $name; } else { // _name $underscore_name = '_'.$name; if (property_exists($object, $underscore_name)) { ...
[ "public", "static", "function", "findPropertyNameStatic", "(", "$", "name", ",", "$", "object", ")", "{", "$", "property", "=", "null", ";", "if", "(", "property_exists", "(", "$", "object", ",", "$", "name", ")", ")", "{", "$", "property", "=", "$", ...
Search a property name in the current object with one or tow leading underscores @param string $name The property name to transform @param string|object $object The object or a class name to work on @return string The transformed property name
[ "Search", "a", "property", "name", "in", "the", "current", "object", "with", "one", "or", "tow", "leading", "underscores" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Object/AbstractInvokable.php#L427-L446
241,043
serlo/athene2-common
src/Common/src/Common/Validator/NotIdentical.php
NotIdentical.isValid
public function isValid($value, array $context = null) { $this->setValue($value); $token = $this->getToken(); if (!$this->getLiteral() && $context !== null) { if (is_array($token)) { while (is_array($token)) { $key = key($token); ...
php
public function isValid($value, array $context = null) { $this->setValue($value); $token = $this->getToken(); if (!$this->getLiteral() && $context !== null) { if (is_array($token)) { while (is_array($token)) { $key = key($token); ...
[ "public", "function", "isValid", "(", "$", "value", ",", "array", "$", "context", "=", "null", ")", "{", "$", "this", "->", "setValue", "(", "$", "value", ")", ";", "$", "token", "=", "$", "this", "->", "getToken", "(", ")", ";", "if", "(", "!", ...
Returns true if and only if a token has been set and the provided value matches that token. @param mixed $value @param array $context @return bool @throws Exception\RuntimeException if the token doesn't exist in the context array
[ "Returns", "true", "if", "and", "only", "if", "a", "token", "has", "been", "set", "and", "the", "provided", "value", "matches", "that", "token", "." ]
b7c4c9a127d9884b26bc7d288b2fe3aee6a9119c
https://github.com/serlo/athene2-common/blob/b7c4c9a127d9884b26bc7d288b2fe3aee6a9119c/src/Common/src/Common/Validator/NotIdentical.php#L37-L76
241,044
slickframework/mvc
src/Service/Entity/AbstractEntityService.php
AbstractEntityService.setEntityClass
public function setEntityClass($className) { if ( !class_exists($className) || !is_subclass_of($className, EntityInterface::class) ) { throw new InvalidEntityClassException( "Class '{$className}' does not implements the " . "Slick\O...
php
public function setEntityClass($className) { if ( !class_exists($className) || !is_subclass_of($className, EntityInterface::class) ) { throw new InvalidEntityClassException( "Class '{$className}' does not implements the " . "Slick\O...
[ "public", "function", "setEntityClass", "(", "$", "className", ")", "{", "if", "(", "!", "class_exists", "(", "$", "className", ")", "||", "!", "is_subclass_of", "(", "$", "className", ",", "EntityInterface", "::", "class", ")", ")", "{", "throw", "new", ...
Set FQ entity class name @param string $className @throws InvalidEntityClassException If the provided class name does not implements the Slick\Orm\EntityInterface interface. @return $this|self|AbstractEntityService
[ "Set", "FQ", "entity", "class", "name" ]
91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab
https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Service/Entity/AbstractEntityService.php#L46-L60
241,045
slickframework/mvc
src/Service/Entity/AbstractEntityService.php
AbstractEntityService.getEntityClassName
public function getEntityClassName() { if (null == $this->entityClass) { $this->setEntityClass(get_class($this->getEntity())); } return $this->entityClass; }
php
public function getEntityClassName() { if (null == $this->entityClass) { $this->setEntityClass(get_class($this->getEntity())); } return $this->entityClass; }
[ "public", "function", "getEntityClassName", "(", ")", "{", "if", "(", "null", "==", "$", "this", "->", "entityClass", ")", "{", "$", "this", "->", "setEntityClass", "(", "get_class", "(", "$", "this", "->", "getEntity", "(", ")", ")", ")", ";", "}", ...
Get the entity FQ class name @return string
[ "Get", "the", "entity", "FQ", "class", "name" ]
91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab
https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Service/Entity/AbstractEntityService.php#L80-L86
241,046
etcinit/tutum-php
src/Chromabits/TutumClient/ClientFactory.php
ClientFactory.makeFromEnvironment
public function makeFromEnvironment() { $env = new EnvUtils(); // Check that we have all variables we need if (!$env->hasBearerKey()) { throw new Exception( 'TUTUM_AUTH is not set. Unable to create from environment' ); } $client = new...
php
public function makeFromEnvironment() { $env = new EnvUtils(); // Check that we have all variables we need if (!$env->hasBearerKey()) { throw new Exception( 'TUTUM_AUTH is not set. Unable to create from environment' ); } $client = new...
[ "public", "function", "makeFromEnvironment", "(", ")", "{", "$", "env", "=", "new", "EnvUtils", "(", ")", ";", "// Check that we have all variables we need", "if", "(", "!", "$", "env", "->", "hasBearerKey", "(", ")", ")", "{", "throw", "new", "Exception", "...
Build a client using configuration from the environment @return Client @throws Exception
[ "Build", "a", "client", "using", "configuration", "from", "the", "environment" ]
39fb3375e0d47109a5da70a0e441efb8fd4f4008
https://github.com/etcinit/tutum-php/blob/39fb3375e0d47109a5da70a0e441efb8fd4f4008/src/Chromabits/TutumClient/ClientFactory.php#L24-L39
241,047
belgattitude/openstore-akilia
src/OpenstoreAkilia/Db/DbExecuter.php
DbExecuter.executeSQL
public function executeSQL($key, $query, $disable_foreign_key_checks = true, $entity=null) { if ($entity !== null && $entity != $this->last_entity) { $this->log("------------------------------------------------------"); $this->log("Entity: '$entity'"); $this->log("-------...
php
public function executeSQL($key, $query, $disable_foreign_key_checks = true, $entity=null) { if ($entity !== null && $entity != $this->last_entity) { $this->log("------------------------------------------------------"); $this->log("Entity: '$entity'"); $this->log("-------...
[ "public", "function", "executeSQL", "(", "$", "key", ",", "$", "query", ",", "$", "disable_foreign_key_checks", "=", "true", ",", "$", "entity", "=", "null", ")", "{", "if", "(", "$", "entity", "!==", "null", "&&", "$", "entity", "!=", "$", "this", "...
Execute a query on the database and logs it @throws Exception @param string $key name of the query @param string $query @param boolean $disable_foreign_key_checks @param string $entity @return void
[ "Execute", "a", "query", "on", "the", "database", "and", "logs", "it" ]
149b9abca971d20620d5003342cb50592a05d1fa
https://github.com/belgattitude/openstore-akilia/blob/149b9abca971d20620d5003342cb50592a05d1fa/src/OpenstoreAkilia/Db/DbExecuter.php#L51-L102
241,048
vpg/titon.common
src/Titon/Common/Traits/Configurable.php
Configurable.applyConfig
public function applyConfig(array $config = []) { $parent = $this; $defaults = isset($this->_config) ? $this->_config : []; // Inherit config from parents while ($parent = get_parent_class($parent)) { $props = get_class_vars($parent); if (isset($props['_config']...
php
public function applyConfig(array $config = []) { $parent = $this; $defaults = isset($this->_config) ? $this->_config : []; // Inherit config from parents while ($parent = get_parent_class($parent)) { $props = get_class_vars($parent); if (isset($props['_config']...
[ "public", "function", "applyConfig", "(", "array", "$", "config", "=", "[", "]", ")", "{", "$", "parent", "=", "$", "this", ";", "$", "defaults", "=", "isset", "(", "$", "this", "->", "_config", ")", "?", "$", "this", "->", "_config", ":", "[", "...
Merge the custom configuration with the defaults and inherit from parent classes. @uses Titon\Utility\Hash @param array $config @return $this
[ "Merge", "the", "custom", "configuration", "with", "the", "defaults", "and", "inherit", "from", "parent", "classes", "." ]
41fe62bd5134bf76db3ff9caa16f280d9d534ef9
https://github.com/vpg/titon.common/blob/41fe62bd5134bf76db3ff9caa16f280d9d534ef9/src/Titon/Common/Traits/Configurable.php#L56-L72
241,049
velkuns/eureka-package-user
src/User/DataMapper/Data/User/Abstracts/UserAbstract.php
UserAbstract.setEmail
public function setEmail($email) { $email = (string) $email; if ($this->exists() && $this->email !== $email) { $this->updated['email'] = true; } $this->email = $email; return $this; }
php
public function setEmail($email) { $email = (string) $email; if ($this->exists() && $this->email !== $email) { $this->updated['email'] = true; } $this->email = $email; return $this; }
[ "public", "function", "setEmail", "(", "$", "email", ")", "{", "$", "email", "=", "(", "string", ")", "$", "email", ";", "if", "(", "$", "this", "->", "exists", "(", ")", "&&", "$", "this", "->", "email", "!==", "$", "email", ")", "{", "$", "th...
Set value for field "user_email" @param string $email @return $this
[ "Set", "value", "for", "field", "user_email" ]
b5a60b5a234162558b390ee3d452e4254c790f2b
https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Data/User/Abstracts/UserAbstract.php#L248-L259
241,050
velkuns/eureka-package-user
src/User/DataMapper/Data/User/Abstracts/UserAbstract.php
UserAbstract.setPassword
public function setPassword($password) { $password = (string) $password; if ($this->exists() && $this->password !== $password) { $this->updated['password'] = true; } $this->password = $password; return $this; }
php
public function setPassword($password) { $password = (string) $password; if ($this->exists() && $this->password !== $password) { $this->updated['password'] = true; } $this->password = $password; return $this; }
[ "public", "function", "setPassword", "(", "$", "password", ")", "{", "$", "password", "=", "(", "string", ")", "$", "password", ";", "if", "(", "$", "this", "->", "exists", "(", ")", "&&", "$", "this", "->", "password", "!==", "$", "password", ")", ...
Set value for field "user_password" @param string $password @return $this
[ "Set", "value", "for", "field", "user_password" ]
b5a60b5a234162558b390ee3d452e4254c790f2b
https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Data/User/Abstracts/UserAbstract.php#L267-L278
241,051
velkuns/eureka-package-user
src/User/DataMapper/Data/User/Abstracts/UserAbstract.php
UserAbstract.setPseudo
public function setPseudo($pseudo) { $pseudo = (string) $pseudo; if ($this->exists() && $this->pseudo !== $pseudo) { $this->updated['pseudo'] = true; } $this->pseudo = $pseudo; return $this; }
php
public function setPseudo($pseudo) { $pseudo = (string) $pseudo; if ($this->exists() && $this->pseudo !== $pseudo) { $this->updated['pseudo'] = true; } $this->pseudo = $pseudo; return $this; }
[ "public", "function", "setPseudo", "(", "$", "pseudo", ")", "{", "$", "pseudo", "=", "(", "string", ")", "$", "pseudo", ";", "if", "(", "$", "this", "->", "exists", "(", ")", "&&", "$", "this", "->", "pseudo", "!==", "$", "pseudo", ")", "{", "$",...
Set value for field "user_pseudo" @param string $pseudo @return $this
[ "Set", "value", "for", "field", "user_pseudo" ]
b5a60b5a234162558b390ee3d452e4254c790f2b
https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Data/User/Abstracts/UserAbstract.php#L286-L297
241,052
velkuns/eureka-package-user
src/User/DataMapper/Data/User/Abstracts/UserAbstract.php
UserAbstract.setFirstname
public function setFirstname($firstname) { $firstname = ($firstname === null ? $firstname : (string) $firstname); if ($this->exists() && $this->firstname !== $firstname) { $this->updated['firstname'] = true; } $this->firstname = $firstname; return $this; }
php
public function setFirstname($firstname) { $firstname = ($firstname === null ? $firstname : (string) $firstname); if ($this->exists() && $this->firstname !== $firstname) { $this->updated['firstname'] = true; } $this->firstname = $firstname; return $this; }
[ "public", "function", "setFirstname", "(", "$", "firstname", ")", "{", "$", "firstname", "=", "(", "$", "firstname", "===", "null", "?", "$", "firstname", ":", "(", "string", ")", "$", "firstname", ")", ";", "if", "(", "$", "this", "->", "exists", "(...
Set value for field "user_firstname" @param string $firstname @return $this
[ "Set", "value", "for", "field", "user_firstname" ]
b5a60b5a234162558b390ee3d452e4254c790f2b
https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Data/User/Abstracts/UserAbstract.php#L305-L316
241,053
velkuns/eureka-package-user
src/User/DataMapper/Data/User/Abstracts/UserAbstract.php
UserAbstract.setLastname
public function setLastname($lastname) { $lastname = ($lastname === null ? $lastname : (string) $lastname); if ($this->exists() && $this->lastname !== $lastname) { $this->updated['lastname'] = true; } $this->lastname = $lastname; return $this; }
php
public function setLastname($lastname) { $lastname = ($lastname === null ? $lastname : (string) $lastname); if ($this->exists() && $this->lastname !== $lastname) { $this->updated['lastname'] = true; } $this->lastname = $lastname; return $this; }
[ "public", "function", "setLastname", "(", "$", "lastname", ")", "{", "$", "lastname", "=", "(", "$", "lastname", "===", "null", "?", "$", "lastname", ":", "(", "string", ")", "$", "lastname", ")", ";", "if", "(", "$", "this", "->", "exists", "(", "...
Set value for field "user_lastname" @param string $lastname @return $this
[ "Set", "value", "for", "field", "user_lastname" ]
b5a60b5a234162558b390ee3d452e4254c790f2b
https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Data/User/Abstracts/UserAbstract.php#L324-L335
241,054
velkuns/eureka-package-user
src/User/DataMapper/Data/User/Abstracts/UserAbstract.php
UserAbstract.setDateRegister
public function setDateRegister($dateRegister) { $dateRegister = ($dateRegister === null ? $dateRegister : (string) $dateRegister); if ($this->exists() && $this->dateRegister !== $dateRegister) { $this->updated['dateRegister'] = true; } $this->dateRegister = $dateRegist...
php
public function setDateRegister($dateRegister) { $dateRegister = ($dateRegister === null ? $dateRegister : (string) $dateRegister); if ($this->exists() && $this->dateRegister !== $dateRegister) { $this->updated['dateRegister'] = true; } $this->dateRegister = $dateRegist...
[ "public", "function", "setDateRegister", "(", "$", "dateRegister", ")", "{", "$", "dateRegister", "=", "(", "$", "dateRegister", "===", "null", "?", "$", "dateRegister", ":", "(", "string", ")", "$", "dateRegister", ")", ";", "if", "(", "$", "this", "->"...
Set value for field "user_date_register" @param string $dateRegister @return $this
[ "Set", "value", "for", "field", "user_date_register" ]
b5a60b5a234162558b390ee3d452e4254c790f2b
https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Data/User/Abstracts/UserAbstract.php#L343-L354
241,055
velkuns/eureka-package-user
src/User/DataMapper/Data/User/Abstracts/UserAbstract.php
UserAbstract.setIsActivated
public function setIsActivated($isActivated) { $isActivated = (int) $isActivated; if ($this->exists() && $this->isActivated !== $isActivated) { $this->updated['isActivated'] = true; } $this->isActivated = $isActivated; return $this; }
php
public function setIsActivated($isActivated) { $isActivated = (int) $isActivated; if ($this->exists() && $this->isActivated !== $isActivated) { $this->updated['isActivated'] = true; } $this->isActivated = $isActivated; return $this; }
[ "public", "function", "setIsActivated", "(", "$", "isActivated", ")", "{", "$", "isActivated", "=", "(", "int", ")", "$", "isActivated", ";", "if", "(", "$", "this", "->", "exists", "(", ")", "&&", "$", "this", "->", "isActivated", "!==", "$", "isActiv...
Set value for field "user_is_activated" @param int $isActivated @return $this
[ "Set", "value", "for", "field", "user_is_activated" ]
b5a60b5a234162558b390ee3d452e4254c790f2b
https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Data/User/Abstracts/UserAbstract.php#L362-L373
241,056
velkuns/eureka-package-user
src/User/DataMapper/Data/User/Abstracts/UserAbstract.php
UserAbstract.setDateActivation
public function setDateActivation($dateActivation) { $dateActivation = ($dateActivation === null ? $dateActivation : (string) $dateActivation); if ($this->exists() && $this->dateActivation !== $dateActivation) { $this->updated['dateActivation'] = true; } $this->dateActi...
php
public function setDateActivation($dateActivation) { $dateActivation = ($dateActivation === null ? $dateActivation : (string) $dateActivation); if ($this->exists() && $this->dateActivation !== $dateActivation) { $this->updated['dateActivation'] = true; } $this->dateActi...
[ "public", "function", "setDateActivation", "(", "$", "dateActivation", ")", "{", "$", "dateActivation", "=", "(", "$", "dateActivation", "===", "null", "?", "$", "dateActivation", ":", "(", "string", ")", "$", "dateActivation", ")", ";", "if", "(", "$", "t...
Set value for field "user_date_activation" @param string $dateActivation @return $this
[ "Set", "value", "for", "field", "user_date_activation" ]
b5a60b5a234162558b390ee3d452e4254c790f2b
https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Data/User/Abstracts/UserAbstract.php#L381-L392
241,057
velkuns/eureka-package-user
src/User/DataMapper/Data/User/Abstracts/UserAbstract.php
UserAbstract.setCodeActivation
public function setCodeActivation($codeActivation) { $codeActivation = ($codeActivation === null ? $codeActivation : (string) $codeActivation); if ($this->exists() && $this->codeActivation !== $codeActivation) { $this->updated['codeActivation'] = true; } $this->codeActi...
php
public function setCodeActivation($codeActivation) { $codeActivation = ($codeActivation === null ? $codeActivation : (string) $codeActivation); if ($this->exists() && $this->codeActivation !== $codeActivation) { $this->updated['codeActivation'] = true; } $this->codeActi...
[ "public", "function", "setCodeActivation", "(", "$", "codeActivation", ")", "{", "$", "codeActivation", "=", "(", "$", "codeActivation", "===", "null", "?", "$", "codeActivation", ":", "(", "string", ")", "$", "codeActivation", ")", ";", "if", "(", "$", "t...
Set value for field "user_code_activation" @param string $codeActivation @return $this
[ "Set", "value", "for", "field", "user_code_activation" ]
b5a60b5a234162558b390ee3d452e4254c790f2b
https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Data/User/Abstracts/UserAbstract.php#L400-L411
241,058
velkuns/eureka-package-user
src/User/DataMapper/Data/User/Abstracts/UserAbstract.php
UserAbstract.setAvatar
public function setAvatar($avatar) { $avatar = (string) $avatar; if ($this->exists() && $this->avatar !== $avatar) { $this->updated['avatar'] = true; } $this->avatar = $avatar; return $this; }
php
public function setAvatar($avatar) { $avatar = (string) $avatar; if ($this->exists() && $this->avatar !== $avatar) { $this->updated['avatar'] = true; } $this->avatar = $avatar; return $this; }
[ "public", "function", "setAvatar", "(", "$", "avatar", ")", "{", "$", "avatar", "=", "(", "string", ")", "$", "avatar", ";", "if", "(", "$", "this", "->", "exists", "(", ")", "&&", "$", "this", "->", "avatar", "!==", "$", "avatar", ")", "{", "$",...
Set value for field "user_avatar" @param string $avatar @return $this
[ "Set", "value", "for", "field", "user_avatar" ]
b5a60b5a234162558b390ee3d452e4254c790f2b
https://github.com/velkuns/eureka-package-user/blob/b5a60b5a234162558b390ee3d452e4254c790f2b/src/User/DataMapper/Data/User/Abstracts/UserAbstract.php#L419-L430
241,059
mattiasdelang/Bierdopje-PHP
src/Bierdopje.php
Bierdopje.getShowById
public function getShowById($showId) { $response = $this->request('/GetShowById/' . $showId); if ( $response->response->status == 'false' ) return null; $show = $response->response; $show = $this->formatShow($show); return $show; }
php
public function getShowById($showId) { $response = $this->request('/GetShowById/' . $showId); if ( $response->response->status == 'false' ) return null; $show = $response->response; $show = $this->formatShow($show); return $show; }
[ "public", "function", "getShowById", "(", "$", "showId", ")", "{", "$", "response", "=", "$", "this", "->", "request", "(", "'/GetShowById/'", ".", "$", "showId", ")", ";", "if", "(", "$", "response", "->", "response", "->", "status", "==", "'false'", ...
Get a show by Bierdopje showId @param $showId @return \SimpleXMLElement[]|\stdClass @throws \Exception
[ "Get", "a", "show", "by", "Bierdopje", "showId" ]
24ee72857c750da97546d92a16778840bf294e69
https://github.com/mattiasdelang/Bierdopje-PHP/blob/24ee72857c750da97546d92a16778840bf294e69/src/Bierdopje.php#L45-L55
241,060
mattiasdelang/Bierdopje-PHP
src/Bierdopje.php
Bierdopje.findShowByName
public function findShowByName($showName) { $response = $this->request('/FindShowByName/' . $showName); if ( $response->response->status == 'false' ) return null; $shows = $response->response->results->result; if ( count($shows) <= 0 ) return null; $show = $shows[0]; $show = $thi...
php
public function findShowByName($showName) { $response = $this->request('/FindShowByName/' . $showName); if ( $response->response->status == 'false' ) return null; $shows = $response->response->results->result; if ( count($shows) <= 0 ) return null; $show = $shows[0]; $show = $thi...
[ "public", "function", "findShowByName", "(", "$", "showName", ")", "{", "$", "response", "=", "$", "this", "->", "request", "(", "'/FindShowByName/'", ".", "$", "showName", ")", ";", "if", "(", "$", "response", "->", "response", "->", "status", "==", "'f...
Search a show by name @param $showName @return null|\stdClass @throws \Exception
[ "Search", "a", "show", "by", "name" ]
24ee72857c750da97546d92a16778840bf294e69
https://github.com/mattiasdelang/Bierdopje-PHP/blob/24ee72857c750da97546d92a16778840bf294e69/src/Bierdopje.php#L65-L79
241,061
mattiasdelang/Bierdopje-PHP
src/Bierdopje.php
Bierdopje.getShowByName
public function getShowByName($showName, $isLinkName = false) { $response = $this->request('/GetShowByName/' . $showName . '/' . $isLinkName); if ( $response->response->status == 'false' ) return null; $show = $response->response; $show = $this->formatShow($show); return $show; }
php
public function getShowByName($showName, $isLinkName = false) { $response = $this->request('/GetShowByName/' . $showName . '/' . $isLinkName); if ( $response->response->status == 'false' ) return null; $show = $response->response; $show = $this->formatShow($show); return $show; }
[ "public", "function", "getShowByName", "(", "$", "showName", ",", "$", "isLinkName", "=", "false", ")", "{", "$", "response", "=", "$", "this", "->", "request", "(", "'/GetShowByName/'", ".", "$", "showName", ".", "'/'", ".", "$", "isLinkName", ")", ";",...
Get a show by exact name. @param string $showName @param bool $isLinkName @return null|\stdClass @throws \Exception
[ "Get", "a", "show", "by", "exact", "name", "." ]
24ee72857c750da97546d92a16778840bf294e69
https://github.com/mattiasdelang/Bierdopje-PHP/blob/24ee72857c750da97546d92a16778840bf294e69/src/Bierdopje.php#L90-L100
241,062
mattiasdelang/Bierdopje-PHP
src/Bierdopje.php
Bierdopje.getShowByTvdbId
public function getShowByTvdbId($tvdbId) { $response = $this->request('/GetShowByTVDBID/' . $tvdbId); if ( $response->response->status == 'false' ) return null; $show = $this->formatShow($response->response); return $show; }
php
public function getShowByTvdbId($tvdbId) { $response = $this->request('/GetShowByTVDBID/' . $tvdbId); if ( $response->response->status == 'false' ) return null; $show = $this->formatShow($response->response); return $show; }
[ "public", "function", "getShowByTvdbId", "(", "$", "tvdbId", ")", "{", "$", "response", "=", "$", "this", "->", "request", "(", "'/GetShowByTVDBID/'", ".", "$", "tvdbId", ")", ";", "if", "(", "$", "response", "->", "response", "->", "status", "==", "'fal...
Search a show by a TVDB showId @param $tvdbId @return \stdClass @throws \Exception
[ "Search", "a", "show", "by", "a", "TVDB", "showId" ]
24ee72857c750da97546d92a16778840bf294e69
https://github.com/mattiasdelang/Bierdopje-PHP/blob/24ee72857c750da97546d92a16778840bf294e69/src/Bierdopje.php#L110-L118
241,063
mattiasdelang/Bierdopje-PHP
src/Bierdopje.php
Bierdopje.getEpisodesOfSeason
public function getEpisodesOfSeason($showId, $season) { $response = $this->request('/GetEpisodesForSeason/' . $showId . '/' . $season); if ( $response->response->status == 'false' ) return null; $episodes = $response->response->results->result; if ( count($episodes) <= 0 ) return null; ...
php
public function getEpisodesOfSeason($showId, $season) { $response = $this->request('/GetEpisodesForSeason/' . $showId . '/' . $season); if ( $response->response->status == 'false' ) return null; $episodes = $response->response->results->result; if ( count($episodes) <= 0 ) return null; ...
[ "public", "function", "getEpisodesOfSeason", "(", "$", "showId", ",", "$", "season", ")", "{", "$", "response", "=", "$", "this", "->", "request", "(", "'/GetEpisodesForSeason/'", ".", "$", "showId", ".", "'/'", ".", "$", "season", ")", ";", "if", "(", ...
Search episodes by season and Bierdopje showId @param $showId @param $season @return array|null @throws \Exception
[ "Search", "episodes", "by", "season", "and", "Bierdopje", "showId" ]
24ee72857c750da97546d92a16778840bf294e69
https://github.com/mattiasdelang/Bierdopje-PHP/blob/24ee72857c750da97546d92a16778840bf294e69/src/Bierdopje.php#L129-L144
241,064
mattiasdelang/Bierdopje-PHP
src/Bierdopje.php
Bierdopje.getEpisodeById
public function getEpisodeById($episodeId) { $response = $this->request('/GetEpisodeById/' . $episodeId); if ( $response->response->status == 'false' ) return null; if ($response->response->cached == 'false') { $episode = $response->response; } else { $episode = $response->response...
php
public function getEpisodeById($episodeId) { $response = $this->request('/GetEpisodeById/' . $episodeId); if ( $response->response->status == 'false' ) return null; if ($response->response->cached == 'false') { $episode = $response->response; } else { $episode = $response->response...
[ "public", "function", "getEpisodeById", "(", "$", "episodeId", ")", "{", "$", "response", "=", "$", "this", "->", "request", "(", "'/GetEpisodeById/'", ".", "$", "episodeId", ")", ";", "if", "(", "$", "response", "->", "response", "->", "status", "==", "...
Search an episode by its Bierdopje Id @param $episodeId @return \stdClass @throws \Exception
[ "Search", "an", "episode", "by", "its", "Bierdopje", "Id" ]
24ee72857c750da97546d92a16778840bf294e69
https://github.com/mattiasdelang/Bierdopje-PHP/blob/24ee72857c750da97546d92a16778840bf294e69/src/Bierdopje.php#L179-L192
241,065
mattiasdelang/Bierdopje-PHP
src/Bierdopje.php
Bierdopje.formatEpisode
private function formatEpisode($original) { $show = new \stdClass(); $show->id = (int) $original->episodeid; $show->tvdbId = (int) $original->tvdbid; $show->title = (string) $original->title; $show->showlink = (string) $original->showlink; $show->episodelink = (string) ...
php
private function formatEpisode($original) { $show = new \stdClass(); $show->id = (int) $original->episodeid; $show->tvdbId = (int) $original->tvdbid; $show->title = (string) $original->title; $show->showlink = (string) $original->showlink; $show->episodelink = (string) ...
[ "private", "function", "formatEpisode", "(", "$", "original", ")", "{", "$", "show", "=", "new", "\\", "stdClass", "(", ")", ";", "$", "show", "->", "id", "=", "(", "int", ")", "$", "original", "->", "episodeid", ";", "$", "show", "->", "tvdbId", "...
Format an Episode response @param $original @return \stdClass
[ "Format", "an", "Episode", "response" ]
24ee72857c750da97546d92a16778840bf294e69
https://github.com/mattiasdelang/Bierdopje-PHP/blob/24ee72857c750da97546d92a16778840bf294e69/src/Bierdopje.php#L201-L224
241,066
mattiasdelang/Bierdopje-PHP
src/Bierdopje.php
Bierdopje.formatShow
private function formatShow($original) { $show = new \stdClass(); $show->id = (int) $original->showid; $show->tvdbId = (int) $original->tvdbid; $show->name = (string) $original->showname; $show->link = (string) $original->showlink; $show->firstAired = strlen($orig...
php
private function formatShow($original) { $show = new \stdClass(); $show->id = (int) $original->showid; $show->tvdbId = (int) $original->tvdbid; $show->name = (string) $original->showname; $show->link = (string) $original->showlink; $show->firstAired = strlen($orig...
[ "private", "function", "formatShow", "(", "$", "original", ")", "{", "$", "show", "=", "new", "\\", "stdClass", "(", ")", ";", "$", "show", "->", "id", "=", "(", "int", ")", "$", "original", "->", "showid", ";", "$", "show", "->", "tvdbId", "=", ...
Format a Show response @param $original @return \stdClass
[ "Format", "a", "Show", "response" ]
24ee72857c750da97546d92a16778840bf294e69
https://github.com/mattiasdelang/Bierdopje-PHP/blob/24ee72857c750da97546d92a16778840bf294e69/src/Bierdopje.php#L233-L269
241,067
mattiasdelang/Bierdopje-PHP
src/Bierdopje.php
Bierdopje.request
protected function request($path) { $response = $this->client->get($this->url . $path); if ( $response->getStatusCode() != 200 ) throw new \Exception('Bierdopje.com not available'); $response = $this->xmlToObj($response->getBody()); return $response; }
php
protected function request($path) { $response = $this->client->get($this->url . $path); if ( $response->getStatusCode() != 200 ) throw new \Exception('Bierdopje.com not available'); $response = $this->xmlToObj($response->getBody()); return $response; }
[ "protected", "function", "request", "(", "$", "path", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "get", "(", "$", "this", "->", "url", ".", "$", "path", ")", ";", "if", "(", "$", "response", "->", "getStatusCode", "(", ")", ...
Make an HTTP request and format the XML resposne @param $path @return \SimpleXMLElement @throws \Exception
[ "Make", "an", "HTTP", "request", "and", "format", "the", "XML", "resposne" ]
24ee72857c750da97546d92a16778840bf294e69
https://github.com/mattiasdelang/Bierdopje-PHP/blob/24ee72857c750da97546d92a16778840bf294e69/src/Bierdopje.php#L279-L289
241,068
mattiasdelang/Bierdopje-PHP
src/Bierdopje.php
Bierdopje.xmlToObj
private function xmlToObj($fileContents) { $fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents); $fileContents = trim(str_replace('"', "'", $fileContents)); $simpleXml = simplexml_load_string($fileContents, null, LIBXML_NOCDATA); return $simpleXml; }
php
private function xmlToObj($fileContents) { $fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents); $fileContents = trim(str_replace('"', "'", $fileContents)); $simpleXml = simplexml_load_string($fileContents, null, LIBXML_NOCDATA); return $simpleXml; }
[ "private", "function", "xmlToObj", "(", "$", "fileContents", ")", "{", "$", "fileContents", "=", "str_replace", "(", "array", "(", "\"\\n\"", ",", "\"\\r\"", ",", "\"\\t\"", ")", ",", "''", ",", "$", "fileContents", ")", ";", "$", "fileContents", "=", "t...
Convert XML string to object @param $fileContents @return \SimpleXMLElement
[ "Convert", "XML", "string", "to", "object" ]
24ee72857c750da97546d92a16778840bf294e69
https://github.com/mattiasdelang/Bierdopje-PHP/blob/24ee72857c750da97546d92a16778840bf294e69/src/Bierdopje.php#L298-L305
241,069
jivoo/core
src/Binary.php
Binary.slice
public static function slice($string, $start, $length = null) { if (function_exists('mb_substr')) { return mb_substr($string, $start, $length, '8bit'); } return substr($string, $start, $length); }
php
public static function slice($string, $start, $length = null) { if (function_exists('mb_substr')) { return mb_substr($string, $start, $length, '8bit'); } return substr($string, $start, $length); }
[ "public", "static", "function", "slice", "(", "$", "string", ",", "$", "start", ",", "$", "length", "=", "null", ")", "{", "if", "(", "function_exists", "(", "'mb_substr'", ")", ")", "{", "return", "mb_substr", "(", "$", "string", ",", "$", "start", ...
Returns the portion of byte string specified by the start and length parameters. @param string $string String. @param int $start Offset to start at. @param int $length Optional length of slice. @return string Slice.
[ "Returns", "the", "portion", "of", "byte", "string", "specified", "by", "the", "start", "and", "length", "parameters", "." ]
4ef3445068f0ff9c0a6512cb741831a847013b76
https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Binary.php#L48-L54
241,070
jivoo/core
src/Binary.php
Binary.base64Encode
public static function base64Encode($data, $url = false) { if ($url) { return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); } else { return base64_encode($data); } }
php
public static function base64Encode($data, $url = false) { if ($url) { return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); } else { return base64_encode($data); } }
[ "public", "static", "function", "base64Encode", "(", "$", "data", ",", "$", "url", "=", "false", ")", "{", "if", "(", "$", "url", ")", "{", "return", "rtrim", "(", "strtr", "(", "base64_encode", "(", "$", "data", ")", ",", "'+/'", ",", "'-_'", ")",...
Encode binary data using base64. @param string $data String. @param bool $url 'base64url' standard. Removes padding and replaces '+' and '/' with '-' and '_'. @return string Base64 encoded string.
[ "Encode", "binary", "data", "using", "base64", "." ]
4ef3445068f0ff9c0a6512cb741831a847013b76
https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Binary.php#L66-L73
241,071
jivoo/core
src/Binary.php
Binary.base64Decode
public static function base64Decode($data, $url = true) { if ($url) { return base64_decode(strtr($data, '-_', '+/')); } else { return base64_decode($data); } }
php
public static function base64Decode($data, $url = true) { if ($url) { return base64_decode(strtr($data, '-_', '+/')); } else { return base64_decode($data); } }
[ "public", "static", "function", "base64Decode", "(", "$", "data", ",", "$", "url", "=", "true", ")", "{", "if", "(", "$", "url", ")", "{", "return", "base64_decode", "(", "strtr", "(", "$", "data", ",", "'-_'", ",", "'+/'", ")", ")", ";", "}", "e...
Decode base64 encoded string. @param string $data Base64 encoded string.. @param bool $url Whether to replace '-' and '_' with '+' and '/'. @return string Original string.
[ "Decode", "base64", "encoded", "string", "." ]
4ef3445068f0ff9c0a6512cb741831a847013b76
https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Binary.php#L84-L91
241,072
marc1706/otp-authenticate
lib/OTPAuthenticate.php
OTPAuthenticate.generateCode
public function generateCode($secret, $counter, $algorithm = 'sha512') { $key = $this->base32->decode($secret); if (empty($counter)) { return ''; } $hash = hash_hmac($algorithm, $this->getBinaryCounter($counter), $key, true); return str_pad($this->truncate($hash), $this->code_length, '0', STR_PAD_LEF...
php
public function generateCode($secret, $counter, $algorithm = 'sha512') { $key = $this->base32->decode($secret); if (empty($counter)) { return ''; } $hash = hash_hmac($algorithm, $this->getBinaryCounter($counter), $key, true); return str_pad($this->truncate($hash), $this->code_length, '0', STR_PAD_LEF...
[ "public", "function", "generateCode", "(", "$", "secret", ",", "$", "counter", ",", "$", "algorithm", "=", "'sha512'", ")", "{", "$", "key", "=", "$", "this", "->", "base32", "->", "decode", "(", "$", "secret", ")", ";", "if", "(", "empty", "(", "$...
Generates code based on timestamp and secret @param string $secret Secret shared with user @param int $counter Counter for code generation @param string $algorithm Algorithm to use for HMAC hash. Defaults to sha512. The following hash types are allowed: TOTP: sha1, sha256, sha512 HOTP: sha1 @return string Generated O...
[ "Generates", "code", "based", "on", "timestamp", "and", "secret" ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPAuthenticate.php#L56-L68
241,073
marc1706/otp-authenticate
lib/OTPAuthenticate.php
OTPAuthenticate.checkTOTP
public function checkTOTP($secret, $code, $hash_type = 'sha512') { $time = $this->getTimestampCounter(time()); for ($i = -1; $i <= 1; $i++) { if ($this->stringCompare($code, $this->generateCode($secret, $time + $i, $hash_type)) === true) { return true; } } return false; }
php
public function checkTOTP($secret, $code, $hash_type = 'sha512') { $time = $this->getTimestampCounter(time()); for ($i = -1; $i <= 1; $i++) { if ($this->stringCompare($code, $this->generateCode($secret, $time + $i, $hash_type)) === true) { return true; } } return false; }
[ "public", "function", "checkTOTP", "(", "$", "secret", ",", "$", "code", ",", "$", "hash_type", "=", "'sha512'", ")", "{", "$", "time", "=", "$", "this", "->", "getTimestampCounter", "(", "time", "(", ")", ")", ";", "for", "(", "$", "i", "=", "-", ...
Check if supplied TOTP code is valid @param string $secret Secret to use for comparison @param int $code Supplied TOTP code @param string $hash_type Hash type @return bool True if code is valid, false if not
[ "Check", "if", "supplied", "TOTP", "code", "is", "valid" ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPAuthenticate.php#L79-L92
241,074
marc1706/otp-authenticate
lib/OTPAuthenticate.php
OTPAuthenticate.checkHOTP
public function checkHOTP($secret, $counter, $code, $hash_type = 'sha512') { return $this->stringCompare($code, $this->generateCode($secret, $counter, $hash_type)); }
php
public function checkHOTP($secret, $counter, $code, $hash_type = 'sha512') { return $this->stringCompare($code, $this->generateCode($secret, $counter, $hash_type)); }
[ "public", "function", "checkHOTP", "(", "$", "secret", ",", "$", "counter", ",", "$", "code", ",", "$", "hash_type", "=", "'sha512'", ")", "{", "return", "$", "this", "->", "stringCompare", "(", "$", "code", ",", "$", "this", "->", "generateCode", "(",...
Check if supplied HOTP code is valid @param string $secret Secret to use for comparison @param int $counter Current counter @param int $code Supplied HOTP code @param string $hash_type Hash type @return bool True if code is valid, false if not
[ "Check", "if", "supplied", "HOTP", "code", "is", "valid" ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPAuthenticate.php#L104-L107
241,075
marc1706/otp-authenticate
lib/OTPAuthenticate.php
OTPAuthenticate.truncate
protected function truncate($hash) { $truncated_hash = 0; $offset = ord(substr($hash, -1)) & 0xF; // Truncate hash using supplied sha1 hash for ($i = 0; $i < 4; ++$i) { $truncated_hash <<= 8; $truncated_hash |= ord($hash[$offset + $i]); } // Truncate to a smaller number of digits. $truncated_h...
php
protected function truncate($hash) { $truncated_hash = 0; $offset = ord(substr($hash, -1)) & 0xF; // Truncate hash using supplied sha1 hash for ($i = 0; $i < 4; ++$i) { $truncated_hash <<= 8; $truncated_hash |= ord($hash[$offset + $i]); } // Truncate to a smaller number of digits. $truncated_h...
[ "protected", "function", "truncate", "(", "$", "hash", ")", "{", "$", "truncated_hash", "=", "0", ";", "$", "offset", "=", "ord", "(", "substr", "(", "$", "hash", ",", "-", "1", ")", ")", "&", "0xF", ";", "// Truncate hash using supplied sha1 hash", "for...
Truncate HMAC hash to binary for generating a TOTP code @param string $hash HMAC hash @return int Truncated binary hash
[ "Truncate", "HMAC", "hash", "to", "binary", "for", "generating", "a", "TOTP", "code" ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPAuthenticate.php#L116-L133
241,076
marc1706/otp-authenticate
lib/OTPAuthenticate.php
OTPAuthenticate.stringCompare
public function stringCompare($string_a, $string_b) { $diff = strlen($string_a) ^ strlen($string_b); for ($i = 0; $i < strlen($string_a) && $i < strlen($string_b); $i++) { $diff |= ord($string_a[$i]) ^ ord($string_b[$i]); } return $diff === 0; }
php
public function stringCompare($string_a, $string_b) { $diff = strlen($string_a) ^ strlen($string_b); for ($i = 0; $i < strlen($string_a) && $i < strlen($string_b); $i++) { $diff |= ord($string_a[$i]) ^ ord($string_b[$i]); } return $diff === 0; }
[ "public", "function", "stringCompare", "(", "$", "string_a", ",", "$", "string_b", ")", "{", "$", "diff", "=", "strlen", "(", "$", "string_a", ")", "^", "strlen", "(", "$", "string_b", ")", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<",...
Compare two strings in constant time to prevent timing attacks. @param string $string_a Initial string @param string $string_b String to compare initial string to @return bool True if strings are the same, false if not
[ "Compare", "two", "strings", "in", "constant", "time", "to", "prevent", "timing", "attacks", "." ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPAuthenticate.php#L167-L177
241,077
marc1706/otp-authenticate
lib/OTPAuthenticate.php
OTPAuthenticate.generateSecret
public function generateSecret($length = 10) { $strong_secret = false; // Try to get $crypto_strong to evaluate to true. Give it 5 tries. for ($i = 0; $i < 5; $i++) { $secret = openssl_random_pseudo_bytes($length, $strong_secret); if ($strong_secret === true) { return $this->base32->encode($secr...
php
public function generateSecret($length = 10) { $strong_secret = false; // Try to get $crypto_strong to evaluate to true. Give it 5 tries. for ($i = 0; $i < 5; $i++) { $secret = openssl_random_pseudo_bytes($length, $strong_secret); if ($strong_secret === true) { return $this->base32->encode($secr...
[ "public", "function", "generateSecret", "(", "$", "length", "=", "10", ")", "{", "$", "strong_secret", "=", "false", ";", "// Try to get $crypto_strong to evaluate to true. Give it 5 tries.", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "5", ";", "$", ...
Generate secret with specified length @param int $length @return string
[ "Generate", "secret", "with", "specified", "length" ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPAuthenticate.php#L186-L202
241,078
dlabas/DlcDiagramm
src/DlcDiagramm/Diagramm/Dependency.php
Dependency.getIdentifier
public function getIdentifier() { $identifier = $this->getFromNode()->getIdentifier() . '-' . $this->getType() . '-' . $this->getToNode()->getIdentifier(); return $identifier; }
php
public function getIdentifier() { $identifier = $this->getFromNode()->getIdentifier() . '-' . $this->getType() . '-' . $this->getToNode()->getIdentifier(); return $identifier; }
[ "public", "function", "getIdentifier", "(", ")", "{", "$", "identifier", "=", "$", "this", "->", "getFromNode", "(", ")", "->", "getIdentifier", "(", ")", ".", "'-'", ".", "$", "this", "->", "getType", "(", ")", ".", "'-'", ".", "$", "this", "->", ...
Returns the unique identifier of this node @return string
[ "Returns", "the", "unique", "identifier", "of", "this", "node" ]
a8d6e6ad01943512fd9e4799278c031332a86400
https://github.com/dlabas/DlcDiagramm/blob/a8d6e6ad01943512fd9e4799278c031332a86400/src/DlcDiagramm/Diagramm/Dependency.php#L78-L87
241,079
Niirrty/Niirrty.Translation
src/Translator.php
Translator.addSource
public function addSource( string $sourceName, ISource $source ) : Translator { $source->setLocale( $this->_locale ); $this->_sources[ $sourceName ] = $source; return $this; }
php
public function addSource( string $sourceName, ISource $source ) : Translator { $source->setLocale( $this->_locale ); $this->_sources[ $sourceName ] = $source; return $this; }
[ "public", "function", "addSource", "(", "string", "$", "sourceName", ",", "ISource", "$", "source", ")", ":", "Translator", "{", "$", "source", "->", "setLocale", "(", "$", "this", "->", "_locale", ")", ";", "$", "this", "->", "_sources", "[", "$", "so...
Adds a source with an associated name. @param string $sourceName The unique source name @param \Niirrty\Translation\Sources\ISource $source @return \Niirrty\Translation\Translator
[ "Adds", "a", "source", "with", "an", "associated", "name", "." ]
5b1ad27fb87c14435edd2dc03e9af46dd5062de8
https://github.com/Niirrty/Niirrty.Translation/blob/5b1ad27fb87c14435edd2dc03e9af46dd5062de8/src/Translator.php#L120-L129
241,080
Niirrty/Niirrty.Translation
src/Translator.php
Translator.read
public function read( $identifier, ?string $sourceName = null, $defaultTranslation = false ) { if ( null !== $sourceName && isset( $this->_sources[ $sourceName ] ) ) { // read from specific source return $this->_sources[ $sourceName ]->read( $identifier, $defaultTranslation ); } ...
php
public function read( $identifier, ?string $sourceName = null, $defaultTranslation = false ) { if ( null !== $sourceName && isset( $this->_sources[ $sourceName ] ) ) { // read from specific source return $this->_sources[ $sourceName ]->read( $identifier, $defaultTranslation ); } ...
[ "public", "function", "read", "(", "$", "identifier", ",", "?", "string", "$", "sourceName", "=", "null", ",", "$", "defaultTranslation", "=", "false", ")", "{", "if", "(", "null", "!==", "$", "sourceName", "&&", "isset", "(", "$", "this", "->", "_sour...
Reads the translation and return it. The returned translation can be of each known type, depending to the requirements. If a valid source index is defined, only this source is used. @param string|int $identifier The translation identifier @param string|null $sourceName The name of the source or NULL for search all ...
[ "Reads", "the", "translation", "and", "return", "it", "." ]
5b1ad27fb87c14435edd2dc03e9af46dd5062de8
https://github.com/Niirrty/Niirrty.Translation/blob/5b1ad27fb87c14435edd2dc03e9af46dd5062de8/src/Translator.php#L172-L192
241,081
Niirrty/Niirrty.Translation
src/Translator.php
Translator.GetInstance
public static function GetInstance() : Translator { if ( null === self::$_instance ) { self::$_instance = new Translator(); } return self::$_instance; }
php
public static function GetInstance() : Translator { if ( null === self::$_instance ) { self::$_instance = new Translator(); } return self::$_instance; }
[ "public", "static", "function", "GetInstance", "(", ")", ":", "Translator", "{", "if", "(", "null", "===", "self", "::", "$", "_instance", ")", "{", "self", "::", "$", "_instance", "=", "new", "Translator", "(", ")", ";", "}", "return", "self", "::", ...
Gets the global Translator instance. If none is define a empty one is created. @return \Niirrty\Translation\Translator @throws TranslationException
[ "Gets", "the", "global", "Translator", "instance", ".", "If", "none", "is", "define", "a", "empty", "one", "is", "created", "." ]
5b1ad27fb87c14435edd2dc03e9af46dd5062de8
https://github.com/Niirrty/Niirrty.Translation/blob/5b1ad27fb87c14435edd2dc03e9af46dd5062de8/src/Translator.php#L303-L313
241,082
vinala/kernel
src/MVC/Model/ORM.php
ORM.emptyConstruct
private function emptyConstruct() { $this->getModel(); $this->getTable(); $this->columns(); $this->key(); $this->_state = CRUD::CREATE_STAT; }
php
private function emptyConstruct() { $this->getModel(); $this->getTable(); $this->columns(); $this->key(); $this->_state = CRUD::CREATE_STAT; }
[ "private", "function", "emptyConstruct", "(", ")", "{", "$", "this", "->", "getModel", "(", ")", ";", "$", "this", "->", "getTable", "(", ")", ";", "$", "this", "->", "columns", "(", ")", ";", "$", "this", "->", "key", "(", ")", ";", "$", "this",...
the empty constructor.
[ "the", "empty", "constructor", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L183-L190
241,083
vinala/kernel
src/MVC/Model/ORM.php
ORM.mainConstruct
private function mainConstruct($key = null, $fail = false) { $this->getModel(); $this->getTable(); $this->columns(); $this->key(); if (!is_null($key)) { $this->struct($key, $fail); $this->_state = CRUD::UPDATE_STAT; } else { $this->...
php
private function mainConstruct($key = null, $fail = false) { $this->getModel(); $this->getTable(); $this->columns(); $this->key(); if (!is_null($key)) { $this->struct($key, $fail); $this->_state = CRUD::UPDATE_STAT; } else { $this->...
[ "private", "function", "mainConstruct", "(", "$", "key", "=", "null", ",", "$", "fail", "=", "false", ")", "{", "$", "this", "->", "getModel", "(", ")", ";", "$", "this", "->", "getTable", "(", ")", ";", "$", "this", "->", "columns", "(", ")", ";...
the main constructor to search that from database. @param int $key @param bool $fail
[ "the", "main", "constructor", "to", "search", "that", "from", "database", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L198-L210
241,084
vinala/kernel
src/MVC/Model/ORM.php
ORM.secondConstruct
private function secondConstruct($data) { $this->getModel($data); $this->getTable($data); $this->columns($data); $this->key($data); $this->fill($data); $this->_state = CRUD::UPDATE_STAT; }
php
private function secondConstruct($data) { $this->getModel($data); $this->getTable($data); $this->columns($data); $this->key($data); $this->fill($data); $this->_state = CRUD::UPDATE_STAT; }
[ "private", "function", "secondConstruct", "(", "$", "data", ")", "{", "$", "this", "->", "getModel", "(", "$", "data", ")", ";", "$", "this", "->", "getTable", "(", "$", "data", ")", ";", "$", "this", "->", "columns", "(", "$", "data", ")", ";", ...
the second Construct to fil data from array. @param array $data
[ "the", "second", "Construct", "to", "fil", "data", "from", "array", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L217-L225
241,085
vinala/kernel
src/MVC/Model/ORM.php
ORM.getTable
protected function getTable($data = null) { if (is_null($data)) { $this->_table = static::$table; $this->_prifixTable = (Config::get('database.prefixing') ? Config::get('database.prefixe') : '').static::$table; // if (!$this->checkTable()) { th...
php
protected function getTable($data = null) { if (is_null($data)) { $this->_table = static::$table; $this->_prifixTable = (Config::get('database.prefixing') ? Config::get('database.prefixe') : '').static::$table; // if (!$this->checkTable()) { th...
[ "protected", "function", "getTable", "(", "$", "data", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "data", ")", ")", "{", "$", "this", "->", "_table", "=", "static", "::", "$", "table", ";", "$", "this", "->", "_prifixTable", "=", "(", ...
get the model table name. @param $table @return null
[ "get", "the", "model", "table", "name", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L286-L301
241,086
vinala/kernel
src/MVC/Model/ORM.php
ORM.checkTable
protected function checkTable() { $data = Query::from('information_schema.tables', false) ->select('*') ->where('TABLE_SCHEMA', '=', Config::get('database.database')) ->andwhere('TABLE_NAME', '=', $this->_prifixTable) ->get(Query::GET_ARRAY); // ...
php
protected function checkTable() { $data = Query::from('information_schema.tables', false) ->select('*') ->where('TABLE_SCHEMA', '=', Config::get('database.database')) ->andwhere('TABLE_NAME', '=', $this->_prifixTable) ->get(Query::GET_ARRAY); // ...
[ "protected", "function", "checkTable", "(", ")", "{", "$", "data", "=", "Query", "::", "from", "(", "'information_schema.tables'", ",", "false", ")", "->", "select", "(", "'*'", ")", "->", "where", "(", "'TABLE_SCHEMA'", ",", "'='", ",", "Config", "::", ...
Check if table exists in database. @param $table string @return bool
[ "Check", "if", "table", "exists", "in", "database", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L310-L319
241,087
vinala/kernel
src/MVC/Model/ORM.php
ORM.columns
protected function columns($data = null) { if (is_null($data)) { $this->_columns = $this->extruct( Query::from('INFORMATION_SCHEMA.COLUMNS', false) ->select('COLUMN_NAME') ->where('TABLE_SCHEMA', '=', Config::get('database.database')) ...
php
protected function columns($data = null) { if (is_null($data)) { $this->_columns = $this->extruct( Query::from('INFORMATION_SCHEMA.COLUMNS', false) ->select('COLUMN_NAME') ->where('TABLE_SCHEMA', '=', Config::get('database.database')) ...
[ "protected", "function", "columns", "(", "$", "data", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "data", ")", ")", "{", "$", "this", "->", "_columns", "=", "$", "this", "->", "extruct", "(", "Query", "::", "from", "(", "'INFORMATION_SCHEM...
to get and set all columns of data table. @return array
[ "to", "get", "and", "set", "all", "columns", "of", "data", "table", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L326-L341
241,088
vinala/kernel
src/MVC/Model/ORM.php
ORM.key
protected function key($data = null) { if (is_null($data)) { $data = $this->getPK(); // if (Table::count($data) > 1) { throw new ManyPrimaryKeysException(); } elseif (Table::count($data) == 0) { throw new PrimaryKeyNotFoundExcep...
php
protected function key($data = null) { if (is_null($data)) { $data = $this->getPK(); // if (Table::count($data) > 1) { throw new ManyPrimaryKeysException(); } elseif (Table::count($data) == 0) { throw new PrimaryKeyNotFoundExcep...
[ "protected", "function", "key", "(", "$", "data", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "data", ")", ")", "{", "$", "data", "=", "$", "this", "->", "getPK", "(", ")", ";", "//", "if", "(", "Table", "::", "count", "(", "$", "d...
set primary key the framework doesn't support more the column to be the primary key otherwise exception will be thrown. @return null
[ "set", "primary", "key", "the", "framework", "doesn", "t", "support", "more", "the", "column", "to", "be", "the", "primary", "key", "otherwise", "exception", "will", "be", "thrown", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L446-L463
241,089
vinala/kernel
src/MVC/Model/ORM.php
ORM.struct
protected function struct($key, $fail) { $data = $this->dig($key); // if (Table::count($data) == 1) { if ($this->_canKept && $this->keptAt($data)) { $this->_kept = true; } if ($this->_canStashed && $this->stashedAt($data)) { ...
php
protected function struct($key, $fail) { $data = $this->dig($key); // if (Table::count($data) == 1) { if ($this->_canKept && $this->keptAt($data)) { $this->_kept = true; } if ($this->_canStashed && $this->stashedAt($data)) { ...
[ "protected", "function", "struct", "(", "$", "key", ",", "$", "fail", ")", "{", "$", "data", "=", "$", "this", "->", "dig", "(", "$", "key", ")", ";", "//", "if", "(", "Table", "::", "count", "(", "$", "data", ")", "==", "1", ")", "{", "if", ...
get data from data table according to primary key value. @param int $key @return null
[ "get", "data", "from", "data", "table", "according", "to", "primary", "key", "value", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L472-L488
241,090
vinala/kernel
src/MVC/Model/ORM.php
ORM.fill
protected function fill($data) { if ($this->_canKept && $this->keptAt($data['values'])) { $this->_kept = true; } if ($this->_canStashed && $this->stashedAt($data['values'])) { $this->_stashed = true; } // $this->convert($data['values']); }
php
protected function fill($data) { if ($this->_canKept && $this->keptAt($data['values'])) { $this->_kept = true; } if ($this->_canStashed && $this->stashedAt($data['values'])) { $this->_stashed = true; } // $this->convert($data['values']); }
[ "protected", "function", "fill", "(", "$", "data", ")", "{", "if", "(", "$", "this", "->", "_canKept", "&&", "$", "this", "->", "keptAt", "(", "$", "data", "[", "'values'", "]", ")", ")", "{", "$", "this", "->", "_kept", "=", "true", ";", "}", ...
fill data from array. @param array $data @return null
[ "fill", "data", "from", "array", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L497-L507
241,091
vinala/kernel
src/MVC/Model/ORM.php
ORM.dig
protected function dig($key) { return Query::from(static::$table) ->select('*') ->where($this->_keyName, '=', $key) ->get(Query::GET_ARRAY); }
php
protected function dig($key) { return Query::from(static::$table) ->select('*') ->where($this->_keyName, '=', $key) ->get(Query::GET_ARRAY); }
[ "protected", "function", "dig", "(", "$", "key", ")", "{", "return", "Query", "::", "from", "(", "static", "::", "$", "table", ")", "->", "select", "(", "'*'", ")", "->", "where", "(", "$", "this", "->", "_keyName", ",", "'='", ",", "$", "key", "...
search for data by Query Class according to primary key. @param int $key @return array
[ "search", "for", "data", "by", "Query", "Class", "according", "to", "primary", "key", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L516-L522
241,092
vinala/kernel
src/MVC/Model/ORM.php
ORM.convert
protected function convert($data) { foreach ($data[0] as $key => $value) { if (!$this->_kept && !$this->_stashed) { $this->$key = $value; $this->setKey($key, $value); } else { if ($this->_kept) { $this->_keptData[$ke...
php
protected function convert($data) { foreach ($data[0] as $key => $value) { if (!$this->_kept && !$this->_stashed) { $this->$key = $value; $this->setKey($key, $value); } else { if ($this->_kept) { $this->_keptData[$ke...
[ "protected", "function", "convert", "(", "$", "data", ")", "{", "foreach", "(", "$", "data", "[", "0", "]", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "!", "$", "this", "->", "_kept", "&&", "!", "$", "this", "->", "_stashed", ")...
make data array colmuns as property in case of hidden data property was true data will be stored in hidden data instead ofas property. @param array $data @return null
[ "make", "data", "array", "colmuns", "as", "property", "in", "case", "of", "hidden", "data", "property", "was", "true", "data", "will", "be", "stored", "in", "hidden", "data", "instead", "ofas", "property", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L566-L583
241,093
vinala/kernel
src/MVC/Model/ORM.php
ORM.save
public function save() { if ($this->_state == CRUD::CREATE_STAT) { $this->add(); } elseif ($this->_state == CRUD::UPDATE_STAT) { $this->edit(); } }
php
public function save() { if ($this->_state == CRUD::CREATE_STAT) { $this->add(); } elseif ($this->_state == CRUD::UPDATE_STAT) { $this->edit(); } }
[ "public", "function", "save", "(", ")", "{", "if", "(", "$", "this", "->", "_state", "==", "CRUD", "::", "CREATE_STAT", ")", "{", "$", "this", "->", "add", "(", ")", ";", "}", "elseif", "(", "$", "this", "->", "_state", "==", "CRUD", "::", "UPDAT...
Save the opertaion makes by user either creation or editing. @return bool
[ "Save", "the", "opertaion", "makes", "by", "user", "either", "creation", "or", "editing", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L640-L647
241,094
vinala/kernel
src/MVC/Model/ORM.php
ORM.add
private function add() { $columns = []; $values = []; // if ($this->_tracked) { $this->created_at = Time::current(); } // foreach ($this->_columns as $value) { if ($value != $this->_keyName && isset($this->$value) && !empty($this->$valu...
php
private function add() { $columns = []; $values = []; // if ($this->_tracked) { $this->created_at = Time::current(); } // foreach ($this->_columns as $value) { if ($value != $this->_keyName && isset($this->$value) && !empty($this->$valu...
[ "private", "function", "add", "(", ")", "{", "$", "columns", "=", "[", "]", ";", "$", "values", "=", "[", "]", ";", "//", "if", "(", "$", "this", "->", "_tracked", ")", "{", "$", "this", "->", "created_at", "=", "Time", "::", "current", "(", ")...
function to add data in data table. @return bool
[ "function", "to", "add", "data", "in", "data", "table", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L654-L671
241,095
vinala/kernel
src/MVC/Model/ORM.php
ORM.insert
private function insert($columns, $values) { return Query::table(static::$table) ->column($columns) ->value($values) ->insert(); }
php
private function insert($columns, $values) { return Query::table(static::$table) ->column($columns) ->value($values) ->insert(); }
[ "private", "function", "insert", "(", "$", "columns", ",", "$", "values", ")", "{", "return", "Query", "::", "table", "(", "static", "::", "$", "table", ")", "->", "column", "(", "$", "columns", ")", "->", "value", "(", "$", "values", ")", "->", "i...
function to exexute insert data. @param array $columns @param array $values @return bool
[ "function", "to", "exexute", "insert", "data", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L681-L687
241,096
vinala/kernel
src/MVC/Model/ORM.php
ORM.edit
private function edit() { $columns = []; $values = []; // if ($this->_tracked) { $this->edited_at = Time::current(); } // foreach ($this->_columns as $value) { if ($value != $this->_keyName) { $columns[] = $value; ...
php
private function edit() { $columns = []; $values = []; // if ($this->_tracked) { $this->edited_at = Time::current(); } // foreach ($this->_columns as $value) { if ($value != $this->_keyName) { $columns[] = $value; ...
[ "private", "function", "edit", "(", ")", "{", "$", "columns", "=", "[", "]", ";", "$", "values", "=", "[", "]", ";", "//", "if", "(", "$", "this", "->", "_tracked", ")", "{", "$", "this", "->", "edited_at", "=", "Time", "::", "current", "(", ")...
function to edit data in data table. @return bool
[ "function", "to", "edit", "data", "in", "data", "table", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L694-L711
241,097
vinala/kernel
src/MVC/Model/ORM.php
ORM.update
private function update($columns, $values) { $query = Query::table(static::$table); // for ($i = 0; $i < Table::count($columns); $i++) { $query = !empty($values[$i]) ? $query->set($columns[$i], $values[$i]) : $query->set($columns[$i], 'null', false); } // ...
php
private function update($columns, $values) { $query = Query::table(static::$table); // for ($i = 0; $i < Table::count($columns); $i++) { $query = !empty($values[$i]) ? $query->set($columns[$i], $values[$i]) : $query->set($columns[$i], 'null', false); } // ...
[ "private", "function", "update", "(", "$", "columns", ",", "$", "values", ")", "{", "$", "query", "=", "Query", "::", "table", "(", "static", "::", "$", "table", ")", ";", "//", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "Table", "::",...
function to exexute update data. @param array $columns @param array $values @return bool
[ "function", "to", "exexute", "update", "data", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L721-L733
241,098
vinala/kernel
src/MVC/Model/ORM.php
ORM.delete
public function delete() { if (!$this->_canKept) { $this->forceDelete(); } else { Query::table(static::$table) ->set('deleted_at', Time::current()) ->where($this->_keyName, '=', $this->_keyValue) ->update(); } }
php
public function delete() { if (!$this->_canKept) { $this->forceDelete(); } else { Query::table(static::$table) ->set('deleted_at', Time::current()) ->where($this->_keyName, '=', $this->_keyValue) ->update(); } }
[ "public", "function", "delete", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_canKept", ")", "{", "$", "this", "->", "forceDelete", "(", ")", ";", "}", "else", "{", "Query", "::", "table", "(", "static", "::", "$", "table", ")", "->", "set"...
to delete the model from database in case of Kept deleted just hide it. @return bool
[ "to", "delete", "the", "model", "from", "database", "in", "case", "of", "Kept", "deleted", "just", "hide", "it", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L741-L751
241,099
vinala/kernel
src/MVC/Model/ORM.php
ORM.forceDelete
public function forceDelete() { $key = $this->_kept ? $this->_keptData[$this->_keyName] : $this->_keyValue; // Query::table(static::$table) ->where($this->_keyName, '=', $key) ->delete(); // $this->reset(); }
php
public function forceDelete() { $key = $this->_kept ? $this->_keptData[$this->_keyName] : $this->_keyValue; // Query::table(static::$table) ->where($this->_keyName, '=', $key) ->delete(); // $this->reset(); }
[ "public", "function", "forceDelete", "(", ")", "{", "$", "key", "=", "$", "this", "->", "_kept", "?", "$", "this", "->", "_keptData", "[", "$", "this", "->", "_keyName", "]", ":", "$", "this", "->", "_keyValue", ";", "//", "Query", "::", "table", "...
to force delete the model from database even if the model is Kept deleted. @return bool
[ "to", "force", "delete", "the", "model", "from", "database", "even", "if", "the", "model", "is", "Kept", "deleted", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Model/ORM.php#L758-L767