id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
205,500
phramework/testphase
src/Globals.php
Globals.toString
public static function toString() { $return = []; foreach (static::$globals as $key => $value) { $type = gettype($value); if (is_callable($value)) { $valueString = 'callable'; $type = 'callable'; } elseif (is_array($value)) { ...
php
public static function toString() { $return = []; foreach (static::$globals as $key => $value) { $type = gettype($value); if (is_callable($value)) { $valueString = 'callable'; $type = 'callable'; } elseif (is_array($value)) { ...
[ "public", "static", "function", "toString", "(", ")", "{", "$", "return", "=", "[", "]", ";", "foreach", "(", "static", "::", "$", "globals", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "type", "=", "gettype", "(", "$", "value", ")", ";"...
Return keys and values of global variables as string @return string
[ "Return", "keys", "and", "values", "of", "global", "variables", "as", "string" ]
b00107b7a37cf1a1b9b8860b3eb031aacfa2634c
https://github.com/phramework/testphase/blob/b00107b7a37cf1a1b9b8860b3eb031aacfa2634c/src/Globals.php#L245-L270
205,501
DBRisinajumi/d2company
controllers/CcucUserCompanyController.php
CcucUserCompanyController.actionEditableSaver
public function actionEditableSaver() { Yii::import('EditableSaver'); //or you can add import 'ext.editable.*' to config $es = new EditableSaver('CcucUserCompany'); // classname of model to be updated $es->update(); //verify if change statuss if($es->attribute != 'c...
php
public function actionEditableSaver() { Yii::import('EditableSaver'); //or you can add import 'ext.editable.*' to config $es = new EditableSaver('CcucUserCompany'); // classname of model to be updated $es->update(); //verify if change statuss if($es->attribute != 'c...
[ "public", "function", "actionEditableSaver", "(", ")", "{", "Yii", "::", "import", "(", "'EditableSaver'", ")", ";", "//or you can add import 'ext.editable.*' to config", "$", "es", "=", "new", "EditableSaver", "(", "'CcucUserCompany'", ")", ";", "// classname of model ...
for company ccuc on change status to USER create customer office uses @return type
[ "for", "company", "ccuc", "on", "change", "status", "to", "USER", "create", "customer", "office", "uses" ]
20df0db96ac2c8e73471c4bab7d487b67ef4ed0a
https://github.com/DBRisinajumi/d2company/blob/20df0db96ac2c8e73471c4bab7d487b67ef4ed0a/controllers/CcucUserCompanyController.php#L129-L149
205,502
rbone/phactory
lib/Phactory/Loader.php
Loader.load
public function load($name) { $factoryClass = ucfirst($name) . "Phactory"; if (!class_exists($factoryClass)) { throw new \Exception("Unknown factory '$name'"); } return new Factory($name, new $factoryClass); }
php
public function load($name) { $factoryClass = ucfirst($name) . "Phactory"; if (!class_exists($factoryClass)) { throw new \Exception("Unknown factory '$name'"); } return new Factory($name, new $factoryClass); }
[ "public", "function", "load", "(", "$", "name", ")", "{", "$", "factoryClass", "=", "ucfirst", "(", "$", "name", ")", ".", "\"Phactory\"", ";", "if", "(", "!", "class_exists", "(", "$", "factoryClass", ")", ")", "{", "throw", "new", "\\", "Exception", ...
Loads the factory according to the object class name @param string $name @return \Phactory\Factory @throws \Exception
[ "Loads", "the", "factory", "according", "to", "the", "object", "class", "name" ]
f1c474084f9b310d171f393fe196e8a2a7aae1ec
https://github.com/rbone/phactory/blob/f1c474084f9b310d171f393fe196e8a2a7aae1ec/lib/Phactory/Loader.php#L17-L26
205,503
newestindustry/ginger-rest
src/Ginger/XMLSerializer.php
XMLSerializer.generateValidXmlFromArray
public static function generateValidXmlFromArray($array, $node_block='response', $node_name='item') { $xml = '<?xml version="1.0" encoding="UTF-8" ?>'; $xml .= '<' . $node_block . '>'; $xml .= self::generateXmlFromArray($array, $node_name); $xml .= '</' . $node_block . '>'; ...
php
public static function generateValidXmlFromArray($array, $node_block='response', $node_name='item') { $xml = '<?xml version="1.0" encoding="UTF-8" ?>'; $xml .= '<' . $node_block . '>'; $xml .= self::generateXmlFromArray($array, $node_name); $xml .= '</' . $node_block . '>'; ...
[ "public", "static", "function", "generateValidXmlFromArray", "(", "$", "array", ",", "$", "node_block", "=", "'response'", ",", "$", "node_name", "=", "'item'", ")", "{", "$", "xml", "=", "'<?xml version=\"1.0\" encoding=\"UTF-8\" ?>'", ";", "$", "xml", ".=", "'...
Generate valid xml from array @param array $array @param string $node_block @param string $node_name @return string
[ "Generate", "valid", "xml", "from", "array" ]
482b77dc122a60ab0bf143a3c4a1e67168985c83
https://github.com/newestindustry/ginger-rest/blob/482b77dc122a60ab0bf143a3c4a1e67168985c83/src/Ginger/XMLSerializer.php#L38-L47
205,504
newestindustry/ginger-rest
src/Ginger/XMLSerializer.php
XMLSerializer.generateXmlFromArray
private static function generateXmlFromArray($array, $node_name) { $xml = ''; if (is_array($array) || is_object($array)) { foreach ($array as $key=>$value) { if (is_numeric($key)) { $key = $node_name; } $xml .= '<' . ...
php
private static function generateXmlFromArray($array, $node_name) { $xml = ''; if (is_array($array) || is_object($array)) { foreach ($array as $key=>$value) { if (is_numeric($key)) { $key = $node_name; } $xml .= '<' . ...
[ "private", "static", "function", "generateXmlFromArray", "(", "$", "array", ",", "$", "node_name", ")", "{", "$", "xml", "=", "''", ";", "if", "(", "is_array", "(", "$", "array", ")", "||", "is_object", "(", "$", "array", ")", ")", "{", "foreach", "(...
Generate XML from array @param array $array @param string $node_name @return string
[ "Generate", "XML", "from", "array" ]
482b77dc122a60ab0bf143a3c4a1e67168985c83
https://github.com/newestindustry/ginger-rest/blob/482b77dc122a60ab0bf143a3c4a1e67168985c83/src/Ginger/XMLSerializer.php#L56-L73
205,505
luoxiaojun1992/lb_framework
components/Log.php
Log.addDeferLog
protected function addDeferLog($role, $level, $message, $context) { $this->deferLogs[] = compact('role', 'level', 'message', 'context'); $this->deferLogsCount++; }
php
protected function addDeferLog($role, $level, $message, $context) { $this->deferLogs[] = compact('role', 'level', 'message', 'context'); $this->deferLogsCount++; }
[ "protected", "function", "addDeferLog", "(", "$", "role", ",", "$", "level", ",", "$", "message", ",", "$", "context", ")", "{", "$", "this", "->", "deferLogs", "[", "]", "=", "compact", "(", "'role'", ",", "'level'", ",", "'message'", ",", "'context'"...
Add a defer log @param $role @param $level @param $message @param $context
[ "Add", "a", "defer", "log" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/Log.php#L145-L149
205,506
luoxiaojun1992/lb_framework
components/Log.php
Log.removeDeferLog
protected function removeDeferLog($k) { if (!isset($this->deferLogs[$k])) { return; } unset($this->deferLogs[$k]); $this->deferLogsCount--; }
php
protected function removeDeferLog($k) { if (!isset($this->deferLogs[$k])) { return; } unset($this->deferLogs[$k]); $this->deferLogsCount--; }
[ "protected", "function", "removeDeferLog", "(", "$", "k", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "deferLogs", "[", "$", "k", "]", ")", ")", "{", "return", ";", "}", "unset", "(", "$", "this", "->", "deferLogs", "[", "$", "k", ...
Remove a defer log @param $k
[ "Remove", "a", "defer", "log" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/Log.php#L156-L164
205,507
luoxiaojun1992/lb_framework
components/Log.php
Log.flush
public function flush() { //todo bugfix batch record foreach ($this->deferLogs as $k => $deferLog) { $this->record($deferLog['message'], $deferLog['context'], $deferLog['level'], $deferLog['role']); $this->removeDeferLog($k); } }
php
public function flush() { //todo bugfix batch record foreach ($this->deferLogs as $k => $deferLog) { $this->record($deferLog['message'], $deferLog['context'], $deferLog['level'], $deferLog['role']); $this->removeDeferLog($k); } }
[ "public", "function", "flush", "(", ")", "{", "//todo bugfix batch record", "foreach", "(", "$", "this", "->", "deferLogs", "as", "$", "k", "=>", "$", "deferLog", ")", "{", "$", "this", "->", "record", "(", "$", "deferLog", "[", "'message'", "]", ",", ...
Flush defer logs
[ "Flush", "defer", "logs" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/Log.php#L169-L176
205,508
factorio-item-browser/api-client
src/Serializer/SerializerFactory.php
SerializerFactory.addCacheDirectory
protected function addCacheDirectory(ContainerInterface $container, SerializerBuilder $builder): void { $config = $container->get('config'); $libraryConfig = $config[ConfigKey::PROJECT][ConfigKey::API_CLIENT] ?? []; $cacheDir = (string) ($libraryConfig[ConfigKey::CACHE_DIR] ?? ''); ...
php
protected function addCacheDirectory(ContainerInterface $container, SerializerBuilder $builder): void { $config = $container->get('config'); $libraryConfig = $config[ConfigKey::PROJECT][ConfigKey::API_CLIENT] ?? []; $cacheDir = (string) ($libraryConfig[ConfigKey::CACHE_DIR] ?? ''); ...
[ "protected", "function", "addCacheDirectory", "(", "ContainerInterface", "$", "container", ",", "SerializerBuilder", "$", "builder", ")", ":", "void", "{", "$", "config", "=", "$", "container", "->", "get", "(", "'config'", ")", ";", "$", "libraryConfig", "=",...
Adds the cache directory from the config to the builder. @param ContainerInterface $container @param SerializerBuilder $builder
[ "Adds", "the", "cache", "directory", "from", "the", "config", "to", "the", "builder", "." ]
ebda897483bd537c310a17ff868ca40c0568f728
https://github.com/factorio-item-browser/api-client/blob/ebda897483bd537c310a17ff868ca40c0568f728/src/Serializer/SerializerFactory.php#L56-L65
205,509
valu-digital/valuso
src/ValuSo/Broker/ServiceBroker.php
ServiceBroker.setOptions
public function setOptions($options) { if (!is_array($options) && !$options instanceof Traversable) { throw new \InvalidArgumentException(sprintf( 'Expected an array or Traversable; received "%s"', (is_object($options) ? get_class($options) : gettype($options)) ))...
php
public function setOptions($options) { if (!is_array($options) && !$options instanceof Traversable) { throw new \InvalidArgumentException(sprintf( 'Expected an array or Traversable; received "%s"', (is_object($options) ? get_class($options) : gettype($options)) ))...
[ "public", "function", "setOptions", "(", "$", "options", ")", "{", "if", "(", "!", "is_array", "(", "$", "options", ")", "&&", "!", "$", "options", "instanceof", "Traversable", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "("...
Configure service broker Use this method to configure service broker. Currently supports only option 'loader' which calls {@see setLoader()}. @param array|Traversable $options @throws \InvalidArgumentException @return \ValuSo\Broker\ServiceBroker
[ "Configure", "service", "broker" ]
c96bed0f6bd21551822334fe6cfe913a7436dd17
https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceBroker.php#L96-L115
205,510
valu-digital/valuso
src/ValuSo/Broker/ServiceBroker.php
ServiceBroker.getDefaultIdentity
public function getDefaultIdentity() { if (!$this->defaultIdentity) { $this->defaultIdentity = new ArrayObject(array()); if ($this->exists('Identity')) { $responses = $this->execute( 'Identity', 'getIdentity', array(), ...
php
public function getDefaultIdentity() { if (!$this->defaultIdentity) { $this->defaultIdentity = new ArrayObject(array()); if ($this->exists('Identity')) { $responses = $this->execute( 'Identity', 'getIdentity', array(), ...
[ "public", "function", "getDefaultIdentity", "(", ")", "{", "if", "(", "!", "$", "this", "->", "defaultIdentity", ")", "{", "$", "this", "->", "defaultIdentity", "=", "new", "ArrayObject", "(", "array", "(", ")", ")", ";", "if", "(", "$", "this", "->", ...
Retrieve default identity @return \ArrayAccess|null
[ "Retrieve", "default", "identity" ]
c96bed0f6bd21551822334fe6cfe913a7436dd17
https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceBroker.php#L141-L167
205,511
valu-digital/valuso
src/ValuSo/Broker/ServiceBroker.php
ServiceBroker.setLoader
public function setLoader(ServiceLoader $loader){ $this->loader = $loader; $that = $this; $this->loader->addInitializer(function ($instance) use ($that) { // Inject broker to services if ($instance instanceof Feature\ServiceBrokerAwareInterface) { $instance->setServiceBroker($that); ...
php
public function setLoader(ServiceLoader $loader){ $this->loader = $loader; $that = $this; $this->loader->addInitializer(function ($instance) use ($that) { // Inject broker to services if ($instance instanceof Feature\ServiceBrokerAwareInterface) { $instance->setServiceBroker($that); ...
[ "public", "function", "setLoader", "(", "ServiceLoader", "$", "loader", ")", "{", "$", "this", "->", "loader", "=", "$", "loader", ";", "$", "that", "=", "$", "this", ";", "$", "this", "->", "loader", "->", "addInitializer", "(", "function", "(", "$", ...
Set service loader instance @param ServiceLoader $loader
[ "Set", "service", "loader", "instance" ]
c96bed0f6bd21551822334fe6cfe913a7436dd17
https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceBroker.php#L185-L204
205,512
valu-digital/valuso
src/ValuSo/Broker/ServiceBroker.php
ServiceBroker.service
public function service($service){ if(!$this->exists($service)){ throw new ServiceNotFoundException(sprintf('Service "%s" not found', $service)); } return new Worker($this, $service); }
php
public function service($service){ if(!$this->exists($service)){ throw new ServiceNotFoundException(sprintf('Service "%s" not found', $service)); } return new Worker($this, $service); }
[ "public", "function", "service", "(", "$", "service", ")", "{", "if", "(", "!", "$", "this", "->", "exists", "(", "$", "service", ")", ")", "{", "throw", "new", "ServiceNotFoundException", "(", "sprintf", "(", "'Service \"%s\" not found'", ",", "$", "servi...
Initialize and retrieve a new service Worker @param string $service @throws ServiceNotFoundException @return Worker
[ "Initialize", "and", "retrieve", "a", "new", "service", "Worker" ]
c96bed0f6bd21551822334fe6cfe913a7436dd17
https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceBroker.php#L257-L264
205,513
valu-digital/valuso
src/ValuSo/Broker/ServiceBroker.php
ServiceBroker.executeInContext
public function executeInContext($context, $service, $operation, $argv = array(), $callback = null) { $command = new Command( $service, $operation, $argv, $context); return $this->dispatch($command, $callback); }
php
public function executeInContext($context, $service, $operation, $argv = array(), $callback = null) { $command = new Command( $service, $operation, $argv, $context); return $this->dispatch($command, $callback); }
[ "public", "function", "executeInContext", "(", "$", "context", ",", "$", "service", ",", "$", "operation", ",", "$", "argv", "=", "array", "(", ")", ",", "$", "callback", "=", "null", ")", "{", "$", "command", "=", "new", "Command", "(", "$", "servic...
Execute service operation in context @param string $context @param string $service @param string $operation @param array $argv @param mixed $callback Valid PHP callback @param string $context @return ResponseCollection
[ "Execute", "service", "operation", "in", "context" ]
c96bed0f6bd21551822334fe6cfe913a7436dd17
https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceBroker.php#L290-L299
205,514
valu-digital/valuso
src/ValuSo/Broker/ServiceBroker.php
ServiceBroker.queue
public function queue(CommandInterface $command, array $options = []) { $queueName = null; if (array_key_exists(self::QUEUE_OPTION_NAME, $options)) { $queueName = $options[self::QUEUE_OPTION_NAME] ?: null; unset($options[self::QUEUE_OPTION_NAME]); } $queue = $t...
php
public function queue(CommandInterface $command, array $options = []) { $queueName = null; if (array_key_exists(self::QUEUE_OPTION_NAME, $options)) { $queueName = $options[self::QUEUE_OPTION_NAME] ?: null; unset($options[self::QUEUE_OPTION_NAME]); } $queue = $t...
[ "public", "function", "queue", "(", "CommandInterface", "$", "command", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "queueName", "=", "null", ";", "if", "(", "array_key_exists", "(", "self", "::", "QUEUE_OPTION_NAME", ",", "$", "options", ...
Queue execution of service operation @param CommandInterface $command @param array $options @return ServiceJob
[ "Queue", "execution", "of", "service", "operation" ]
c96bed0f6bd21551822334fe6cfe913a7436dd17
https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceBroker.php#L308-L339
205,515
valu-digital/valuso
src/ValuSo/Broker/ServiceBroker.php
ServiceBroker.createEvent
protected function createEvent($name, CommandInterface $command) { $event = new ServiceEvent(); $event->setName($name); $event->setCommand($command); $event->setParams($command->getParams()); return $event; }
php
protected function createEvent($name, CommandInterface $command) { $event = new ServiceEvent(); $event->setName($name); $event->setCommand($command); $event->setParams($command->getParams()); return $event; }
[ "protected", "function", "createEvent", "(", "$", "name", ",", "CommandInterface", "$", "command", ")", "{", "$", "event", "=", "new", "ServiceEvent", "(", ")", ";", "$", "event", "->", "setName", "(", "$", "name", ")", ";", "$", "event", "->", "setCom...
Create a new service event @param string $name @param CommandInterface $command @return \ValuSo\Broker\ServiceEvent
[ "Create", "a", "new", "service", "event" ]
c96bed0f6bd21551822334fe6cfe913a7436dd17
https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Broker/ServiceBroker.php#L515-L523
205,516
worldnettps/magento2-module-subscription
Model/Status.php
Status.getCurrency
public function getCurrency() { $options = [ 'EUR' => __('Euro'), 'GBP' => __('Sterling'), 'USD' => __('US Dollar'), 'CAD' => __('Canadian Dollar'), 'AUD' => __('Australian Dollar'), 'DKK' => __('Danish Krone...
php
public function getCurrency() { $options = [ 'EUR' => __('Euro'), 'GBP' => __('Sterling'), 'USD' => __('US Dollar'), 'CAD' => __('Canadian Dollar'), 'AUD' => __('Australian Dollar'), 'DKK' => __('Danish Krone...
[ "public", "function", "getCurrency", "(", ")", "{", "$", "options", "=", "[", "'EUR'", "=>", "__", "(", "'Euro'", ")", ",", "'GBP'", "=>", "__", "(", "'Sterling'", ")", ",", "'USD'", "=>", "__", "(", "'US Dollar'", ")", ",", "'CAD'", "=>", "__", "(...
Get Grid row currency labels array. @return array
[ "Get", "Grid", "row", "currency", "labels", "array", "." ]
dcac6fb7f13bc9a3d47cb9ca04734fef627b0eab
https://github.com/worldnettps/magento2-module-subscription/blob/dcac6fb7f13bc9a3d47cb9ca04734fef627b0eab/Model/Status.php#L11-L23
205,517
bariew/yii2-doctest-extension
MethodParser.php
MethodParser.processComment
protected function processComment() { $comment=strtr(trim(preg_replace('/^\s*\**( |\t)?/m','',trim($this->getDocComment(),'/'))),"\r",''); if(preg_match('/^\s*@\w+/m',$comment, $matches, PREG_OFFSET_CAPTURE)){ $meta=substr($comment,$matches[0][1]); $this->processTags($meta); ...
php
protected function processComment() { $comment=strtr(trim(preg_replace('/^\s*\**( |\t)?/m','',trim($this->getDocComment(),'/'))),"\r",''); if(preg_match('/^\s*@\w+/m',$comment, $matches, PREG_OFFSET_CAPTURE)){ $meta=substr($comment,$matches[0][1]); $this->processTags($meta); ...
[ "protected", "function", "processComment", "(", ")", "{", "$", "comment", "=", "strtr", "(", "trim", "(", "preg_replace", "(", "'/^\\s*\\**( |\\t)?/m'", ",", "''", ",", "trim", "(", "$", "this", "->", "getDocComment", "(", ")", ",", "'/'", ")", ")", ")",...
gets tags lines from docblock @author Qiang Xue <qiang.xue@gmail.com>
[ "gets", "tags", "lines", "from", "docblock" ]
526e0281f055dbd55ad5fbcb2a3104164a056e0b
https://github.com/bariew/yii2-doctest-extension/blob/526e0281f055dbd55ad5fbcb2a3104164a056e0b/MethodParser.php#L23-L30
205,518
bariew/yii2-doctest-extension
MethodParser.php
MethodParser.processTags
protected function processTags($comment) { $tags = preg_split('/^\s*@/m',$comment,-1,PREG_SPLIT_NO_EMPTY); foreach($tags as $tag){ $segs = preg_split('/\s+/',trim($tag),2); $tagName= $segs[0]; $param = isset($segs[1]) ? trim($segs[1]) : ''; $this->t...
php
protected function processTags($comment) { $tags = preg_split('/^\s*@/m',$comment,-1,PREG_SPLIT_NO_EMPTY); foreach($tags as $tag){ $segs = preg_split('/\s+/',trim($tag),2); $tagName= $segs[0]; $param = isset($segs[1]) ? trim($segs[1]) : ''; $this->t...
[ "protected", "function", "processTags", "(", "$", "comment", ")", "{", "$", "tags", "=", "preg_split", "(", "'/^\\s*@/m'", ",", "$", "comment", ",", "-", "1", ",", "PREG_SPLIT_NO_EMPTY", ")", ";", "foreach", "(", "$", "tags", "as", "$", "tag", ")", "{"...
extracts tags array from docblock @param string $comment docblock @author Qiang Xue <qiang.xue@gmail.com>
[ "extracts", "tags", "array", "from", "docblock" ]
526e0281f055dbd55ad5fbcb2a3104164a056e0b
https://github.com/bariew/yii2-doctest-extension/blob/526e0281f055dbd55ad5fbcb2a3104164a056e0b/MethodParser.php#L36-L45
205,519
gbprod/doctrine-specification
src/DoctrineSpecification/Registry.php
Registry.getFactory
public function getFactory(Specification $spec): Factory { if(!isset($this->factories[get_class($spec)])) { throw new \OutOfRangeException(sprintf( 'Factory for Specification "%s" not registred', get_class($spec) )); } return $this->fa...
php
public function getFactory(Specification $spec): Factory { if(!isset($this->factories[get_class($spec)])) { throw new \OutOfRangeException(sprintf( 'Factory for Specification "%s" not registred', get_class($spec) )); } return $this->fa...
[ "public", "function", "getFactory", "(", "Specification", "$", "spec", ")", ":", "Factory", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "factories", "[", "get_class", "(", "$", "spec", ")", "]", ")", ")", "{", "throw", "new", "\\", "OutOfRa...
Get registred factory for Specification @param Specification $spec @return Factory @throw OutOfRangeException if Factory not found
[ "Get", "registred", "factory", "for", "Specification" ]
348e8ec31547f4949a193d21b3a1d5cdb48b23cb
https://github.com/gbprod/doctrine-specification/blob/348e8ec31547f4949a193d21b3a1d5cdb48b23cb/src/DoctrineSpecification/Registry.php#L42-L52
205,520
carno-php/nsq
src/Chips/TMCommands.php
TMCommands.retry
public function retry(int $delayed = 0) : void { $this->link->req($this->id(), $delayed); }
php
public function retry(int $delayed = 0) : void { $this->link->req($this->id(), $delayed); }
[ "public", "function", "retry", "(", "int", "$", "delayed", "=", "0", ")", ":", "void", "{", "$", "this", "->", "link", "->", "req", "(", "$", "this", "->", "id", "(", ")", ",", "$", "delayed", ")", ";", "}" ]
delayed in milliseconds @param int $delayed
[ "delayed", "in", "milliseconds" ]
cc4f1278556ff530bbe2e03345bdeb54fef1275a
https://github.com/carno-php/nsq/blob/cc4f1278556ff530bbe2e03345bdeb54fef1275a/src/Chips/TMCommands.php#L41-L44
205,521
bruno-barros/w.eloquent-framework
src/weloquent/Plugins/Blade/blade.php
BladePlugin.parse
public function parse($template) { $viewsFromConfig = $this->app['config']->get('view.paths'); $views = array_merge((array)$viewsFromConfig, (array)$this->paths['theme']); $cache = $this->paths['storage'] . '/views'; $blade = new BladeAdapter($views, $cache); if (!$blade->getCompiler()->isExpired($templa...
php
public function parse($template) { $viewsFromConfig = $this->app['config']->get('view.paths'); $views = array_merge((array)$viewsFromConfig, (array)$this->paths['theme']); $cache = $this->paths['storage'] . '/views'; $blade = new BladeAdapter($views, $cache); if (!$blade->getCompiler()->isExpired($templa...
[ "public", "function", "parse", "(", "$", "template", ")", "{", "$", "viewsFromConfig", "=", "$", "this", "->", "app", "[", "'config'", "]", "->", "get", "(", "'view.paths'", ")", ";", "$", "views", "=", "array_merge", "(", "(", "array", ")", "$", "vi...
Handle the compilation of the templates @param $template
[ "Handle", "the", "compilation", "of", "the", "templates" ]
d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd
https://github.com/bruno-barros/w.eloquent-framework/blob/d252dcb1ba1b6b1cecf67877d7d6d3ba57ebedbd/src/weloquent/Plugins/Blade/blade.php#L103-L122
205,522
Anahkiasen/php-configuration
src/TreeBuilder/ClosureNode.php
ClosureNode.validateType
protected function validateType($value) { if (!$value instanceof Closure && $value !== null) { $exception = new InvalidTypeException(sprintf( 'Invalid type for path "%s". Expected closure, but got %s.', $this->getPath(), gettype($value) ...
php
protected function validateType($value) { if (!$value instanceof Closure && $value !== null) { $exception = new InvalidTypeException(sprintf( 'Invalid type for path "%s". Expected closure, but got %s.', $this->getPath(), gettype($value) ...
[ "protected", "function", "validateType", "(", "$", "value", ")", "{", "if", "(", "!", "$", "value", "instanceof", "Closure", "&&", "$", "value", "!==", "null", ")", "{", "$", "exception", "=", "new", "InvalidTypeException", "(", "sprintf", "(", "'Invalid t...
Validates the type of a Node. @param mixed $value The value to validate @throws InvalidTypeException when the value is invalid
[ "Validates", "the", "type", "of", "a", "Node", "." ]
f67f1e045f3e2e3dc8bd88c66caf960095e69d97
https://github.com/Anahkiasen/php-configuration/blob/f67f1e045f3e2e3dc8bd88c66caf960095e69d97/src/TreeBuilder/ClosureNode.php#L27-L44
205,523
rackberg/para
src/Service/Strategy/DisplayCombinedOutputStrategy.php
DisplayCombinedOutputStrategy.addProcessInfo
private function addProcessInfo(Process $process, Project $project) { $this->processes[$project->getName()] = [ 'process' => $process, 'project' => $project, ]; }
php
private function addProcessInfo(Process $process, Project $project) { $this->processes[$project->getName()] = [ 'process' => $process, 'project' => $project, ]; }
[ "private", "function", "addProcessInfo", "(", "Process", "$", "process", ",", "Project", "$", "project", ")", "{", "$", "this", "->", "processes", "[", "$", "project", "->", "getName", "(", ")", "]", "=", "[", "'process'", "=>", "$", "process", ",", "'...
Adds the process and project info. @param \Symfony\Component\Process\Process $process @param \Para\Entity\Project $project
[ "Adds", "the", "process", "and", "project", "info", "." ]
e0ef1356ed2979670eb7c670d88921406cade46e
https://github.com/rackberg/para/blob/e0ef1356ed2979670eb7c670d88921406cade46e/src/Service/Strategy/DisplayCombinedOutputStrategy.php#L78-L84
205,524
rackberg/para
src/Service/Strategy/DisplayCombinedOutputStrategy.php
DisplayCombinedOutputStrategy.workaroundForSingleChar
private function workaroundForSingleChar( string &$incrementalOutput, Project $project ) { // Check if there is a temporarily stored char. if (!empty($this->tmpChar[$project->getName()]) && !empty($incrementalOutput)) { // Add the char directly at the beginning of the cur...
php
private function workaroundForSingleChar( string &$incrementalOutput, Project $project ) { // Check if there is a temporarily stored char. if (!empty($this->tmpChar[$project->getName()]) && !empty($incrementalOutput)) { // Add the char directly at the beginning of the cur...
[ "private", "function", "workaroundForSingleChar", "(", "string", "&", "$", "incrementalOutput", ",", "Project", "$", "project", ")", "{", "// Check if there is a temporarily stored char.", "if", "(", "!", "empty", "(", "$", "this", "->", "tmpChar", "[", "$", "proj...
Workaround for single char. Sometimes it happens that only one char has been returned by $process->getIncrementalOutput() even if there are more chars that could also be returned. In this case we need to create a workaround, that temporarily stores the single char returned to output it in front of the next incremental...
[ "Workaround", "for", "single", "char", "." ]
e0ef1356ed2979670eb7c670d88921406cade46e
https://github.com/rackberg/para/blob/e0ef1356ed2979670eb7c670d88921406cade46e/src/Service/Strategy/DisplayCombinedOutputStrategy.php#L118-L136
205,525
rackberg/para
src/Service/Strategy/DisplayCombinedOutputStrategy.php
DisplayCombinedOutputStrategy.handleProcessOutput
protected function handleProcessOutput( array $processInfo, BufferedOutputInterface $output, callable $processTerminatedCallback ) { // Get the process. /** @var Process $process */ $process = $processInfo['process']; // Get the project. /** @var Proj...
php
protected function handleProcessOutput( array $processInfo, BufferedOutputInterface $output, callable $processTerminatedCallback ) { // Get the process. /** @var Process $process */ $process = $processInfo['process']; // Get the project. /** @var Proj...
[ "protected", "function", "handleProcessOutput", "(", "array", "$", "processInfo", ",", "BufferedOutputInterface", "$", "output", ",", "callable", "$", "processTerminatedCallback", ")", "{", "// Get the process.", "/** @var Process $process */", "$", "process", "=", "$", ...
Handles the output for a process. @param array $processInfo The process information. @param \Para\Service\Output\BufferedOutputInterface $output @param callable $processTerminatedCallback
[ "Handles", "the", "output", "for", "a", "process", "." ]
e0ef1356ed2979670eb7c670d88921406cade46e
https://github.com/rackberg/para/blob/e0ef1356ed2979670eb7c670d88921406cade46e/src/Service/Strategy/DisplayCombinedOutputStrategy.php#L145-L239
205,526
ossbrownie/util
src/Brownie/Util/StorageList.php
StorageList.get
public function get($keyName, $defaultValue = null) { $this->initList(); $keyName = strtolower($keyName); if (empty($this->list[$keyName])) { return $defaultValue; } return $this->list[$keyName]; }
php
public function get($keyName, $defaultValue = null) { $this->initList(); $keyName = strtolower($keyName); if (empty($this->list[$keyName])) { return $defaultValue; } return $this->list[$keyName]; }
[ "public", "function", "get", "(", "$", "keyName", ",", "$", "defaultValue", "=", "null", ")", "{", "$", "this", "->", "initList", "(", ")", ";", "$", "keyName", "=", "strtolower", "(", "$", "keyName", ")", ";", "if", "(", "empty", "(", "$", "this",...
Gets value of by key name. @param string $keyName Key name. @param mixed $defaultValue Default value. @return string|mixed
[ "Gets", "value", "of", "by", "key", "name", "." ]
d60edd989f4c1e3caad243a75020f251a4b80283
https://github.com/ossbrownie/util/blob/d60edd989f4c1e3caad243a75020f251a4b80283/src/Brownie/Util/StorageList.php#L71-L79
205,527
kiler129/TinyWs
src/UpgradeHandler.php
UpgradeHandler.generateSwitchResponse
private function generateSwitchResponse($client, $request) { $acceptHeader = sha1($request->getHeader("sec-websocket-key") . self::WEBSOCKET_GUID, true); $switchParams = array( "Upgrade" => "websocket", "Connection" => "Upgrade", "Sec-WebSocket-Accept" => base64_e...
php
private function generateSwitchResponse($client, $request) { $acceptHeader = sha1($request->getHeader("sec-websocket-key") . self::WEBSOCKET_GUID, true); $switchParams = array( "Upgrade" => "websocket", "Connection" => "Upgrade", "Sec-WebSocket-Accept" => base64_e...
[ "private", "function", "generateSwitchResponse", "(", "$", "client", ",", "$", "request", ")", "{", "$", "acceptHeader", "=", "sha1", "(", "$", "request", "->", "getHeader", "(", "\"sec-websocket-key\"", ")", ".", "self", "::", "WEBSOCKET_GUID", ",", "true", ...
Generates WebSocket upgrade response & notifies clients handler @param HttpClient|StreamServerNodeInterface $client WebSocketClient which should be upgraded to WebSocket protocol @param HttpRequest $request Original HTTP upgrade handshake sent by client @return HttpResponse
[ "Generates", "WebSocket", "upgrade", "response", "&", "notifies", "clients", "handler" ]
85f0335b87b3ec73ab47f5a5631eb86ba70b64a1
https://github.com/kiler129/TinyWs/blob/85f0335b87b3ec73ab47f5a5631eb86ba70b64a1/src/UpgradeHandler.php#L76-L88
205,528
kiler129/TinyWs
src/UpgradeHandler.php
UpgradeHandler.verifyUpgradeRequest
private function verifyUpgradeRequest(HttpRequest $request) { $this->logger->debug("Attempting to switch protocols (checking preconditions per RFC)"); //That "ifology" is ugly, but I don't have better idea to perform checks //Check request to conform with RFC 6455 [see page 16] if ...
php
private function verifyUpgradeRequest(HttpRequest $request) { $this->logger->debug("Attempting to switch protocols (checking preconditions per RFC)"); //That "ifology" is ugly, but I don't have better idea to perform checks //Check request to conform with RFC 6455 [see page 16] if ...
[ "private", "function", "verifyUpgradeRequest", "(", "HttpRequest", "$", "request", ")", "{", "$", "this", "->", "logger", "->", "debug", "(", "\"Attempting to switch protocols (checking preconditions per RFC)\"", ")", ";", "//That \"ifology\" is ugly, but I don't have better id...
Validates HTTP => WebSocket upgrade request @param HttpRequest $request HTTP request, it's assumed upgrade request @throws HttpException
[ "Validates", "HTTP", "=", ">", "WebSocket", "upgrade", "request" ]
85f0335b87b3ec73ab47f5a5631eb86ba70b64a1
https://github.com/kiler129/TinyWs/blob/85f0335b87b3ec73ab47f5a5631eb86ba70b64a1/src/UpgradeHandler.php#L97-L134
205,529
kiler129/TinyWs
src/UpgradeHandler.php
UpgradeHandler.populatePaths
private function populatePaths($paths) { if (!is_array($paths)) { $paths = array($paths); } foreach ($paths as $path) { if ($path[0] !== "/" && $path[0] !== "*") { throw new InvalidArgumentException("Invalid handler path specified"); } ...
php
private function populatePaths($paths) { if (!is_array($paths)) { $paths = array($paths); } foreach ($paths as $path) { if ($path[0] !== "/" && $path[0] !== "*") { throw new InvalidArgumentException("Invalid handler path specified"); } ...
[ "private", "function", "populatePaths", "(", "$", "paths", ")", "{", "if", "(", "!", "is_array", "(", "$", "paths", ")", ")", "{", "$", "paths", "=", "array", "(", "$", "paths", ")", ";", "}", "foreach", "(", "$", "paths", "as", "$", "path", ")",...
Verifies & adds paths handled by this handler It's private due to fact that for performance reasons CherryHttp will cache paths for each handler @param string|string[] $paths One (or more) paths to be handled @throws InvalidArgumentException Raised if any of paths is invalid
[ "Verifies", "&", "adds", "paths", "handled", "by", "this", "handler", "It", "s", "private", "due", "to", "fact", "that", "for", "performance", "reasons", "CherryHttp", "will", "cache", "paths", "for", "each", "handler" ]
85f0335b87b3ec73ab47f5a5631eb86ba70b64a1
https://github.com/kiler129/TinyWs/blob/85f0335b87b3ec73ab47f5a5631eb86ba70b64a1/src/UpgradeHandler.php#L144-L157
205,530
pmdevelopment/tool-bundle
Framework/PMKernel.php
PMKernel.getBaseTmpDir
public function getBaseTmpDir() { $folders = explode(DIRECTORY_SEPARATOR, $this->getRootDir()); $foldersCount = count($folders); /** * Base Path */ $projectDir = ''; if (true === isset($folders[$foldersCount - 2])) { $projectDir = $folders[$fold...
php
public function getBaseTmpDir() { $folders = explode(DIRECTORY_SEPARATOR, $this->getRootDir()); $foldersCount = count($folders); /** * Base Path */ $projectDir = ''; if (true === isset($folders[$foldersCount - 2])) { $projectDir = $folders[$fold...
[ "public", "function", "getBaseTmpDir", "(", ")", "{", "$", "folders", "=", "explode", "(", "DIRECTORY_SEPARATOR", ",", "$", "this", "->", "getRootDir", "(", ")", ")", ";", "$", "foldersCount", "=", "count", "(", "$", "folders", ")", ";", "/**\n * B...
Get Base Tmp Dir @return string
[ "Get", "Base", "Tmp", "Dir" ]
2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129
https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Framework/PMKernel.php#L97-L114
205,531
valu-digital/valuso
src/ValuSo/Service/MetaService.php
MetaService.describe
public function describe($serviceId) { $cache = $this->getCache(); $cacheId = self::CACHE_ID_PREFIX . $serviceId; if ($cache && ($description = $this->getCache()->getItem($cacheId))) { return $description; } $loader = $this->getServiceLoader(); ...
php
public function describe($serviceId) { $cache = $this->getCache(); $cacheId = self::CACHE_ID_PREFIX . $serviceId; if ($cache && ($description = $this->getCache()->getItem($cacheId))) { return $description; } $loader = $this->getServiceLoader(); ...
[ "public", "function", "describe", "(", "$", "serviceId", ")", "{", "$", "cache", "=", "$", "this", "->", "getCache", "(", ")", ";", "$", "cacheId", "=", "self", "::", "CACHE_ID_PREFIX", ".", "$", "serviceId", ";", "if", "(", "$", "cache", "&&", "(", ...
Retrieve service description @param string $serviceId Service ID @ValuService\Context({"cli", "http", "http-get"})
[ "Retrieve", "service", "description" ]
c96bed0f6bd21551822334fe6cfe913a7436dd17
https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Service/MetaService.php#L52-L92
205,532
pmdevelopment/tool-bundle
Services/PdfService.php
PdfService.get
public function get($html) { $kernel_dir = $this->kerneldir; require __DIR__ . "/../Resources/config/dompdf.php"; $this->pdf = new DOMPDF; foreach ($this->options as $optionKey => $optionValue) { $this->pdf->set_option($optionKey, $optionValue); } $this->pdf->load_html($h...
php
public function get($html) { $kernel_dir = $this->kerneldir; require __DIR__ . "/../Resources/config/dompdf.php"; $this->pdf = new DOMPDF; foreach ($this->options as $optionKey => $optionValue) { $this->pdf->set_option($optionKey, $optionValue); } $this->pdf->load_html($h...
[ "public", "function", "get", "(", "$", "html", ")", "{", "$", "kernel_dir", "=", "$", "this", "->", "kerneldir", ";", "require", "__DIR__", ".", "\"/../Resources/config/dompdf.php\"", ";", "$", "this", "->", "pdf", "=", "new", "DOMPDF", ";", "foreach", "("...
Get PDF By HTML @param string $html @return Response
[ "Get", "PDF", "By", "HTML" ]
2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129
https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Services/PdfService.php#L55-L76
205,533
jasny/entity
src/Traits/SetTrait.php
SetTrait.set
public function set($key, $value = null) { i\type_check($key, ['array', 'string']); if (func_num_args() === 1 && is_string($key)) { throw new BadMethodCallException(sprintf( "Too few arguments to method %s::%s(). If first argument is a string, a second argument is requir...
php
public function set($key, $value = null) { i\type_check($key, ['array', 'string']); if (func_num_args() === 1 && is_string($key)) { throw new BadMethodCallException(sprintf( "Too few arguments to method %s::%s(). If first argument is a string, a second argument is requir...
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "i", "\\", "type_check", "(", "$", "key", ",", "[", "'array'", ",", "'string'", "]", ")", ";", "if", "(", "func_num_args", "(", ")", "===", "1", "&&", "is_str...
Set a value or multiple values. <code> $entity->set('foo', 22); $entity->set('bar', null); $entity->set(['qux' => 100, 'clr' => 'red']); </code> @param string|array $key Property or set of values @param mixed $value @return $this
[ "Set", "a", "value", "or", "multiple", "values", "." ]
5af7c94645671a3257d6565ff1891ff61fdcf69b
https://github.com/jasny/entity/blob/5af7c94645671a3257d6565ff1891ff61fdcf69b/src/Traits/SetTrait.php#L39-L62
205,534
znframework/package-hypertext
HtmlElementsTrait.php
HtmlElementsTrait.aria
public function aria(String $type, String $element) { $this->settings['attr']['aria-'.$type] = $element; return $this; }
php
public function aria(String $type, String $element) { $this->settings['attr']['aria-'.$type] = $element; return $this; }
[ "public", "function", "aria", "(", "String", "$", "type", ",", "String", "$", "element", ")", "{", "$", "this", "->", "settings", "[", "'attr'", "]", "[", "'aria-'", ".", "$", "type", "]", "=", "$", "element", ";", "return", "$", "this", ";", "}" ]
Sets aria attribute @param string $type @param string $element @return self
[ "Sets", "aria", "attribute" ]
12bbc3bd47a2fae735f638a3e01cc82c1b9c9005
https://github.com/znframework/package-hypertext/blob/12bbc3bd47a2fae735f638a3e01cc82c1b9c9005/HtmlElementsTrait.php#L22-L27
205,535
znframework/package-hypertext
HtmlElementsTrait.php
HtmlElementsTrait.data
public function data(String $type, String $element) { $this->settings['attr']['data-'.$type] = $element; return $this; }
php
public function data(String $type, String $element) { $this->settings['attr']['data-'.$type] = $element; return $this; }
[ "public", "function", "data", "(", "String", "$", "type", ",", "String", "$", "element", ")", "{", "$", "this", "->", "settings", "[", "'attr'", "]", "[", "'data-'", ".", "$", "type", "]", "=", "$", "element", ";", "return", "$", "this", ";", "}" ]
Sets data attribute @param string $type @param string $element @return self
[ "Sets", "data", "attribute" ]
12bbc3bd47a2fae735f638a3e01cc82c1b9c9005
https://github.com/znframework/package-hypertext/blob/12bbc3bd47a2fae735f638a3e01cc82c1b9c9005/HtmlElementsTrait.php#L37-L42
205,536
znframework/package-hypertext
HtmlElementsTrait.php
HtmlElementsTrait.spry
public function spry(String $type, String $element) { $this->settings['attr']['spry-'.$type] = $element; return $this; }
php
public function spry(String $type, String $element) { $this->settings['attr']['spry-'.$type] = $element; return $this; }
[ "public", "function", "spry", "(", "String", "$", "type", ",", "String", "$", "element", ")", "{", "$", "this", "->", "settings", "[", "'attr'", "]", "[", "'spry-'", ".", "$", "type", "]", "=", "$", "element", ";", "return", "$", "this", ";", "}" ]
Sets spry attribute @param string $type @param string $element @return self
[ "Sets", "spry", "attribute" ]
12bbc3bd47a2fae735f638a3e01cc82c1b9c9005
https://github.com/znframework/package-hypertext/blob/12bbc3bd47a2fae735f638a3e01cc82c1b9c9005/HtmlElementsTrait.php#L66-L71
205,537
bennybi/yii2-cza-base
models/statics/ResponseDatum.php
ResponseDatum.getSuccessDatum
public static function getSuccessDatum($meta = [], $data = null, $html = false) { $defaultMeta = array( 'result' => OperationResult::SUCCESS, 'type' => OperationResult::getType(OperationResult::SUCCESS), 'time' => date('Y-m-d H:i:s'), 'message' => Yii::t('cza', 'O...
php
public static function getSuccessDatum($meta = [], $data = null, $html = false) { $defaultMeta = array( 'result' => OperationResult::SUCCESS, 'type' => OperationResult::getType(OperationResult::SUCCESS), 'time' => date('Y-m-d H:i:s'), 'message' => Yii::t('cza', 'O...
[ "public", "static", "function", "getSuccessDatum", "(", "$", "meta", "=", "[", "]", ",", "$", "data", "=", "null", ",", "$", "html", "=", "false", ")", "{", "$", "defaultMeta", "=", "array", "(", "'result'", "=>", "OperationResult", "::", "SUCCESS", ",...
standardize the datum format @param array $data - return data fields @param array $metaData - meta data @return ['_data'=>[], '_meta'=[]]
[ "standardize", "the", "datum", "format" ]
8257db8034bd948712fa469062921f210f0ba8da
https://github.com/bennybi/yii2-cza-base/blob/8257db8034bd948712fa469062921f210f0ba8da/models/statics/ResponseDatum.php#L39-L58
205,538
buse974/Dal
src/Dal/Paginator/Paginator.php
Paginator.getItems
public function getItems() { $statement = (null !== $this->c && null !== $this->d) ? $this->getStatementDay() : $this->getStatementPagination(); $result = $statement->execute((is_array($this->select)) ? $this->select[1] : null); $resultSet = clone $this->resultSetPrototype; $this->r...
php
public function getItems() { $statement = (null !== $this->c && null !== $this->d) ? $this->getStatementDay() : $this->getStatementPagination(); $result = $statement->execute((is_array($this->select)) ? $this->select[1] : null); $resultSet = clone $this->resultSetPrototype; $this->r...
[ "public", "function", "getItems", "(", ")", "{", "$", "statement", "=", "(", "null", "!==", "$", "this", "->", "c", "&&", "null", "!==", "$", "this", "->", "d", ")", "?", "$", "this", "->", "getStatementDay", "(", ")", ":", "$", "this", "->", "ge...
Returns an ResultSet of items for a page. @return \Dal\Db\ResultSet\ResultSet
[ "Returns", "an", "ResultSet", "of", "items", "for", "a", "page", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Paginator/Paginator.php#L204-L213
205,539
buse974/Dal
src/Dal/Paginator/Paginator.php
Paginator.getStatementDay
public function getStatementDay() { if (null === $this->n) { $this->n = 1; } $date = new \DateTime($this->d, new \DateTimeZone('UTC')); $date->sub(new \DateInterval(sprintf('P%dD', ($this->p * $this->n) - 1))); $start_date = $date->format('Y-m-j'); $dat...
php
public function getStatementDay() { if (null === $this->n) { $this->n = 1; } $date = new \DateTime($this->d, new \DateTimeZone('UTC')); $date->sub(new \DateInterval(sprintf('P%dD', ($this->p * $this->n) - 1))); $start_date = $date->format('Y-m-j'); $dat...
[ "public", "function", "getStatementDay", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "n", ")", "{", "$", "this", "->", "n", "=", "1", ";", "}", "$", "date", "=", "new", "\\", "DateTime", "(", "$", "this", "->", "d", ",", "new", ...
Get Statement Pagination By Date @return \Zend\Db\Adapter\Driver\StatementInterface
[ "Get", "Statement", "Pagination", "By", "Date" ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Paginator/Paginator.php#L220-L246
205,540
buse974/Dal
src/Dal/Paginator/Paginator.php
Paginator.getTotalItemCount
public function getTotalItemCount() { if ($this->rowCount !== null) { return $this->rowCount; } $param = null; if (is_array($this->select)) { $select = $this->select[0]; $param = $this->select[1]; $adt = $this->sql->getAdapter(); ...
php
public function getTotalItemCount() { if ($this->rowCount !== null) { return $this->rowCount; } $param = null; if (is_array($this->select)) { $select = $this->select[0]; $param = $this->select[1]; $adt = $this->sql->getAdapter(); ...
[ "public", "function", "getTotalItemCount", "(", ")", "{", "if", "(", "$", "this", "->", "rowCount", "!==", "null", ")", "{", "return", "$", "this", "->", "rowCount", ";", "}", "$", "param", "=", "null", ";", "if", "(", "is_array", "(", "$", "this", ...
Returns the total number of rows in the result set @return int
[ "Returns", "the", "total", "number", "of", "rows", "in", "the", "result", "set" ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Paginator/Paginator.php#L354-L387
205,541
buse974/Dal
src/Dal/Paginator/Paginator.php
Paginator.checkColumns
private function checkColumns($ok, $table, $cols) { $fords = false; foreach ($cols as $ck => $cv) { if ($cv instanceof Expression || $cv instanceof Select || is_string($cv)) { if ($ok === $ck) { $fords = $ok; break; } elseif ( ...
php
private function checkColumns($ok, $table, $cols) { $fords = false; foreach ($cols as $ck => $cv) { if ($cv instanceof Expression || $cv instanceof Select || is_string($cv)) { if ($ok === $ck) { $fords = $ok; break; } elseif ( ...
[ "private", "function", "checkColumns", "(", "$", "ok", ",", "$", "table", ",", "$", "cols", ")", "{", "$", "fords", "=", "false", ";", "foreach", "(", "$", "cols", "as", "$", "ck", "=>", "$", "cv", ")", "{", "if", "(", "$", "cv", "instanceof", ...
Check Column name @param string $ok @return array
[ "Check", "Column", "name" ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Paginator/Paginator.php#L395-L414
205,542
thiagodp/http
lib/Mime.php
Mime.make
static function make( $mime, $param = null, $paramValue = null ) { if ( null === $param || null === $paramValue ) { return $mime; } return "$mime;$param=$paramValue"; }
php
static function make( $mime, $param = null, $paramValue = null ) { if ( null === $param || null === $paramValue ) { return $mime; } return "$mime;$param=$paramValue"; }
[ "static", "function", "make", "(", "$", "mime", ",", "$", "param", "=", "null", ",", "$", "paramValue", "=", "null", ")", "{", "if", "(", "null", "===", "$", "param", "||", "null", "===", "$", "paramValue", ")", "{", "return", "$", "mime", ";", "...
USEFUL STATIC METHODS
[ "USEFUL", "STATIC", "METHODS" ]
e9ccb5e352015213dfcbf1d648c81afb293f4f24
https://github.com/thiagodp/http/blob/e9ccb5e352015213dfcbf1d648c81afb293f4f24/lib/Mime.php#L70-L75
205,543
gwa/zero-library
src/Theme/AbstractTheme.php
AbstractTheme.addImageSize
final protected function addImageSize($name, $width, $height, $crop = false) { $this->getWpBridge()->addImageSize($name, $width, $height, $crop); }
php
final protected function addImageSize($name, $width, $height, $crop = false) { $this->getWpBridge()->addImageSize($name, $width, $height, $crop); }
[ "final", "protected", "function", "addImageSize", "(", "$", "name", ",", "$", "width", ",", "$", "height", ",", "$", "crop", "=", "false", ")", "{", "$", "this", "->", "getWpBridge", "(", ")", "->", "addImageSize", "(", "$", "name", ",", "$", "width"...
Register a WP image size. @param string $name @param integer $width @param integer $height @param boolean|array $crop
[ "Register", "a", "WP", "image", "size", "." ]
2c1e700640f527ace3d58bc0e90bd71a096dcf41
https://github.com/gwa/zero-library/blob/2c1e700640f527ace3d58bc0e90bd71a096dcf41/src/Theme/AbstractTheme.php#L203-L206
205,544
crisu83/yii-seo
behaviors/SeoActiveRecordBehavior.php
SeoActiveRecordBehavior.createUrl
public function createUrl($params=array()) { return Yii::app()->createUrl($this->route, CMap::mergeArray($params, $this->evaluateParams($this->params))); }
php
public function createUrl($params=array()) { return Yii::app()->createUrl($this->route, CMap::mergeArray($params, $this->evaluateParams($this->params))); }
[ "public", "function", "createUrl", "(", "$", "params", "=", "array", "(", ")", ")", "{", "return", "Yii", "::", "app", "(", ")", "->", "createUrl", "(", "$", "this", "->", "route", ",", "CMap", "::", "mergeArray", "(", "$", "params", ",", "$", "thi...
Returns the URL for this model. @param array $params additional GET parameters (name=>value) @return string the URL
[ "Returns", "the", "URL", "for", "this", "model", "." ]
0cf100b2b89c09ba74a8b4c43b14539a023a9225
https://github.com/crisu83/yii-seo/blob/0cf100b2b89c09ba74a8b4c43b14539a023a9225/behaviors/SeoActiveRecordBehavior.php#L26-L29
205,545
crisu83/yii-seo
behaviors/SeoActiveRecordBehavior.php
SeoActiveRecordBehavior.evaluateParams
protected function evaluateParams($params) { foreach ($params as $name => $value) { if (is_callable($value)) $params[$name] = $this->evaluateExpression($value, array('data' => $this->owner)); } return $params; }
php
protected function evaluateParams($params) { foreach ($params as $name => $value) { if (is_callable($value)) $params[$name] = $this->evaluateExpression($value, array('data' => $this->owner)); } return $params; }
[ "protected", "function", "evaluateParams", "(", "$", "params", ")", "{", "foreach", "(", "$", "params", "as", "$", "name", "=>", "$", "value", ")", "{", "if", "(", "is_callable", "(", "$", "value", ")", ")", "$", "params", "[", "$", "name", "]", "=...
Evaluates the given params. @param array $params the parameters. @return array the evaluated params.
[ "Evaluates", "the", "given", "params", "." ]
0cf100b2b89c09ba74a8b4c43b14539a023a9225
https://github.com/crisu83/yii-seo/blob/0cf100b2b89c09ba74a8b4c43b14539a023a9225/behaviors/SeoActiveRecordBehavior.php#L46-L54
205,546
smalldb/libSmalldb
class/Utils/UnionFind.php
UnionFind.findAll
public function findAll() { $a = []; foreach ($this->parents as $x => $r) { $a[$x] = $this->find($x); } return $a; }
php
public function findAll() { $a = []; foreach ($this->parents as $x => $r) { $a[$x] = $this->find($x); } return $a; }
[ "public", "function", "findAll", "(", ")", "{", "$", "a", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "parents", "as", "$", "x", "=>", "$", "r", ")", "{", "$", "a", "[", "$", "x", "]", "=", "$", "this", "->", "find", "(", "$", ...
Get map of all items -> representative
[ "Get", "map", "of", "all", "items", "-", ">", "representative" ]
b94d22af5014e8060d0530fc7043768cdc57b01a
https://github.com/smalldb/libSmalldb/blob/b94d22af5014e8060d0530fc7043768cdc57b01a/class/Utils/UnionFind.php#L116-L123
205,547
smalldb/libSmalldb
class/Utils/UnionFind.php
UnionFind.findDistinct
public function findDistinct() { $a = []; foreach ($this->parents as $x => $r) { $a[$this->find($x)] = null; } return array_keys($a); }
php
public function findDistinct() { $a = []; foreach ($this->parents as $x => $r) { $a[$this->find($x)] = null; } return array_keys($a); }
[ "public", "function", "findDistinct", "(", ")", "{", "$", "a", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "parents", "as", "$", "x", "=>", "$", "r", ")", "{", "$", "a", "[", "$", "this", "->", "find", "(", "$", "x", ")", "]", "=...
Get a representative for each component.
[ "Get", "a", "representative", "for", "each", "component", "." ]
b94d22af5014e8060d0530fc7043768cdc57b01a
https://github.com/smalldb/libSmalldb/blob/b94d22af5014e8060d0530fc7043768cdc57b01a/class/Utils/UnionFind.php#L129-L136
205,548
phPoirot/Loader
fixes/LoaderAggregate.php
LoaderAggregate.loader
function loader($loaderName) { $loaderName = $this->_normalizeLoaderName($loaderName); if (!$this->hasAttached($loaderName)) throw new \Exception(sprintf( 'Loader with name (%s) has not attached.' , $loaderName )); return $this->_t_lo...
php
function loader($loaderName) { $loaderName = $this->_normalizeLoaderName($loaderName); if (!$this->hasAttached($loaderName)) throw new \Exception(sprintf( 'Loader with name (%s) has not attached.' , $loaderName )); return $this->_t_lo...
[ "function", "loader", "(", "$", "loaderName", ")", "{", "$", "loaderName", "=", "$", "this", "->", "_normalizeLoaderName", "(", "$", "loaderName", ")", ";", "if", "(", "!", "$", "this", "->", "hasAttached", "(", "$", "loaderName", ")", ")", "throw", "n...
Get Loader By Name [code:] $aggregateLoader->loader(\Poirot\Loader\Autoloader\LoaderAutoloadNamespace::class) ->with([..options]) [code] @param string $loaderName Loader Name, default is class name @throws \Exception Loader class not found @return iLoader
[ "Get", "Loader", "By", "Name" ]
c645a56bbb81aac99271e077652f6f53f58c0675
https://github.com/phPoirot/Loader/blob/c645a56bbb81aac99271e077652f6f53f58c0675/fixes/LoaderAggregate.php#L93-L104
205,549
phPoirot/Loader
fixes/LoaderAggregate.php
LoaderAggregate.hasAttached
function hasAttached($loaderName) { $loaderName = $this->_normalizeLoaderName($loaderName); return in_array($loaderName, $this->listAttached()); }
php
function hasAttached($loaderName) { $loaderName = $this->_normalizeLoaderName($loaderName); return in_array($loaderName, $this->listAttached()); }
[ "function", "hasAttached", "(", "$", "loaderName", ")", "{", "$", "loaderName", "=", "$", "this", "->", "_normalizeLoaderName", "(", "$", "loaderName", ")", ";", "return", "in_array", "(", "$", "loaderName", ",", "$", "this", "->", "listAttached", "(", ")"...
Has Loader With This Name Attached? [code:] $aggregateLoader->hasAttached(\Poirot\Loader\Autoloader\LoaderAutoloadNamespace::class) [code] @param string $loaderName Loader Name, default is class name @return bool
[ "Has", "Loader", "With", "This", "Name", "Attached?" ]
c645a56bbb81aac99271e077652f6f53f58c0675
https://github.com/phPoirot/Loader/blob/c645a56bbb81aac99271e077652f6f53f58c0675/fixes/LoaderAggregate.php#L117-L121
205,550
IftekherSunny/Planet-Framework
src/Sun/Security/Encrypter.php
Encrypter.encrypt
public function encrypt($data) { $iv = openssl_random_pseudo_bytes($this->getSize()); $value = openssl_encrypt(serialize($data), $this->method, $this->key, 0, $iv); $mac = $this->hash($iv = base64_encode($iv), $value); return base64_encode(json_encode(compact('iv', 'value'...
php
public function encrypt($data) { $iv = openssl_random_pseudo_bytes($this->getSize()); $value = openssl_encrypt(serialize($data), $this->method, $this->key, 0, $iv); $mac = $this->hash($iv = base64_encode($iv), $value); return base64_encode(json_encode(compact('iv', 'value'...
[ "public", "function", "encrypt", "(", "$", "data", ")", "{", "$", "iv", "=", "openssl_random_pseudo_bytes", "(", "$", "this", "->", "getSize", "(", ")", ")", ";", "$", "value", "=", "openssl_encrypt", "(", "serialize", "(", "$", "data", ")", ",", "$", ...
To encrypt data @param $data @return string
[ "To", "encrypt", "data" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Security/Encrypter.php#L63-L72
205,551
IftekherSunny/Planet-Framework
src/Sun/Security/Encrypter.php
Encrypter.decrypt
public function decrypt($data) { $json = base64_decode($data); $data = json_decode($json); // check mac if ($this->hashCheck($data->iv, $data->value, $data->mac)) { $iv = base64_decode($data->iv); $data = openssl_decrypt($data->value, $this->metho...
php
public function decrypt($data) { $json = base64_decode($data); $data = json_decode($json); // check mac if ($this->hashCheck($data->iv, $data->value, $data->mac)) { $iv = base64_decode($data->iv); $data = openssl_decrypt($data->value, $this->metho...
[ "public", "function", "decrypt", "(", "$", "data", ")", "{", "$", "json", "=", "base64_decode", "(", "$", "data", ")", ";", "$", "data", "=", "json_decode", "(", "$", "json", ")", ";", "// check mac\r", "if", "(", "$", "this", "->", "hashCheck", "(",...
To decrypt data @param $data @return mixed|string @throws Exception
[ "To", "decrypt", "data" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Security/Encrypter.php#L82-L99
205,552
IftekherSunny/Planet-Framework
src/Sun/Security/Encrypter.php
Encrypter.hashCheck
protected function hashCheck($iv, $value, $mac) { $salt = Str::random($this->keySize); $mainMac = hash_hmac('sha256', $this->hash($iv, $value), $salt); $checkMac = hash_hmac('sha256', $mac, $salt); if ($mainMac === $checkMac) { return true; } ...
php
protected function hashCheck($iv, $value, $mac) { $salt = Str::random($this->keySize); $mainMac = hash_hmac('sha256', $this->hash($iv, $value), $salt); $checkMac = hash_hmac('sha256', $mac, $salt); if ($mainMac === $checkMac) { return true; } ...
[ "protected", "function", "hashCheck", "(", "$", "iv", ",", "$", "value", ",", "$", "mac", ")", "{", "$", "salt", "=", "Str", "::", "random", "(", "$", "this", "->", "keySize", ")", ";", "$", "mainMac", "=", "hash_hmac", "(", "'sha256'", ",", "$", ...
To check mac @param $iv @param $value @param $mac @return bool
[ "To", "check", "mac" ]
530e772fb97695c1c4e1af73f81675f189474d9f
https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Security/Encrypter.php#L110-L123
205,553
chadicus/coding-standard
Chadicus/Sniffs/Commenting/FunctionCommentSniff.php
Chadicus_Sniffs_Commenting_FunctionCommentSniff.process
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) { $methodProperties = $phpcsFile->getMethodProperties($stackPtr); if ($methodProperties['scope'] !== 'public') { return; } parent::process($phpcsFile, $stackPtr); }
php
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) { $methodProperties = $phpcsFile->getMethodProperties($stackPtr); if ($methodProperties['scope'] !== 'public') { return; } parent::process($phpcsFile, $stackPtr); }
[ "public", "function", "process", "(", "PHP_CodeSniffer_File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "$", "methodProperties", "=", "$", "phpcsFile", "->", "getMethodProperties", "(", "$", "stackPtr", ")", ";", "if", "(", "$", "methodProperties", "["...
Ensures only public methods are processed. @param PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Ensures", "only", "public", "methods", "are", "processed", "." ]
e877151eed0c300e4e33e00308470e3873aa04ea
https://github.com/chadicus/coding-standard/blob/e877151eed0c300e4e33e00308470e3873aa04ea/Chadicus/Sniffs/Commenting/FunctionCommentSniff.php#L27-L35
205,554
chadicus/coding-standard
Chadicus/Sniffs/Commenting/FunctionCommentSniff.php
Chadicus_Sniffs_Commenting_FunctionCommentSniff.checkSpacingAfterParamType
protected function checkSpacingAfterParamType(PHP_CodeSniffer_File $phpcsFile, $param, $maxType, $spacing = 1) { // Check number of spaces after the type. $spaces = ($maxType - strlen($param['type']) + $spacing); if ($param['type_space'] !== $spaces) { $error = 'Expected %s space...
php
protected function checkSpacingAfterParamType(PHP_CodeSniffer_File $phpcsFile, $param, $maxType, $spacing = 1) { // Check number of spaces after the type. $spaces = ($maxType - strlen($param['type']) + $spacing); if ($param['type_space'] !== $spaces) { $error = 'Expected %s space...
[ "protected", "function", "checkSpacingAfterParamType", "(", "PHP_CodeSniffer_File", "$", "phpcsFile", ",", "$", "param", ",", "$", "maxType", ",", "$", "spacing", "=", "1", ")", "{", "// Check number of spaces after the type.", "$", "spaces", "=", "(", "$", "maxTy...
Check the spacing after the type of a parameter. @param PHP_CodeSniffer_File $phpcsFile The file being scanned. @param array $param The parameter to be checked. @param int $maxType The maxlength of the longest parameter type. @param int $spacing The number of sp...
[ "Check", "the", "spacing", "after", "the", "type", "of", "a", "parameter", "." ]
e877151eed0c300e4e33e00308470e3873aa04ea
https://github.com/chadicus/coding-standard/blob/e877151eed0c300e4e33e00308470e3873aa04ea/Chadicus/Sniffs/Commenting/FunctionCommentSniff.php#L558-L600
205,555
martinvium/seine
src/Seine/Writer/OfficeOpenXML2007/SharedStringsHelper.php
SharedStringsHelper.writeString
public function writeString($string) { fwrite($this->stream, ' <si><t>' . Utils::escape($string) . '</t></si>' . MyWriter::EOL); return $this->id++; }
php
public function writeString($string) { fwrite($this->stream, ' <si><t>' . Utils::escape($string) . '</t></si>' . MyWriter::EOL); return $this->id++; }
[ "public", "function", "writeString", "(", "$", "string", ")", "{", "fwrite", "(", "$", "this", "->", "stream", ",", "' <si><t>'", ".", "Utils", "::", "escape", "(", "$", "string", ")", ".", "'</t></si>'", ".", "MyWriter", "::", "EOL", ")", ";", "ret...
String MUST already be escaped @param string $string @return integer id referencing string
[ "String", "MUST", "already", "be", "escaped" ]
b361241c88bb73e81c66259f59193b175223c2eb
https://github.com/martinvium/seine/blob/b361241c88bb73e81c66259f59193b175223c2eb/src/Seine/Writer/OfficeOpenXML2007/SharedStringsHelper.php#L65-L69
205,556
anklimsk/cakephp-console-installer
Model/InstallerInit.php
InstallerInit.initDbTable
public function initDbTable($table = null) { if (empty($table)) { return false; } $initModel = ClassRegistry::init(Inflector::classify($table), true); if ($initModel === false) { return false; } if (!method_exists($initModel, 'initDbTable')) { return false; } $ds = $initModel->getDataSource(...
php
public function initDbTable($table = null) { if (empty($table)) { return false; } $initModel = ClassRegistry::init(Inflector::classify($table), true); if ($initModel === false) { return false; } if (!method_exists($initModel, 'initDbTable')) { return false; } $ds = $initModel->getDataSource(...
[ "public", "function", "initDbTable", "(", "$", "table", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "table", ")", ")", "{", "return", "false", ";", "}", "$", "initModel", "=", "ClassRegistry", "::", "init", "(", "Inflector", "::", "classify", ...
Initialization of database table the initial values @param string $table Database table name for initialization. Seeking method `initDbTable()` in the appropriate model and call it. @return bool Result of coll method `initDbTable()`
[ "Initialization", "of", "database", "table", "the", "initial", "values" ]
76136550e856ff4f8fd3634b77633f86510f63e9
https://github.com/anklimsk/cakephp-console-installer/blob/76136550e856ff4f8fd3634b77633f86510f63e9/Model/InstallerInit.php#L47-L67
205,557
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.setCanvasColor
public function setCanvasColor(array $canvas_color) : AbstractResize { if (Helper::colorIndexValid('r', $canvas_color) === false || Helper::colorIndexValid('g', $canvas_color) === false || Helper::colorIndexValid('b', $canvas_color) === false ) { throw new \Invali...
php
public function setCanvasColor(array $canvas_color) : AbstractResize { if (Helper::colorIndexValid('r', $canvas_color) === false || Helper::colorIndexValid('g', $canvas_color) === false || Helper::colorIndexValid('b', $canvas_color) === false ) { throw new \Invali...
[ "public", "function", "setCanvasColor", "(", "array", "$", "canvas_color", ")", ":", "AbstractResize", "{", "if", "(", "Helper", "::", "colorIndexValid", "(", "'r'", ",", "$", "canvas_color", ")", "===", "false", "||", "Helper", "::", "colorIndexValid", "(", ...
Set a new canvas color @param array $canvas_color Indexed array, r, g, b for color @return AbstractResize @throws \Exception
[ "Set", "a", "new", "canvas", "color" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L147-L157
205,558
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.loadImage
public function loadImage(string $file, string $path = '') : AbstractResize { if (file_exists($path . $file) === true) { $this->source['path'] = $path; $this->source['file'] = $file; $this->sourceProperties(); } else { throw new \Exception("File couldn...
php
public function loadImage(string $file, string $path = '') : AbstractResize { if (file_exists($path . $file) === true) { $this->source['path'] = $path; $this->source['file'] = $file; $this->sourceProperties(); } else { throw new \Exception("File couldn...
[ "public", "function", "loadImage", "(", "string", "$", "file", ",", "string", "$", "path", "=", "''", ")", ":", "AbstractResize", "{", "if", "(", "file_exists", "(", "$", "path", ".", "$", "file", ")", "===", "true", ")", "{", "$", "this", "->", "s...
Load the image @param string $file File name and extension @param string $path Full patch to image @return AbstractResize @throws \Exception Throws an exception if the image can't be loaded
[ "Load", "the", "image" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L168-L184
205,559
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.sourceProperties
protected function sourceProperties() { $properties = Helper::imageProperties($this->source['file'], $this->source['path']); if ($properties['width'] !== null) { $this->source['width'] = $properties['width']; $this->source['height'] = $properties['height']; $this...
php
protected function sourceProperties() { $properties = Helper::imageProperties($this->source['file'], $this->source['path']); if ($properties['width'] !== null) { $this->source['width'] = $properties['width']; $this->source['height'] = $properties['height']; $this...
[ "protected", "function", "sourceProperties", "(", ")", "{", "$", "properties", "=", "Helper", "::", "imageProperties", "(", "$", "this", "->", "source", "[", "'file'", "]", ",", "$", "this", "->", "source", "[", "'path'", "]", ")", ";", "if", "(", "$",...
Fetch the dimensions of the source image and calculate the aspect ratio. We also check to ensure that the image is being resized down, currently we don't support upscaling the image @return void @throws \Exception
[ "Fetch", "the", "dimensions", "of", "the", "source", "image", "and", "calculate", "the", "aspect", "ratio", ".", "We", "also", "check", "to", "ensure", "that", "the", "image", "is", "being", "resized", "down", "currently", "we", "don", "t", "support", "ups...
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L194-L209
205,560
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.resizeSource
public function resizeSource() : AbstractResize { if ($this->intermediate['maintain_aspect'] === true) { if ($this->source['aspect_ratio'] > 1.00) { $this->intermediateSizeLandscape(); } else { if ($this->source['aspect_ratio'] === 1.00) { ...
php
public function resizeSource() : AbstractResize { if ($this->intermediate['maintain_aspect'] === true) { if ($this->source['aspect_ratio'] > 1.00) { $this->intermediateSizeLandscape(); } else { if ($this->source['aspect_ratio'] === 1.00) { ...
[ "public", "function", "resizeSource", "(", ")", ":", "AbstractResize", "{", "if", "(", "$", "this", "->", "intermediate", "[", "'maintain_aspect'", "]", "===", "true", ")", "{", "if", "(", "$", "this", "->", "source", "[", "'aspect_ratio'", "]", ">", "1....
Process the request, generate the size required for the image along with the canvas spacing @return AbstractResize @throws \Exception Throws an exception if unable to create image
[ "Process", "the", "request", "generate", "the", "size", "required", "for", "the", "image", "along", "with", "the", "canvas", "spacing" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L218-L241
205,561
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.intermediateSizeLandscape
protected function intermediateSizeLandscape() { // Set width and then calculate height $this->intermediate['width'] = $this->canvas['width']; $this->intermediate['height'] = intval(round( $this->intermediate['width'] / $this->source['aspect_ratio'], 0)); // If height la...
php
protected function intermediateSizeLandscape() { // Set width and then calculate height $this->intermediate['width'] = $this->canvas['width']; $this->intermediate['height'] = intval(round( $this->intermediate['width'] / $this->source['aspect_ratio'], 0)); // If height la...
[ "protected", "function", "intermediateSizeLandscape", "(", ")", "{", "// Set width and then calculate height", "$", "this", "->", "intermediate", "[", "'width'", "]", "=", "$", "this", "->", "canvas", "[", "'width'", "]", ";", "$", "this", "->", "intermediate", ...
The source image is landscape, maintaining aspect ratio calculate the intermediate image height and width @return void
[ "The", "source", "image", "is", "landscape", "maintaining", "aspect", "ratio", "calculate", "the", "intermediate", "image", "height", "and", "width" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L249-L262
205,562
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.intermediateSizeSquare
protected function intermediateSizeSquare() { if ($this->canvas['height'] === $this->canvas['width']) { $this->intermediate['width'] = $this->canvas['width']; $this->intermediate['height'] = $this->canvas['height']; } else { if ($this->canvas['width'] > $this->can...
php
protected function intermediateSizeSquare() { if ($this->canvas['height'] === $this->canvas['width']) { $this->intermediate['width'] = $this->canvas['width']; $this->intermediate['height'] = $this->canvas['height']; } else { if ($this->canvas['width'] > $this->can...
[ "protected", "function", "intermediateSizeSquare", "(", ")", "{", "if", "(", "$", "this", "->", "canvas", "[", "'height'", "]", "===", "$", "this", "->", "canvas", "[", "'width'", "]", ")", "{", "$", "this", "->", "intermediate", "[", "'width'", "]", "...
The source image is landscape, fit as appropriate @return void
[ "The", "source", "image", "is", "landscape", "fit", "as", "appropriate" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L269-L283
205,563
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.intermediateSizePortrait
protected function intermediateSizePortrait() { // Set height and then calculate width $this->intermediate['height'] = $this->canvas['height']; $this->intermediate['width'] = intval(round( $this->intermediate['height'] * $this->source['aspect_ratio'], 0)); // If width la...
php
protected function intermediateSizePortrait() { // Set height and then calculate width $this->intermediate['height'] = $this->canvas['height']; $this->intermediate['width'] = intval(round( $this->intermediate['height'] * $this->source['aspect_ratio'], 0)); // If width la...
[ "protected", "function", "intermediateSizePortrait", "(", ")", "{", "// Set height and then calculate width", "$", "this", "->", "intermediate", "[", "'height'", "]", "=", "$", "this", "->", "canvas", "[", "'height'", "]", ";", "$", "this", "->", "intermediate", ...
The source image is portrait, maintaining aspect ratio calculate the intermediate image height and width @return void
[ "The", "source", "image", "is", "portrait", "maintaining", "aspect", "ratio", "calculate", "the", "intermediate", "image", "height", "and", "width" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L291-L304
205,564
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.canvasSpacingX
protected function canvasSpacingX() { $this->canvas['spacing']['x'] = 0; if ($this->intermediate['width'] < $this->canvas['width']) { $difference = $this->canvas['width'] - $this->intermediate['width']; if ($difference % 2 === 0) { $this->canvas['spacing']['...
php
protected function canvasSpacingX() { $this->canvas['spacing']['x'] = 0; if ($this->intermediate['width'] < $this->canvas['width']) { $difference = $this->canvas['width'] - $this->intermediate['width']; if ($difference % 2 === 0) { $this->canvas['spacing']['...
[ "protected", "function", "canvasSpacingX", "(", ")", "{", "$", "this", "->", "canvas", "[", "'spacing'", "]", "[", "'x'", "]", "=", "0", ";", "if", "(", "$", "this", "->", "intermediate", "[", "'width'", "]", "<", "$", "this", "->", "canvas", "[", ...
Calculate any required x canvas spacing, necessary if the intermediate image will be smaller than the canvas @return void
[ "Calculate", "any", "required", "x", "canvas", "spacing", "necessary", "if", "the", "intermediate", "image", "will", "be", "smaller", "than", "the", "canvas" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L312-L329
205,565
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.canvasSpacingY
protected function canvasSpacingY() { $this->canvas['spacing']['y'] = 0; if ($this->intermediate['height'] < $this->canvas['height']) { $difference = $this->canvas['height'] - $this->intermediate['height']; if ($difference % 2 === 0) { $this->canvas['spacin...
php
protected function canvasSpacingY() { $this->canvas['spacing']['y'] = 0; if ($this->intermediate['height'] < $this->canvas['height']) { $difference = $this->canvas['height'] - $this->intermediate['height']; if ($difference % 2 === 0) { $this->canvas['spacin...
[ "protected", "function", "canvasSpacingY", "(", ")", "{", "$", "this", "->", "canvas", "[", "'spacing'", "]", "[", "'y'", "]", "=", "0", ";", "if", "(", "$", "this", "->", "intermediate", "[", "'height'", "]", "<", "$", "this", "->", "canvas", "[", ...
Calculate any required y canvas spacing, necessary if the intermediate image will be smaller than the canvas @return void
[ "Calculate", "any", "required", "y", "canvas", "spacing", "necessary", "if", "the", "intermediate", "image", "will", "be", "smaller", "than", "the", "canvas" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L337-L355
205,566
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.createCanvas
protected function createCanvas() { $this->canvas['canvas'] = imagecreatetruecolor($this->canvas['width'], $this->canvas['height']); if ($this->canvas['canvas'] === false) { throw new \Exception(Helper::ERROR_CALL_IMAGECREATETRUECOLOR); } $fill_color = imagecolorallocate...
php
protected function createCanvas() { $this->canvas['canvas'] = imagecreatetruecolor($this->canvas['width'], $this->canvas['height']); if ($this->canvas['canvas'] === false) { throw new \Exception(Helper::ERROR_CALL_IMAGECREATETRUECOLOR); } $fill_color = imagecolorallocate...
[ "protected", "function", "createCanvas", "(", ")", "{", "$", "this", "->", "canvas", "[", "'canvas'", "]", "=", "imagecreatetruecolor", "(", "$", "this", "->", "canvas", "[", "'width'", "]", ",", "$", "this", "->", "canvas", "[", "'height'", "]", ")", ...
Create the canvas and fill with the canvas colour @throws \Exception
[ "Create", "the", "canvas", "and", "fill", "with", "the", "canvas", "colour" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L410-L426
205,567
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.resampleCopy
protected function resampleCopy() { $result = imagecopyresampled($this->canvas['canvas'], $this->intermediate['copy'], $this->canvas['spacing']['x'], $this->canvas['spacing']['y'], 0 ,0, $this->intermediate['width'], $this->intermediate['height'], $this->source['width'], ...
php
protected function resampleCopy() { $result = imagecopyresampled($this->canvas['canvas'], $this->intermediate['copy'], $this->canvas['spacing']['x'], $this->canvas['spacing']['y'], 0 ,0, $this->intermediate['width'], $this->intermediate['height'], $this->source['width'], ...
[ "protected", "function", "resampleCopy", "(", ")", "{", "$", "result", "=", "imagecopyresampled", "(", "$", "this", "->", "canvas", "[", "'canvas'", "]", ",", "$", "this", "->", "intermediate", "[", "'copy'", "]", ",", "$", "this", "->", "canvas", "[", ...
Resample the image copy @throws \Exception
[ "Resample", "the", "image", "copy" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L433-L443
205,568
deanblackborough/random-grab-bag
src/ImageResize/AbstractResize.php
AbstractResize.save
public function save() : AbstractResize { if ($this->file === null) { $this->file = str_replace($this->extension, '-copy' . $this->extension, $this->source['file']); } if ($this->path === null) { $this->path = $this->source['path']; } $this->saveFile(...
php
public function save() : AbstractResize { if ($this->file === null) { $this->file = str_replace($this->extension, '-copy' . $this->extension, $this->source['file']); } if ($this->path === null) { $this->path = $this->source['path']; } $this->saveFile(...
[ "public", "function", "save", "(", ")", ":", "AbstractResize", "{", "if", "(", "$", "this", "->", "file", "===", "null", ")", "{", "$", "this", "->", "file", "=", "str_replace", "(", "$", "this", "->", "extension", ",", "'-copy'", ".", "$", "this", ...
Save the new image @return AbstractResize @throws \Exception Throws an exception if the save fails
[ "Save", "the", "new", "image" ]
b72814a80357d5dbd344b99c3d242678c8cf080f
https://github.com/deanblackborough/random-grab-bag/blob/b72814a80357d5dbd344b99c3d242678c8cf080f/src/ImageResize/AbstractResize.php#L496-L508
205,569
foothing/laravel-wrappr
src/Foothing/Wrappr/Installer/Parser.php
Parser.getResourceFromPath
public function getResourceFromPath(Route $route, $path) { // Explode it. $chunks = explode("/", $path); return $route->resourceOffset ? $chunks[$route->resourceOffset ] : null; }
php
public function getResourceFromPath(Route $route, $path) { // Explode it. $chunks = explode("/", $path); return $route->resourceOffset ? $chunks[$route->resourceOffset ] : null; }
[ "public", "function", "getResourceFromPath", "(", "Route", "$", "route", ",", "$", "path", ")", "{", "// Explode it.", "$", "chunks", "=", "explode", "(", "\"/\"", ",", "$", "path", ")", ";", "return", "$", "route", "->", "resourceOffset", "?", "$", "chu...
Extract the resource identifier from the given path. @param Route $route @param $path @return mixed resource identifier
[ "Extract", "the", "resource", "identifier", "from", "the", "given", "path", "." ]
4f6b0181679866b2e42c2e86bdbc1d9fb5d2390b
https://github.com/foothing/laravel-wrappr/blob/4f6b0181679866b2e42c2e86bdbc1d9fb5d2390b/src/Foothing/Wrappr/Installer/Parser.php#L95-L99
205,570
foothing/laravel-wrappr
src/Foothing/Wrappr/Installer/Parser.php
Parser.trimPath
public function trimPath($path) { // Rewrite leading double slashes. $path = preg_replace("/^\/\//", "/", $path); // If there are more double slashes route is invalid. if (preg_match("/\/{2,}/", $path)) { throw new \Exception('Route path has invalid format ' . $path); ...
php
public function trimPath($path) { // Rewrite leading double slashes. $path = preg_replace("/^\/\//", "/", $path); // If there are more double slashes route is invalid. if (preg_match("/\/{2,}/", $path)) { throw new \Exception('Route path has invalid format ' . $path); ...
[ "public", "function", "trimPath", "(", "$", "path", ")", "{", "// Rewrite leading double slashes.", "$", "path", "=", "preg_replace", "(", "\"/^\\/\\//\"", ",", "\"/\"", ",", "$", "path", ")", ";", "// If there are more double slashes route is invalid.", "if", "(", ...
Right and left trim route from blanks and undesired characters. @param $path @return string @throws \Exception
[ "Right", "and", "left", "trim", "route", "from", "blanks", "and", "undesired", "characters", "." ]
4f6b0181679866b2e42c2e86bdbc1d9fb5d2390b
https://github.com/foothing/laravel-wrappr/blob/4f6b0181679866b2e42c2e86bdbc1d9fb5d2390b/src/Foothing/Wrappr/Installer/Parser.php#L109-L120
205,571
rawcreative/Receiptful
src/Api.php
Api.factory
public static function factory(array $config) { if ( ! array_key_exists('apiKey', $config)) { throw new \Exception('Api factory requires $apiKey parameter.'); } $client = new Client([ 'defaults' => [ 'headers' => [ 'X-ApiKey' => $c...
php
public static function factory(array $config) { if ( ! array_key_exists('apiKey', $config)) { throw new \Exception('Api factory requires $apiKey parameter.'); } $client = new Client([ 'defaults' => [ 'headers' => [ 'X-ApiKey' => $c...
[ "public", "static", "function", "factory", "(", "array", "$", "config", ")", "{", "if", "(", "!", "array_key_exists", "(", "'apiKey'", ",", "$", "config", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'Api factory requires $apiKey parameter.'", ")", ...
Creates and returns an Api client instance @param array $config @return Api @throws \Exception
[ "Creates", "and", "returns", "an", "Api", "client", "instance" ]
1075a189a1e0c4ef01fcdfc5cd75c91cc2fb8f14
https://github.com/rawcreative/Receiptful/blob/1075a189a1e0c4ef01fcdfc5cd75c91cc2fb8f14/src/Api.php#L18-L37
205,572
rawcreative/Receiptful
src/Api.php
Api.getDescriptionFromConfig
private static function getDescriptionFromConfig(array $config) { $data = isset($config['descriptionPath']) && is_readable($config['descriptionPath']) ? include $config['descriptionPath'] : include __DIR__ . '/receiptful-api.php'; return new Description($data); }
php
private static function getDescriptionFromConfig(array $config) { $data = isset($config['descriptionPath']) && is_readable($config['descriptionPath']) ? include $config['descriptionPath'] : include __DIR__ . '/receiptful-api.php'; return new Description($data); }
[ "private", "static", "function", "getDescriptionFromConfig", "(", "array", "$", "config", ")", "{", "$", "data", "=", "isset", "(", "$", "config", "[", "'descriptionPath'", "]", ")", "&&", "is_readable", "(", "$", "config", "[", "'descriptionPath'", "]", ")"...
Loads the api service description @param array $config @return Description
[ "Loads", "the", "api", "service", "description" ]
1075a189a1e0c4ef01fcdfc5cd75c91cc2fb8f14
https://github.com/rawcreative/Receiptful/blob/1075a189a1e0c4ef01fcdfc5cd75c91cc2fb8f14/src/Api.php#L45-L52
205,573
diatem-net/jin-social
src/Social/Jasig/CAS/CASSSO.php
CASSSO.getBaseUrl
protected static function getBaseUrl() { $baseUrl = 'https://'; if (!self::$ssl) { $baseUrl = 'http://'; } $baseUrl .= sprintf('%s:%s/%s/', self::$host, self::$port, self::$context); return $baseUrl; }
php
protected static function getBaseUrl() { $baseUrl = 'https://'; if (!self::$ssl) { $baseUrl = 'http://'; } $baseUrl .= sprintf('%s:%s/%s/', self::$host, self::$port, self::$context); return $baseUrl; }
[ "protected", "static", "function", "getBaseUrl", "(", ")", "{", "$", "baseUrl", "=", "'https://'", ";", "if", "(", "!", "self", "::", "$", "ssl", ")", "{", "$", "baseUrl", "=", "'http://'", ";", "}", "$", "baseUrl", ".=", "sprintf", "(", "'%s:%s/%s/'",...
Construit l'url de connexion au serveur @return string
[ "Construit", "l", "url", "de", "connexion", "au", "serveur" ]
c49bc8d1b28264ae58e0af9e0452c8d17623e25d
https://github.com/diatem-net/jin-social/blob/c49bc8d1b28264ae58e0af9e0452c8d17623e25d/src/Social/Jasig/CAS/CASSSO.php#L149-L157
205,574
schpill/thin
src/Redisraw.php
Redisraw.run
public function run($method, $parameters) {dieDump($method); fwrite($this->connect(), $this->command($method, (array) $parameters)); $response = trim(fgets($this->connect())); return $this->parse($response); }
php
public function run($method, $parameters) {dieDump($method); fwrite($this->connect(), $this->command($method, (array) $parameters)); $response = trim(fgets($this->connect())); return $this->parse($response); }
[ "public", "function", "run", "(", "$", "method", ",", "$", "parameters", ")", "{", "dieDump", "(", "$", "method", ")", ";", "fwrite", "(", "$", "this", "->", "connect", "(", ")", ",", "$", "this", "->", "command", "(", "$", "method", ",", "(", "a...
Execute a command against the Redis database. <code> // Execute the GET command for the "name" key $name = Redis::db()->run('get', array('name')); // Execute the LRANGE command for the "list" key $list = Redis::db()->run('lrange', array(0, 5)); </code> @param string $method @param array $parameters @return mixe...
[ "Execute", "a", "command", "against", "the", "Redis", "database", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Redisraw.php#L101-L106
205,575
schpill/thin
src/Redisraw.php
Redisraw.parse
protected function parse($response) { switch (substr($response, 0, 1)) { case '-': throw new Exception('Redis error: ' . substr(trim($response), 4)); case '+': case ':': return $this->inline($response); ...
php
protected function parse($response) { switch (substr($response, 0, 1)) { case '-': throw new Exception('Redis error: ' . substr(trim($response), 4)); case '+': case ':': return $this->inline($response); ...
[ "protected", "function", "parse", "(", "$", "response", ")", "{", "switch", "(", "substr", "(", "$", "response", ",", "0", ",", "1", ")", ")", "{", "case", "'-'", ":", "throw", "new", "Exception", "(", "'Redis error: '", ".", "substr", "(", "trim", "...
Parse and return the response from the Redis database. @param string $response @return mixed
[ "Parse", "and", "return", "the", "response", "from", "the", "Redis", "database", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Redisraw.php#L114-L133
205,576
villermen/runescape-lookup-commons
src/HighScore/SkillHighScore.php
SkillHighScore.getCombatLevel
public function getCombatLevel($includeSummoning = true): int { $attackLevel = $this->getSkill(Skill::SKILL_ATTACK) ? $this->getSkill(Skill::SKILL_ATTACK)->getLevel() : 1; $defenceLevel = $this->getSkill(Skill::SKILL_DEFENCE) ? $this->getSkill(Skill::SKILL_DEFENCE)->getLevel() : 1; $strength...
php
public function getCombatLevel($includeSummoning = true): int { $attackLevel = $this->getSkill(Skill::SKILL_ATTACK) ? $this->getSkill(Skill::SKILL_ATTACK)->getLevel() : 1; $defenceLevel = $this->getSkill(Skill::SKILL_DEFENCE) ? $this->getSkill(Skill::SKILL_DEFENCE)->getLevel() : 1; $strength...
[ "public", "function", "getCombatLevel", "(", "$", "includeSummoning", "=", "true", ")", ":", "int", "{", "$", "attackLevel", "=", "$", "this", "->", "getSkill", "(", "Skill", "::", "SKILL_ATTACK", ")", "?", "$", "this", "->", "getSkill", "(", "Skill", ":...
Returns the combat level of this high score. @param bool $includeSummoning Whether to include the summoning skill while calculating the combat level. @return int
[ "Returns", "the", "combat", "level", "of", "this", "high", "score", "." ]
3e24dadbdc5e20b755280e5110f4ca0a1758b04c
https://github.com/villermen/runescape-lookup-commons/blob/3e24dadbdc5e20b755280e5110f4ca0a1758b04c/src/HighScore/SkillHighScore.php#L33-L48
205,577
chilimatic/chilimatic-framework
lib/file/Image.php
Image.create_thumbnail
public function create_thumbnail($width = 200, $height = 200, $bestfit = false, $fill = false) { if (empty($this->imagemagik) || empty($this->filename)) return false; try { $this->imagemagik->thumbnailimage($width, $height, $bestfit, $fill); } catch (\ImagickException $e) { ...
php
public function create_thumbnail($width = 200, $height = 200, $bestfit = false, $fill = false) { if (empty($this->imagemagik) || empty($this->filename)) return false; try { $this->imagemagik->thumbnailimage($width, $height, $bestfit, $fill); } catch (\ImagickException $e) { ...
[ "public", "function", "create_thumbnail", "(", "$", "width", "=", "200", ",", "$", "height", "=", "200", ",", "$", "bestfit", "=", "false", ",", "$", "fill", "=", "false", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "imagemagik", ")", "||...
Wrapper for Imagick thumbnail @param int $width @param int $height @param boolean $bestfit @param boolean $fill @throws \Exception @throws \ImagickException @return boolean
[ "Wrapper", "for", "Imagick", "thumbnail" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/file/Image.php#L72-L83
205,578
chilimatic/chilimatic-framework
lib/file/Image.php
Image.saveThumb
public function saveThumb($path = '', $filename = '') { if (empty($this->filename)) return false; try { $save_name = (empty($path) ? $this->path : $path); $save_name = "$save_name/" . (empty($filename) ? 'th_' . $this->filename : $filename); $this->imagemagik->wr...
php
public function saveThumb($path = '', $filename = '') { if (empty($this->filename)) return false; try { $save_name = (empty($path) ? $this->path : $path); $save_name = "$save_name/" . (empty($filename) ? 'th_' . $this->filename : $filename); $this->imagemagik->wr...
[ "public", "function", "saveThumb", "(", "$", "path", "=", "''", ",", "$", "filename", "=", "''", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "filename", ")", ")", "return", "false", ";", "try", "{", "$", "save_name", "=", "(", "empty", ...
saves the file and opens the fileinfo for this file @param string $path @param string $filename @throws \Exception @throws \ImagickException @return boolean
[ "saves", "the", "file", "and", "opens", "the", "fileinfo", "for", "this", "file" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/file/Image.php#L96-L109
205,579
BenGorFile/FileBundle
src/BenGorFile/FileBundle/Controller/OverwriteAction.php
OverwriteAction.overwriteAction
public function overwriteAction($anId, Request $aRequest, FileCommandBus $aCommandBus, $aProperty) { if (false === $aRequest->files->has($aProperty)) { throw new \InvalidArgumentException(sprintf('Given %s property is not in the request', $aProperty)); } $uploadedFile = $aReques...
php
public function overwriteAction($anId, Request $aRequest, FileCommandBus $aCommandBus, $aProperty) { if (false === $aRequest->files->has($aProperty)) { throw new \InvalidArgumentException(sprintf('Given %s property is not in the request', $aProperty)); } $uploadedFile = $aReques...
[ "public", "function", "overwriteAction", "(", "$", "anId", ",", "Request", "$", "aRequest", ",", "FileCommandBus", "$", "aCommandBus", ",", "$", "aProperty", ")", "{", "if", "(", "false", "===", "$", "aRequest", "->", "files", "->", "has", "(", "$", "aPr...
Overwrite action. @param string $anId The file id @param Request $aRequest The request @param FileCommandBus $aCommandBus The command bus @param string $aProperty The file property that want to get from request @return array
[ "Overwrite", "action", "." ]
82c1fa952e7e7b7a188141a34053ab612b699a21
https://github.com/BenGorFile/FileBundle/blob/82c1fa952e7e7b7a188141a34053ab612b699a21/src/BenGorFile/FileBundle/Controller/OverwriteAction.php#L36-L58
205,580
phPoirot/Stream
Wrapper/WrapperPsrToPhpResource.php
WrapperPsrToPhpResource.convertToResource
static function convertToResource(StreamInterface $stream) { # register wrapper if not $self = new self; if(!RegistryOfWrapperStream::isRegistered($self->getLabel())) RegistryOfWrapperStream::register($self); # make resource $mode = new AccessMode(); (!$s...
php
static function convertToResource(StreamInterface $stream) { # register wrapper if not $self = new self; if(!RegistryOfWrapperStream::isRegistered($self->getLabel())) RegistryOfWrapperStream::register($self); # make resource $mode = new AccessMode(); (!$s...
[ "static", "function", "convertToResource", "(", "StreamInterface", "$", "stream", ")", "{", "# register wrapper if not", "$", "self", "=", "new", "self", ";", "if", "(", "!", "RegistryOfWrapperStream", "::", "isRegistered", "(", "$", "self", "->", "getLabel", "(...
Convert StreamInterface To PHP resource @param StreamInterface $stream @return resource
[ "Convert", "StreamInterface", "To", "PHP", "resource" ]
db448ee0528c2a5b07c594b8a30e2543fbc15f57
https://github.com/phPoirot/Stream/blob/db448ee0528c2a5b07c594b8a30e2543fbc15f57/Wrapper/WrapperPsrToPhpResource.php#L47-L71
205,581
diasbruno/stc
lib/stc/DataLoader.php
DataLoader.read_file
private function read_file($file) { $handler = fopen($file, "r"); $file_content = fread($handler, filesize($file)); fclose($handler); return $file_content; }
php
private function read_file($file) { $handler = fopen($file, "r"); $file_content = fread($handler, filesize($file)); fclose($handler); return $file_content; }
[ "private", "function", "read_file", "(", "$", "file", ")", "{", "$", "handler", "=", "fopen", "(", "$", "file", ",", "\"r\"", ")", ";", "$", "file_content", "=", "fread", "(", "$", "handler", ",", "filesize", "(", "$", "file", ")", ")", ";", "fclos...
Creates the handler and reads the files. @param $file string | The filename. @return string
[ "Creates", "the", "handler", "and", "reads", "the", "files", "." ]
43f62c3b28167bff76274f954e235413a9e9c707
https://github.com/diasbruno/stc/blob/43f62c3b28167bff76274f954e235413a9e9c707/lib/stc/DataLoader.php#L21-L28
205,582
diasbruno/stc
lib/stc/DataLoader.php
DataLoader.load
public function load($path, $file) { $the_file = $path . '/' . $file; return json_decode($this->read_file($the_file), true); }
php
public function load($path, $file) { $the_file = $path . '/' . $file; return json_decode($this->read_file($the_file), true); }
[ "public", "function", "load", "(", "$", "path", ",", "$", "file", ")", "{", "$", "the_file", "=", "$", "path", ".", "'/'", ".", "$", "file", ";", "return", "json_decode", "(", "$", "this", "->", "read_file", "(", "$", "the_file", ")", ",", "true", ...
Load the file. @param $path string | The path where the file is located. @param $file string | The filename. @return string
[ "Load", "the", "file", "." ]
43f62c3b28167bff76274f954e235413a9e9c707
https://github.com/diasbruno/stc/blob/43f62c3b28167bff76274f954e235413a9e9c707/lib/stc/DataLoader.php#L36-L41
205,583
bennybi/yii2-cza-base
models/traits/TreeTrait.php
TreeTrait.initDefaults
public function initDefaults() { /** * @var Tree $this */ $module = Yii::$app->controller->module; $iconTypeAttribute = null; extract($module->dataStructure); $this->setDefault($iconTypeAttribute, TreeView::ICON_CSS); foreach (static::$boolAttribs as $at...
php
public function initDefaults() { /** * @var Tree $this */ $module = Yii::$app->controller->module; $iconTypeAttribute = null; extract($module->dataStructure); $this->setDefault($iconTypeAttribute, TreeView::ICON_CSS); foreach (static::$boolAttribs as $at...
[ "public", "function", "initDefaults", "(", ")", "{", "/**\n * @var Tree $this\n */", "$", "module", "=", "Yii", "::", "$", "app", "->", "controller", "->", "module", ";", "$", "iconTypeAttribute", "=", "null", ";", "extract", "(", "$", "module", ...
Initialize default values
[ "Initialize", "default", "values" ]
8257db8034bd948712fa469062921f210f0ba8da
https://github.com/bennybi/yii2-cza-base/blob/8257db8034bd948712fa469062921f210f0ba8da/models/traits/TreeTrait.php#L146-L158
205,584
bennybi/yii2-cza-base
models/traits/TreeTrait.php
TreeTrait.removeNode
public function removeNode($softDelete = true, $currNode = true) { /** * @var Tree $this * @var Tree $child */ if ($softDelete) { $this->nodeRemovalErrors = []; $module = Yii::$app->controller->module; extract($module->treeStructure); ...
php
public function removeNode($softDelete = true, $currNode = true) { /** * @var Tree $this * @var Tree $child */ if ($softDelete) { $this->nodeRemovalErrors = []; $module = Yii::$app->controller->module; extract($module->treeStructure); ...
[ "public", "function", "removeNode", "(", "$", "softDelete", "=", "true", ",", "$", "currNode", "=", "true", ")", "{", "/**\n * @var Tree $this\n * @var Tree $child\n */", "if", "(", "$", "softDelete", ")", "{", "$", "this", "->", "nodeRemoval...
Removes a node @param boolean $softDelete whether to soft delete or hard delete @param boolean $currNode whether to update the current node value also @return boolean status of activation/inactivation
[ "Removes", "a", "node" ]
8257db8034bd948712fa469062921f210f0ba8da
https://github.com/bennybi/yii2-cza-base/blob/8257db8034bd948712fa469062921f210f0ba8da/models/traits/TreeTrait.php#L300-L346
205,585
bennybi/yii2-cza-base
models/traits/TreeTrait.php
TreeTrait.getBreadcrumbs
public function getBreadcrumbs($depth = 1, $glue = ' &raquo; ', $currCss = 'kv-crumb-active', $new = 'Untitled') { /** * @var Tree $this */ if ($this->isNewRecord || empty($this)) { return $currCss ? Html::tag('span', $new, ['class' => $currCss]) : $new; } $...
php
public function getBreadcrumbs($depth = 1, $glue = ' &raquo; ', $currCss = 'kv-crumb-active', $new = 'Untitled') { /** * @var Tree $this */ if ($this->isNewRecord || empty($this)) { return $currCss ? Html::tag('span', $new, ['class' => $currCss]) : $new; } $...
[ "public", "function", "getBreadcrumbs", "(", "$", "depth", "=", "1", ",", "$", "glue", "=", "' &raquo; '", ",", "$", "currCss", "=", "'kv-crumb-active'", ",", "$", "new", "=", "'Untitled'", ")", "{", "/**\n * @var Tree $this\n */", "if", "(", "...
Generate and return the breadcrumbs for the node. @param integer $depth the breadcrumbs parent depth @param string $glue the pattern to separate the breadcrumbs @param string $currCss the CSS class to be set for current node @param string $new the name to be displayed for a new node @return string the par...
[ "Generate", "and", "return", "the", "breadcrumbs", "for", "the", "node", "." ]
8257db8034bd948712fa469062921f210f0ba8da
https://github.com/bennybi/yii2-cza-base/blob/8257db8034bd948712fa469062921f210f0ba8da/models/traits/TreeTrait.php#L393-L417
205,586
silvercommerce/contact-admin
src/bulkhandler/AddRelatedHandler.php
AddRelatedHandler.Link
public function Link($action = null) { return Controller::join_links( parent::Link(), $this->config()->url_segment, $action ); }
php
public function Link($action = null) { return Controller::join_links( parent::Link(), $this->config()->url_segment, $action ); }
[ "public", "function", "Link", "(", "$", "action", "=", "null", ")", "{", "return", "Controller", "::", "join_links", "(", "parent", "::", "Link", "(", ")", ",", "$", "this", "->", "config", "(", ")", "->", "url_segment", ",", "$", "action", ")", ";",...
Return URL to this RequestHandler @param string $action Action to append to URL @return string URL
[ "Return", "URL", "to", "this", "RequestHandler" ]
32cbc2ef2589f93f9dd1796e5db2f11ad15d888c
https://github.com/silvercommerce/contact-admin/blob/32cbc2ef2589f93f9dd1796e5db2f11ad15d888c/src/bulkhandler/AddRelatedHandler.php#L44-L51
205,587
atelierspierrot/templatengine
src/TemplateEngine/TemplateObject/TitleTag.php
TitleTag.set
public function set(array $strs) { if (!empty($strs)) { foreach ($strs as $_str) { $this->add($_str); } } return $this; }
php
public function set(array $strs) { if (!empty($strs)) { foreach ($strs as $_str) { $this->add($_str); } } return $this; }
[ "public", "function", "set", "(", "array", "$", "strs", ")", "{", "if", "(", "!", "empty", "(", "$", "strs", ")", ")", "{", "foreach", "(", "$", "strs", "as", "$", "_str", ")", "{", "$", "this", "->", "add", "(", "$", "_str", ")", ";", "}", ...
Set a strings stack to build page header title @param array $strs An array of title strings @return self @see self::add()
[ "Set", "a", "strings", "stack", "to", "build", "page", "header", "title" ]
de01b117f882670bed7b322e2d3b8b30fa9ae45f
https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/TemplateEngine/TemplateObject/TitleTag.php#L79-L87
205,588
luoxiaojun1992/lb_framework
controllers/web/WebController.php
WebController.injectDebugBar
protected function injectDebugBar($output) { if (!($debugBarConfig = Lb::app()->getConfigByName('debugbar'))) { return $output; } if (empty($debugBarConfig['enabled'])) { return $output; } if (empty($debugBarConfig['baseUrl'])) { return $ou...
php
protected function injectDebugBar($output) { if (!($debugBarConfig = Lb::app()->getConfigByName('debugbar'))) { return $output; } if (empty($debugBarConfig['enabled'])) { return $output; } if (empty($debugBarConfig['baseUrl'])) { return $ou...
[ "protected", "function", "injectDebugBar", "(", "$", "output", ")", "{", "if", "(", "!", "(", "$", "debugBarConfig", "=", "Lb", "::", "app", "(", ")", "->", "getConfigByName", "(", "'debugbar'", ")", ")", ")", "{", "return", "$", "output", ";", "}", ...
Inject debug bar to html output @param $output @return mixed
[ "Inject", "debug", "bar", "to", "html", "output" ]
12a865729e7738d7d1e07371ad7203243c4571fa
https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/controllers/web/WebController.php#L169-L195
205,589
wearesho-team/cpa-integration
src/Postback/PostbackService.php
PostbackService.send
public function send(ConversionInterface $conversion): ResponseInterface { foreach ($this->services as $service) { if (is_null($service->getConfig())) { $config = $this->config->getConfiguredConfigInstance($service); if ($config instanceof PostbackServiceConfigInt...
php
public function send(ConversionInterface $conversion): ResponseInterface { foreach ($this->services as $service) { if (is_null($service->getConfig())) { $config = $this->config->getConfiguredConfigInstance($service); if ($config instanceof PostbackServiceConfigInt...
[ "public", "function", "send", "(", "ConversionInterface", "$", "conversion", ")", ":", "ResponseInterface", "{", "foreach", "(", "$", "this", "->", "services", "as", "$", "service", ")", "{", "if", "(", "is_null", "(", "$", "service", "->", "getConfig", "(...
Try each service to send conversion, while getting UnsupportedConversionException @param ConversionInterface $conversion @throws UnsupportedConversionTypeException @throws DuplicatedConversionException @throws RequestException @return ResponseInterface
[ "Try", "each", "service", "to", "send", "conversion", "while", "getting", "UnsupportedConversionException" ]
6b78d2315e893ecf09132ae3e9d8e8c1b5ae6291
https://github.com/wearesho-team/cpa-integration/blob/6b78d2315e893ecf09132ae3e9d8e8c1b5ae6291/src/Postback/PostbackService.php#L113-L132
205,590
ekyna/AdminBundle
Install/AdminInstaller.php
AdminInstaller.createGroups
private function createGroups(OutputInterface $output) { $em = $this->container->get('ekyna_user.group.manager'); $repository = $this->container->get('ekyna_user.group.repository'); foreach ($this->defaultGroups as $name => $options) { $output->write(sprintf( '- ...
php
private function createGroups(OutputInterface $output) { $em = $this->container->get('ekyna_user.group.manager'); $repository = $this->container->get('ekyna_user.group.repository'); foreach ($this->defaultGroups as $name => $options) { $output->write(sprintf( '- ...
[ "private", "function", "createGroups", "(", "OutputInterface", "$", "output", ")", "{", "$", "em", "=", "$", "this", "->", "container", "->", "get", "(", "'ekyna_user.group.manager'", ")", ";", "$", "repository", "=", "$", "this", "->", "container", "->", ...
Creates default groups entities @param OutputInterface $output
[ "Creates", "default", "groups", "entities" ]
3f58e253ae9cf651add7f3d587caec80eaea459a
https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Install/AdminInstaller.php#L70-L96
205,591
ekyna/AdminBundle
Install/AdminInstaller.php
AdminInstaller.createSuperAdmin
private function createSuperAdmin(Command $command, OutputInterface $output) { $groupRepository = $this->container->get('ekyna_user.group.repository'); $userRepository = $this->container->get('ekyna_user.user.repository'); /** @var \Ekyna\Bundle\UserBundle\Model\GroupInterface $group */ ...
php
private function createSuperAdmin(Command $command, OutputInterface $output) { $groupRepository = $this->container->get('ekyna_user.group.repository'); $userRepository = $this->container->get('ekyna_user.user.repository'); /** @var \Ekyna\Bundle\UserBundle\Model\GroupInterface $group */ ...
[ "private", "function", "createSuperAdmin", "(", "Command", "$", "command", ",", "OutputInterface", "$", "output", ")", "{", "$", "groupRepository", "=", "$", "this", "->", "container", "->", "get", "(", "'ekyna_user.group.repository'", ")", ";", "$", "userReposi...
Creates the super admin user. @param Command $command @param OutputInterface $output
[ "Creates", "the", "super", "admin", "user", "." ]
3f58e253ae9cf651add7f3d587caec80eaea459a
https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Install/AdminInstaller.php#L136-L199
205,592
phpalchemy/phpalchemy
Alchemy/Annotation/Reader/Adapter/NotojReader.php
NotojReader.createAnnotationObjects
protected function createAnnotationObjects(array $annotations) { $objects = array(); //var_dump($annotations); foreach ($annotations as $name => $args) { $name = ucfirst($name); $class = $this->defaultNamespace . $name . 'Annotation'; if (in_array(s...
php
protected function createAnnotationObjects(array $annotations) { $objects = array(); //var_dump($annotations); foreach ($annotations as $name => $args) { $name = ucfirst($name); $class = $this->defaultNamespace . $name . 'Annotation'; if (in_array(s...
[ "protected", "function", "createAnnotationObjects", "(", "array", "$", "annotations", ")", "{", "$", "objects", "=", "array", "(", ")", ";", "//var_dump($annotations);", "foreach", "(", "$", "annotations", "as", "$", "name", "=>", "$", "args", ")", "{", "$",...
Create annotations object @param array $annotations annotated elements @return array array of annoatated objects
[ "Create", "annotations", "object" ]
5b7e9b13acfda38c61b2da2639e8a56f298dc32e
https://github.com/phpalchemy/phpalchemy/blob/5b7e9b13acfda38c61b2da2639e8a56f298dc32e/Alchemy/Annotation/Reader/Adapter/NotojReader.php#L66-L98
205,593
phpalchemy/phpalchemy
Alchemy/Annotation/Reader/Adapter/NotojReader.php
NotojReader.convertAnnotationObj
protected function convertAnnotationObj($reflection) { $annotations = (array) $reflection->getAnnotations(); $result = array(); foreach ($annotations as $annotation) { if (! array_key_exists($annotation['method'], $result)) { $result[$annotation['method']] = arra...
php
protected function convertAnnotationObj($reflection) { $annotations = (array) $reflection->getAnnotations(); $result = array(); foreach ($annotations as $annotation) { if (! array_key_exists($annotation['method'], $result)) { $result[$annotation['method']] = arra...
[ "protected", "function", "convertAnnotationObj", "(", "$", "reflection", ")", "{", "$", "annotations", "=", "(", "array", ")", "$", "reflection", "->", "getAnnotations", "(", ")", ";", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "$", "ann...
This method converts Notoj returned array to reader data @param Mixed/Reflection $reflection a Notoj reflection object @return array annoations array
[ "This", "method", "converts", "Notoj", "returned", "array", "to", "reader", "data" ]
5b7e9b13acfda38c61b2da2639e8a56f298dc32e
https://github.com/phpalchemy/phpalchemy/blob/5b7e9b13acfda38c61b2da2639e8a56f298dc32e/Alchemy/Annotation/Reader/Adapter/NotojReader.php#L106-L126
205,594
valu-digital/valuso
src/ValuSo/Annotation/AnnotationBuilderFactory.php
AnnotationBuilderFactory.createService
public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); $config = empty($config['valu_so']) ? [] : $config['valu_so']; $annotationBuilder = new AnnotationBuilder(); // Attach custom annotations if (!...
php
public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); $config = empty($config['valu_so']) ? [] : $config['valu_so']; $annotationBuilder = new AnnotationBuilder(); // Attach custom annotations if (!...
[ "public", "function", "createService", "(", "ServiceLocatorInterface", "$", "serviceLocator", ")", "{", "$", "config", "=", "$", "serviceLocator", "->", "get", "(", "'Config'", ")", ";", "$", "config", "=", "empty", "(", "$", "config", "[", "'valu_so'", "]",...
Create an annotation builder for service broker {@see ValuSo\Broker\ServiceBroker} uses {@see Zend\ServiceManager\ServiceManager} internally to initialize service instances. {@see Zend\Mvc\Service\ServiceManagerConfig} for how to configure service manager. This factory uses following configuration scheme: <code> [ 'v...
[ "Create", "an", "annotation", "builder", "for", "service", "broker" ]
c96bed0f6bd21551822334fe6cfe913a7436dd17
https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Annotation/AnnotationBuilderFactory.php#L40-L67
205,595
PopSugar/php-yesmail-api
src/Yesmail/YesmailListload.php
YesmailListload.is_valid
public function is_valid() { $ret = false; if (is_null($this->division) === false && is_null($this->datafileURI) === false && is_null($this->subscribe) === false && is_null($this->profileUpdate) === false && is_null($this->listLoadName) === false && is_null($this->loadMode) === ...
php
public function is_valid() { $ret = false; if (is_null($this->division) === false && is_null($this->datafileURI) === false && is_null($this->subscribe) === false && is_null($this->profileUpdate) === false && is_null($this->listLoadName) === false && is_null($this->loadMode) === ...
[ "public", "function", "is_valid", "(", ")", "{", "$", "ret", "=", "false", ";", "if", "(", "is_null", "(", "$", "this", "->", "division", ")", "===", "false", "&&", "is_null", "(", "$", "this", "->", "datafileURI", ")", "===", "false", "&&", "is_null...
Validates a listload @return bool True if the listload is valid, false otherwise @access public
[ "Validates", "a", "listload" ]
42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c
https://github.com/PopSugar/php-yesmail-api/blob/42c20a3ded1d8f2177c792cd3aa44bcdfdcb239c/src/Yesmail/YesmailListload.php#L134-L147
205,596
Synapse-Cmf/synapse-cmf
src/Synapse/Cmf/Framework/Media/File/Action/Dal/CreateAction.php
CreateAction.resolve
public function resolve() { $this->file = (new $this->fileClass()) ->setName( $this->physicalFile->getBasename() ) // calculate original name (keep it for user data display) ->setOriginalName($this->originalName ?: $this->physic...
php
public function resolve() { $this->file = (new $this->fileClass()) ->setName( $this->physicalFile->getBasename() ) // calculate original name (keep it for user data display) ->setOriginalName($this->originalName ?: $this->physic...
[ "public", "function", "resolve", "(", ")", "{", "$", "this", "->", "file", "=", "(", "new", "$", "this", "->", "fileClass", "(", ")", ")", "->", "setName", "(", "$", "this", "->", "physicalFile", "->", "getBasename", "(", ")", ")", "// calculate origin...
File creation method. @return File
[ "File", "creation", "method", "." ]
d8122a4150a83d5607289724425cf35c56a5e880
https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Framework/Media/File/Action/Dal/CreateAction.php#L30-L60
205,597
aryelgois/medools-router
src/Router.php
Router.parseAccept
public static function parseAccept(string $accept) { $result = []; foreach (explode(',', $accept) as $directive) { $parts = explode(';', $directive, 2); $type = trim($parts[0]); $priority = ((float) filter_var( $parts[1] ?? 1, FI...
php
public static function parseAccept(string $accept) { $result = []; foreach (explode(',', $accept) as $directive) { $parts = explode(';', $directive, 2); $type = trim($parts[0]); $priority = ((float) filter_var( $parts[1] ?? 1, FI...
[ "public", "static", "function", "parseAccept", "(", "string", "$", "accept", ")", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "explode", "(", "','", ",", "$", "accept", ")", "as", "$", "directive", ")", "{", "$", "parts", "=", "explode", ...
Parses Accept header @param string $accept Accept header @return float[] With 'type' => priority Keys may contain '*'
[ "Parses", "Accept", "header" ]
5d755f53b8099952d60cf15a0eb209af5fa3ca8a
https://github.com/aryelgois/medools-router/blob/5d755f53b8099952d60cf15a0eb209af5fa3ca8a/src/Router.php#L1302-L1325
205,598
aryelgois/medools-router
src/Router.php
Router.parseBody
protected function parseBody(string $resource, string $type, string $body) { $content_type = static::parseContentType($type); $mime = $content_type['mime'] ?? $content_type; if (($content_type['charset'] ?? null) !== null) { $body = mb_convert_encoding( $body, ...
php
protected function parseBody(string $resource, string $type, string $body) { $content_type = static::parseContentType($type); $mime = $content_type['mime'] ?? $content_type; if (($content_type['charset'] ?? null) !== null) { $body = mb_convert_encoding( $body, ...
[ "protected", "function", "parseBody", "(", "string", "$", "resource", ",", "string", "$", "type", ",", "string", "$", "body", ")", "{", "$", "content_type", "=", "static", "::", "parseContentType", "(", "$", "type", ")", ";", "$", "mime", "=", "$", "co...
Parses request body @param string $resource Resource name @param string $type Content-Type header @param string $body Request Body @return array @throws RouterException If $type is not supported @throws RouterException If $body could not be parsed
[ "Parses", "request", "body" ]
5d755f53b8099952d60cf15a0eb209af5fa3ca8a
https://github.com/aryelgois/medools-router/blob/5d755f53b8099952d60cf15a0eb209af5fa3ca8a/src/Router.php#L1339-L1390
205,599
aryelgois/medools-router
src/Router.php
Router.parseContentType
public static function parseContentType(string $content_type) { $directives = array_map('trim', explode(';', $content_type)); $result = [ 'mime' => array_shift($directives) ]; if (empty($directives)) { return $result['mime']; } foreach ($dir...
php
public static function parseContentType(string $content_type) { $directives = array_map('trim', explode(';', $content_type)); $result = [ 'mime' => array_shift($directives) ]; if (empty($directives)) { return $result['mime']; } foreach ($dir...
[ "public", "static", "function", "parseContentType", "(", "string", "$", "content_type", ")", "{", "$", "directives", "=", "array_map", "(", "'trim'", ",", "explode", "(", "';'", ",", "$", "content_type", ")", ")", ";", "$", "result", "=", "[", "'mime'", ...
Parses a Content-Type header @param string $content_type Content-Type header to be parsed @return string @return string[] With keys 'mime', and 'charset' and/or 'boundary'
[ "Parses", "a", "Content", "-", "Type", "header" ]
5d755f53b8099952d60cf15a0eb209af5fa3ca8a
https://github.com/aryelgois/medools-router/blob/5d755f53b8099952d60cf15a0eb209af5fa3ca8a/src/Router.php#L1400-L1418