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
197,400
jayzeng/PHPEnum
Src/Util/Enum.php
Enum.getAllValues
final public function getAllValues() { $subClass = get_called_class(); // Subclass has already been registered if(isset($this->_cachedEnums[$subClass])) { return FALSE; } $reflection = new \ReflectionClass($subClass); return $reflection->getConstants(); ...
php
final public function getAllValues() { $subClass = get_called_class(); // Subclass has already been registered if(isset($this->_cachedEnums[$subClass])) { return FALSE; } $reflection = new \ReflectionClass($subClass); return $reflection->getConstants(); ...
[ "final", "public", "function", "getAllValues", "(", ")", "{", "$", "subClass", "=", "get_called_class", "(", ")", ";", "// Subclass has already been registered", "if", "(", "isset", "(", "$", "this", "->", "_cachedEnums", "[", "$", "subClass", "]", ")", ")", ...
Return all populated arrays @return false|array return array of constants or false when the subclass is already registered in cache
[ "Return", "all", "populated", "arrays" ]
af04fa72a664f19a0900de4b7a69af4888854d1d
https://github.com/jayzeng/PHPEnum/blob/af04fa72a664f19a0900de4b7a69af4888854d1d/Src/Util/Enum.php#L63-L74
197,401
KickAssCommerce/framework
src/Commerce/Product/Cache/Product.php
Product.afterMethodExecution
public function afterMethodExecution(MethodInvocation $invocation) { $filesystemAdapter = new Local(APP_BASE_DIR . 'storage/cache/api/'); $filesystem = new Filesystem($filesystemAdapter); $pool = new FilesystemCachePool($filesystem); $cacheKey = "products_" . md5(implode('_'...
php
public function afterMethodExecution(MethodInvocation $invocation) { $filesystemAdapter = new Local(APP_BASE_DIR . 'storage/cache/api/'); $filesystem = new Filesystem($filesystemAdapter); $pool = new FilesystemCachePool($filesystem); $cacheKey = "products_" . md5(implode('_'...
[ "public", "function", "afterMethodExecution", "(", "MethodInvocation", "$", "invocation", ")", "{", "$", "filesystemAdapter", "=", "new", "Local", "(", "APP_BASE_DIR", ".", "'storage/cache/api/'", ")", ";", "$", "filesystem", "=", "new", "Filesystem", "(", "$", ...
Cache bridge file response @param MethodInvocation $invocation @return \KickAss\Commerce\Product\Map\Product @Around("execution(public KickAss\Commerce\Product\Repository\Product->loadByAttribute(*))")
[ "Cache", "bridge", "file", "response" ]
492f4baa1e660f72acc83d37df45581aa8dfeb38
https://github.com/KickAssCommerce/framework/blob/492f4baa1e660f72acc83d37df45581aa8dfeb38/src/Commerce/Product/Cache/Product.php#L32-L62
197,402
kael-shipman/php-std-traits
src/AbstractCliConfig.php
AbstractCliConfig.reload
public function reload(): void { $config = []; foreach($this->configSources as $src) { // If it's a string, then it's a file or directory path if (is_string($src)) { // If directory, get all config files within it, recursively if (is_dir($src))...
php
public function reload(): void { $config = []; foreach($this->configSources as $src) { // If it's a string, then it's a file or directory path if (is_string($src)) { // If directory, get all config files within it, recursively if (is_dir($src))...
[ "public", "function", "reload", "(", ")", ":", "void", "{", "$", "config", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "configSources", "as", "$", "src", ")", "{", "// If it's a string, then it's a file or directory path", "if", "(", "is_string", ...
Reload the config from it's sources (usually done on SIGHUP to load in configuration changes in files @return void
[ "Reload", "the", "config", "from", "it", "s", "sources", "(", "usually", "done", "on", "SIGHUP", "to", "load", "in", "configuration", "changes", "in", "files" ]
c21ddfc9dc682e6589e52f3717df81e0d2972c0e
https://github.com/kael-shipman/php-std-traits/blob/c21ddfc9dc682e6589e52f3717df81e0d2972c0e/src/AbstractCliConfig.php#L55-L102
197,403
kael-shipman/php-std-traits
src/AbstractCliConfig.php
AbstractCliConfig.parseConfig
protected function parseConfig(string $config): array { $config = json_decode($config, true); if ($config === null) { throw new ConfigFileFormatException("Config files should be written in valid JSON"); } return $config; }
php
protected function parseConfig(string $config): array { $config = json_decode($config, true); if ($config === null) { throw new ConfigFileFormatException("Config files should be written in valid JSON"); } return $config; }
[ "protected", "function", "parseConfig", "(", "string", "$", "config", ")", ":", "array", "{", "$", "config", "=", "json_decode", "(", "$", "config", ",", "true", ")", ";", "if", "(", "$", "config", "===", "null", ")", "{", "throw", "new", "ConfigFileFo...
An overridable method that allows parsing arbitrary strings into config arrays @param string $config The contents of a config file (or sometimes the filename itself) @return array The config array resulting from the parse
[ "An", "overridable", "method", "that", "allows", "parsing", "arbitrary", "strings", "into", "config", "arrays" ]
c21ddfc9dc682e6589e52f3717df81e0d2972c0e
https://github.com/kael-shipman/php-std-traits/blob/c21ddfc9dc682e6589e52f3717df81e0d2972c0e/src/AbstractCliConfig.php#L110-L117
197,404
ColibriPlatform/base
controllers/InstallController.php
InstallController.actionIndex
public function actionIndex($lang = '') { $model = new InstallForm(); if (!empty($lang)) { Yii::$app->language = $lang; $model->language = $lang; } if ($model->load(Yii::$app->request->post()) && $model->validate()) { $this->createEnvFile($model...
php
public function actionIndex($lang = '') { $model = new InstallForm(); if (!empty($lang)) { Yii::$app->language = $lang; $model->language = $lang; } if ($model->load(Yii::$app->request->post()) && $model->validate()) { $this->createEnvFile($model...
[ "public", "function", "actionIndex", "(", "$", "lang", "=", "''", ")", "{", "$", "model", "=", "new", "InstallForm", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "lang", ")", ")", "{", "Yii", "::", "$", "app", "->", "language", "=", "$", "...
Display the install form @param string $lang The lang to use @return string
[ "Display", "the", "install", "form" ]
b45db9c88317e28acc5b024ac98f8428685179aa
https://github.com/ColibriPlatform/base/blob/b45db9c88317e28acc5b024ac98f8428685179aa/controllers/InstallController.php#L31-L64
197,405
ColibriPlatform/base
controllers/InstallController.php
InstallController.processMigrations
protected function processMigrations() { $messages = ''; $migrationsPaths = [ '@vendor/dektrium/yii2-user/migrations', '@yii/rbac/migrations', '@pheme/settings/migrations', ]; foreach ($migrationsPaths as $path) { $migration =...
php
protected function processMigrations() { $messages = ''; $migrationsPaths = [ '@vendor/dektrium/yii2-user/migrations', '@yii/rbac/migrations', '@pheme/settings/migrations', ]; foreach ($migrationsPaths as $path) { $migration =...
[ "protected", "function", "processMigrations", "(", ")", "{", "$", "messages", "=", "''", ";", "$", "migrationsPaths", "=", "[", "'@vendor/dektrium/yii2-user/migrations'", ",", "'@yii/rbac/migrations'", ",", "'@pheme/settings/migrations'", ",", "]", ";", "foreach", "("...
Process required migrations @return string
[ "Process", "required", "migrations" ]
b45db9c88317e28acc5b024ac98f8428685179aa
https://github.com/ColibriPlatform/base/blob/b45db9c88317e28acc5b024ac98f8428685179aa/controllers/InstallController.php#L71-L89
197,406
ColibriPlatform/base
controllers/InstallController.php
InstallController.createEnvFile
protected function createEnvFile(InstallForm $model) { $envFile = Yii::getAlias('@app/.env'); if (!file_exists($envFile)) { $dsn = ''; $buffer = "\n"; $cookieKey = $this->generateRandomString(); $buffer .= "YII_DEBUG = 0\n"; $buf...
php
protected function createEnvFile(InstallForm $model) { $envFile = Yii::getAlias('@app/.env'); if (!file_exists($envFile)) { $dsn = ''; $buffer = "\n"; $cookieKey = $this->generateRandomString(); $buffer .= "YII_DEBUG = 0\n"; $buf...
[ "protected", "function", "createEnvFile", "(", "InstallForm", "$", "model", ")", "{", "$", "envFile", "=", "Yii", "::", "getAlias", "(", "'@app/.env'", ")", ";", "if", "(", "!", "file_exists", "(", "$", "envFile", ")", ")", "{", "$", "dsn", "=", "''", ...
Create the application env file @param InstallForm $model @return void
[ "Create", "the", "application", "env", "file" ]
b45db9c88317e28acc5b024ac98f8428685179aa
https://github.com/ColibriPlatform/base/blob/b45db9c88317e28acc5b024ac98f8428685179aa/controllers/InstallController.php#L98-L129
197,407
ColibriPlatform/base
controllers/InstallController.php
InstallController.callModulesMethod
protected function callModulesMethod($methodName) { $modules = Yii::$app->getModules(); $returns = []; foreach ($modules as $moduleName => $module) { if (is_array($module)) { $module = Yii::$app->getModule($moduleName); } if (meth...
php
protected function callModulesMethod($methodName) { $modules = Yii::$app->getModules(); $returns = []; foreach ($modules as $moduleName => $module) { if (is_array($module)) { $module = Yii::$app->getModule($moduleName); } if (meth...
[ "protected", "function", "callModulesMethod", "(", "$", "methodName", ")", "{", "$", "modules", "=", "Yii", "::", "$", "app", "->", "getModules", "(", ")", ";", "$", "returns", "=", "[", "]", ";", "foreach", "(", "$", "modules", "as", "$", "moduleName"...
Call a method if exists on every application modules @param string $methodName The method to call @return mixed[]
[ "Call", "a", "method", "if", "exists", "on", "every", "application", "modules" ]
b45db9c88317e28acc5b024ac98f8428685179aa
https://github.com/ColibriPlatform/base/blob/b45db9c88317e28acc5b024ac98f8428685179aa/controllers/InstallController.php#L204-L221
197,408
miguelibero/meinhof
src/Meinhof/Action/OutputAction.php
OutputAction.shouldWriteOutput
protected function shouldWriteOutput($min=0, $max=null) { $out = $this->getOutput(); if (!$out instanceof OutputInterface) { return false; } $v = $out->getVerbosity(); return !($v<$min || ($max!==null && $v>$max)); }
php
protected function shouldWriteOutput($min=0, $max=null) { $out = $this->getOutput(); if (!$out instanceof OutputInterface) { return false; } $v = $out->getVerbosity(); return !($v<$min || ($max!==null && $v>$max)); }
[ "protected", "function", "shouldWriteOutput", "(", "$", "min", "=", "0", ",", "$", "max", "=", "null", ")", "{", "$", "out", "=", "$", "this", "->", "getOutput", "(", ")", ";", "if", "(", "!", "$", "out", "instanceof", "OutputInterface", ")", "{", ...
Checks if the output verbositiy is between two given levels @param integer $min minimum verbosity level @param integer $max maximum verbosity level or null for no maximum @return boolean if output should be written
[ "Checks", "if", "the", "output", "verbositiy", "is", "between", "two", "given", "levels" ]
3a090f08485dc0da3e27463cf349dba374201072
https://github.com/miguelibero/meinhof/blob/3a090f08485dc0da3e27463cf349dba374201072/src/Meinhof/Action/OutputAction.php#L30-L39
197,409
miguelibero/meinhof
src/Meinhof/Action/OutputAction.php
OutputAction.writeOutputLine
protected function writeOutputLine($msg, $min=0, $max=null) { if (!$this->shouldWriteOutput($min, $max)) { return; } $this->getOutput()->writeln($msg); }
php
protected function writeOutputLine($msg, $min=0, $max=null) { if (!$this->shouldWriteOutput($min, $max)) { return; } $this->getOutput()->writeln($msg); }
[ "protected", "function", "writeOutputLine", "(", "$", "msg", ",", "$", "min", "=", "0", ",", "$", "max", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "shouldWriteOutput", "(", "$", "min", ",", "$", "max", ")", ")", "{", "return", ";"...
Prints a text line if the output verbositiy is between two given levels @param string $msg the text to print @param integer $min minimum verbosity level @param integer $max maximum verbosity level or null for no maximum
[ "Prints", "a", "text", "line", "if", "the", "output", "verbositiy", "is", "between", "two", "given", "levels" ]
3a090f08485dc0da3e27463cf349dba374201072
https://github.com/miguelibero/meinhof/blob/3a090f08485dc0da3e27463cf349dba374201072/src/Meinhof/Action/OutputAction.php#L48-L55
197,410
miguelibero/meinhof
src/Meinhof/Action/OutputAction.php
OutputAction.writeOutput
protected function writeOutput($msg, $min=0, $max=null) { if (!$this->shouldWriteOutput($min, $max)) { return; } return $this->getOutput()->write($msg); }
php
protected function writeOutput($msg, $min=0, $max=null) { if (!$this->shouldWriteOutput($min, $max)) { return; } return $this->getOutput()->write($msg); }
[ "protected", "function", "writeOutput", "(", "$", "msg", ",", "$", "min", "=", "0", ",", "$", "max", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "shouldWriteOutput", "(", "$", "min", ",", "$", "max", ")", ")", "{", "return", ";", ...
Prints a text if the output verbositiy is between two given levels @param string $msg the text to print @param integer $min minimum verbosity level @param integer $max maximum verbosity level or null for no maximum
[ "Prints", "a", "text", "if", "the", "output", "verbositiy", "is", "between", "two", "given", "levels" ]
3a090f08485dc0da3e27463cf349dba374201072
https://github.com/miguelibero/meinhof/blob/3a090f08485dc0da3e27463cf349dba374201072/src/Meinhof/Action/OutputAction.php#L79-L86
197,411
ivopetkov/html-server-components-bearframework-addon
classes/HTMLServerComponents/Internal/Compiler.php
Compiler.makeComponent
public function makeComponent(array $attributes = [], string $innerHTML = '', string $tagName = 'component') { $app = App::get(); if (self::$newComponentCache === null) { self::$newComponentCache = new \IvoPetkov\BearFramework\Addons\HTMLServerComponents\Internal\Component(); } ...
php
public function makeComponent(array $attributes = [], string $innerHTML = '', string $tagName = 'component') { $app = App::get(); if (self::$newComponentCache === null) { self::$newComponentCache = new \IvoPetkov\BearFramework\Addons\HTMLServerComponents\Internal\Component(); } ...
[ "public", "function", "makeComponent", "(", "array", "$", "attributes", "=", "[", "]", ",", "string", "$", "innerHTML", "=", "''", ",", "string", "$", "tagName", "=", "'component'", ")", "{", "$", "app", "=", "App", "::", "get", "(", ")", ";", "if", ...
Constructs a component object @param array $attributes The attributes of the component object @param string $innerHTML The innerHTML of the component object @param string $tagName The tag name of the component object @return \IvoPetkov\BearFramework\Addons\HTMLServerComponents\Internal\Component A component object
[ "Constructs", "a", "component", "object" ]
c9a5f275d10f194b2216d733bfea612fd876a0b2
https://github.com/ivopetkov/html-server-components-bearframework-addon/blob/c9a5f275d10f194b2216d733bfea612fd876a0b2/classes/HTMLServerComponents/Internal/Compiler.php#L33-L49
197,412
zhaoxianfang/tools
src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php
PassConfig.getPasses
public function getPasses() { return array_merge( array($this->mergePass), $this->getBeforeOptimizationPasses(), $this->getOptimizationPasses(), $this->getBeforeRemovingPasses(), $this->getRemovingPasses(), $this->getAfterRemovingPasses...
php
public function getPasses() { return array_merge( array($this->mergePass), $this->getBeforeOptimizationPasses(), $this->getOptimizationPasses(), $this->getBeforeRemovingPasses(), $this->getRemovingPasses(), $this->getAfterRemovingPasses...
[ "public", "function", "getPasses", "(", ")", "{", "return", "array_merge", "(", "array", "(", "$", "this", "->", "mergePass", ")", ",", "$", "this", "->", "getBeforeOptimizationPasses", "(", ")", ",", "$", "this", "->", "getOptimizationPasses", "(", ")", "...
Returns all passes in order to be processed. @return CompilerPassInterface[]
[ "Returns", "all", "passes", "in", "order", "to", "be", "processed", "." ]
d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7
https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php#L101-L111
197,413
squareproton/Bond
src/Bond/Pg/Resource.php
Resource.ensure
public static function ensure() { $cnt = 0; foreach( self::$instances as $instance ) { if( !$instance->isAlive() ) { $instance->reset(); $cnt++; } } return $cnt; }
php
public static function ensure() { $cnt = 0; foreach( self::$instances as $instance ) { if( !$instance->isAlive() ) { $instance->reset(); $cnt++; } } return $cnt; }
[ "public", "static", "function", "ensure", "(", ")", "{", "$", "cnt", "=", "0", ";", "foreach", "(", "self", "::", "$", "instances", "as", "$", "instance", ")", "{", "if", "(", "!", "$", "instance", "->", "isAlive", "(", ")", ")", "{", "$", "insta...
Ensure all known, non terminated, resource objects are golden
[ "Ensure", "all", "known", "non", "terminated", "resource", "objects", "are", "golden" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Resource.php#L97-L107
197,414
squareproton/Bond
src/Bond/Pg/Resource.php
Resource.unserialize
public function unserialize($data) { $connectionSettings = new ConnectionSettings( json_decode( $data, true ) ); $this->__construct( $connectionSettings ); }
php
public function unserialize($data) { $connectionSettings = new ConnectionSettings( json_decode( $data, true ) ); $this->__construct( $connectionSettings ); }
[ "public", "function", "unserialize", "(", "$", "data", ")", "{", "$", "connectionSettings", "=", "new", "ConnectionSettings", "(", "json_decode", "(", "$", "data", ",", "true", ")", ")", ";", "$", "this", "->", "__construct", "(", "$", "connectionSettings", ...
Unserialize. Object. @waring. Unserializing a resource will generate a new resource
[ "Unserialize", ".", "Object", "." ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Resource.php#L131-L135
197,415
squareproton/Bond
src/Bond/Pg/Resource.php
Resource.isTerminated
public function isTerminated( $throwExceptionIfTerminated = true ) { if( $this->terminated ) { if( $throwExceptionIfTerminated ) { throw new ConnectionTerminatedException( $this ); } return true; } return false; }
php
public function isTerminated( $throwExceptionIfTerminated = true ) { if( $this->terminated ) { if( $throwExceptionIfTerminated ) { throw new ConnectionTerminatedException( $this ); } return true; } return false; }
[ "public", "function", "isTerminated", "(", "$", "throwExceptionIfTerminated", "=", "true", ")", "{", "if", "(", "$", "this", "->", "terminated", ")", "{", "if", "(", "$", "throwExceptionIfTerminated", ")", "{", "throw", "new", "ConnectionTerminatedException", "(...
Has this resource been terminated? @throws Bond\Pg\ConnectionTerminated @return bool
[ "Has", "this", "resource", "been", "terminated?" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Resource.php#L180-L189
197,416
squareproton/Bond
src/Bond/Pg/Resource.php
Resource.get
public function get( $reconnectOnFailure = false ) { if( $reconnectOnFailure and !$this->isAlive() ) { $this->reset(); } return $this->resource; }
php
public function get( $reconnectOnFailure = false ) { if( $reconnectOnFailure and !$this->isAlive() ) { $this->reset(); } return $this->resource; }
[ "public", "function", "get", "(", "$", "reconnectOnFailure", "=", "false", ")", "{", "if", "(", "$", "reconnectOnFailure", "and", "!", "$", "this", "->", "isAlive", "(", ")", ")", "{", "$", "this", "->", "reset", "(", ")", ";", "}", "return", "$", ...
Return the pglink resource. @param bool Reset the connection if, for any reason, it has gone away @return pg_link resource
[ "Return", "the", "pglink", "resource", "." ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Resource.php#L220-L226
197,417
koolkode/context
src/Container.php
Container.createInstance
public function createInstance(Binding $binding, InjectionPointInterface $point = NULL) { switch($binding->getOptions() & BindingInterface::MASK_TYPE) { case BindingInterface::TYPE_ALIAS: return $this->get($binding->getTarget(), $point); case BindingInterface::TYPE_FACTORY: case BindingInterface::TYPE...
php
public function createInstance(Binding $binding, InjectionPointInterface $point = NULL) { switch($binding->getOptions() & BindingInterface::MASK_TYPE) { case BindingInterface::TYPE_ALIAS: return $this->get($binding->getTarget(), $point); case BindingInterface::TYPE_FACTORY: case BindingInterface::TYPE...
[ "public", "function", "createInstance", "(", "Binding", "$", "binding", ",", "InjectionPointInterface", "$", "point", "=", "NULL", ")", "{", "switch", "(", "$", "binding", "->", "getOptions", "(", ")", "&", "BindingInterface", "::", "MASK_TYPE", ")", "{", "c...
Create an instance of the bound type, will NOT create or re-use a scoped proxy. @param Binding $binding @param InjectionPointInterface $point @return object
[ "Create", "an", "instance", "of", "the", "bound", "type", "will", "NOT", "create", "or", "re", "-", "use", "a", "scoped", "proxy", "." ]
f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36
https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Container.php#L228-L245
197,418
koolkode/context
src/Container.php
Container.createObjectUsingFactory
protected function createObjectUsingFactory(Binding $binding, InjectionPointInterface $point = NULL) { $callback = $binding->getTarget(); if(is_array($callback)) { $callback = [$this->get($callback[0]), $callback[1]]; $ref = new \ReflectionMethod(get_class($callback[0]), $callback[1]); } else { ...
php
protected function createObjectUsingFactory(Binding $binding, InjectionPointInterface $point = NULL) { $callback = $binding->getTarget(); if(is_array($callback)) { $callback = [$this->get($callback[0]), $callback[1]]; $ref = new \ReflectionMethod(get_class($callback[0]), $callback[1]); } else { ...
[ "protected", "function", "createObjectUsingFactory", "(", "Binding", "$", "binding", ",", "InjectionPointInterface", "$", "point", "=", "NULL", ")", "{", "$", "callback", "=", "$", "binding", "->", "getTarget", "(", ")", ";", "if", "(", "is_array", "(", "$",...
Create an object using the factory defined in the given binding. @param Binding $binding @param InjectionPointInterface $point @return object
[ "Create", "an", "object", "using", "the", "factory", "defined", "in", "the", "given", "binding", "." ]
f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36
https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Container.php#L269-L337
197,419
koolkode/context
src/Container.php
Container.registerBindings
protected function registerBindings(array $bindings) { foreach($bindings as $binding) { $this->bindings[(string)$binding] = $binding; foreach($binding->getMarkers() as $marker) { $marker = get_class($marker); if(empty($this->markers[$marker])) { $this->markers[$marker] = new \SplO...
php
protected function registerBindings(array $bindings) { foreach($bindings as $binding) { $this->bindings[(string)$binding] = $binding; foreach($binding->getMarkers() as $marker) { $marker = get_class($marker); if(empty($this->markers[$marker])) { $this->markers[$marker] = new \SplO...
[ "protected", "function", "registerBindings", "(", "array", "$", "bindings", ")", "{", "foreach", "(", "$", "bindings", "as", "$", "binding", ")", "{", "$", "this", "->", "bindings", "[", "(", "string", ")", "$", "binding", "]", "=", "$", "binding", ";"...
Register the given bindings with the container and prepare markers. @param array<Binding> $bindings
[ "Register", "the", "given", "bindings", "with", "the", "container", "and", "prepare", "markers", "." ]
f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36
https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Container.php#L344-L362
197,420
anime-db/catalog-bundle
src/Console/Progress/Export.php
Export.advance
public function advance($step = 1, $redraw = false) { parent::advance($step, $redraw); $this->current += $step; $percent = 0; if ($this->max > 0) { $percent = (float) $this->current / $this->max; } $this->output->write(sprintf('%d%%', floor($percent * 10...
php
public function advance($step = 1, $redraw = false) { parent::advance($step, $redraw); $this->current += $step; $percent = 0; if ($this->max > 0) { $percent = (float) $this->current / $this->max; } $this->output->write(sprintf('%d%%', floor($percent * 10...
[ "public", "function", "advance", "(", "$", "step", "=", "1", ",", "$", "redraw", "=", "false", ")", "{", "parent", "::", "advance", "(", "$", "step", ",", "$", "redraw", ")", ";", "$", "this", "->", "current", "+=", "$", "step", ";", "$", "percen...
Advances the progress output X steps. @param int $step Number of steps to advance @param bool $redraw Whether to redraw or not @throws \LogicException
[ "Advances", "the", "progress", "output", "X", "steps", "." ]
631b6f92a654e91bee84f46218c52cf42bdb8606
https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Console/Progress/Export.php#L72-L83
197,421
AnonymPHP/Anonym-Database
Capsule/Capsule.php
Capsule.addConnection
public function addConnection(Base $connection = null, $name = '') { if($connection instanceof Base) { if($name !== '') { $this->connections[$name] = $connection; }else{ $this->connections[] = $connection; } }els...
php
public function addConnection(Base $connection = null, $name = '') { if($connection instanceof Base) { if($name !== '') { $this->connections[$name] = $connection; }else{ $this->connections[] = $connection; } }els...
[ "public", "function", "addConnection", "(", "Base", "$", "connection", "=", "null", ",", "$", "name", "=", "''", ")", "{", "if", "(", "$", "connection", "instanceof", "Base", ")", "{", "if", "(", "$", "name", "!==", "''", ")", "{", "$", "this", "->...
add a connection to capsule @param Base $connection @param string $name @throws CapsuleInstanceException
[ "add", "a", "connection", "to", "capsule" ]
4d034219e0e3eb2833fa53204e9f52a74a9a7e4b
https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Capsule/Capsule.php#L47-L60
197,422
AnonymPHP/Anonym-Database
Capsule/Capsule.php
Capsule.deleteConnection
public function deleteConnection($offset) { if(isset($this->connections[$offset])) { unset($this->connections[$offset]); } return $this; }
php
public function deleteConnection($offset) { if(isset($this->connections[$offset])) { unset($this->connections[$offset]); } return $this; }
[ "public", "function", "deleteConnection", "(", "$", "offset", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "connections", "[", "$", "offset", "]", ")", ")", "{", "unset", "(", "$", "this", "->", "connections", "[", "$", "offset", "]", ")", ...
delete a connection in capsule @param mixed $offset @return $this
[ "delete", "a", "connection", "in", "capsule" ]
4d034219e0e3eb2833fa53204e9f52a74a9a7e4b
https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Capsule/Capsule.php#L69-L77
197,423
sil-project/Product
Factory/CodeFactory.php
CodeFactory.generateProductVariantCode
public static function generateProductVariantCode(ProductInterface $product, array $productOptions): CodeInterface { $productVariantCodeGenerator = new ProductVariantCodeGenerator(); return $productVariantCodeGenerator->generate($product->getCode(), $productOptions); }
php
public static function generateProductVariantCode(ProductInterface $product, array $productOptions): CodeInterface { $productVariantCodeGenerator = new ProductVariantCodeGenerator(); return $productVariantCodeGenerator->generate($product->getCode(), $productOptions); }
[ "public", "static", "function", "generateProductVariantCode", "(", "ProductInterface", "$", "product", ",", "array", "$", "productOptions", ")", ":", "CodeInterface", "{", "$", "productVariantCodeGenerator", "=", "new", "ProductVariantCodeGenerator", "(", ")", ";", "r...
Generate product variant code. @param ProductInterface $product Current Product @param array|Option[] $productOptions array of Options @return CodeInterface Generated Code
[ "Generate", "product", "variant", "code", "." ]
830dca4cc90502a7adcf3d6f0e1f14b4dddf80b4
https://github.com/sil-project/Product/blob/830dca4cc90502a7adcf3d6f0e1f14b4dddf80b4/Factory/CodeFactory.php#L45-L50
197,424
helsingborg-stad/better-post-UI
source/php/Components/Comments.php
Comments.commentsFilter
public function commentsFilter() { $post_types = get_post_types(); foreach ($post_types as &$post_type) { if (post_type_supports($post_type, 'comments')) { $post_type_obj = get_post_type_object($post_type); $post_type = array( 'name' => $post_type_obj->nam...
php
public function commentsFilter() { $post_types = get_post_types(); foreach ($post_types as &$post_type) { if (post_type_supports($post_type, 'comments')) { $post_type_obj = get_post_type_object($post_type); $post_type = array( 'name' => $post_type_obj->nam...
[ "public", "function", "commentsFilter", "(", ")", "{", "$", "post_types", "=", "get_post_types", "(", ")", ";", "foreach", "(", "$", "post_types", "as", "&", "$", "post_type", ")", "{", "if", "(", "post_type_supports", "(", "$", "post_type", ",", "'comment...
Filter comments by post type @return void
[ "Filter", "comments", "by", "post", "type" ]
0454e8d6f42787244d02f0e976825ed8dca579f0
https://github.com/helsingborg-stad/better-post-UI/blob/0454e8d6f42787244d02f0e976825ed8dca579f0/source/php/Components/Comments.php#L19-L41
197,425
helsingborg-stad/better-post-UI
source/php/Components/Comments.php
Comments.queryFilter
public function queryFilter($query) { global $pagenow; if (!is_admin() || !$pagenow || $pagenow !== 'edit-comments.php' || !isset($_GET['post_type']) || !$_GET['post_type']) { return; } $query->set('post_type', $_GET['post_type']); }
php
public function queryFilter($query) { global $pagenow; if (!is_admin() || !$pagenow || $pagenow !== 'edit-comments.php' || !isset($_GET['post_type']) || !$_GET['post_type']) { return; } $query->set('post_type', $_GET['post_type']); }
[ "public", "function", "queryFilter", "(", "$", "query", ")", "{", "global", "$", "pagenow", ";", "if", "(", "!", "is_admin", "(", ")", "||", "!", "$", "pagenow", "||", "$", "pagenow", "!==", "'edit-comments.php'", "||", "!", "isset", "(", "$", "_GET", ...
Filter the wp query @param WP_Query $query @return void
[ "Filter", "the", "wp", "query" ]
0454e8d6f42787244d02f0e976825ed8dca579f0
https://github.com/helsingborg-stad/better-post-UI/blob/0454e8d6f42787244d02f0e976825ed8dca579f0/source/php/Components/Comments.php#L48-L57
197,426
helsingborg-stad/better-post-UI
source/php/Components/Comments.php
Comments.tableColumnsContent
public function tableColumnsContent($column, $postId) { if ($column == 'post_type') { $comment = get_comment($postId, OBJECT); $post_type_slug = get_post_type($comment->comment_post_ID); $post_type_obj = get_post_type_object($post_type_slug); echo $post_type_obj->label; } }
php
public function tableColumnsContent($column, $postId) { if ($column == 'post_type') { $comment = get_comment($postId, OBJECT); $post_type_slug = get_post_type($comment->comment_post_ID); $post_type_obj = get_post_type_object($post_type_slug); echo $post_type_obj->label; } }
[ "public", "function", "tableColumnsContent", "(", "$", "column", ",", "$", "postId", ")", "{", "if", "(", "$", "column", "==", "'post_type'", ")", "{", "$", "comment", "=", "get_comment", "(", "$", "postId", ",", "OBJECT", ")", ";", "$", "post_type_slug"...
Content for table columns @param string $column @param int $postId @return void
[ "Content", "for", "table", "columns" ]
0454e8d6f42787244d02f0e976825ed8dca579f0
https://github.com/helsingborg-stad/better-post-UI/blob/0454e8d6f42787244d02f0e976825ed8dca579f0/source/php/Components/Comments.php#L82-L90
197,427
danielgp/composer-packages-listing
source/ComposerPackagesListing.php
ComposerPackagesListing.getFileModifiedTimestampOfFile
protected function getFileModifiedTimestampOfFile($fileName, $format = 'Y-m-d H:i:s', $resultInUtc = false) { if (!file_exists($fileName)) { return ['error' => $fileName . ' was not found']; } $info = new \SplFileInfo($fileName); if ($format === 'PHPtime') { r...
php
protected function getFileModifiedTimestampOfFile($fileName, $format = 'Y-m-d H:i:s', $resultInUtc = false) { if (!file_exists($fileName)) { return ['error' => $fileName . ' was not found']; } $info = new \SplFileInfo($fileName); if ($format === 'PHPtime') { r...
[ "protected", "function", "getFileModifiedTimestampOfFile", "(", "$", "fileName", ",", "$", "format", "=", "'Y-m-d H:i:s'", ",", "$", "resultInUtc", "=", "false", ")", "{", "if", "(", "!", "file_exists", "(", "$", "fileName", ")", ")", "{", "return", "[", "...
Returns Modified date and time of a given file @param string $fileName @param string $format @param boolean $resultInUtc @return string
[ "Returns", "Modified", "date", "and", "time", "of", "a", "given", "file" ]
400cdc599348cee1072df10fb207bc03bce94b9f
https://github.com/danielgp/composer-packages-listing/blob/400cdc599348cee1072df10fb207bc03bce94b9f/source/ComposerPackagesListing.php#L115-L129
197,428
danielgp/composer-packages-listing
source/ComposerPackagesListing.php
ComposerPackagesListing.getPackageDetailsFromGivenComposerLockFileEnhanced
protected function getPackageDetailsFromGivenComposerLockFileEnhanced($fileIn, $inParametersArray = []) { if (!file_exists($fileIn)) { return ['error' => $fileIn . ' was not found']; } $alnfo = []; $packages = $this->getPkgFileInListOfPackageArrayOut($fileIn); ...
php
protected function getPackageDetailsFromGivenComposerLockFileEnhanced($fileIn, $inParametersArray = []) { if (!file_exists($fileIn)) { return ['error' => $fileIn . ' was not found']; } $alnfo = []; $packages = $this->getPkgFileInListOfPackageArrayOut($fileIn); ...
[ "protected", "function", "getPackageDetailsFromGivenComposerLockFileEnhanced", "(", "$", "fileIn", ",", "$", "inParametersArray", "=", "[", "]", ")", "{", "if", "(", "!", "file_exists", "(", "$", "fileIn", ")", ")", "{", "return", "[", "'error'", "=>", "$", ...
Returns a complete list of packages and respective details from a composer.lock file @param string $fileIn @param array $inParametersArray @return array
[ "Returns", "a", "complete", "list", "of", "packages", "and", "respective", "details", "from", "a", "composer", ".", "lock", "file" ]
400cdc599348cee1072df10fb207bc03bce94b9f
https://github.com/danielgp/composer-packages-listing/blob/400cdc599348cee1072df10fb207bc03bce94b9f/source/ComposerPackagesListing.php#L159-L177
197,429
1HappyPlace/ansi-terminal
src/ANSI/Color/Color.php
Color.setEmpty
public function setEmpty() { // set all properties to null $this->name = $this->ANSICode = $this->XTermCode = $this->RGB = null; }
php
public function setEmpty() { // set all properties to null $this->name = $this->ANSICode = $this->XTermCode = $this->RGB = null; }
[ "public", "function", "setEmpty", "(", ")", "{", "// set all properties to null", "$", "this", "->", "name", "=", "$", "this", "->", "ANSICode", "=", "$", "this", "->", "XTermCode", "=", "$", "this", "->", "RGB", "=", "null", ";", "}" ]
Set the color object to empty
[ "Set", "the", "color", "object", "to", "empty" ]
3a550eadb21bb87a6909436c3b961919d2731923
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/Color/Color.php#L228-L232
197,430
1HappyPlace/ansi-terminal
src/ANSI/Color/Color.php
Color.isEmpty
public function isEmpty() { // return true if all properties are null return (is_null($this->name) && is_null($this->ANSICode) && is_null($this->XTermCode) && is_null($this->RGB)); }
php
public function isEmpty() { // return true if all properties are null return (is_null($this->name) && is_null($this->ANSICode) && is_null($this->XTermCode) && is_null($this->RGB)); }
[ "public", "function", "isEmpty", "(", ")", "{", "// return true if all properties are null", "return", "(", "is_null", "(", "$", "this", "->", "name", ")", "&&", "is_null", "(", "$", "this", "->", "ANSICode", ")", "&&", "is_null", "(", "$", "this", "->", "...
Return whether the object is empty @return bool
[ "Return", "whether", "the", "object", "is", "empty" ]
3a550eadb21bb87a6909436c3b961919d2731923
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/Color/Color.php#L238-L243
197,431
1HappyPlace/ansi-terminal
src/ANSI/Color/Color.php
Color.setColor
public function setColor($color) { // if null is passed in, then just leave everything null if (!is_null($color)) { // if it an instance of another color if ($color instanceof ColorInterface) { // save the name $this->name = $color->getName(); ...
php
public function setColor($color) { // if null is passed in, then just leave everything null if (!is_null($color)) { // if it an instance of another color if ($color instanceof ColorInterface) { // save the name $this->name = $color->getName(); ...
[ "public", "function", "setColor", "(", "$", "color", ")", "{", "// if null is passed in, then just leave everything null", "if", "(", "!", "is_null", "(", "$", "color", ")", ")", "{", "// if it an instance of another color", "if", "(", "$", "color", "instanceof", "C...
The variety of ways to set a color @param ColorInterface | string | integer | int[] $color - Many options for initializing a color object - SEE CONSTRUCTOR
[ "The", "variety", "of", "ways", "to", "set", "a", "color" ]
3a550eadb21bb87a6909436c3b961919d2731923
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/Color/Color.php#L249-L333
197,432
1HappyPlace/ansi-terminal
src/ANSI/Color/Color.php
Color.generateColorCoding
public function generateColorCoding($mode, $isFill = false) { // initialize the returned code $codes = ""; // ensure the color has a value if ($this->isValid()) { // cast the mode into the class $mode = new Mode($mode); // generally yo...
php
public function generateColorCoding($mode, $isFill = false) { // initialize the returned code $codes = ""; // ensure the color has a value if ($this->isValid()) { // cast the mode into the class $mode = new Mode($mode); // generally yo...
[ "public", "function", "generateColorCoding", "(", "$", "mode", ",", "$", "isFill", "=", "false", ")", "{", "// initialize the returned code", "$", "codes", "=", "\"\"", ";", "// ensure the color has a value", "if", "(", "$", "this", "->", "isValid", "(", ")", ...
Generate a color coding based on the terminal type @param Mode | int | string $mode Mode send in a Mode object built already integer - send in the desired number of colors to pick the closest mode (<16 for VT100, >16 and <256 for xterm and > 256 for RGB) string - send in one of the constants Mode::VT100, Mode::XTERM, ...
[ "Generate", "a", "color", "coding", "based", "on", "the", "terminal", "type" ]
3a550eadb21bb87a6909436c3b961919d2731923
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/Color/Color.php#L478-L533
197,433
1HappyPlace/ansi-terminal
src/ANSI/Color/Color.php
Color.next
public function next() { // if this is a valid name if ($this->isValid()) { // find it on the index of colors $colorNames = Colors::getW3CIndex(); // get the position of the name in the color index $pos = array_search($this->name,$colorNames); ...
php
public function next() { // if this is a valid name if ($this->isValid()) { // find it on the index of colors $colorNames = Colors::getW3CIndex(); // get the position of the name in the color index $pos = array_search($this->name,$colorNames); ...
[ "public", "function", "next", "(", ")", "{", "// if this is a valid name", "if", "(", "$", "this", "->", "isValid", "(", ")", ")", "{", "// find it on the index of colors", "$", "colorNames", "=", "Colors", "::", "getW3CIndex", "(", ")", ";", "// get the positio...
Return the next name on the main Colors name index @return string | null - return null if this color is not valid, otherwise, return the next name or the first name, if this is the last name
[ "Return", "the", "next", "name", "on", "the", "main", "Colors", "name", "index" ]
3a550eadb21bb87a6909436c3b961919d2731923
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/Color/Color.php#L540-L583
197,434
gplcart/ga_report
controllers/Settings.php
Settings.editSettings
public function editSettings() { $this->setTitleEditSettings(); $this->setBreadcrumbEditSettings(); $this->setData('stores', $this->store->getList()); $this->setData('credentials', $this->getCredentialSettings()); $this->setData('handlers', $this->report_model->getHandlers()...
php
public function editSettings() { $this->setTitleEditSettings(); $this->setBreadcrumbEditSettings(); $this->setData('stores', $this->store->getList()); $this->setData('credentials', $this->getCredentialSettings()); $this->setData('handlers', $this->report_model->getHandlers()...
[ "public", "function", "editSettings", "(", ")", "{", "$", "this", "->", "setTitleEditSettings", "(", ")", ";", "$", "this", "->", "setBreadcrumbEditSettings", "(", ")", ";", "$", "this", "->", "setData", "(", "'stores'", ",", "$", "this", "->", "store", ...
Route page callback Displays the module settings page
[ "Route", "page", "callback", "Displays", "the", "module", "settings", "page" ]
856a480e394bb3feaeea4785ccccad56abaac499
https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/controllers/Settings.php#L42-L54
197,435
gplcart/ga_report
controllers/Settings.php
Settings.validateGaProfileSettings
protected function validateGaProfileSettings() { $profiles = $this->getSubmitted('ga_profile_id', array()); if (empty($profiles)) { $this->setError('ga_profile_id', $this->text('Profile ID is required')); return false; } $stores = $this->store->getList(); ...
php
protected function validateGaProfileSettings() { $profiles = $this->getSubmitted('ga_profile_id', array()); if (empty($profiles)) { $this->setError('ga_profile_id', $this->text('Profile ID is required')); return false; } $stores = $this->store->getList(); ...
[ "protected", "function", "validateGaProfileSettings", "(", ")", "{", "$", "profiles", "=", "$", "this", "->", "getSubmitted", "(", "'ga_profile_id'", ",", "array", "(", ")", ")", ";", "if", "(", "empty", "(", "$", "profiles", ")", ")", "{", "$", "this", ...
Validates Google Analytics profiles
[ "Validates", "Google", "Analytics", "profiles" ]
856a480e394bb3feaeea4785ccccad56abaac499
https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/controllers/Settings.php#L136-L161
197,436
eliasis-framework/complement
src/Traits/ComplementImport.php
ComplementImport.install
public function install() { if (! isset($this->complement['installation-files'])) { self::$errors[] = [ 'message' => $this->complement['path']['root'] ]; return false; } $this->deleteDirectory(); $this->changeState(); $in...
php
public function install() { if (! isset($this->complement['installation-files'])) { self::$errors[] = [ 'message' => $this->complement['path']['root'] ]; return false; } $this->deleteDirectory(); $this->changeState(); $in...
[ "public", "function", "install", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "complement", "[", "'installation-files'", "]", ")", ")", "{", "self", "::", "$", "errors", "[", "]", "=", "[", "'message'", "=>", "$", "this", "->", "...
Complement installation handler. @uses \Eliasis\Complement\Traits\ComplementState->changeState() @uses \Eliasis\Complement\Complement->$complement @return bool
[ "Complement", "installation", "handler", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementImport.php#L67-L98
197,437
eliasis-framework/complement
src/Traits/ComplementImport.php
ComplementImport.remove
public function remove() { $this->setState('uninstall'); $this->changeState(); if (! $this->deleteDirectory()) { $this->setState('uninstalled'); } return true; }
php
public function remove() { $this->setState('uninstall'); $this->changeState(); if (! $this->deleteDirectory()) { $this->setState('uninstalled'); } return true; }
[ "public", "function", "remove", "(", ")", "{", "$", "this", "->", "setState", "(", "'uninstall'", ")", ";", "$", "this", "->", "changeState", "(", ")", ";", "if", "(", "!", "$", "this", "->", "deleteDirectory", "(", ")", ")", "{", "$", "this", "->"...
Delete complement. @uses \Eliasis\Complement\Traits\ComplementState->getState() @uses \Eliasis\Complement\Traits\ComplementState->setState() @uses \Eliasis\Complement\Traits\ComplementState->changeState() @return bool true
[ "Delete", "complement", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementImport.php#L109-L120
197,438
eliasis-framework/complement
src/Traits/ComplementImport.php
ComplementImport.deleteDirectory
private function deleteDirectory() { $path = $this->complement['path']['root']; if (! $this->validateRoute($path)) { return false; } $isUninstall = ($this->getState() === 'inactive'); if (! File::deleteDirRecursively($path) && $isUninstall) { $type ...
php
private function deleteDirectory() { $path = $this->complement['path']['root']; if (! $this->validateRoute($path)) { return false; } $isUninstall = ($this->getState() === 'inactive'); if (! File::deleteDirRecursively($path) && $isUninstall) { $type ...
[ "private", "function", "deleteDirectory", "(", ")", "{", "$", "path", "=", "$", "this", "->", "complement", "[", "'path'", "]", "[", "'root'", "]", ";", "if", "(", "!", "$", "this", "->", "validateRoute", "(", "$", "path", ")", ")", "{", "return", ...
Delete complement directory. @uses \Eliasis\Complement\Complement->$complement @uses \Eliasis\Complement\Complement::$errors @uses \Eliasis\Complement\Traits\ComplementHandler::getType() @uses \Josantonius\File\File::deleteDirRecursively() @return string → complement state
[ "Delete", "complement", "directory", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementImport.php#L132-L153
197,439
eliasis-framework/complement
src/Traits/ComplementImport.php
ComplementImport.installComplement
private function installComplement($complement, $path, $slug, $root = true) { $path = ($root) ? $path : $path . key($complement) . '/'; if (! $this->validateRoute($path)) { return false; } if (! File::createDir($path)) { $msg = "The directory exists or could...
php
private function installComplement($complement, $path, $slug, $root = true) { $path = ($root) ? $path : $path . key($complement) . '/'; if (! $this->validateRoute($path)) { return false; } if (! File::createDir($path)) { $msg = "The directory exists or could...
[ "private", "function", "installComplement", "(", "$", "complement", ",", "$", "path", ",", "$", "slug", ",", "$", "root", "=", "true", ")", "{", "$", "path", "=", "(", "$", "root", ")", "?", "$", "path", ":", "$", "path", ".", "key", "(", "$", ...
Install complement. @param array $complement → complement files @param string $path → complement path @param string $slug → complement slug @param bool $root → root folder @uses \Eliasis\Framework\App::COMPLEMENT_URL() @uses \Eliasis\Complement\Traits\ComplementHandler::getType() @uses \Josantoni...
[ "Install", "complement", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementImport.php#L169-L205
197,440
eliasis-framework/complement
src/Traits/ComplementImport.php
ComplementImport.saveRemoteFile
private function saveRemoteFile($fileUrl, $filePath) { if (! $file = @file_get_contents($fileUrl)) { self::$errors[] = [ 'message' => 'Error to download file: ' . $fileUrl ]; return false; } if (! @file_put_contents($filePath, $file)) { ...
php
private function saveRemoteFile($fileUrl, $filePath) { if (! $file = @file_get_contents($fileUrl)) { self::$errors[] = [ 'message' => 'Error to download file: ' . $fileUrl ]; return false; } if (! @file_put_contents($filePath, $file)) { ...
[ "private", "function", "saveRemoteFile", "(", "$", "fileUrl", ",", "$", "filePath", ")", "{", "if", "(", "!", "$", "file", "=", "@", "file_get_contents", "(", "$", "fileUrl", ")", ")", "{", "self", "::", "$", "errors", "[", "]", "=", "[", "'message'"...
Save remote file. @param string $fileUrl → remote file url @param string $filePath → file path to save @return bool
[ "Save", "remote", "file", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementImport.php#L215-L234
197,441
modulusphp/security
Remember.php
Remember.boot
public function boot() { if (!is_dir(Remember::$tokensDir)) { mkdir(Remember::$tokensDir, 0777, true); } $this->hasTokens(); $this->configure(); $this->start(); }
php
public function boot() { if (!is_dir(Remember::$tokensDir)) { mkdir(Remember::$tokensDir, 0777, true); } $this->hasTokens(); $this->configure(); $this->start(); }
[ "public", "function", "boot", "(", ")", "{", "if", "(", "!", "is_dir", "(", "Remember", "::", "$", "tokensDir", ")", ")", "{", "mkdir", "(", "Remember", "::", "$", "tokensDir", ",", "0777", ",", "true", ")", ";", "}", "$", "this", "->", "hasTokens"...
Boot remember me component @return void
[ "Boot", "remember", "me", "component" ]
7a0b7f7a23f682588a3582b810d61266f7c14567
https://github.com/modulusphp/security/blob/7a0b7f7a23f682588a3582b810d61266f7c14567/Remember.php#L46-L55
197,442
modulusphp/security
Remember.php
Remember.hasTokens
public function hasTokens() { if (!is_writable(Remember::$tokensDir) || !is_dir(Remember::$tokensDir)) { $tokens = Remember::$tokensDir; return $this->exception("'$tokens' does not exist or is not writable by the web server"); } }
php
public function hasTokens() { if (!is_writable(Remember::$tokensDir) || !is_dir(Remember::$tokensDir)) { $tokens = Remember::$tokensDir; return $this->exception("'$tokens' does not exist or is not writable by the web server"); } }
[ "public", "function", "hasTokens", "(", ")", "{", "if", "(", "!", "is_writable", "(", "Remember", "::", "$", "tokensDir", ")", "||", "!", "is_dir", "(", "Remember", "::", "$", "tokensDir", ")", ")", "{", "$", "tokens", "=", "Remember", "::", "$", "to...
Check if the tokens directory exists or is writable @return void
[ "Check", "if", "the", "tokens", "directory", "exists", "or", "is", "writable" ]
7a0b7f7a23f682588a3582b810d61266f7c14567
https://github.com/modulusphp/security/blob/7a0b7f7a23f682588a3582b810d61266f7c14567/Remember.php#L62-L68
197,443
modulusphp/security
Remember.php
Remember.configure
public function configure() { $tokenGenerator = new DefaultToken(94, DefaultToken::FORMAT_BASE64); $expire = strtotime(Remember::$expire, 0); $cookie = new PHPCookie("application_session", $expire, "/", "", true, true); Remember::$storage = new FileStorage(Remember::$tokensDir); Remember::$remem...
php
public function configure() { $tokenGenerator = new DefaultToken(94, DefaultToken::FORMAT_BASE64); $expire = strtotime(Remember::$expire, 0); $cookie = new PHPCookie("application_session", $expire, "/", "", true, true); Remember::$storage = new FileStorage(Remember::$tokensDir); Remember::$remem...
[ "public", "function", "configure", "(", ")", "{", "$", "tokenGenerator", "=", "new", "DefaultToken", "(", "94", ",", "DefaultToken", "::", "FORMAT_BASE64", ")", ";", "$", "expire", "=", "strtotime", "(", "Remember", "::", "$", "expire", ",", "0", ")", ";...
Configure remember me @return void
[ "Configure", "remember", "me" ]
7a0b7f7a23f682588a3582b810d61266f7c14567
https://github.com/modulusphp/security/blob/7a0b7f7a23f682588a3582b810d61266f7c14567/Remember.php#L75-L84
197,444
modulusphp/security
Remember.php
Remember.start
public function start() { $rememberMe = Remember::$rememberMe; $loginResult = $rememberMe->login(); if ($loginResult->isSuccess()) { $_SESSION['_uas'] = $loginResult->getCredential(); $_SESSION['remembered_by_cookie'] = true; return; } if ($loginResult->hasPossibleManipulation(...
php
public function start() { $rememberMe = Remember::$rememberMe; $loginResult = $rememberMe->login(); if ($loginResult->isSuccess()) { $_SESSION['_uas'] = $loginResult->getCredential(); $_SESSION['remembered_by_cookie'] = true; return; } if ($loginResult->hasPossibleManipulation(...
[ "public", "function", "start", "(", ")", "{", "$", "rememberMe", "=", "Remember", "::", "$", "rememberMe", ";", "$", "loginResult", "=", "$", "rememberMe", "->", "login", "(", ")", ";", "if", "(", "$", "loginResult", "->", "isSuccess", "(", ")", ")", ...
Start remember me @return void
[ "Start", "remember", "me" ]
7a0b7f7a23f682588a3582b810d61266f7c14567
https://github.com/modulusphp/security/blob/7a0b7f7a23f682588a3582b810d61266f7c14567/Remember.php#L91-L115
197,445
MosaicPHP/Common
src/Arr.php
Arr.unwrap
public static function unwrap(array $input, $default = null) { if (count($input) > 1) { return $input; } return ! empty($input) ? current($input) : $default; }
php
public static function unwrap(array $input, $default = null) { if (count($input) > 1) { return $input; } return ! empty($input) ? current($input) : $default; }
[ "public", "static", "function", "unwrap", "(", "array", "$", "input", ",", "$", "default", "=", "null", ")", "{", "if", "(", "count", "(", "$", "input", ")", ">", "1", ")", "{", "return", "$", "input", ";", "}", "return", "!", "empty", "(", "$", ...
Unwraps a single item array into the item. If the array contains more than one item, it will be returned as-is. A default value can be provided, and will be used when an empty array is given. @param array $input @param mixed|null $default @return mixed
[ "Unwraps", "a", "single", "item", "array", "into", "the", "item", ".", "If", "the", "array", "contains", "more", "than", "one", "item", "it", "will", "be", "returned", "as", "-", "is", ".", "A", "default", "value", "can", "be", "provided", "and", "will...
f8b347f11401fb34e32f66ca3cec0cd9e743c0d4
https://github.com/MosaicPHP/Common/blob/f8b347f11401fb34e32f66ca3cec0cd9e743c0d4/src/Arr.php#L32-L39
197,446
PenoaksDev/Milky-Framework
src/Milky/Binding/ServiceResolver.php
ServiceResolver.resolveClass
public function resolveClass( $class ) { if ( !is_string( $class ) ) throw new ResolverException( "Class must be a string" ); // Check if a class has been mapped to a key if ( array_key_exists( $class, $this->classAlias ) ) try { return $this->resolve( null, $this->classAlias[$class] ); } cat...
php
public function resolveClass( $class ) { if ( !is_string( $class ) ) throw new ResolverException( "Class must be a string" ); // Check if a class has been mapped to a key if ( array_key_exists( $class, $this->classAlias ) ) try { return $this->resolve( null, $this->classAlias[$class] ); } cat...
[ "public", "function", "resolveClass", "(", "$", "class", ")", "{", "if", "(", "!", "is_string", "(", "$", "class", ")", ")", "throw", "new", "ResolverException", "(", "\"Class must be a string\"", ")", ";", "// Check if a class has been mapped to a key", "if", "("...
Called the a class needs resolving. Each registered resolver will be called for this purpose, the first to return non-false will succeed. @param string $class
[ "Called", "the", "a", "class", "needs", "resolving", ".", "Each", "registered", "resolver", "will", "be", "called", "for", "this", "purpose", "the", "first", "to", "return", "non", "-", "false", "will", "succeed", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Binding/ServiceResolver.php#L159-L183
197,447
gilbertsoft/typo3-gscacheconfig
Classes/Extension/Configurator.php
Configurator.additionalConfiguration
public static function additionalConfiguration($extensionKey) { // Get the configuration $extConf = self::getSanitizedExtConf($extensionKey); if ($extConf['cachingConfigEnable'] == 1) { self::handleCachingConfiguration($extConf); } }
php
public static function additionalConfiguration($extensionKey) { // Get the configuration $extConf = self::getSanitizedExtConf($extensionKey); if ($extConf['cachingConfigEnable'] == 1) { self::handleCachingConfiguration($extConf); } }
[ "public", "static", "function", "additionalConfiguration", "(", "$", "extensionKey", ")", "{", "// Get the configuration", "$", "extConf", "=", "self", "::", "getSanitizedExtConf", "(", "$", "extensionKey", ")", ";", "if", "(", "$", "extConf", "[", "'cachingConfig...
Called from additionalConfiguration.php. @param string $extensionKey Extension key @return void
[ "Called", "from", "additionalConfiguration", ".", "php", "." ]
dc6c3131b9e3d714b6c79c802c09ef1d165296d1
https://github.com/gilbertsoft/typo3-gscacheconfig/blob/dc6c3131b9e3d714b6c79c802c09ef1d165296d1/Classes/Extension/Configurator.php#L177-L185
197,448
polusphp/polus
src/Traits/ResponseTrait.php
ResponseTrait.setResponseBody
public function setResponseBody($data) { if (!is_string($data)) { $data = json_encode($data, \JSON_PRETTY_PRINT); } $this->response->getBody()->write($data); return $this; }
php
public function setResponseBody($data) { if (!is_string($data)) { $data = json_encode($data, \JSON_PRETTY_PRINT); } $this->response->getBody()->write($data); return $this; }
[ "public", "function", "setResponseBody", "(", "$", "data", ")", "{", "if", "(", "!", "is_string", "(", "$", "data", ")", ")", "{", "$", "data", "=", "json_encode", "(", "$", "data", ",", "\\", "JSON_PRETTY_PRINT", ")", ";", "}", "$", "this", "->", ...
Set response body if is not string json_encode @param mixed $data @return $this
[ "Set", "response", "body", "if", "is", "not", "string", "json_encode" ]
2de7c13e6ceaa8104a48172957cdb166e64bf342
https://github.com/polusphp/polus/blob/2de7c13e6ceaa8104a48172957cdb166e64bf342/src/Traits/ResponseTrait.php#L35-L42
197,449
olobu/olobu
fs/upload.php
Upload._curl
protected function _curl($data, $url) { //kalo tidak ada library curl, langsung gagal if ( ! function_exists("curl_init")) { return array( "output" => NULL, "status" => -1 ); } $data_string = json_encode($data); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($cur...
php
protected function _curl($data, $url) { //kalo tidak ada library curl, langsung gagal if ( ! function_exists("curl_init")) { return array( "output" => NULL, "status" => -1 ); } $data_string = json_encode($data); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($cur...
[ "protected", "function", "_curl", "(", "$", "data", ",", "$", "url", ")", "{", "//kalo tidak ada library curl, langsung gagal", "if", "(", "!", "function_exists", "(", "\"curl_init\"", ")", ")", "{", "return", "array", "(", "\"output\"", "=>", "NULL", ",", "\"...
request berupa CURL
[ "request", "berupa", "CURL" ]
05bea2bff63d3e38b458fb42e8f07f1d850ae211
https://github.com/olobu/olobu/blob/05bea2bff63d3e38b458fb42e8f07f1d850ae211/fs/upload.php#L308-L343
197,450
AndyDune/DateTime
src/DateTime.php
DateTime.setAction
public function setAction(AbstractAction $action) : DateTime { $this->action = $action; $this->action->setDateTime($this); return $this; }
php
public function setAction(AbstractAction $action) : DateTime { $this->action = $action; $this->action->setDateTime($this); return $this; }
[ "public", "function", "setAction", "(", "AbstractAction", "$", "action", ")", ":", "DateTime", "{", "$", "this", "->", "action", "=", "$", "action", ";", "$", "this", "->", "action", "->", "setDateTime", "(", "$", "this", ")", ";", "return", "$", "this...
Set strategy pattern action for modification array. Action callable object resieves whole array in container and return array ro replace. @param AbstractAction $action @return $this
[ "Set", "strategy", "pattern", "action", "for", "modification", "array", ".", "Action", "callable", "object", "resieves", "whole", "array", "in", "container", "and", "return", "array", "ro", "replace", "." ]
4f49f449b23072ac6d2ae0f1ea4b8e34804b760f
https://github.com/AndyDune/DateTime/blob/4f49f449b23072ac6d2ae0f1ea4b8e34804b760f/src/DateTime.php#L78-L83
197,451
AndyDune/DateTime
src/DateTime.php
DateTime.add
public function add($interval) : DateTime { if ($interval instanceof DateInterval) { $this->value->add($interval); return $this; } $i = $this->tryToCreateIntervalByDesignators($interval); if (!$i) { $i = DateInterval::createFromDateString($interva...
php
public function add($interval) : DateTime { if ($interval instanceof DateInterval) { $this->value->add($interval); return $this; } $i = $this->tryToCreateIntervalByDesignators($interval); if (!$i) { $i = DateInterval::createFromDateString($interva...
[ "public", "function", "add", "(", "$", "interval", ")", ":", "DateTime", "{", "if", "(", "$", "interval", "instanceof", "DateInterval", ")", "{", "$", "this", "->", "value", "->", "add", "(", "$", "interval", ")", ";", "return", "$", "this", ";", "}"...
Performs dates arithmetic. http://php.net/manual/en/datetime.formats.relative.php Each duration period is represented by an integer value followed by a period designator. If the duration contains time elements, that portion of the specification is preceded by the letter T. Period Designators: Y - years, M - months, D...
[ "Performs", "dates", "arithmetic", "." ]
4f49f449b23072ac6d2ae0f1ea4b8e34804b760f
https://github.com/AndyDune/DateTime/blob/4f49f449b23072ac6d2ae0f1ea4b8e34804b760f/src/DateTime.php#L155-L170
197,452
AndyDune/DateTime
src/DateTime.php
DateTime.getDateMonday
public function getDateMonday($format = 'Y-m-d') { $weekDay = $this->format('N') - 1; $dateTime = clone $this; if ($weekDay) { $dateTime->add(sprintf('- %d days', $weekDay)); } if ($format) { return $dateTime->format($format); } return ...
php
public function getDateMonday($format = 'Y-m-d') { $weekDay = $this->format('N') - 1; $dateTime = clone $this; if ($weekDay) { $dateTime->add(sprintf('- %d days', $weekDay)); } if ($format) { return $dateTime->format($format); } return ...
[ "public", "function", "getDateMonday", "(", "$", "format", "=", "'Y-m-d'", ")", "{", "$", "weekDay", "=", "$", "this", "->", "format", "(", "'N'", ")", "-", "1", ";", "$", "dateTime", "=", "clone", "$", "this", ";", "if", "(", "$", "weekDay", ")", ...
Returns monday date. @param string $format @return string|DateTime returns DateTime if empty param $format
[ "Returns", "monday", "date", "." ]
4f49f449b23072ac6d2ae0f1ea4b8e34804b760f
https://github.com/AndyDune/DateTime/blob/4f49f449b23072ac6d2ae0f1ea4b8e34804b760f/src/DateTime.php#L209-L220
197,453
ApatisArchive/ArrayStorage
src/CollectionSerializable.php
CollectionSerializable.unserialize
public function unserialize($serialized) { $serialized = @unserialize($serialized); if (!is_array($serialized)) { throw new \InvalidArgumentException( 'Invalid argument 1, arguments must be serialized of array.', E_USER_ERROR ); } ...
php
public function unserialize($serialized) { $serialized = @unserialize($serialized); if (!is_array($serialized)) { throw new \InvalidArgumentException( 'Invalid argument 1, arguments must be serialized of array.', E_USER_ERROR ); } ...
[ "public", "function", "unserialize", "(", "$", "serialized", ")", "{", "$", "serialized", "=", "@", "unserialize", "(", "$", "serialized", ")", ";", "if", "(", "!", "is_array", "(", "$", "serialized", ")", ")", "{", "throw", "new", "\\", "InvalidArgument...
Un-serialize Magic Method @param string $serialized
[ "Un", "-", "serialize", "Magic", "Method" ]
4f6515164352f2997275278b89884fc1e885e7d9
https://github.com/ApatisArchive/ArrayStorage/blob/4f6515164352f2997275278b89884fc1e885e7d9/src/CollectionSerializable.php#L27-L38
197,454
RudyMas/Emvc_Email
src/Email.php
Email.setup
public function setup(string $host, string $username, string $password, string $security, bool $use_smtp = true): void { $this->use_smtp = $use_smtp; $this->email_host = $host; $this->email_username = $username; $this->email_password = $password; $this->email_security = $secu...
php
public function setup(string $host, string $username, string $password, string $security, bool $use_smtp = true): void { $this->use_smtp = $use_smtp; $this->email_host = $host; $this->email_username = $username; $this->email_password = $password; $this->email_security = $secu...
[ "public", "function", "setup", "(", "string", "$", "host", ",", "string", "$", "username", ",", "string", "$", "password", ",", "string", "$", "security", ",", "bool", "$", "use_smtp", "=", "true", ")", ":", "void", "{", "$", "this", "->", "use_smtp", ...
Use this function when you use it in your own project @param string $host @param string $username @param string $password @param string $security @param bool $use_smtp
[ "Use", "this", "function", "when", "you", "use", "it", "in", "your", "own", "project" ]
9ac2380c6863549fdc30ea64e446bbc6a9ebbb06
https://github.com/RudyMas/Emvc_Email/blob/9ac2380c6863549fdc30ea64e446bbc6a9ebbb06/src/Email.php#L49-L56
197,455
RudyMas/Emvc_Email
src/Email.php
Email.emvc_config
public function emvc_config(): void { $this->use_smtp = USE_SMTP; $this->email_host = EMAIL_HOST; $this->email_username = EMAIL_USERNAME; $this->email_password = EMAIL_PASSWORD; $this->email_security = EMAIL_SECURITY; }
php
public function emvc_config(): void { $this->use_smtp = USE_SMTP; $this->email_host = EMAIL_HOST; $this->email_username = EMAIL_USERNAME; $this->email_password = EMAIL_PASSWORD; $this->email_security = EMAIL_SECURITY; }
[ "public", "function", "emvc_config", "(", ")", ":", "void", "{", "$", "this", "->", "use_smtp", "=", "USE_SMTP", ";", "$", "this", "->", "email_host", "=", "EMAIL_HOST", ";", "$", "this", "->", "email_username", "=", "EMAIL_USERNAME", ";", "$", "this", "...
Use this function when you use it in the EasyMVC framework
[ "Use", "this", "function", "when", "you", "use", "it", "in", "the", "EasyMVC", "framework" ]
9ac2380c6863549fdc30ea64e446bbc6a9ebbb06
https://github.com/RudyMas/Emvc_Email/blob/9ac2380c6863549fdc30ea64e446bbc6a9ebbb06/src/Email.php#L61-L68
197,456
RudyMas/Emvc_Email
src/Email.php
Email.setTextMessage
public function setTextMessage(array $to, string $subject, string $body, array $attachment = null, array $cc = null, array $bcc = EMAIL_BCC): voi...
php
public function setTextMessage(array $to, string $subject, string $body, array $attachment = null, array $cc = null, array $bcc = EMAIL_BCC): voi...
[ "public", "function", "setTextMessage", "(", "array", "$", "to", ",", "string", "$", "subject", ",", "string", "$", "body", ",", "array", "$", "attachment", "=", "null", ",", "array", "$", "cc", "=", "null", ",", "array", "$", "bcc", "=", "EMAIL_BCC", ...
Prepare a plain text E-mail @param array $to @param string $subject @param string $body @param array|null $attachment @param array|null $cc @param array $bcc
[ "Prepare", "a", "plain", "text", "E", "-", "mail" ]
9ac2380c6863549fdc30ea64e446bbc6a9ebbb06
https://github.com/RudyMas/Emvc_Email/blob/9ac2380c6863549fdc30ea64e446bbc6a9ebbb06/src/Email.php#L90-L118
197,457
RudyMas/Emvc_Email
src/Email.php
Email.sendMail
public function sendMail(): void { if ($this->use_smtp) { $mailer = new SmtpMailer([ 'host' => $this->email_host, 'username' => $this->email_username, 'password' => $this->email_password, 'secure' => $this->email_security ...
php
public function sendMail(): void { if ($this->use_smtp) { $mailer = new SmtpMailer([ 'host' => $this->email_host, 'username' => $this->email_username, 'password' => $this->email_password, 'secure' => $this->email_security ...
[ "public", "function", "sendMail", "(", ")", ":", "void", "{", "if", "(", "$", "this", "->", "use_smtp", ")", "{", "$", "mailer", "=", "new", "SmtpMailer", "(", "[", "'host'", "=>", "$", "this", "->", "email_host", ",", "'username'", "=>", "$", "this"...
Use this after your E-mail has been prepared
[ "Use", "this", "after", "your", "E", "-", "mail", "has", "been", "prepared" ]
9ac2380c6863549fdc30ea64e446bbc6a9ebbb06
https://github.com/RudyMas/Emvc_Email/blob/9ac2380c6863549fdc30ea64e446bbc6a9ebbb06/src/Email.php#L163-L176
197,458
RudyMas/Emvc_Email
src/Email.php
Email.emvcRenderHtml
public function emvcRenderHtml(string $latteFile, array $data): string { $latte = new Engine(); $latte->setTempDirectory($_SERVER['DOCUMENT_ROOT'] . BASE_URL . '/tmp/latte'); return $latte->renderToString($_SERVER['DOCUMENT_ROOT'] . BASE_URL . '/private/latte/' . $latteFile, $data); }
php
public function emvcRenderHtml(string $latteFile, array $data): string { $latte = new Engine(); $latte->setTempDirectory($_SERVER['DOCUMENT_ROOT'] . BASE_URL . '/tmp/latte'); return $latte->renderToString($_SERVER['DOCUMENT_ROOT'] . BASE_URL . '/private/latte/' . $latteFile, $data); }
[ "public", "function", "emvcRenderHtml", "(", "string", "$", "latteFile", ",", "array", "$", "data", ")", ":", "string", "{", "$", "latte", "=", "new", "Engine", "(", ")", ";", "$", "latte", "->", "setTempDirectory", "(", "$", "_SERVER", "[", "'DOCUMENT_R...
Use Latte for rendering HTML E-mails in the EasyMVC framework @param string $latteFile @param array $data @return string
[ "Use", "Latte", "for", "rendering", "HTML", "E", "-", "mails", "in", "the", "EasyMVC", "framework" ]
9ac2380c6863549fdc30ea64e446bbc6a9ebbb06
https://github.com/RudyMas/Emvc_Email/blob/9ac2380c6863549fdc30ea64e446bbc6a9ebbb06/src/Email.php#L185-L190
197,459
RudyMas/Emvc_Email
src/Email.php
Email.renderHtml
public function renderHtml(string $latteFile, array $data, string $tempFolderLatte = '/tmp/latte'): string { $latte = new Engine(); $latte->setTempDirectory($tempFolderLatte); return $latte->renderToString($latteFile, $data); }
php
public function renderHtml(string $latteFile, array $data, string $tempFolderLatte = '/tmp/latte'): string { $latte = new Engine(); $latte->setTempDirectory($tempFolderLatte); return $latte->renderToString($latteFile, $data); }
[ "public", "function", "renderHtml", "(", "string", "$", "latteFile", ",", "array", "$", "data", ",", "string", "$", "tempFolderLatte", "=", "'/tmp/latte'", ")", ":", "string", "{", "$", "latte", "=", "new", "Engine", "(", ")", ";", "$", "latte", "->", ...
Use Latte for rendering HTML E-mails in your own project @param string $latteFile @param array $data @param string $tempFolderLatte @return string
[ "Use", "Latte", "for", "rendering", "HTML", "E", "-", "mails", "in", "your", "own", "project" ]
9ac2380c6863549fdc30ea64e446bbc6a9ebbb06
https://github.com/RudyMas/Emvc_Email/blob/9ac2380c6863549fdc30ea64e446bbc6a9ebbb06/src/Email.php#L200-L205
197,460
netbull/CoreBundle
Utils/PrintLabels.php
PrintLabels.labelSetFormat
public function labelSetFormat($format, $unit) { $this->format = $format; $this->paperSize = $this->getFormatValue('paper-size'); $this->orientation = $this->getFormatValue('orientation'); $this->fontName = $this->getFormatValue('font-name'); $this->charSize = $this->getForma...
php
public function labelSetFormat($format, $unit) { $this->format = $format; $this->paperSize = $this->getFormatValue('paper-size'); $this->orientation = $this->getFormatValue('orientation'); $this->fontName = $this->getFormatValue('font-name'); $this->charSize = $this->getForma...
[ "public", "function", "labelSetFormat", "(", "$", "format", ",", "$", "unit", ")", "{", "$", "this", "->", "format", "=", "$", "format", ";", "$", "this", "->", "paperSize", "=", "$", "this", "->", "getFormatValue", "(", "'paper-size'", ")", ";", "$", ...
initialize label format settings. @param $format @param $unit
[ "initialize", "label", "format", "settings", "." ]
0bacc1d9e4733b6da613027400c48421e5a14645
https://github.com/netbull/CoreBundle/blob/0bacc1d9e4733b6da613027400c48421e5a14645/Utils/PrintLabels.php#L137-L157
197,461
netbull/CoreBundle
Utils/PrintLabels.php
PrintLabels.addPdfLabel
public function addPdfLabel(string $text) { if ($this->countX == $this->xNumber) { // Page full, we start a new one $this->AddPage(); $this->countX = 0; $this->countY = 0; } $posX = $this->marginLeft + ($this->countX * ($this->width + $this->x...
php
public function addPdfLabel(string $text) { if ($this->countX == $this->xNumber) { // Page full, we start a new one $this->AddPage(); $this->countX = 0; $this->countY = 0; } $posX = $this->marginLeft + ($this->countX * ($this->width + $this->x...
[ "public", "function", "addPdfLabel", "(", "string", "$", "text", ")", "{", "if", "(", "$", "this", "->", "countX", "==", "$", "this", "->", "xNumber", ")", "{", "// Page full, we start a new one", "$", "this", "->", "AddPage", "(", ")", ";", "$", "this",...
Print a label. @param string $text
[ "Print", "a", "label", "." ]
0bacc1d9e4733b6da613027400c48421e5a14645
https://github.com/netbull/CoreBundle/blob/0bacc1d9e4733b6da613027400c48421e5a14645/Utils/PrintLabels.php#L206-L228
197,462
linpax/microphp-framework
src/file/Type.php
Type.arrayWalkRecursive
public static function arrayWalkRecursive(array $data, callable $function) { if (!is_array($data)) { return call_user_func($function, $data); } foreach ($data as $k => &$item) { $item = self::arrayWalkRecursive($data[$k], $function); } return $data; ...
php
public static function arrayWalkRecursive(array $data, callable $function) { if (!is_array($data)) { return call_user_func($function, $data); } foreach ($data as $k => &$item) { $item = self::arrayWalkRecursive($data[$k], $function); } return $data; ...
[ "public", "static", "function", "arrayWalkRecursive", "(", "array", "$", "data", ",", "callable", "$", "function", ")", "{", "if", "(", "!", "is_array", "(", "$", "data", ")", ")", "{", "return", "call_user_func", "(", "$", "function", ",", "$", "data", ...
Array walk recursive @access public @param array $data array to walk @param callable $function callable function @return array|mixed @static
[ "Array", "walk", "recursive" ]
11f3370f3f64c516cce9b84ecd8276c6e9ae8df9
https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/file/Type.php#L70-L81
197,463
linpax/microphp-framework
src/file/Type.php
Type.getSubArrayFromArrayByKeys
public static function getSubArrayFromArrayByKeys(array $array, array $keys) { $result = []; foreach ($keys as $key) { if (array_key_exists($key, $array)) { $result[$key] = $array[$key]; } } return $result; }
php
public static function getSubArrayFromArrayByKeys(array $array, array $keys) { $result = []; foreach ($keys as $key) { if (array_key_exists($key, $array)) { $result[$key] = $array[$key]; } } return $result; }
[ "public", "static", "function", "getSubArrayFromArrayByKeys", "(", "array", "$", "array", ",", "array", "$", "keys", ")", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "keys", "as", "$", "key", ")", "{", "if", "(", "array_key_exists", "(...
Get SubArray from array by keys @access public @param array $array @param array $keys @return array @static
[ "Get", "SubArray", "from", "array", "by", "keys" ]
11f3370f3f64c516cce9b84ecd8276c6e9ae8df9
https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/file/Type.php#L94-L105
197,464
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Map/M2PTableMap.php
M2PTableMap.doDelete
public static function doDelete($values, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(M2PTableMap::DATABASE_NAME); } if ($values instanceof Criteria) { // rename for clarity $criteria = ...
php
public static function doDelete($values, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(M2PTableMap::DATABASE_NAME); } if ($values instanceof Criteria) { // rename for clarity $criteria = ...
[ "public", "static", "function", "doDelete", "(", "$", "values", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "if", "(", "null", "===", "$", "con", ")", "{", "$", "con", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "getW...
Performs a DELETE on the database, given a M2P or Criteria object OR a primary key value. @param mixed $values Criteria or M2P object or primary key or array of primary keys which is used to create the DELETE statement @param ConnectionInterface $con the connection to use @return int The num...
[ "Performs", "a", "DELETE", "on", "the", "database", "given", "a", "M2P", "or", "Criteria", "object", "OR", "a", "primary", "key", "value", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Map/M2PTableMap.php#L404-L442
197,465
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Map/M2PTableMap.php
M2PTableMap.doInsert
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(M2PTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for ...
php
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(M2PTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for ...
[ "public", "static", "function", "doInsert", "(", "$", "criteria", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "if", "(", "null", "===", "$", "con", ")", "{", "$", "con", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "ge...
Performs an INSERT on the database, given a M2P or Criteria object. @param mixed $criteria Criteria or M2P object containing data that is used to create the INSERT statement. @param ConnectionInterface $con the ConnectionInterface connection to use @return mixed The new primary key. @throws Pro...
[ "Performs", "an", "INSERT", "on", "the", "database", "given", "a", "M2P", "or", "Criteria", "object", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Map/M2PTableMap.php#L464-L485
197,466
fiiSoft/fiisoft-logger
src/Logger/Reader/LogsMonitor/AbstractLogsMonitor.php
AbstractLogsMonitor.filterByLevel
final public function filterByLevel($level, array $levels = []) { if ($level !== $this->minLevel) { $this->minLevel = $level; $this->consumer = null; } if (!empty($levels)) { $this->levels = $levels; $this->consumer = null; } ...
php
final public function filterByLevel($level, array $levels = []) { if ($level !== $this->minLevel) { $this->minLevel = $level; $this->consumer = null; } if (!empty($levels)) { $this->levels = $levels; $this->consumer = null; } ...
[ "final", "public", "function", "filterByLevel", "(", "$", "level", ",", "array", "$", "levels", "=", "[", "]", ")", "{", "if", "(", "$", "level", "!==", "$", "this", "->", "minLevel", ")", "{", "$", "this", "->", "minLevel", "=", "$", "level", ";",...
One can set minimum level of logs that will be streamed to OutputWriter by this LogsMonitor. This is optional and if method is not call, all available logs are supposed to be streamed. If second param is not empty then use this set of levels instead of defaults. The list of Levels must be ordered from the most to the ...
[ "One", "can", "set", "minimum", "level", "of", "logs", "that", "will", "be", "streamed", "to", "OutputWriter", "by", "this", "LogsMonitor", ".", "This", "is", "optional", "and", "if", "method", "is", "not", "call", "all", "available", "logs", "are", "suppo...
3d2eb9d18a785ec119d2fbeb9d34b74265e7dcf5
https://github.com/fiiSoft/fiisoft-logger/blob/3d2eb9d18a785ec119d2fbeb9d34b74265e7dcf5/src/Logger/Reader/LogsMonitor/AbstractLogsMonitor.php#L66-L79
197,467
fiiSoft/fiisoft-logger
src/Logger/Reader/LogsMonitor/AbstractLogsMonitor.php
AbstractLogsMonitor.filterByContext
final public function filterByContext(array $context) { if ($context !== $this->withContext) { $this->withContext = $context; $this->consumer = null; } return $this; }
php
final public function filterByContext(array $context) { if ($context !== $this->withContext) { $this->withContext = $context; $this->consumer = null; } return $this; }
[ "final", "public", "function", "filterByContext", "(", "array", "$", "context", ")", "{", "if", "(", "$", "context", "!==", "$", "this", "->", "withContext", ")", "{", "$", "this", "->", "withContext", "=", "$", "context", ";", "$", "this", "->", "cons...
One can set context that is required to stream logs to OutputWriter by this LogsMonitor. This is optional and if method is not call, all available logs are supposed to be streamed. @param array $context @return $this fluent interface
[ "One", "can", "set", "context", "that", "is", "required", "to", "stream", "logs", "to", "OutputWriter", "by", "this", "LogsMonitor", ".", "This", "is", "optional", "and", "if", "method", "is", "not", "call", "all", "available", "logs", "are", "supposed", "...
3d2eb9d18a785ec119d2fbeb9d34b74265e7dcf5
https://github.com/fiiSoft/fiisoft-logger/blob/3d2eb9d18a785ec119d2fbeb9d34b74265e7dcf5/src/Logger/Reader/LogsMonitor/AbstractLogsMonitor.php#L88-L96
197,468
fiiSoft/fiisoft-logger
src/Logger/Reader/LogsMonitor/AbstractLogsMonitor.php
AbstractLogsMonitor.setOutputWriter
final public function setOutputWriter(OutputWriter $outputWriter) { if ($outputWriter !== $this->outputWriter) { $this->outputWriter = $outputWriter; $this->consumer = null; } return $this; }
php
final public function setOutputWriter(OutputWriter $outputWriter) { if ($outputWriter !== $this->outputWriter) { $this->outputWriter = $outputWriter; $this->consumer = null; } return $this; }
[ "final", "public", "function", "setOutputWriter", "(", "OutputWriter", "$", "outputWriter", ")", "{", "if", "(", "$", "outputWriter", "!==", "$", "this", "->", "outputWriter", ")", "{", "$", "this", "->", "outputWriter", "=", "$", "outputWriter", ";", "$", ...
Call of this method is required before logs are streamed to OutputWriter. @param OutputWriter $outputWriter @return $this fluent interface
[ "Call", "of", "this", "method", "is", "required", "before", "logs", "are", "streamed", "to", "OutputWriter", "." ]
3d2eb9d18a785ec119d2fbeb9d34b74265e7dcf5
https://github.com/fiiSoft/fiisoft-logger/blob/3d2eb9d18a785ec119d2fbeb9d34b74265e7dcf5/src/Logger/Reader/LogsMonitor/AbstractLogsMonitor.php#L104-L112
197,469
Kris-Kuiper/sFire-Framework
src/Image/Color.php
Color.name
public static function name($color) { if(false === is_string($color)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($color)), E_USER_ERROR); } if(1 !== preg_match('#^[0-9a-fA-F]{6,6}$#', $color)) { return trigger_error(sprintf...
php
public static function name($color) { if(false === is_string($color)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($color)), E_USER_ERROR); } if(1 !== preg_match('#^[0-9a-fA-F]{6,6}$#', $color)) { return trigger_error(sprintf...
[ "public", "static", "function", "name", "(", "$", "color", ")", "{", "if", "(", "false", "===", "is_string", "(", "$", "color", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Argument 1 passed to %s() must be of the type string, \"%s\" given'", "...
Convert a hexadecimal color to color name in human language @param string $color @return null|stdClass Object
[ "Convert", "a", "hexadecimal", "color", "to", "color", "name", "in", "human", "language" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Image/Color.php#L28-L78
197,470
Kris-Kuiper/sFire-Framework
src/Image/Color.php
Color.index
private static function index() { $colors = ColorList :: get('colors'); foreach($colors as $hex => $color) { $rgb = static :: rgb($hex); $hsl = static :: hsl($hex); $shade = ColorList :: get(['shades', $color['s']]); $base = ColorList :: get(['base', $shade['b']]); static :: $...
php
private static function index() { $colors = ColorList :: get('colors'); foreach($colors as $hex => $color) { $rgb = static :: rgb($hex); $hsl = static :: hsl($hex); $shade = ColorList :: get(['shades', $color['s']]); $base = ColorList :: get(['base', $shade['b']]); static :: $...
[ "private", "static", "function", "index", "(", ")", "{", "$", "colors", "=", "ColorList", "::", "get", "(", "'colors'", ")", ";", "foreach", "(", "$", "colors", "as", "$", "hex", "=>", "$", "color", ")", "{", "$", "rgb", "=", "static", "::", "rgb",...
Initialise all colors
[ "Initialise", "all", "colors" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Image/Color.php#L84-L119
197,471
Kris-Kuiper/sFire-Framework
src/Image/Color.php
Color.rgb
private static function rgb($color) { return (object) [ 'r' => intval(hexdec(substr($color, 0, 2))), 'g' => intval(hexdec(substr($color, 2, 2))), 'b' => intval(hexdec(substr($color, 4, 2))) ]; }
php
private static function rgb($color) { return (object) [ 'r' => intval(hexdec(substr($color, 0, 2))), 'g' => intval(hexdec(substr($color, 2, 2))), 'b' => intval(hexdec(substr($color, 4, 2))) ]; }
[ "private", "static", "function", "rgb", "(", "$", "color", ")", "{", "return", "(", "object", ")", "[", "'r'", "=>", "intval", "(", "hexdec", "(", "substr", "(", "$", "color", ",", "0", ",", "2", ")", ")", ")", ",", "'g'", "=>", "intval", "(", ...
Convert hexadecimal color to RGB @param string $color @return stdClass Object
[ "Convert", "hexadecimal", "color", "to", "RGB" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Image/Color.php#L127-L135
197,472
Kris-Kuiper/sFire-Framework
src/Image/Color.php
Color.hsl
private static function hsl($color) { $r = intval(hexdec(substr($color, 0, 2))) / 255; $g = intval(hexdec(substr($color, 2, 2))) / 255; $b = intval(hexdec(substr($color, 4, 2))) / 255; $min = min($r, $g, $b); $max = max($r, $g, $b); $delta = $max - $min; $l = ($min + $max) / 2; $s = 0...
php
private static function hsl($color) { $r = intval(hexdec(substr($color, 0, 2))) / 255; $g = intval(hexdec(substr($color, 2, 2))) / 255; $b = intval(hexdec(substr($color, 4, 2))) / 255; $min = min($r, $g, $b); $max = max($r, $g, $b); $delta = $max - $min; $l = ($min + $max) / 2; $s = 0...
[ "private", "static", "function", "hsl", "(", "$", "color", ")", "{", "$", "r", "=", "intval", "(", "hexdec", "(", "substr", "(", "$", "color", ",", "0", ",", "2", ")", ")", ")", "/", "255", ";", "$", "g", "=", "intval", "(", "hexdec", "(", "s...
Convert hexadecimal color to HSL @param string $color @return stdClass Object
[ "Convert", "hexadecimal", "color", "to", "HSL" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Image/Color.php#L143-L183
197,473
koolkode/lexer
src/AbstractToken.php
AbstractToken.serialize
public function serialize(SerializedTokenIterator $it) { $it->append($this->type); $it->append($this->text); }
php
public function serialize(SerializedTokenIterator $it) { $it->append($this->type); $it->append($this->text); }
[ "public", "function", "serialize", "(", "SerializedTokenIterator", "$", "it", ")", "{", "$", "it", "->", "append", "(", "$", "this", "->", "type", ")", ";", "$", "it", "->", "append", "(", "$", "this", "->", "text", ")", ";", "}" ]
Serialize the token into the given token interation. @param SerializedTokenIterator $it
[ "Serialize", "the", "token", "into", "the", "given", "token", "interation", "." ]
1f33fb4e95bf3b6b21c63187e503bbe612a1646c
https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractToken.php#L129-L133
197,474
koolkode/lexer
src/AbstractToken.php
AbstractToken.getTypeName
public static function getTypeName($type) { static $ref = []; $key = static::class; if(empty($ref[$key])) { $ref[$key] = new \ReflectionClass($key); } foreach($ref[$key]->getConstants() as $k => $v) { if($v === $type && strpos($k, 'T_') === 0) { return $k; } } return static:...
php
public static function getTypeName($type) { static $ref = []; $key = static::class; if(empty($ref[$key])) { $ref[$key] = new \ReflectionClass($key); } foreach($ref[$key]->getConstants() as $k => $v) { if($v === $type && strpos($k, 'T_') === 0) { return $k; } } return static:...
[ "public", "static", "function", "getTypeName", "(", "$", "type", ")", "{", "static", "$", "ref", "=", "[", "]", ";", "$", "key", "=", "static", "::", "class", ";", "if", "(", "empty", "(", "$", "ref", "[", "$", "key", "]", ")", ")", "{", "$", ...
Get a human-readable name of the given token type. @param integer $type @return string
[ "Get", "a", "human", "-", "readable", "name", "of", "the", "given", "token", "type", "." ]
1f33fb4e95bf3b6b21c63187e503bbe612a1646c
https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractToken.php#L141-L161
197,475
Erdiko/doctrine
src/EntityManager.php
EntityManager.getEntityManager
public static function getEntityManager($db = null, $context = 'shared') { // Get db config info from file $dbConfig = \erdiko\core\Helper::getConfig("database", $context); if($db == null) $db = $dbConfig['default']; $dbParams = $dbConfig['connections'][$db]; $dbP...
php
public static function getEntityManager($db = null, $context = 'shared') { // Get db config info from file $dbConfig = \erdiko\core\Helper::getConfig("database", $context); if($db == null) $db = $dbConfig['default']; $dbParams = $dbConfig['connections'][$db]; $dbP...
[ "public", "static", "function", "getEntityManager", "(", "$", "db", "=", "null", ",", "$", "context", "=", "'shared'", ")", "{", "// Get db config info from file", "$", "dbConfig", "=", "\\", "erdiko", "\\", "core", "\\", "Helper", "::", "getConfig", "(", "\...
Get Doctrine entity manager @param string $db, default to the 'default' database in the config @param string
[ "Get", "Doctrine", "entity", "manager" ]
b8fdba2f34a67c862cafc0448d1d613a2fa4da16
https://github.com/Erdiko/doctrine/blob/b8fdba2f34a67c862cafc0448d1d613a2fa4da16/src/EntityManager.php#L18-L34
197,476
Erdiko/doctrine
src/EntityManager.php
EntityManager.update
public static function update($entity) { $entityManager = self::getEntityManager(); $entity = $entityManager->merge($entity); $entityManager->flush(); // transact return $entity; }
php
public static function update($entity) { $entityManager = self::getEntityManager(); $entity = $entityManager->merge($entity); $entityManager->flush(); // transact return $entity; }
[ "public", "static", "function", "update", "(", "$", "entity", ")", "{", "$", "entityManager", "=", "self", "::", "getEntityManager", "(", ")", ";", "$", "entity", "=", "$", "entityManager", "->", "merge", "(", "$", "entity", ")", ";", "$", "entityManager...
Update a single record Convenience method to update a row. You should use the Doctrine EntityManager directly to take control of the Entity merge process. @note do we need this?
[ "Update", "a", "single", "record", "Convenience", "method", "to", "update", "a", "row", ".", "You", "should", "use", "the", "Doctrine", "EntityManager", "directly", "to", "take", "control", "of", "the", "Entity", "merge", "process", "." ]
b8fdba2f34a67c862cafc0448d1d613a2fa4da16
https://github.com/Erdiko/doctrine/blob/b8fdba2f34a67c862cafc0448d1d613a2fa4da16/src/EntityManager.php#L42-L49
197,477
sil-project/SeedBatchBundle
src/Entity/Plot.php
Plot.addSeedBatch
public function addSeedBatch(\Librinfo\SeedBatchBundle\Entity\SeedBatch $seedBatch) { $this->seedBatches[] = $seedBatch; return $this; }
php
public function addSeedBatch(\Librinfo\SeedBatchBundle\Entity\SeedBatch $seedBatch) { $this->seedBatches[] = $seedBatch; return $this; }
[ "public", "function", "addSeedBatch", "(", "\\", "Librinfo", "\\", "SeedBatchBundle", "\\", "Entity", "\\", "SeedBatch", "$", "seedBatch", ")", "{", "$", "this", "->", "seedBatches", "[", "]", "=", "$", "seedBatch", ";", "return", "$", "this", ";", "}" ]
Add seedBatch. @param \Librinfo\SeedBatchBundle\Entity\SeedBatch $seedBatch @return Plot
[ "Add", "seedBatch", "." ]
a2640b5359fe31d3bdb9c9fa2f72141ac841729c
https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/Entity/Plot.php#L114-L119
197,478
sil-project/SeedBatchBundle
src/Entity/Plot.php
Plot.removeSeedBatch
public function removeSeedBatch(\Librinfo\SeedBatchBundle\Entity\SeedBatch $seedBatch) { return $this->seedBatches->removeElement($seedBatch); }
php
public function removeSeedBatch(\Librinfo\SeedBatchBundle\Entity\SeedBatch $seedBatch) { return $this->seedBatches->removeElement($seedBatch); }
[ "public", "function", "removeSeedBatch", "(", "\\", "Librinfo", "\\", "SeedBatchBundle", "\\", "Entity", "\\", "SeedBatch", "$", "seedBatch", ")", "{", "return", "$", "this", "->", "seedBatches", "->", "removeElement", "(", "$", "seedBatch", ")", ";", "}" ]
Remove seedBatch. @param \Librinfo\SeedBatchBundle\Entity\SeedBatch $seedBatch @return bool tRUE if this collection contained the specified element, FALSE otherwise
[ "Remove", "seedBatch", "." ]
a2640b5359fe31d3bdb9c9fa2f72141ac841729c
https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/Entity/Plot.php#L128-L131
197,479
sil-project/SeedBatchBundle
src/Entity/Plot.php
Plot.setProducer
public function setProducer(\Librinfo\CRMBundle\Entity\Organism $producer = null) { $this->producer = $producer; return $this; }
php
public function setProducer(\Librinfo\CRMBundle\Entity\Organism $producer = null) { $this->producer = $producer; return $this; }
[ "public", "function", "setProducer", "(", "\\", "Librinfo", "\\", "CRMBundle", "\\", "Entity", "\\", "Organism", "$", "producer", "=", "null", ")", "{", "$", "this", "->", "producer", "=", "$", "producer", ";", "return", "$", "this", ";", "}" ]
Set producer. @param \Librinfo\CRMBundle\Entity\Organism $producer @return Plot
[ "Set", "producer", "." ]
a2640b5359fe31d3bdb9c9fa2f72141ac841729c
https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/Entity/Plot.php#L150-L155
197,480
sil-project/SeedBatchBundle
src/Entity/Plot.php
Plot.addCertification
public function addCertification(\Librinfo\SeedBatchBundle\Entity\Certification $certifications) { $this->certifications[] = $certifications; return $this; }
php
public function addCertification(\Librinfo\SeedBatchBundle\Entity\Certification $certifications) { $this->certifications[] = $certifications; return $this; }
[ "public", "function", "addCertification", "(", "\\", "Librinfo", "\\", "SeedBatchBundle", "\\", "Entity", "\\", "Certification", "$", "certifications", ")", "{", "$", "this", "->", "certifications", "[", "]", "=", "$", "certifications", ";", "return", "$", "th...
Add certifications. @param \Librinfo\SeedBatchBundle\Entity\Certification $certifications @return Plot
[ "Add", "certifications", "." ]
a2640b5359fe31d3bdb9c9fa2f72141ac841729c
https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/Entity/Plot.php#L188-L193
197,481
sil-project/SeedBatchBundle
src/Entity/Plot.php
Plot.removeCertification
public function removeCertification(\Librinfo\SeedBatchBundle\Entity\Certification $certification) { $this->certifications->removeElement($certification); }
php
public function removeCertification(\Librinfo\SeedBatchBundle\Entity\Certification $certification) { $this->certifications->removeElement($certification); }
[ "public", "function", "removeCertification", "(", "\\", "Librinfo", "\\", "SeedBatchBundle", "\\", "Entity", "\\", "Certification", "$", "certification", ")", "{", "$", "this", "->", "certifications", "->", "removeElement", "(", "$", "certification", ")", ";", "...
Remove certification. @param \Librinfo\SeedBatchBundle\Entity\Certification $certification
[ "Remove", "certification", "." ]
a2640b5359fe31d3bdb9c9fa2f72141ac841729c
https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/Entity/Plot.php#L200-L203
197,482
mrstroz/yii2-wavecms-form
models/FormSettings.php
FormSettings.replaceTags
public function replaceTags($model) { if (isset($model->attributes)) { foreach ($model->attributes as $key => $attribute) { if (in_array($key, $this->dataAttributes)) { $val = Yii::$app->formatter->asDatetime($model->{$key}, 'short'); } else { ...
php
public function replaceTags($model) { if (isset($model->attributes)) { foreach ($model->attributes as $key => $attribute) { if (in_array($key, $this->dataAttributes)) { $val = Yii::$app->formatter->asDatetime($model->{$key}, 'short'); } else { ...
[ "public", "function", "replaceTags", "(", "$", "model", ")", "{", "if", "(", "isset", "(", "$", "model", "->", "attributes", ")", ")", "{", "foreach", "(", "$", "model", "->", "attributes", "as", "$", "key", "=>", "$", "attribute", ")", "{", "if", ...
Replace tags by values in text and subject field @param Form $model @throws \yii\base\InvalidArgumentException @throws \yii\base\InvalidConfigException @throws \yii\base\InvalidParamException @throws \Exception
[ "Replace", "tags", "by", "values", "in", "text", "and", "subject", "field" ]
9ada0dbbe07b2281fb20905f7cfd07e4075bd065
https://github.com/mrstroz/yii2-wavecms-form/blob/9ada0dbbe07b2281fb20905f7cfd07e4075bd065/models/FormSettings.php#L125-L150
197,483
mrstroz/yii2-wavecms-form
models/FormSettings.php
FormSettings.replaceExtraTag
public function replaceExtraTag($tag, $value) { $this->subject = str_replace('{' . $tag . '}', $value, $this->subject); $this->user_subject = str_replace('{' . $tag . '}', $value, $this->user_subject); $this->text = str_replace('{' . $tag . '}', $value, $this->text); $this->user_text...
php
public function replaceExtraTag($tag, $value) { $this->subject = str_replace('{' . $tag . '}', $value, $this->subject); $this->user_subject = str_replace('{' . $tag . '}', $value, $this->user_subject); $this->text = str_replace('{' . $tag . '}', $value, $this->text); $this->user_text...
[ "public", "function", "replaceExtraTag", "(", "$", "tag", ",", "$", "value", ")", "{", "$", "this", "->", "subject", "=", "str_replace", "(", "'{'", ".", "$", "tag", ".", "'}'", ",", "$", "value", ",", "$", "this", "->", "subject", ")", ";", "$", ...
Replace additional tags in email subject and text @param $tag @param $value
[ "Replace", "additional", "tags", "in", "email", "subject", "and", "text" ]
9ada0dbbe07b2281fb20905f7cfd07e4075bd065
https://github.com/mrstroz/yii2-wavecms-form/blob/9ada0dbbe07b2281fb20905f7cfd07e4075bd065/models/FormSettings.php#L157-L163
197,484
Soneritics/Database
Soneritics/Database/Query/Count.php
Count.fields
public function fields($fields) { if (!is_string($fields)) { throw new FatalException('Only strings are allowed in COUNT query'); } $this->fields = sprintf( 'COUNT(%s)', DatabaseConnectionFactory::get()->quoteIdentifier($fields) ); ...
php
public function fields($fields) { if (!is_string($fields)) { throw new FatalException('Only strings are allowed in COUNT query'); } $this->fields = sprintf( 'COUNT(%s)', DatabaseConnectionFactory::get()->quoteIdentifier($fields) ); ...
[ "public", "function", "fields", "(", "$", "fields", ")", "{", "if", "(", "!", "is_string", "(", "$", "fields", ")", ")", "{", "throw", "new", "FatalException", "(", "'Only strings are allowed in COUNT query'", ")", ";", "}", "$", "this", "->", "fields", "=...
Set the field to count. @param $fields @return $this @throws FatalException
[ "Set", "the", "field", "to", "count", "." ]
20cb74f2a2ee8d9161d3144b5c061a6da11cd066
https://github.com/Soneritics/Database/blob/20cb74f2a2ee8d9161d3144b5c061a6da11cd066/Soneritics/Database/Query/Count.php#L47-L59
197,485
libreworks/caridea-container
src/Provider.php
Provider.get
public function get(Container $container) { if ($this->singleton) { if ($this->instance === null) { $f = $this->factory; $this->instance = $f($container); } return $this->instance; } else { $f = $this->factory; ...
php
public function get(Container $container) { if ($this->singleton) { if ($this->instance === null) { $f = $this->factory; $this->instance = $f($container); } return $this->instance; } else { $f = $this->factory; ...
[ "public", "function", "get", "(", "Container", "$", "container", ")", "{", "if", "(", "$", "this", "->", "singleton", ")", "{", "if", "(", "$", "this", "->", "instance", "===", "null", ")", "{", "$", "f", "=", "$", "this", "->", "factory", ";", "...
Gets the value instance. @param \Caridea\Container\Container $container The owning container @return mixed The value instance
[ "Gets", "the", "value", "instance", "." ]
b93087ff5bf49f5885025da691575093335bfe8f
https://github.com/libreworks/caridea-container/blob/b93087ff5bf49f5885025da691575093335bfe8f/src/Provider.php#L70-L82
197,486
bytic/MediaLibrary
src/Loaders/AbstractLoader.php
AbstractLoader.loadMedia
public function loadMedia() { $files = $this->getMediaFiles(); foreach ($files as $file) { $mediaFile = $this->getCollection()->newMedia(); $mediaFile->setFile($file); $this->appendMediaInCollection($mediaFile); } }
php
public function loadMedia() { $files = $this->getMediaFiles(); foreach ($files as $file) { $mediaFile = $this->getCollection()->newMedia(); $mediaFile->setFile($file); $this->appendMediaInCollection($mediaFile); } }
[ "public", "function", "loadMedia", "(", ")", "{", "$", "files", "=", "$", "this", "->", "getMediaFiles", "(", ")", ";", "foreach", "(", "$", "files", "as", "$", "file", ")", "{", "$", "mediaFile", "=", "$", "this", "->", "getCollection", "(", ")", ...
Load media for a collection
[ "Load", "media", "for", "a", "collection" ]
c52783e726b512184bd72e04d829d6f93242a61d
https://github.com/bytic/MediaLibrary/blob/c52783e726b512184bd72e04d829d6f93242a61d/src/Loaders/AbstractLoader.php#L47-L56
197,487
Palmabit-IT/library
src/Palmabit/Library/ImportExport/Reader.php
Reader.istantiateObjects
public function istantiateObjects() { $this->validateObjectClassName(); $objects_iterator = new ArrayIterator; $this->appendObjectDataToIterator($objects_iterator); $this->objects_istantiated = $objects_iterator; return $this->objects_istantiated; }
php
public function istantiateObjects() { $this->validateObjectClassName(); $objects_iterator = new ArrayIterator; $this->appendObjectDataToIterator($objects_iterator); $this->objects_istantiated = $objects_iterator; return $this->objects_istantiated; }
[ "public", "function", "istantiateObjects", "(", ")", "{", "$", "this", "->", "validateObjectClassName", "(", ")", ";", "$", "objects_iterator", "=", "new", "ArrayIterator", ";", "$", "this", "->", "appendObjectDataToIterator", "(", "$", "objects_iterator", ")", ...
Assuming that we can pass all the proprieties to that object as an array we istantiate each of that StdClass as a IstantiatedObject @return \ArrayIterator @throws \Exception
[ "Assuming", "that", "we", "can", "pass", "all", "the", "proprieties", "to", "that", "object", "as", "an", "array", "we", "istantiate", "each", "of", "that", "StdClass", "as", "a", "IstantiatedObject" ]
ec49a3c333eb4e94d9610a0f58d82c9ea1ade4b9
https://github.com/Palmabit-IT/library/blob/ec49a3c333eb4e94d9610a0f58d82c9ea1ade4b9/src/Palmabit/Library/ImportExport/Reader.php#L53-L63
197,488
TomK/CronParser
src/CronParser.php
CronParser.isDue
public static function isDue($pattern, \DateTime $time = null) { if($time === null) { $time = new \DateTime(); } // trim time back to last round minute $time->setTime($time->format('H'), $time->format('i')); $expression = Expression::createFromPattern($pattern); foreach(self::$_for...
php
public static function isDue($pattern, \DateTime $time = null) { if($time === null) { $time = new \DateTime(); } // trim time back to last round minute $time->setTime($time->format('H'), $time->format('i')); $expression = Expression::createFromPattern($pattern); foreach(self::$_for...
[ "public", "static", "function", "isDue", "(", "$", "pattern", ",", "\\", "DateTime", "$", "time", "=", "null", ")", "{", "if", "(", "$", "time", "===", "null", ")", "{", "$", "time", "=", "new", "\\", "DateTime", "(", ")", ";", "}", "// trim time b...
Returns true if the time matches the pattern supplied. Time defaults to current time. @param $pattern @param \DateTime $time @return bool
[ "Returns", "true", "if", "the", "time", "matches", "the", "pattern", "supplied", ".", "Time", "defaults", "to", "current", "time", "." ]
cdb1133e49ac2f68b45665f6df2a551bfb9824c1
https://github.com/TomK/CronParser/blob/cdb1133e49ac2f68b45665f6df2a551bfb9824c1/src/CronParser.php#L142-L199
197,489
ezra-obiwale/dSCore
src/Form/Fieldset.php
Fieldset.getAttributes
final public function getAttributes($parsed = false) { if (!is_array($this->attributes)) { $this->attributes = array(); } return ($parsed) ? $this->parseAttributes() : $this->attributes; }
php
final public function getAttributes($parsed = false) { if (!is_array($this->attributes)) { $this->attributes = array(); } return ($parsed) ? $this->parseAttributes() : $this->attributes; }
[ "final", "public", "function", "getAttributes", "(", "$", "parsed", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "this", "->", "attributes", ")", ")", "{", "$", "this", "->", "attributes", "=", "array", "(", ")", ";", "}", "return", ...
Fetches the attributes of the fieldset @param boolean $parsed @return string|array
[ "Fetches", "the", "attributes", "of", "the", "fieldset" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Fieldset.php#L106-L111
197,490
ezra-obiwale/dSCore
src/Form/Fieldset.php
Fieldset.setModel
final public function setModel(IModel $model) { $this->model = $model; $this->setData($model->toArray(false, true)); return $this; }
php
final public function setModel(IModel $model) { $this->model = $model; $this->setData($model->toArray(false, true)); return $this; }
[ "final", "public", "function", "setModel", "(", "IModel", "$", "model", ")", "{", "$", "this", "->", "model", "=", "$", "model", ";", "$", "this", "->", "setData", "(", "$", "model", "->", "toArray", "(", "false", ",", "true", ")", ")", ";", "retur...
Maps the form to a model @param IModel $model @return Form
[ "Maps", "the", "form", "to", "a", "model" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Fieldset.php#L132-L136
197,491
ezra-obiwale/dSCore
src/Form/Fieldset.php
Fieldset.getModel
public function getModel() { if (!$this->model) return null; $data = $this->data; if ($this->isValid() && $this->model) { foreach ($this->fieldsets as $name) { if (!isset($this->elements[$name])) continue; $fieldset = ...
php
public function getModel() { if (!$this->model) return null; $data = $this->data; if ($this->isValid() && $this->model) { foreach ($this->fieldsets as $name) { if (!isset($this->elements[$name])) continue; $fieldset = ...
[ "public", "function", "getModel", "(", ")", "{", "if", "(", "!", "$", "this", "->", "model", ")", "return", "null", ";", "$", "data", "=", "$", "this", "->", "data", ";", "if", "(", "$", "this", "->", "isValid", "(", ")", "&&", "$", "this", "->...
Fetches the populated model @return IModel
[ "Fetches", "the", "populated", "model" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Fieldset.php#L146-L164
197,492
ezra-obiwale/dSCore
src/Form/Fieldset.php
Fieldset.add
public function add($element) { if ((is_object($element) && !is_a($element, 'DScribe\Form\Element')) || (!is_object($element) && !is_array($element))) throw new Exception('Form elements must be either an array or an object subclass of DScribe\Form\Element'); else if (is_array...
php
public function add($element) { if ((is_object($element) && !is_a($element, 'DScribe\Form\Element')) || (!is_object($element) && !is_array($element))) throw new Exception('Form elements must be either an array or an object subclass of DScribe\Form\Element'); else if (is_array...
[ "public", "function", "add", "(", "$", "element", ")", "{", "if", "(", "(", "is_object", "(", "$", "element", ")", "&&", "!", "is_a", "(", "$", "element", ",", "'DScribe\\Form\\Element'", ")", ")", "||", "(", "!", "is_object", "(", "$", "element", ")...
Adds an element to the fieldset @param array | \DScribe\Form\Element $element @return Fieldset @throws Exception
[ "Adds", "an", "element", "to", "the", "fieldset" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Fieldset.php#L183-L215
197,493
ezra-obiwale/dSCore
src/Form/Fieldset.php
Fieldset.setData
final public function setData($data) { if ((is_object($data) && !is_a($data, 'Object')) || (!is_object($data) && !is_array($data))) throw new \Exception('Data must be either an array or an object that extends Object: ' . gettype($data)); $data = is_array($data) ? $data : $data->toArray(); ...
php
final public function setData($data) { if ((is_object($data) && !is_a($data, 'Object')) || (!is_object($data) && !is_array($data))) throw new \Exception('Data must be either an array or an object that extends Object: ' . gettype($data)); $data = is_array($data) ? $data : $data->toArray(); ...
[ "final", "public", "function", "setData", "(", "$", "data", ")", "{", "if", "(", "(", "is_object", "(", "$", "data", ")", "&&", "!", "is_a", "(", "$", "data", ",", "'Object'", ")", ")", "||", "(", "!", "is_object", "(", "$", "data", ")", "&&", ...
Sets data to validate @param \Object | array $data @return Fieldset|Element @throws Exception
[ "Sets", "data", "to", "validate" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Fieldset.php#L278-L290
197,494
ezra-obiwale/dSCore
src/Form/Fieldset.php
Fieldset.getData
final public function getData($toArray = false) { if (is_null($this->valid)) throw new \Exception('Form must be validated before you can get data'); if ($toArray) return ($this->data) ? $this->data : array(); else return ($this->data) ? new \Object($this->dat...
php
final public function getData($toArray = false) { if (is_null($this->valid)) throw new \Exception('Form must be validated before you can get data'); if ($toArray) return ($this->data) ? $this->data : array(); else return ($this->data) ? new \Object($this->dat...
[ "final", "public", "function", "getData", "(", "$", "toArray", "=", "false", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "valid", ")", ")", "throw", "new", "\\", "Exception", "(", "'Form must be validated before you can get data'", ")", ";", "if"...
Fetches the filtered data @return Object
[ "Fetches", "the", "filtered", "data" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Fieldset.php#L296-L304
197,495
ezra-obiwale/dSCore
src/Form/Fieldset.php
Fieldset.render
public function render() { $rendered = ''; foreach ($this->elements as $element) { if (!method_exists($this, 'openTag')) { $element->name = $this->multiple ? $element->name . '[]' : $this->getName() . '[' . $element->name . ']';...
php
public function render() { $rendered = ''; foreach ($this->elements as $element) { if (!method_exists($this, 'openTag')) { $element->name = $this->multiple ? $element->name . '[]' : $this->getName() . '[' . $element->name . ']';...
[ "public", "function", "render", "(", ")", "{", "$", "rendered", "=", "''", ";", "foreach", "(", "$", "this", "->", "elements", "as", "$", "element", ")", "{", "if", "(", "!", "method_exists", "(", "$", "this", ",", "'openTag'", ")", ")", "{", "$", ...
Renders the elements of the fieldset out @return string
[ "Renders", "the", "elements", "of", "the", "fieldset", "out" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Fieldset.php#L315-L328
197,496
Polosa/shade-framework-core
app/Converter.php
Converter.formatBytes
public static function formatBytes($bytes, $precision = 2) { if ($bytes < 1024) { return $bytes.' B'; } elseif ($bytes < 1048576) { return round($bytes / 1024, $precision).' KB'; } elseif ($bytes < 1073741824) { return round($bytes / 1048576, $precision).'...
php
public static function formatBytes($bytes, $precision = 2) { if ($bytes < 1024) { return $bytes.' B'; } elseif ($bytes < 1048576) { return round($bytes / 1024, $precision).' KB'; } elseif ($bytes < 1073741824) { return round($bytes / 1048576, $precision).'...
[ "public", "static", "function", "formatBytes", "(", "$", "bytes", ",", "$", "precision", "=", "2", ")", "{", "if", "(", "$", "bytes", "<", "1024", ")", "{", "return", "$", "bytes", ".", "' B'", ";", "}", "elseif", "(", "$", "bytes", "<", "1048576",...
Convert size in bytes to human readable format @param integer $bytes Size in Bytes @param integer $precision Number of decimal digits to round to @return string
[ "Convert", "size", "in", "bytes", "to", "human", "readable", "format" ]
d735d3e8e0616fb9cf4ffc25b8425762ed07940f
https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/Converter.php#L28-L41
197,497
congraphcms/core
Bus/CommandDispatcher.php
CommandDispatcher.validate
public function validate($command) { if ($command instanceof SelfValidating) { return $this->container->call([$command, 'validate']); } $validatorClass = $this->getValidatorClass($command); if(!$validatorClass) { return; } $validator = $this->container->make($validatorClass); $...
php
public function validate($command) { if ($command instanceof SelfValidating) { return $this->container->call([$command, 'validate']); } $validatorClass = $this->getValidatorClass($command); if(!$validatorClass) { return; } $validator = $this->container->make($validatorClass); $...
[ "public", "function", "validate", "(", "$", "command", ")", "{", "if", "(", "$", "command", "instanceof", "SelfValidating", ")", "{", "return", "$", "this", "->", "container", "->", "call", "(", "[", "$", "command", ",", "'validate'", "]", ")", ";", "}...
Validate a command with its appropriate validator. @param mixed $command @return mixed
[ "Validate", "a", "command", "with", "its", "appropriate", "validator", "." ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Bus/CommandDispatcher.php#L150-L165
197,498
koolkode/stream
src/ChunkDecodedInputStream.php
ChunkDecodedInputStream.loadBuffer
protected function loadBuffer() { $this->remainder = 0; if($this->ended) { return; } while(!$this->stream->eof() && strlen($this->buffer) < self::BUFFER_SIZE) { $this->buffer .= $this->stream->read(self::BUFFER_SIZE); } $m = NULL; if(preg_match("'^\r?\n?([a-fA-F0-9]+).*\r\n'", $this...
php
protected function loadBuffer() { $this->remainder = 0; if($this->ended) { return; } while(!$this->stream->eof() && strlen($this->buffer) < self::BUFFER_SIZE) { $this->buffer .= $this->stream->read(self::BUFFER_SIZE); } $m = NULL; if(preg_match("'^\r?\n?([a-fA-F0-9]+).*\r\n'", $this...
[ "protected", "function", "loadBuffer", "(", ")", "{", "$", "this", "->", "remainder", "=", "0", ";", "if", "(", "$", "this", "->", "ended", ")", "{", "return", ";", "}", "while", "(", "!", "$", "this", "->", "stream", "->", "eof", "(", ")", "&&",...
Load data of the next chunk into memory.
[ "Load", "data", "of", "the", "next", "chunk", "into", "memory", "." ]
05e83efd76e1cb9e40a972711986b4a7e38bc141
https://github.com/koolkode/stream/blob/05e83efd76e1cb9e40a972711986b4a7e38bc141/src/ChunkDecodedInputStream.php#L148-L193
197,499
spoom-php/core
src/extension/Helper/Wrapper.php
Wrapper.wrap
protected function wrap( StorageInterface $input, array $definition ) { foreach( $definition as $property => $class ) { // wrap the whole value in a class, or every subvalue $is_array = $class{0} == '[' && $class{1} == ']'; /** @var self $class */ $class = ltrim( $class, '[]' ); // c...
php
protected function wrap( StorageInterface $input, array $definition ) { foreach( $definition as $property => $class ) { // wrap the whole value in a class, or every subvalue $is_array = $class{0} == '[' && $class{1} == ']'; /** @var self $class */ $class = ltrim( $class, '[]' ); // c...
[ "protected", "function", "wrap", "(", "StorageInterface", "$", "input", ",", "array", "$", "definition", ")", "{", "foreach", "(", "$", "definition", "as", "$", "property", "=>", "$", "class", ")", "{", "// wrap the whole value in a class, or every subvalue", "$",...
Wrap input elements in classes @param StorageInterface $input @param array $definition Defined operations @throws \TypeError
[ "Wrap", "input", "elements", "in", "classes" ]
ea7184213352fa2fad7636927a019e5798734e04
https://github.com/spoom-php/core/blob/ea7184213352fa2fad7636927a019e5798734e04/src/extension/Helper/Wrapper.php#L76-L100