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
200,900
libreworks/caridea-validate
src/Registry.php
Registry.register
public function register(array $definitions): self { foreach ($definitions as $name => $callback) { if (!is_callable($callback)) { throw new \InvalidArgumentException('Values passed to register must be callable'); } $this->definitions[$name] = $callback; ...
php
public function register(array $definitions): self { foreach ($definitions as $name => $callback) { if (!is_callable($callback)) { throw new \InvalidArgumentException('Values passed to register must be callable'); } $this->definitions[$name] = $callback; ...
[ "public", "function", "register", "(", "array", "$", "definitions", ")", ":", "self", "{", "foreach", "(", "$", "definitions", "as", "$", "name", "=>", "$", "callback", ")", "{", "if", "(", "!", "is_callable", "(", "$", "callback", ")", ")", "{", "th...
Registers rule definitions. ```php $registry = new \Caridea\Validate\Registry(); $registry->register([ 'adult' => ['My\Validate\AgeRule', 'adult'], 'credit_card' => function(){return new CreditCardRule();}, 'something' => 'my_function_that_can_be_called' ]); ``` @param array<string,callable> $definitions Associative ...
[ "Registers", "rule", "definitions", "." ]
625835694d34591bfb1e3b2ce60c2cc28a28d006
https://github.com/libreworks/caridea-validate/blob/625835694d34591bfb1e3b2ce60c2cc28a28d006/src/Registry.php#L96-L105
200,901
libreworks/caridea-validate
src/Registry.php
Registry.alias
public function alias(string $name, $rules, ?string $error = null): self { $this->definitions[$name] = function () use ($rules, $error) { return $this->parser->parse($rules)->setError($error); }; return $this; }
php
public function alias(string $name, $rules, ?string $error = null): self { $this->definitions[$name] = function () use ($rules, $error) { return $this->parser->parse($rules)->setError($error); }; return $this; }
[ "public", "function", "alias", "(", "string", "$", "name", ",", "$", "rules", ",", "?", "string", "$", "error", "=", "null", ")", ":", "self", "{", "$", "this", "->", "definitions", "[", "$", "name", "]", "=", "function", "(", ")", "use", "(", "$...
Registers an alias for a ruleset. @param string $name The name of the alias @param object|array $rules The ruleset to alias @param string|null $error A custom error code to return, or `null` to use normal codes @return $this provides a fluent interface
[ "Registers", "an", "alias", "for", "a", "ruleset", "." ]
625835694d34591bfb1e3b2ce60c2cc28a28d006
https://github.com/libreworks/caridea-validate/blob/625835694d34591bfb1e3b2ce60c2cc28a28d006/src/Registry.php#L115-L121
200,902
libreworks/caridea-validate
src/Registry.php
Registry.aliasDefinition
public function aliasDefinition($definition): self { if (is_object($definition)) { $definition = (array) $definition; } if (!is_array($definition)) { throw new \InvalidArgumentException("Invalid alias definition: must be an object or an associative array"); } ...
php
public function aliasDefinition($definition): self { if (is_object($definition)) { $definition = (array) $definition; } if (!is_array($definition)) { throw new \InvalidArgumentException("Invalid alias definition: must be an object or an associative array"); } ...
[ "public", "function", "aliasDefinition", "(", "$", "definition", ")", ":", "self", "{", "if", "(", "is_object", "(", "$", "definition", ")", ")", "{", "$", "definition", "=", "(", "array", ")", "$", "definition", ";", "}", "if", "(", "!", "is_array", ...
Registers an alias for a ruleset, using a LIVR-compliant definition. ```javascript // alias.json { "name": "valid_address", "rules": { "nested_object": { "country": "required", "city": "required", "zip": "positive_integer" }}, error: "WRONG_ADDRESS" } ``` ```php $registry->aliasDefinition(json_decode(file_get_contents...
[ "Registers", "an", "alias", "for", "a", "ruleset", "using", "a", "LIVR", "-", "compliant", "definition", "." ]
625835694d34591bfb1e3b2ce60c2cc28a28d006
https://github.com/libreworks/caridea-validate/blob/625835694d34591bfb1e3b2ce60c2cc28a28d006/src/Registry.php#L146-L158
200,903
libreworks/caridea-validate
src/Registry.php
Registry.factory
public function factory(string $name, $arg = null): Rule { if (!array_key_exists($name, $this->definitions)) { throw new \InvalidArgumentException("No rule registered with name: $name"); } $vrule = is_array($arg) ? call_user_func_array($this->definitions[$name], $arg)...
php
public function factory(string $name, $arg = null): Rule { if (!array_key_exists($name, $this->definitions)) { throw new \InvalidArgumentException("No rule registered with name: $name"); } $vrule = is_array($arg) ? call_user_func_array($this->definitions[$name], $arg)...
[ "public", "function", "factory", "(", "string", "$", "name", ",", "$", "arg", "=", "null", ")", ":", "Rule", "{", "if", "(", "!", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "definitions", ")", ")", "{", "throw", "new", "\\", "Inv...
Constructs a validation rule. @param string $name A string name @param mixed $arg Optional constructor argument, or an array of arguments @return \Caridea\Validate\Rule The instantiated rule @throws \InvalidArgumentException if the rule name is not registered @throws \UnexpectedValueException if the factory returns a ...
[ "Constructs", "a", "validation", "rule", "." ]
625835694d34591bfb1e3b2ce60c2cc28a28d006
https://github.com/libreworks/caridea-validate/blob/625835694d34591bfb1e3b2ce60c2cc28a28d006/src/Registry.php#L169-L181
200,904
WellCommerce/DistributionBundle
Composer/HerokuEnvironment.php
HerokuEnvironment.populateEnvironment
public static function populateEnvironment(Event $event) { $url = getenv('CLEARDB_DATABASE_URL'); if ($url) { $url = parse_url($url); putenv("SYMFONY_DATABASE_HOST={$url['host']}"); putenv("SYMFONY_DATABASE_USER={$url['user']}"); putenv("SYMFONY_DATAB...
php
public static function populateEnvironment(Event $event) { $url = getenv('CLEARDB_DATABASE_URL'); if ($url) { $url = parse_url($url); putenv("SYMFONY_DATABASE_HOST={$url['host']}"); putenv("SYMFONY_DATABASE_USER={$url['user']}"); putenv("SYMFONY_DATAB...
[ "public", "static", "function", "populateEnvironment", "(", "Event", "$", "event", ")", "{", "$", "url", "=", "getenv", "(", "'CLEARDB_DATABASE_URL'", ")", ";", "if", "(", "$", "url", ")", "{", "$", "url", "=", "parse_url", "(", "$", "url", ")", ";", ...
Populate Heroku environment @param Event $event Event
[ "Populate", "Heroku", "environment" ]
82b1b4c2c5a59536aaae22506b23ccd5d141cbb0
https://github.com/WellCommerce/DistributionBundle/blob/82b1b4c2c5a59536aaae22506b23ccd5d141cbb0/Composer/HerokuEnvironment.php#L29-L47
200,905
praxigento/mobi_mod_downline
Helper/Registry.php
Registry.putQuoteId
public function putQuoteId($data) { if ($this->registry->registry(self::QUOTE_ID)) { $this->registry->unregister(self::QUOTE_ID); } $this->registry->register(self::QUOTE_ID, $data); }
php
public function putQuoteId($data) { if ($this->registry->registry(self::QUOTE_ID)) { $this->registry->unregister(self::QUOTE_ID); } $this->registry->register(self::QUOTE_ID, $data); }
[ "public", "function", "putQuoteId", "(", "$", "data", ")", "{", "if", "(", "$", "this", "->", "registry", "->", "registry", "(", "self", "::", "QUOTE_ID", ")", ")", "{", "$", "this", "->", "registry", "->", "unregister", "(", "self", "::", "QUOTE_ID", ...
Quote ID for newly created orders. @param int $data
[ "Quote", "ID", "for", "newly", "created", "orders", "." ]
0f3c276dfff1aa029f9fd205ccfc56f207a2e75b
https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Helper/Registry.php#L62-L68
200,906
fxpio/fxp-default-value-bundle
DependencyInjection/Compiler/DefaultValuePass.php
DefaultValuePass.findTags
protected function findTags(ContainerBuilder $container, $tagName, $argumentPosition, $ext = false): void { $services = []; foreach ($container->findTaggedServiceIds($tagName) as $serviceId => $tag) { $class = isset($tag[0]['class']) ? $this->getRealClassName($container,...
php
protected function findTags(ContainerBuilder $container, $tagName, $argumentPosition, $ext = false): void { $services = []; foreach ($container->findTaggedServiceIds($tagName) as $serviceId => $tag) { $class = isset($tag[0]['class']) ? $this->getRealClassName($container,...
[ "protected", "function", "findTags", "(", "ContainerBuilder", "$", "container", ",", "$", "tagName", ",", "$", "argumentPosition", ",", "$", "ext", "=", "false", ")", ":", "void", "{", "$", "services", "=", "[", "]", ";", "foreach", "(", "$", "container"...
Find service tags. @param ContainerBuilder $container @param string $tagName @param int $argumentPosition @param bool $ext @throws InvalidConfigurationException
[ "Find", "service", "tags", "." ]
f2610281aa59b3d841931dc952af79664a6fc063
https://github.com/fxpio/fxp-default-value-bundle/blob/f2610281aa59b3d841931dc952af79664a6fc063/DependencyInjection/Compiler/DefaultValuePass.php#L59-L79
200,907
fxpio/fxp-default-value-bundle
DependencyInjection/Compiler/DefaultValuePass.php
DefaultValuePass.getRealClassName
protected function getRealClassName(ContainerBuilder $container, $classname) { return 0 === strpos($classname, '%') ? $container->getParameter(trim($classname, '%')) : $classname; }
php
protected function getRealClassName(ContainerBuilder $container, $classname) { return 0 === strpos($classname, '%') ? $container->getParameter(trim($classname, '%')) : $classname; }
[ "protected", "function", "getRealClassName", "(", "ContainerBuilder", "$", "container", ",", "$", "classname", ")", "{", "return", "0", "===", "strpos", "(", "$", "classname", ",", "'%'", ")", "?", "$", "container", "->", "getParameter", "(", "trim", "(", ...
Get the real class name. @param ContainerBuilder $container The container @param string $classname The class name or the parameter name of classname @return string
[ "Get", "the", "real", "class", "name", "." ]
f2610281aa59b3d841931dc952af79664a6fc063
https://github.com/fxpio/fxp-default-value-bundle/blob/f2610281aa59b3d841931dc952af79664a6fc063/DependencyInjection/Compiler/DefaultValuePass.php#L89-L92
200,908
fxpio/fxp-default-value-bundle
DependencyInjection/Compiler/DefaultValuePass.php
DefaultValuePass.getClassName
protected function getClassName(ContainerBuilder $container, $serviceId, $tagName) { $type = $container->getDefinition($serviceId); $interfaces = class_implements($type->getClass()); if (\in_array(ObjectTypeExtensionInterface::class, $interfaces, true)) { throw new InvalidConfig...
php
protected function getClassName(ContainerBuilder $container, $serviceId, $tagName) { $type = $container->getDefinition($serviceId); $interfaces = class_implements($type->getClass()); if (\in_array(ObjectTypeExtensionInterface::class, $interfaces, true)) { throw new InvalidConfig...
[ "protected", "function", "getClassName", "(", "ContainerBuilder", "$", "container", ",", "$", "serviceId", ",", "$", "tagName", ")", "{", "$", "type", "=", "$", "container", "->", "getDefinition", "(", "$", "serviceId", ")", ";", "$", "interfaces", "=", "c...
Get the class name of default value type. @param ContainerBuilder $container The container service @param string $serviceId The service id of default value type @param string $tagName The tag name @throws InvalidConfigurationException When the service is not an instance of Fxp\Component\DefaultV...
[ "Get", "the", "class", "name", "of", "default", "value", "type", "." ]
f2610281aa59b3d841931dc952af79664a6fc063
https://github.com/fxpio/fxp-default-value-bundle/blob/f2610281aa59b3d841931dc952af79664a6fc063/DependencyInjection/Compiler/DefaultValuePass.php#L105-L118
200,909
fxpio/fxp-default-value-bundle
DependencyInjection/Compiler/DefaultValuePass.php
DefaultValuePass.buildInstanceType
protected function buildInstanceType(Definition $type, $serviceId, $tagName) { $parents = class_parents($type->getClass()); $args = $type->getArguments(); $ref = new \ReflectionClass($type); if (\in_array(AbstractSimpleType::class, $parents, true) && (0 === \count($a...
php
protected function buildInstanceType(Definition $type, $serviceId, $tagName) { $parents = class_parents($type->getClass()); $args = $type->getArguments(); $ref = new \ReflectionClass($type); if (\in_array(AbstractSimpleType::class, $parents, true) && (0 === \count($a...
[ "protected", "function", "buildInstanceType", "(", "Definition", "$", "type", ",", "$", "serviceId", ",", "$", "tagName", ")", "{", "$", "parents", "=", "class_parents", "(", "$", "type", "->", "getClass", "(", ")", ")", ";", "$", "args", "=", "$", "ty...
Build the simple default type instance. @param Definition $type The definition of default value type @param string $serviceId The service id of default value type @param string $tagName The tag name @return ObjectTypeInterface
[ "Build", "the", "simple", "default", "type", "instance", "." ]
f2610281aa59b3d841931dc952af79664a6fc063
https://github.com/fxpio/fxp-default-value-bundle/blob/f2610281aa59b3d841931dc952af79664a6fc063/DependencyInjection/Compiler/DefaultValuePass.php#L129-L141
200,910
fxpio/fxp-default-value-bundle
DependencyInjection/Compiler/DefaultValuePass.php
DefaultValuePass.findResolveTarget
private function findResolveTarget(ContainerBuilder $container, $class) { $resolveTargets = $this->getResolveTargets($container); if (isset($resolveTargets[$class])) { $class = $resolveTargets[$class]; } return $class; }
php
private function findResolveTarget(ContainerBuilder $container, $class) { $resolveTargets = $this->getResolveTargets($container); if (isset($resolveTargets[$class])) { $class = $resolveTargets[$class]; } return $class; }
[ "private", "function", "findResolveTarget", "(", "ContainerBuilder", "$", "container", ",", "$", "class", ")", "{", "$", "resolveTargets", "=", "$", "this", "->", "getResolveTargets", "(", "$", "container", ")", ";", "if", "(", "isset", "(", "$", "resolveTar...
Find the resolve target of class. @param ContainerBuilder $container The container @param string $class The class name @return string
[ "Find", "the", "resolve", "target", "of", "class", "." ]
f2610281aa59b3d841931dc952af79664a6fc063
https://github.com/fxpio/fxp-default-value-bundle/blob/f2610281aa59b3d841931dc952af79664a6fc063/DependencyInjection/Compiler/DefaultValuePass.php#L151-L160
200,911
fxpio/fxp-default-value-bundle
DependencyInjection/Compiler/DefaultValuePass.php
DefaultValuePass.replaceResolveTargetClass
private function replaceResolveTargetClass(ContainerBuilder $container, $tagName, $serviceId, $class): void { $def = $container->getDefinition($serviceId); $this->replaceClassInArguments($container, $def, $class); $this->replaceClassInTags($def, $tagName, $class); }
php
private function replaceResolveTargetClass(ContainerBuilder $container, $tagName, $serviceId, $class): void { $def = $container->getDefinition($serviceId); $this->replaceClassInArguments($container, $def, $class); $this->replaceClassInTags($def, $tagName, $class); }
[ "private", "function", "replaceResolveTargetClass", "(", "ContainerBuilder", "$", "container", ",", "$", "tagName", ",", "$", "serviceId", ",", "$", "class", ")", ":", "void", "{", "$", "def", "=", "$", "container", "->", "getDefinition", "(", "$", "serviceI...
Replace the resolve target class. @param ContainerBuilder $container The container service @param string $tagName The tag name @param string $serviceId The service id of default value type @param string $class The class name
[ "Replace", "the", "resolve", "target", "class", "." ]
f2610281aa59b3d841931dc952af79664a6fc063
https://github.com/fxpio/fxp-default-value-bundle/blob/f2610281aa59b3d841931dc952af79664a6fc063/DependencyInjection/Compiler/DefaultValuePass.php#L196-L202
200,912
WellCommerce/LocaleBundle
Command/DeleteLocaleCommand.php
DeleteLocaleCommand.deleteLocaleData
protected function deleteLocaleData($localeCode, OutputInterface $output) { $entityManager = $this->getDoctrineHelper()->getEntityManager(); $metadata = $this->getDoctrineHelper()->getAllMetadata(); $locale = $this->getLocaleRepository()->findOneBy(['code' => $localeCode]); ...
php
protected function deleteLocaleData($localeCode, OutputInterface $output) { $entityManager = $this->getDoctrineHelper()->getEntityManager(); $metadata = $this->getDoctrineHelper()->getAllMetadata(); $locale = $this->getLocaleRepository()->findOneBy(['code' => $localeCode]); ...
[ "protected", "function", "deleteLocaleData", "(", "$", "localeCode", ",", "OutputInterface", "$", "output", ")", "{", "$", "entityManager", "=", "$", "this", "->", "getDoctrineHelper", "(", ")", "->", "getEntityManager", "(", ")", ";", "$", "metadata", "=", ...
Deletes the locale @param $localeCode @param OutputInterface $output
[ "Deletes", "the", "locale" ]
da61e059b789ccc748fd3cb0e881780fe6e6d3c6
https://github.com/WellCommerce/LocaleBundle/blob/da61e059b789ccc748fd3cb0e881780fe6e6d3c6/Command/DeleteLocaleCommand.php#L74-L91
200,913
sil-project/SeedBatchBundle
src/Entity/SeedBatch.php
SeedBatch.setSeedFarm
public function setSeedFarm(\Librinfo\SeedBatchBundle\Entity\SeedFarm $seedFarm = null) { $this->seedFarm = $seedFarm; return $this; }
php
public function setSeedFarm(\Librinfo\SeedBatchBundle\Entity\SeedFarm $seedFarm = null) { $this->seedFarm = $seedFarm; return $this; }
[ "public", "function", "setSeedFarm", "(", "\\", "Librinfo", "\\", "SeedBatchBundle", "\\", "Entity", "\\", "SeedFarm", "$", "seedFarm", "=", "null", ")", "{", "$", "this", "->", "seedFarm", "=", "$", "seedFarm", ";", "return", "$", "this", ";", "}" ]
Set seedFarm. @param \Librinfo\SeedBatchBundle\Entity\SeedFarm $seedFarm @return SeedBatch
[ "Set", "seedFarm", "." ]
a2640b5359fe31d3bdb9c9fa2f72141ac841729c
https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/Entity/SeedBatch.php#L306-L311
200,914
bit55/midcore
src/Middleware/ErrorHandler.php
ErrorHandler.createErrorHandler
private function createErrorHandler() { /** * @param int $errno * @param string $errstr * @param string $errfile * @param int $errline * @return void * @throws \ErrorException if error is not within the error_reporting mask. */ return fu...
php
private function createErrorHandler() { /** * @param int $errno * @param string $errstr * @param string $errfile * @param int $errline * @return void * @throws \ErrorException if error is not within the error_reporting mask. */ return fu...
[ "private", "function", "createErrorHandler", "(", ")", "{", "/**\n * @param int $errno\n * @param string $errstr\n * @param string $errfile\n * @param int $errline\n * @return void\n * @throws \\ErrorException if error is not within the error_reporting mas...
Creates and returns a callable error handler that raises exceptions. Only raises exceptions for errors that are within the error_reporting mask. @return callable
[ "Creates", "and", "returns", "a", "callable", "error", "handler", "that", "raises", "exceptions", "." ]
53f96a82e709918b4691372f0554a6e6f6ba2ae3
https://github.com/bit55/midcore/blob/53f96a82e709918b4691372f0554a6e6f6ba2ae3/src/Middleware/ErrorHandler.php#L47-L65
200,915
BenGorUser/DoctrineORMBridge
src/BenGorUser/DoctrineORMBridge/Infrastructure/Persistence/EntityManagerFactory.php
EntityManagerFactory.build
public function build($aConnection, array $mappingsPaths = [], $isDevMode = true) { if (empty($mappingsPaths)) { $mappingsPaths = [__DIR__ . '/Mapping']; } Type::addType('user_id', UserIdType::class); Type::addType('user_roles', UserRolesType::class); return Ent...
php
public function build($aConnection, array $mappingsPaths = [], $isDevMode = true) { if (empty($mappingsPaths)) { $mappingsPaths = [__DIR__ . '/Mapping']; } Type::addType('user_id', UserIdType::class); Type::addType('user_roles', UserRolesType::class); return Ent...
[ "public", "function", "build", "(", "$", "aConnection", ",", "array", "$", "mappingsPaths", "=", "[", "]", ",", "$", "isDevMode", "=", "true", ")", "{", "if", "(", "empty", "(", "$", "mappingsPaths", ")", ")", "{", "$", "mappingsPaths", "=", "[", "__...
Creates an entity manager instance enabling mappings and custom types. @param mixed $aConnection Connection parameters as db driver @param array $mappingsPaths The mapping files diretory paths @param bool $isDevMode Enables the dev mode, by default is enabled @return EntityManager
[ "Creates", "an", "entity", "manager", "instance", "enabling", "mappings", "and", "custom", "types", "." ]
0ad9799a0d7f3502f5b86292d426d83d9c245c86
https://github.com/BenGorUser/DoctrineORMBridge/blob/0ad9799a0d7f3502f5b86292d426d83d9c245c86/src/BenGorUser/DoctrineORMBridge/Infrastructure/Persistence/EntityManagerFactory.php#L37-L50
200,916
elifesciences/bus-sdk-php
src/Queue/CachedTransformer.php
CachedTransformer.get
public function get(string $type, string $id) { if ($this->shouldCacheEntity($type, $id)) { $key = $this->getKey($type, $id); $this->logger->debug('Fetching from cache', [ 'type' => $type, 'id' => $id, 'key' => $key, ]); ...
php
public function get(string $type, string $id) { if ($this->shouldCacheEntity($type, $id)) { $key = $this->getKey($type, $id); $this->logger->debug('Fetching from cache', [ 'type' => $type, 'id' => $id, 'key' => $key, ]); ...
[ "public", "function", "get", "(", "string", "$", "type", ",", "string", "$", "id", ")", "{", "if", "(", "$", "this", "->", "shouldCacheEntity", "(", "$", "type", ",", "$", "id", ")", ")", "{", "$", "key", "=", "$", "this", "->", "getKey", "(", ...
Get single entity. This method will return an API SDK item when given an ID and Type. If the item should be cached ($this->shouldCache) then we check to see if the item is in the cache. - If the item IS in the cache we return it, never hitting the ApiSDK. - If the item IS NOT in the cache but it CAN be cached we requ...
[ "Get", "single", "entity", "." ]
3af0739fac110e79ea7f21aadf8d17b891f3b918
https://github.com/elifesciences/bus-sdk-php/blob/3af0739fac110e79ea7f21aadf8d17b891f3b918/src/Queue/CachedTransformer.php#L60-L75
200,917
elifesciences/bus-sdk-php
src/Queue/CachedTransformer.php
CachedTransformer.getFreshDataWithCache
private function getFreshDataWithCache(QueueItem $item) { $sdk = $this->getSdk($item); $entity = $sdk->get($item->getId())->wait(true); if (false === $this->shouldCacheEntity($item->getType(), $item->getId())) { return $entity; } if ($entity) { $this->...
php
private function getFreshDataWithCache(QueueItem $item) { $sdk = $this->getSdk($item); $entity = $sdk->get($item->getId())->wait(true); if (false === $this->shouldCacheEntity($item->getType(), $item->getId())) { return $entity; } if ($entity) { $this->...
[ "private", "function", "getFreshDataWithCache", "(", "QueueItem", "$", "item", ")", "{", "$", "sdk", "=", "$", "this", "->", "getSdk", "(", "$", "item", ")", ";", "$", "entity", "=", "$", "sdk", "->", "get", "(", "$", "item", "->", "getId", "(", ")...
Get fresh data with cache. This method call guarantees a fresh copy of them entity in ApiSDK represented by the QueueItem. If the item should be cached, it will be cached at this point. @return mixed
[ "Get", "fresh", "data", "with", "cache", "." ]
3af0739fac110e79ea7f21aadf8d17b891f3b918
https://github.com/elifesciences/bus-sdk-php/blob/3af0739fac110e79ea7f21aadf8d17b891f3b918/src/Queue/CachedTransformer.php#L85-L110
200,918
johnkrovitch/Sam
Task/TaskRunner.php
TaskRunner.run
public function run(Task $task) { // get configured filters for this task $filters = $task ->getConfiguration() ->getParameter('filters'); // get sources files $sources = $this->fetchSources($task); $destinations = $this->fetchDestinations($task); ...
php
public function run(Task $task) { // get configured filters for this task $filters = $task ->getConfiguration() ->getParameter('filters'); // get sources files $sources = $this->fetchSources($task); $destinations = $this->fetchDestinations($task); ...
[ "public", "function", "run", "(", "Task", "$", "task", ")", "{", "// get configured filters for this task", "$", "filters", "=", "$", "task", "->", "getConfiguration", "(", ")", "->", "getParameter", "(", "'filters'", ")", ";", "// get sources files", "$", "sour...
Run a task, load its sources before and call the clean method on the filter. @param Task $task @throws Exception
[ "Run", "a", "task", "load", "its", "sources", "before", "and", "call", "the", "clean", "method", "on", "the", "filter", "." ]
fbd3770c11eecc0a6d8070f439f149062316f606
https://github.com/johnkrovitch/Sam/blob/fbd3770c11eecc0a6d8070f439f149062316f606/Task/TaskRunner.php#L47-L84
200,919
johnkrovitch/Sam
Task/TaskRunner.php
TaskRunner.getFilter
protected function getFilter($name) { // filters must exists in configured filters if (!array_key_exists($name, $this->filters)) { throw new Exception('Invalid filter '.$name.'. Check your mapping configuration'); } return $this->filters[$name]; }
php
protected function getFilter($name) { // filters must exists in configured filters if (!array_key_exists($name, $this->filters)) { throw new Exception('Invalid filter '.$name.'. Check your mapping configuration'); } return $this->filters[$name]; }
[ "protected", "function", "getFilter", "(", "$", "name", ")", "{", "// filters must exists in configured filters", "if", "(", "!", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "filters", ")", ")", "{", "throw", "new", "Exception", "(", "'Invali...
Return a filter by its name. Throw an exception if it is not exists. @param string $name @return FilterInterface @throws Exception
[ "Return", "a", "filter", "by", "its", "name", ".", "Throw", "an", "exception", "if", "it", "is", "not", "exists", "." ]
fbd3770c11eecc0a6d8070f439f149062316f606
https://github.com/johnkrovitch/Sam/blob/fbd3770c11eecc0a6d8070f439f149062316f606/Task/TaskRunner.php#L93-L101
200,920
johnkrovitch/Sam
Task/TaskRunner.php
TaskRunner.fetchSources
protected function fetchSources(Task $task) { $sources = []; foreach ($task->getSources() as $source) { // locate new resource and merge them to the existing sources $sources = array_merge($sources, $this->locator->locate($source)); } return $sources; }
php
protected function fetchSources(Task $task) { $sources = []; foreach ($task->getSources() as $source) { // locate new resource and merge them to the existing sources $sources = array_merge($sources, $this->locator->locate($source)); } return $sources; }
[ "protected", "function", "fetchSources", "(", "Task", "$", "task", ")", "{", "$", "sources", "=", "[", "]", ";", "foreach", "(", "$", "task", "->", "getSources", "(", ")", "as", "$", "source", ")", "{", "// locate new resource and merge them to the existing so...
Fetch the source files from the task and return and array of SplInfo. @param Task $task @return array
[ "Fetch", "the", "source", "files", "from", "the", "task", "and", "return", "and", "array", "of", "SplInfo", "." ]
fbd3770c11eecc0a6d8070f439f149062316f606
https://github.com/johnkrovitch/Sam/blob/fbd3770c11eecc0a6d8070f439f149062316f606/Task/TaskRunner.php#L109-L119
200,921
johnkrovitch/Sam
Task/TaskRunner.php
TaskRunner.fetchDestinations
protected function fetchDestinations(Task $task) { $sources = []; foreach ($task->getDestinations() as $source) { // locate new resource and merge them to the existing sources $sources[] = new SplFileInfo($source); } return $sources; }
php
protected function fetchDestinations(Task $task) { $sources = []; foreach ($task->getDestinations() as $source) { // locate new resource and merge them to the existing sources $sources[] = new SplFileInfo($source); } return $sources; }
[ "protected", "function", "fetchDestinations", "(", "Task", "$", "task", ")", "{", "$", "sources", "=", "[", "]", ";", "foreach", "(", "$", "task", "->", "getDestinations", "(", ")", "as", "$", "source", ")", "{", "// locate new resource and merge them to the e...
Fetch the destination files from the task and return and array of SplInfo. @param Task $task @return SplFileInfo[]
[ "Fetch", "the", "destination", "files", "from", "the", "task", "and", "return", "and", "array", "of", "SplInfo", "." ]
fbd3770c11eecc0a6d8070f439f149062316f606
https://github.com/johnkrovitch/Sam/blob/fbd3770c11eecc0a6d8070f439f149062316f606/Task/TaskRunner.php#L127-L137
200,922
johnkrovitch/Sam
Task/TaskRunner.php
TaskRunner.filterSources
protected function filterSources(array $sources, FilterInterface $filter) { $filteredSources = []; // if the filter supports no extension, there is an error if (!is_array($filter->getSupportedExtensions()) || !count($filter->getSupportedExtensions())) { throw new Exception('No s...
php
protected function filterSources(array $sources, FilterInterface $filter) { $filteredSources = []; // if the filter supports no extension, there is an error if (!is_array($filter->getSupportedExtensions()) || !count($filter->getSupportedExtensions())) { throw new Exception('No s...
[ "protected", "function", "filterSources", "(", "array", "$", "sources", ",", "FilterInterface", "$", "filter", ")", "{", "$", "filteredSources", "=", "[", "]", ";", "// if the filter supports no extension, there is an error", "if", "(", "!", "is_array", "(", "$", ...
Filter only the sources supported by the current filter. @param SplFileInfo[] $sources @param FilterInterface $filter @return array @throws Exception
[ "Filter", "only", "the", "sources", "supported", "by", "the", "current", "filter", "." ]
fbd3770c11eecc0a6d8070f439f149062316f606
https://github.com/johnkrovitch/Sam/blob/fbd3770c11eecc0a6d8070f439f149062316f606/Task/TaskRunner.php#L147-L169
200,923
johnkrovitch/Sam
Task/TaskRunner.php
TaskRunner.updateSources
protected function updateSources(array $originalSources, array $filteredSources, array $updatedSources) { $sources = []; $filteredPath = []; foreach ($filteredSources as $filteredSource) { $filteredPath[] = $filteredSource->getPath(); } // keep only the not filte...
php
protected function updateSources(array $originalSources, array $filteredSources, array $updatedSources) { $sources = []; $filteredPath = []; foreach ($filteredSources as $filteredSource) { $filteredPath[] = $filteredSource->getPath(); } // keep only the not filte...
[ "protected", "function", "updateSources", "(", "array", "$", "originalSources", ",", "array", "$", "filteredSources", ",", "array", "$", "updatedSources", ")", "{", "$", "sources", "=", "[", "]", ";", "$", "filteredPath", "=", "[", "]", ";", "foreach", "("...
Remove the filtered files from the sources, and merge with the new ones. @param SplFileInfo[] $originalSources @param SplFileInfo[] $filteredSources @param SplFileInfo[] $updatedSources @return SplFileInfo[] @throws Exception
[ "Remove", "the", "filtered", "files", "from", "the", "sources", "and", "merge", "with", "the", "new", "ones", "." ]
fbd3770c11eecc0a6d8070f439f149062316f606
https://github.com/johnkrovitch/Sam/blob/fbd3770c11eecc0a6d8070f439f149062316f606/Task/TaskRunner.php#L180-L208
200,924
lasallecms/lasallecms-l5-helpers-pkg
src/Images/ImagesHelper.php
ImagesHelper.urlOfImage
public function urlOfImage($filename, $width=300, $height=300) { $url = Config::get('app.url'); $url .= '/'; $url .= Config::get('lasallecmsfrontend.images_folder_resized'); $url .= '/'; $url .= $this->parseFilenameIntoResizedFilename($filename, $width, $height); re...
php
public function urlOfImage($filename, $width=300, $height=300) { $url = Config::get('app.url'); $url .= '/'; $url .= Config::get('lasallecmsfrontend.images_folder_resized'); $url .= '/'; $url .= $this->parseFilenameIntoResizedFilename($filename, $width, $height); re...
[ "public", "function", "urlOfImage", "(", "$", "filename", ",", "$", "width", "=", "300", ",", "$", "height", "=", "300", ")", "{", "$", "url", "=", "Config", "::", "get", "(", "'app.url'", ")", ";", "$", "url", ".=", "'/'", ";", "$", "url", ".=",...
Put together the URL of the image. Need this for the social media tags for image. @param string $filename The uploaded image's filename @parem int $width Width of the resized image @param int $height Height of the resized image @return string
[ "Put", "together", "the", "URL", "of", "the", "image", "." ]
733967ce3fd81a1efba5265e11663c324ff983c4
https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/Images/ImagesHelper.php#L102-L111
200,925
lasallecms/lasallecms-l5-helpers-pkg
src/Images/ImagesHelper.php
ImagesHelper.parseFilenameIntoResizedFilename
public function parseFilenameIntoResizedFilename($filename, $width=300, $height=300) { $fileNameWithNoExtension = $this->filenameWithNoExtension($filename); $fileNameExtension = $this->filenameWithExtensionOnly($filename); $parsedFilename = ""; $parsedFilename .= $fileNameWit...
php
public function parseFilenameIntoResizedFilename($filename, $width=300, $height=300) { $fileNameWithNoExtension = $this->filenameWithNoExtension($filename); $fileNameExtension = $this->filenameWithExtensionOnly($filename); $parsedFilename = ""; $parsedFilename .= $fileNameWit...
[ "public", "function", "parseFilenameIntoResizedFilename", "(", "$", "filename", ",", "$", "width", "=", "300", ",", "$", "height", "=", "300", ")", "{", "$", "fileNameWithNoExtension", "=", "$", "this", "->", "filenameWithNoExtension", "(", "$", "filename", ")...
Take an image's filename, and return the name of the resized file. For use within the "single post" blade file. Does *NOT* create the resized image file. @param string $filename The uploaded image's filename @parem int $width Width of the resized image @param int $he...
[ "Take", "an", "image", "s", "filename", "and", "return", "the", "name", "of", "the", "resized", "file", "." ]
733967ce3fd81a1efba5265e11663c324ff983c4
https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/Images/ImagesHelper.php#L126-L141
200,926
lasallecms/lasallecms-l5-helpers-pkg
src/Images/ImagesHelper.php
ImagesHelper.categoryImageResizedFilename
public function categoryImageResizedFilename($categoryFeaturedImage) { // grab the image sizes to create from the config $imageSizes = Config::get('lasallecmsfrontend.category_featured_image_size'); // filename $fileNameWithNoExtension = $this->filenameWithNoExtension($categoryFeatu...
php
public function categoryImageResizedFilename($categoryFeaturedImage) { // grab the image sizes to create from the config $imageSizes = Config::get('lasallecmsfrontend.category_featured_image_size'); // filename $fileNameWithNoExtension = $this->filenameWithNoExtension($categoryFeatu...
[ "public", "function", "categoryImageResizedFilename", "(", "$", "categoryFeaturedImage", ")", "{", "// grab the image sizes to create from the config", "$", "imageSizes", "=", "Config", "::", "get", "(", "'lasallecmsfrontend.category_featured_image_size'", ")", ";", "// filenam...
What is the name of the resized category featured image that the view will use? Does not actually resize the image! ASSUMES THAT THERE IS JUST ONE RESIZED CATEGORY IMAGE @param string $categoryFeaturedImage The category's featured image (that is in the categories table) @return string
[ "What", "is", "the", "name", "of", "the", "resized", "category", "featured", "image", "that", "the", "view", "will", "use?" ]
733967ce3fd81a1efba5265e11663c324ff983c4
https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/Images/ImagesHelper.php#L192-L206
200,927
lasallecms/lasallecms-l5-helpers-pkg
src/Images/ImagesHelper.php
ImagesHelper.createCategoryResizedImageFiles
public function createCategoryResizedImageFiles($filename) { // Use the default or a specified category featured image $filename = $this->categoryImageDefaultOrSpecified($filename); // grab the image sizes to create from the config $imageSizes = Config::get('lasallecmsfrontend.categ...
php
public function createCategoryResizedImageFiles($filename) { // Use the default or a specified category featured image $filename = $this->categoryImageDefaultOrSpecified($filename); // grab the image sizes to create from the config $imageSizes = Config::get('lasallecmsfrontend.categ...
[ "public", "function", "createCategoryResizedImageFiles", "(", "$", "filename", ")", "{", "// Use the default or a specified category featured image", "$", "filename", "=", "$", "this", "->", "categoryImageDefaultOrSpecified", "(", "$", "filename", ")", ";", "// grab the ima...
Create resized image files for the category featured image @param string $filename Category's UN-resized image's filename @return void
[ "Create", "resized", "image", "files", "for", "the", "category", "featured", "image" ]
733967ce3fd81a1efba5265e11663c324ff983c4
https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/Images/ImagesHelper.php#L216-L233
200,928
lasallecms/lasallecms-l5-helpers-pkg
src/Images/ImagesHelper.php
ImagesHelper.tagImageResizedFilename
public function tagImageResizedFilename($defaultTagImage) { // grab the image sizes to create from the config $imageSizes = Config::get('lasallecmsfrontend.default_tag_image_image_size'); // filename $fileNameWithNoExtension = $this->filenameWithNoExtension($defaultTagImage); ...
php
public function tagImageResizedFilename($defaultTagImage) { // grab the image sizes to create from the config $imageSizes = Config::get('lasallecmsfrontend.default_tag_image_image_size'); // filename $fileNameWithNoExtension = $this->filenameWithNoExtension($defaultTagImage); ...
[ "public", "function", "tagImageResizedFilename", "(", "$", "defaultTagImage", ")", "{", "// grab the image sizes to create from the config", "$", "imageSizes", "=", "Config", "::", "get", "(", "'lasallecmsfrontend.default_tag_image_image_size'", ")", ";", "// filename", "$", ...
What is the name of the resized tag default image that the view will use? Does not actually resize the image! @param string $defaultTagImage The defaul_tag_image config setting @return string
[ "What", "is", "the", "name", "of", "the", "resized", "tag", "default", "image", "that", "the", "view", "will", "use?" ]
733967ce3fd81a1efba5265e11663c324ff983c4
https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/Images/ImagesHelper.php#L250-L264
200,929
lasallecms/lasallecms-l5-helpers-pkg
src/Images/ImagesHelper.php
ImagesHelper.tagResizedImageFiles
public function tagResizedImageFiles($defaultTagImage) { // grab the image sizes to create from the config $imageSizes = Config::get('lasallecmsfrontend.default_tag_image_image_size'); // iterate through the sizes to create new image files for each size foreach ($imageSizes as $widt...
php
public function tagResizedImageFiles($defaultTagImage) { // grab the image sizes to create from the config $imageSizes = Config::get('lasallecmsfrontend.default_tag_image_image_size'); // iterate through the sizes to create new image files for each size foreach ($imageSizes as $widt...
[ "public", "function", "tagResizedImageFiles", "(", "$", "defaultTagImage", ")", "{", "// grab the image sizes to create from the config", "$", "imageSizes", "=", "Config", "::", "get", "(", "'lasallecmsfrontend.default_tag_image_image_size'", ")", ";", "// iterate through the s...
Create resized image files for the tag default image @param string $defaultTagImage The defaul_tag_image config setting @return void
[ "Create", "resized", "image", "files", "for", "the", "tag", "default", "image" ]
733967ce3fd81a1efba5265e11663c324ff983c4
https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/Images/ImagesHelper.php#L274-L288
200,930
lasallecms/lasallecms-l5-helpers-pkg
src/Images/ImagesHelper.php
ImagesHelper.resize
public function resize($filename, $width, $height) { // open an image file $img = Image::make($this->pathOfImagesUploadFolder() .'/'. $filename); // resize image // http://image.intervention.io/api/resize // closure prevents possible upsizing $img->resize($width, $he...
php
public function resize($filename, $width, $height) { // open an image file $img = Image::make($this->pathOfImagesUploadFolder() .'/'. $filename); // resize image // http://image.intervention.io/api/resize // closure prevents possible upsizing $img->resize($width, $he...
[ "public", "function", "resize", "(", "$", "filename", ",", "$", "width", ",", "$", "height", ")", "{", "// open an image file", "$", "img", "=", "Image", "::", "make", "(", "$", "this", "->", "pathOfImagesUploadFolder", "(", ")", ".", "'/'", ".", "$", ...
Resize the image using the terrific Intervention package @param string $filename Image filename @param int $width Resized width @param int $height Resized height @return void
[ "Resize", "the", "image", "using", "the", "terrific", "Intervention", "package" ]
733967ce3fd81a1efba5265e11663c324ff983c4
https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/Images/ImagesHelper.php#L304-L318
200,931
lasallecms/lasallecms-l5-helpers-pkg
src/Images/ImagesHelper.php
ImagesHelper.pathFilenameOfResizedImage
public function pathFilenameOfResizedImage($filename, $width, $height) { $path = $this->pathOfImagesResizedFolder(); $filenameWithNoExtension = $this->filenameWithNoExtension($filename); $filenameWithExtensionOnly = $this->filenameWithExtensionOnly($filename); ...
php
public function pathFilenameOfResizedImage($filename, $width, $height) { $path = $this->pathOfImagesResizedFolder(); $filenameWithNoExtension = $this->filenameWithNoExtension($filename); $filenameWithExtensionOnly = $this->filenameWithExtensionOnly($filename); ...
[ "public", "function", "pathFilenameOfResizedImage", "(", "$", "filename", ",", "$", "width", ",", "$", "height", ")", "{", "$", "path", "=", "$", "this", "->", "pathOfImagesResizedFolder", "(", ")", ";", "$", "filenameWithNoExtension", "=", "$", "this", "->"...
Put together the path + name of the resized imaged. @param string $filename Image filename @param int $width Resized width @param int $height Resized height @return string
[ "Put", "together", "the", "path", "+", "name", "of", "the", "resized", "imaged", "." ]
733967ce3fd81a1efba5265e11663c324ff983c4
https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/Images/ImagesHelper.php#L357-L374
200,932
wobblecode/WobbleCodeUserBundle
Document/Contact.php
Contact.getServiceProfile
public function getServiceProfile($service) { if (isset($this->serviceProfiles[$service])) { return $this->serviceProfiles[$service]; } return null; }
php
public function getServiceProfile($service) { if (isset($this->serviceProfiles[$service])) { return $this->serviceProfiles[$service]; } return null; }
[ "public", "function", "getServiceProfile", "(", "$", "service", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "serviceProfiles", "[", "$", "service", "]", ")", ")", "{", "return", "$", "this", "->", "serviceProfiles", "[", "$", "service", "]", ...
Get service profile data @param string $service @return array|null
[ "Get", "service", "profile", "data" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/Document/Contact.php#L775-L782
200,933
ARCANESOFT/Media
src/Entities/FileCollection.php
FileCollection.exclude
public function exclude(array $patterns) { return $this->reject(function ($file) use ($patterns) { foreach ($patterns as $pattern) { if (Str::is($pattern, $file['name'])) return true; } return false; }); }
php
public function exclude(array $patterns) { return $this->reject(function ($file) use ($patterns) { foreach ($patterns as $pattern) { if (Str::is($pattern, $file['name'])) return true; } return false; }); }
[ "public", "function", "exclude", "(", "array", "$", "patterns", ")", "{", "return", "$", "this", "->", "reject", "(", "function", "(", "$", "file", ")", "use", "(", "$", "patterns", ")", "{", "foreach", "(", "$", "patterns", "as", "$", "pattern", ")"...
ExcludePattern files with the given patterns. @param array $patterns @return self
[ "ExcludePattern", "files", "with", "the", "given", "patterns", "." ]
e98aad52f94e6587fcbf79c56f7bf7072929bfc9
https://github.com/ARCANESOFT/Media/blob/e98aad52f94e6587fcbf79c56f7bf7072929bfc9/src/Entities/FileCollection.php#L26-L35
200,934
danielgp/common-lib
source/CommonViews.php
CommonViews.setField
private function setField($tableSource, $dtl, $features, $fieldLabel) { if ($dtl['COLUMN_NAME'] == 'host') { $inVl = gethostbyaddr($this->tCmnRequest->server->get('REMOTE_ADDR')); return [ 'label' => '<label for="' . $dtl['COLUMN_NAME'] . '">Numele calculatorului</lab...
php
private function setField($tableSource, $dtl, $features, $fieldLabel) { if ($dtl['COLUMN_NAME'] == 'host') { $inVl = gethostbyaddr($this->tCmnRequest->server->get('REMOTE_ADDR')); return [ 'label' => '<label for="' . $dtl['COLUMN_NAME'] . '">Numele calculatorului</lab...
[ "private", "function", "setField", "(", "$", "tableSource", ",", "$", "dtl", ",", "$", "features", ",", "$", "fieldLabel", ")", "{", "if", "(", "$", "dtl", "[", "'COLUMN_NAME'", "]", "==", "'host'", ")", "{", "$", "inVl", "=", "gethostbyaddr", "(", "...
Builds field output w. special column name @param string $tableSource @param array $dtl @param array $features @param string $fieldLabel @return array
[ "Builds", "field", "output", "w", ".", "special", "column", "name" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonViews.php#L50-L61
200,935
danielgp/common-lib
source/CommonViews.php
CommonViews.setFieldInput
private function setFieldInput($tableSource, $dtl, $features) { if ($dtl['COLUMN_NAME'] == 'ChoiceId') { return '<input type="text" name="ChoiceId" value="' . $this->tCmnRequest->request->get($dtl['COLUMN_NAME']) . '" />'; } return $this->setNeededFieldByType(...
php
private function setFieldInput($tableSource, $dtl, $features) { if ($dtl['COLUMN_NAME'] == 'ChoiceId') { return '<input type="text" name="ChoiceId" value="' . $this->tCmnRequest->request->get($dtl['COLUMN_NAME']) . '" />'; } return $this->setNeededFieldByType(...
[ "private", "function", "setFieldInput", "(", "$", "tableSource", ",", "$", "dtl", ",", "$", "features", ")", "{", "if", "(", "$", "dtl", "[", "'COLUMN_NAME'", "]", "==", "'ChoiceId'", ")", "{", "return", "'<input type=\"text\" name=\"ChoiceId\" value=\"'", ".", ...
Builds field output w. another special column name @param string $tableSource @param array $dtl @param array $features @return string
[ "Builds", "field", "output", "w", ".", "another", "special", "column", "name" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonViews.php#L71-L78
200,936
danielgp/common-lib
source/CommonViews.php
CommonViews.setFormGenericSingleRecord
protected function setFormGenericSingleRecord($tblSrc, $feat, $hdnInf = []) { echo $this->setStringIntoTag('', 'div', ['id' => 'loading']); $this->setTableCache($tblSrc); if (strpos($tblSrc, '.') !== false) { $tblSrc = explode('.', str_replace('`', '', $tblSrc))[1]; } ...
php
protected function setFormGenericSingleRecord($tblSrc, $feat, $hdnInf = []) { echo $this->setStringIntoTag('', 'div', ['id' => 'loading']); $this->setTableCache($tblSrc); if (strpos($tblSrc, '.') !== false) { $tblSrc = explode('.', str_replace('`', '', $tblSrc))[1]; } ...
[ "protected", "function", "setFormGenericSingleRecord", "(", "$", "tblSrc", ",", "$", "feat", ",", "$", "hdnInf", "=", "[", "]", ")", "{", "echo", "$", "this", "->", "setStringIntoTag", "(", "''", ",", "'div'", ",", "[", "'id'", "=>", "'loading'", "]", ...
Returns a generic form based on a given table @param string $tblSrc @param array $feat @param array $hdnInf @return string Form to add/modify detail for a single row within a table
[ "Returns", "a", "generic", "form", "based", "on", "a", "given", "table" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonViews.php#L89-L105
200,937
danielgp/common-lib
source/CommonViews.php
CommonViews.setNeededField
private function setNeededField($tableSource, $details, $features) { if (isset($features['hidden'])) { if (in_array($details['COLUMN_NAME'], $features['hidden'])) { return null; } } $fieldLabel = $this->getFieldNameForDisplay($details); if ($fi...
php
private function setNeededField($tableSource, $details, $features) { if (isset($features['hidden'])) { if (in_array($details['COLUMN_NAME'], $features['hidden'])) { return null; } } $fieldLabel = $this->getFieldNameForDisplay($details); if ($fi...
[ "private", "function", "setNeededField", "(", "$", "tableSource", ",", "$", "details", ",", "$", "features", ")", "{", "if", "(", "isset", "(", "$", "features", "[", "'hidden'", "]", ")", ")", "{", "if", "(", "in_array", "(", "$", "details", "[", "'C...
Analyse the field and returns the proper line 2 use in forms @param string $tableSource @param array $details @param array $features @return string|array
[ "Analyse", "the", "field", "and", "returns", "the", "proper", "line", "2", "use", "in", "forms" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonViews.php#L115-L127
200,938
danielgp/common-lib
source/CommonViews.php
CommonViews.setNeededFieldByType
private function setNeededFieldByType($tblName, $dtls, $features) { if (isset($features['special']) && isset($features['special'][$dtls['COLUMN_NAME']])) { $sOpt = $this->setMySQLquery2Server($features['special'][$dtls['COLUMN_NAME']], 'array_key_value'); return $this->setArrayToSele...
php
private function setNeededFieldByType($tblName, $dtls, $features) { if (isset($features['special']) && isset($features['special'][$dtls['COLUMN_NAME']])) { $sOpt = $this->setMySQLquery2Server($features['special'][$dtls['COLUMN_NAME']], 'array_key_value'); return $this->setArrayToSele...
[ "private", "function", "setNeededFieldByType", "(", "$", "tblName", ",", "$", "dtls", ",", "$", "features", ")", "{", "if", "(", "isset", "(", "$", "features", "[", "'special'", "]", ")", "&&", "isset", "(", "$", "features", "[", "'special'", "]", "[",...
Analyse the field type and returns the proper lines 2 use in forms @param string $tblName @param array $dtls @param array $features @return string|array
[ "Analyse", "the", "field", "type", "and", "returns", "the", "proper", "lines", "2", "use", "in", "forms" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonViews.php#L137-L144
200,939
danielgp/common-lib
source/CommonViews.php
CommonViews.setViewModernDelete
protected function setViewModernDelete($tbl, $idn) { $tMsg = $this->setViewDeleteFeedbacks(); if ($tbl == '') { $sReturn = $this->setFeedbackModern('error', $tMsg['Confirmation'], $tMsg['Impossible']); } else { $this->initializeSprGlbAndSession(); $idFldVa...
php
protected function setViewModernDelete($tbl, $idn) { $tMsg = $this->setViewDeleteFeedbacks(); if ($tbl == '') { $sReturn = $this->setFeedbackModern('error', $tMsg['Confirmation'], $tMsg['Impossible']); } else { $this->initializeSprGlbAndSession(); $idFldVa...
[ "protected", "function", "setViewModernDelete", "(", "$", "tbl", ",", "$", "idn", ")", "{", "$", "tMsg", "=", "$", "this", "->", "setViewDeleteFeedbacks", "(", ")", ";", "if", "(", "$", "tbl", "==", "''", ")", "{", "$", "sReturn", "=", "$", "this", ...
Automatic handler for Record deletion @param string $tbl @param string $idn @return string
[ "Automatic", "handler", "for", "Record", "deletion" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonViews.php#L189-L205
200,940
LpFactory/NestedSetRoutingBundle
Configuration/PageRouteConfigurationChain.php
PageRouteConfigurationChain.findConfiguration
protected function findConfiguration($value, \Closure $func) { /** @var AbstractPageRouteConfiguration $configuration */ foreach ($this->all() as $configuration) { if ($func($configuration, $value)) { return $configuration; } } return null; ...
php
protected function findConfiguration($value, \Closure $func) { /** @var AbstractPageRouteConfiguration $configuration */ foreach ($this->all() as $configuration) { if ($func($configuration, $value)) { return $configuration; } } return null; ...
[ "protected", "function", "findConfiguration", "(", "$", "value", ",", "\\", "Closure", "$", "func", ")", "{", "/** @var AbstractPageRouteConfiguration $configuration */", "foreach", "(", "$", "this", "->", "all", "(", ")", "as", "$", "configuration", ")", "{", "...
Find a configuration matching custom criteria @param string $value @param callable $func @return null|AbstractPageRouteConfiguration
[ "Find", "a", "configuration", "matching", "custom", "criteria" ]
dc07227a6764e657b7b321827a18127ec18ba214
https://github.com/LpFactory/NestedSetRoutingBundle/blob/dc07227a6764e657b7b321827a18127ec18ba214/Configuration/PageRouteConfigurationChain.php#L116-L126
200,941
bytic/debugbar
src/DebugBar.php
DebugBar.injectDebugBar
public function injectDebugBar(ResponseInterface $response) { $content = $response->getContent(); $renderer = $this->getJavascriptRenderer(); $renderedContent = $this->generateAssetsContent().$renderer->render(); $pos = strripos($content, '</body>'); if (false !== $pos) { ...
php
public function injectDebugBar(ResponseInterface $response) { $content = $response->getContent(); $renderer = $this->getJavascriptRenderer(); $renderedContent = $this->generateAssetsContent().$renderer->render(); $pos = strripos($content, '</body>'); if (false !== $pos) { ...
[ "public", "function", "injectDebugBar", "(", "ResponseInterface", "$", "response", ")", "{", "$", "content", "=", "$", "response", "->", "getContent", "(", ")", ";", "$", "renderer", "=", "$", "this", "->", "getJavascriptRenderer", "(", ")", ";", "$", "ren...
Injects the web debug toolbar @param Response $response
[ "Injects", "the", "web", "debug", "toolbar" ]
3199ade9a8fff866bffc39712bdf78d2dd214e4b
https://github.com/bytic/debugbar/blob/3199ade9a8fff866bffc39712bdf78d2dd214e4b/src/DebugBar.php#L116-L132
200,942
spoom-php/core
src/extension/Application.php
Application.environment
public static function environment( int $severity, array $configuration = [] ) { // setup error reporting in PHP $reporting = ~E_ALL; foreach( self::SEVERITY as $key => $value ) { if( $key <= $severity ) $reporting |= $value; } error_reporting( $reporting ); // setup locale if( isset...
php
public static function environment( int $severity, array $configuration = [] ) { // setup error reporting in PHP $reporting = ~E_ALL; foreach( self::SEVERITY as $key => $value ) { if( $key <= $severity ) $reporting |= $value; } error_reporting( $reporting ); // setup locale if( isset...
[ "public", "static", "function", "environment", "(", "int", "$", "severity", ",", "array", "$", "configuration", "=", "[", "]", ")", "{", "// setup error reporting in PHP", "$", "reporting", "=", "~", "E_ALL", ";", "foreach", "(", "self", "::", "SEVERITY", "a...
Global setup of the PHP environment This SHOULD be done before the application...or anything else in the PHP code @param int $severity Maximum severity level tht should be reported @param array $configuration
[ "Global", "setup", "of", "the", "PHP", "environment" ]
ea7184213352fa2fad7636927a019e5798734e04
https://github.com/spoom-php/core/blob/ea7184213352fa2fad7636927a019e5798734e04/src/extension/Application.php#L260-L284
200,943
jenskooij/cloudcontrol
src/storage/storage/ImageSetStorage.php
ImageSetStorage.getImageSetBySlug
public function getImageSetBySlug($slug) { $imageSet = $this->getImageSet(); foreach ($imageSet as $set) { if ($set->slug == $slug) { return $set; } } return null; }
php
public function getImageSetBySlug($slug) { $imageSet = $this->getImageSet(); foreach ($imageSet as $set) { if ($set->slug == $slug) { return $set; } } return null; }
[ "public", "function", "getImageSetBySlug", "(", "$", "slug", ")", "{", "$", "imageSet", "=", "$", "this", "->", "getImageSet", "(", ")", ";", "foreach", "(", "$", "imageSet", "as", "$", "set", ")", "{", "if", "(", "$", "set", "->", "slug", "==", "$...
Get Image by slug @param $slug @return \stdClass
[ "Get", "Image", "by", "slug" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/ImageSetStorage.php#L29-L39
200,944
jenskooij/cloudcontrol
src/storage/storage/ImageSetStorage.php
ImageSetStorage.addImageSet
public function addImageSet($postValues) { $imageSetObject = ImageSetFactory::createImageSetFromPostValues($postValues); $imageSet = $this->repository->imageSet; $imageSet[] = $imageSetObject; $this->repository->imageSet = $imageSet; $this->save(); }
php
public function addImageSet($postValues) { $imageSetObject = ImageSetFactory::createImageSetFromPostValues($postValues); $imageSet = $this->repository->imageSet; $imageSet[] = $imageSetObject; $this->repository->imageSet = $imageSet; $this->save(); }
[ "public", "function", "addImageSet", "(", "$", "postValues", ")", "{", "$", "imageSetObject", "=", "ImageSetFactory", "::", "createImageSetFromPostValues", "(", "$", "postValues", ")", ";", "$", "imageSet", "=", "$", "this", "->", "repository", "->", "imageSet",...
Add image set @param $postValues @throws \Exception
[ "Add", "image", "set" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/ImageSetStorage.php#L48-L57
200,945
jenskooij/cloudcontrol
src/storage/storage/ImageSetStorage.php
ImageSetStorage.saveImageSet
public function saveImageSet($slug, $postValues) { $imageSetObject = ImageSetFactory::createImageSetFromPostValues($postValues); $imageSet = $this->repository->imageSet; foreach ($imageSet as $key => $set) { if ($set->slug == $slug) { $imageSet[$key] = $imageSetO...
php
public function saveImageSet($slug, $postValues) { $imageSetObject = ImageSetFactory::createImageSetFromPostValues($postValues); $imageSet = $this->repository->imageSet; foreach ($imageSet as $key => $set) { if ($set->slug == $slug) { $imageSet[$key] = $imageSetO...
[ "public", "function", "saveImageSet", "(", "$", "slug", ",", "$", "postValues", ")", "{", "$", "imageSetObject", "=", "ImageSetFactory", "::", "createImageSetFromPostValues", "(", "$", "postValues", ")", ";", "$", "imageSet", "=", "$", "this", "->", "repositor...
Save Image Set by it's slug @param $slug @param $postValues @throws \Exception
[ "Save", "Image", "Set", "by", "it", "s", "slug" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/ImageSetStorage.php#L67-L79
200,946
jenskooij/cloudcontrol
src/storage/storage/ImageSetStorage.php
ImageSetStorage.deleteImageSetBySlug
public function deleteImageSetBySlug($slug) { $imageSet = $this->getImageSet(); foreach ($imageSet as $key => $set) { if ($set->slug == $slug) { unset($imageSet[$key]); } } $imageSet = array_values($imageSet); $this->repository->imageS...
php
public function deleteImageSetBySlug($slug) { $imageSet = $this->getImageSet(); foreach ($imageSet as $key => $set) { if ($set->slug == $slug) { unset($imageSet[$key]); } } $imageSet = array_values($imageSet); $this->repository->imageS...
[ "public", "function", "deleteImageSetBySlug", "(", "$", "slug", ")", "{", "$", "imageSet", "=", "$", "this", "->", "getImageSet", "(", ")", ";", "foreach", "(", "$", "imageSet", "as", "$", "key", "=>", "$", "set", ")", "{", "if", "(", "$", "set", "...
Delete Image Set by its slug @param $slug @throws \Exception
[ "Delete", "Image", "Set", "by", "its", "slug" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/ImageSetStorage.php#L88-L100
200,947
jenskooij/cloudcontrol
src/storage/storage/ImageSetStorage.php
ImageSetStorage.getSmallestImageSet
public function getSmallestImageSet() { $imageSet = $this->getImageSet(); $returnSize = PHP_INT_MAX; $returnSet = null; foreach ($imageSet as $set) { $size = $set->width * $set->height; if ($size < $returnSize) { $returnSize = $size; ...
php
public function getSmallestImageSet() { $imageSet = $this->getImageSet(); $returnSize = PHP_INT_MAX; $returnSet = null; foreach ($imageSet as $set) { $size = $set->width * $set->height; if ($size < $returnSize) { $returnSize = $size; ...
[ "public", "function", "getSmallestImageSet", "(", ")", "{", "$", "imageSet", "=", "$", "this", "->", "getImageSet", "(", ")", ";", "$", "returnSize", "=", "PHP_INT_MAX", ";", "$", "returnSet", "=", "null", ";", "foreach", "(", "$", "imageSet", "as", "$",...
Get the image set with the smallest size @return \stdClass
[ "Get", "the", "image", "set", "with", "the", "smallest", "size" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/ImageSetStorage.php#L107-L128
200,948
Kris-Kuiper/sFire-Framework
src/Validator/Message.php
Message.setError
public static function setError($prefix = null, $field, $error) { if(null !== $prefix && false === is_string($prefix)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($prefix)), E_USER_ERROR); } if(false === is_string($field)) { ...
php
public static function setError($prefix = null, $field, $error) { if(null !== $prefix && false === is_string($prefix)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($prefix)), E_USER_ERROR); } if(false === is_string($field)) { ...
[ "public", "static", "function", "setError", "(", "$", "prefix", "=", "null", ",", "$", "field", ",", "$", "error", ")", "{", "if", "(", "null", "!==", "$", "prefix", "&&", "false", "===", "is_string", "(", "$", "prefix", ")", ")", "{", "return", "t...
Sets an error for the current field @param string $prefix @param string $field @param string $error @return sFire\Validator\Message
[ "Sets", "an", "error", "for", "the", "current", "field" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Message.php#L121-L150
200,949
Kris-Kuiper/sFire-Framework
src/Validator/Message.php
Message.getMessage
public static function getMessage($field, $rule) { if(false === is_string($field)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($field)), E_USER_ERROR); } if(false === is_string($rule)) { return trigger_error(sprintf('Argumen...
php
public static function getMessage($field, $rule) { if(false === is_string($field)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($field)), E_USER_ERROR); } if(false === is_string($rule)) { return trigger_error(sprintf('Argumen...
[ "public", "static", "function", "getMessage", "(", "$", "field", ",", "$", "rule", ")", "{", "if", "(", "false", "===", "is_string", "(", "$", "field", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Argument 1 passed to %s() must be of the ty...
Returns message by field and rule @param string $field @param string $rule @return string
[ "Returns", "message", "by", "field", "and", "rule" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Message.php#L159-L172
200,950
Kris-Kuiper/sFire-Framework
src/Validator/Message.php
Message.loadCustom
public static function loadCustom($classname, $namespace, $name) { if(false === is_string($classname)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($classname)), E_USER_ERROR); } if(false === is_string($namespace)) { return t...
php
public static function loadCustom($classname, $namespace, $name) { if(false === is_string($classname)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($classname)), E_USER_ERROR); } if(false === is_string($namespace)) { return t...
[ "public", "static", "function", "loadCustom", "(", "$", "classname", ",", "$", "namespace", ",", "$", "name", ")", "{", "if", "(", "false", "===", "is_string", "(", "$", "classname", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Argume...
Loads a custom validator class @param string $classname @param string $namespace @param string $name @return sFire\Validator\Message
[ "Loads", "a", "custom", "validator", "class" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Message.php#L191-L208
200,951
Kris-Kuiper/sFire-Framework
src/Validator/Message.php
Message.getErrors
public static function getErrors($fullnames = false) { if(false === is_bool($fullnames)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($fullnames)), E_USER_ERROR); } if(true === $fullnames) { return static :: $errors['full'];...
php
public static function getErrors($fullnames = false) { if(false === is_bool($fullnames)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($fullnames)), E_USER_ERROR); } if(true === $fullnames) { return static :: $errors['full'];...
[ "public", "static", "function", "getErrors", "(", "$", "fullnames", "=", "false", ")", "{", "if", "(", "false", "===", "is_bool", "(", "$", "fullnames", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Argument 1 passed to %s() must be of the typ...
Returns all errors @param boolean $fullnames @return array
[ "Returns", "all", "errors" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Message.php#L216-L227
200,952
Kris-Kuiper/sFire-Framework
src/Validator/Message.php
Message.addMessage
private static function addMessage($rule, $params) { if(false === is_string($rule)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($rule)), E_USER_ERROR); } if(false === is_array($params)) { return trigger_error(sprintf('Argume...
php
private static function addMessage($rule, $params) { if(false === is_string($rule)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($rule)), E_USER_ERROR); } if(false === is_array($params)) { return trigger_error(sprintf('Argume...
[ "private", "static", "function", "addMessage", "(", "$", "rule", ",", "$", "params", ")", "{", "if", "(", "false", "===", "is_string", "(", "$", "rule", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Argument 1 passed to %s() must be of the t...
Adds a new custom message to current fieldname @param string $rule @param array $params
[ "Adds", "a", "new", "custom", "message", "to", "current", "fieldname" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Message.php#L235-L257
200,953
koolkode/lexer
src/AbstractTokenBuffer.php
AbstractTokenBuffer.append
public function append($data) { if($data instanceof AbstractToken) { $this->tokens[] = $data; } elseif($data instanceof AbstractTokenContainer) { $this->tokens = array_merge($this->tokens, $data->toArray()); } elseif($data instanceof AbstractTokenCursor) { while($data->valid()) { $this-...
php
public function append($data) { if($data instanceof AbstractToken) { $this->tokens[] = $data; } elseif($data instanceof AbstractTokenContainer) { $this->tokens = array_merge($this->tokens, $data->toArray()); } elseif($data instanceof AbstractTokenCursor) { while($data->valid()) { $this-...
[ "public", "function", "append", "(", "$", "data", ")", "{", "if", "(", "$", "data", "instanceof", "AbstractToken", ")", "{", "$", "this", "->", "tokens", "[", "]", "=", "$", "data", ";", "}", "elseif", "(", "$", "data", "instanceof", "AbstractTokenCont...
Append the given token or token container to the TokenBuffer. @param mixed $data @return AbstractTokenBuffer @throws \InvalidArgumentException
[ "Append", "the", "given", "token", "or", "token", "container", "to", "the", "TokenBuffer", "." ]
1f33fb4e95bf3b6b21c63187e503bbe612a1646c
https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenBuffer.php#L37-L62
200,954
RhubarbPHP/Module.ImageProcessing
src/ImageMetrics.php
ImageMetrics.commit
public function commit() { $this->sourceWidth = $this->frameWidth; $this->sourceHeight = $this->frameHeight; $this->offsetX = 0; $this->offsetY = 0; $this->scaleWidth = $this->frameWidth; $this->scaleHeight = $this->frameHeight; $this->getFocalPoint(); }
php
public function commit() { $this->sourceWidth = $this->frameWidth; $this->sourceHeight = $this->frameHeight; $this->offsetX = 0; $this->offsetY = 0; $this->scaleWidth = $this->frameWidth; $this->scaleHeight = $this->frameHeight; $this->getFocalPoint(); }
[ "public", "function", "commit", "(", ")", "{", "$", "this", "->", "sourceWidth", "=", "$", "this", "->", "frameWidth", ";", "$", "this", "->", "sourceHeight", "=", "$", "this", "->", "frameHeight", ";", "$", "this", "->", "offsetX", "=", "0", ";", "$...
Resets the image metrics so as to reflect the image should the current settings be applied.
[ "Resets", "the", "image", "metrics", "so", "as", "to", "reflect", "the", "image", "should", "the", "current", "settings", "be", "applied", "." ]
e980ae6b524ce60f550064257eb7318dce331c1a
https://github.com/RhubarbPHP/Module.ImageProcessing/blob/e980ae6b524ce60f550064257eb7318dce331c1a/src/ImageMetrics.php#L46-L56
200,955
RhubarbPHP/Module.ImageProcessing
src/ImageMetrics.php
ImageMetrics.getFocalPoint
public function getFocalPoint() { $scale = $this->sourceWidth / $this->scaleWidth; $focalX = ( ( $this->frameWidth / 2 ) - $this->offsetX ) * $scale; $focalY = ( ( $this->frameHeight / 2 ) - $this->offsetY ) * $scale; return array( $focalX, $focalY ); }
php
public function getFocalPoint() { $scale = $this->sourceWidth / $this->scaleWidth; $focalX = ( ( $this->frameWidth / 2 ) - $this->offsetX ) * $scale; $focalY = ( ( $this->frameHeight / 2 ) - $this->offsetY ) * $scale; return array( $focalX, $focalY ); }
[ "public", "function", "getFocalPoint", "(", ")", "{", "$", "scale", "=", "$", "this", "->", "sourceWidth", "/", "$", "this", "->", "scaleWidth", ";", "$", "focalX", "=", "(", "(", "$", "this", "->", "frameWidth", "/", "2", ")", "-", "$", "this", "-...
Returns an array with the X, Y co-ords of the focal point of the current crop. The measurement is relative to the original source image.
[ "Returns", "an", "array", "with", "the", "X", "Y", "co", "-", "ords", "of", "the", "focal", "point", "of", "the", "current", "crop", "." ]
e980ae6b524ce60f550064257eb7318dce331c1a
https://github.com/RhubarbPHP/Module.ImageProcessing/blob/e980ae6b524ce60f550064257eb7318dce331c1a/src/ImageMetrics.php#L64-L72
200,956
RhubarbPHP/Module.ImageProcessing
src/ImageMetrics.php
ImageMetrics.setSourceDetails
public function setSourceDetails() { if ( !file_exists( $this->sourcePath ) ) { throw new FileNotFoundException( $this->sourcePath ); } if ( is_dir( $this->sourcePath ) ) { throw new FileNotFoundException( $this->sourcePath ); } $imageDetails = getimagesize( $this->sourcePath ); $this->sourceW...
php
public function setSourceDetails() { if ( !file_exists( $this->sourcePath ) ) { throw new FileNotFoundException( $this->sourcePath ); } if ( is_dir( $this->sourcePath ) ) { throw new FileNotFoundException( $this->sourcePath ); } $imageDetails = getimagesize( $this->sourcePath ); $this->sourceW...
[ "public", "function", "setSourceDetails", "(", ")", "{", "if", "(", "!", "file_exists", "(", "$", "this", "->", "sourcePath", ")", ")", "{", "throw", "new", "FileNotFoundException", "(", "$", "this", "->", "sourcePath", ")", ";", "}", "if", "(", "is_dir"...
Reads basic information about the metrics of the source image. @throws FileNotFoundException Thrown if the source image couldn't be found.
[ "Reads", "basic", "information", "about", "the", "metrics", "of", "the", "source", "image", "." ]
e980ae6b524ce60f550064257eb7318dce331c1a
https://github.com/RhubarbPHP/Module.ImageProcessing/blob/e980ae6b524ce60f550064257eb7318dce331c1a/src/ImageMetrics.php#L99-L125
200,957
RhubarbPHP/Module.ImageProcessing
src/ImageMetrics.php
ImageMetrics.resize
public function resize( $width, $height, $maintainAspect = false, $scaleUp = true ) { $oldFrameWidth = $this->frameWidth; $aspectRatio = $this->frameWidth / $this->frameHeight; if ( $maintainAspect ) { // Try width first $newHeight = round( $width / $aspectRatio ); if ( $newHeight > $height ) { ...
php
public function resize( $width, $height, $maintainAspect = false, $scaleUp = true ) { $oldFrameWidth = $this->frameWidth; $aspectRatio = $this->frameWidth / $this->frameHeight; if ( $maintainAspect ) { // Try width first $newHeight = round( $width / $aspectRatio ); if ( $newHeight > $height ) { ...
[ "public", "function", "resize", "(", "$", "width", ",", "$", "height", ",", "$", "maintainAspect", "=", "false", ",", "$", "scaleUp", "=", "true", ")", "{", "$", "oldFrameWidth", "=", "$", "this", "->", "frameWidth", ";", "$", "aspectRatio", "=", "$", ...
Resizes the image with the given bounds. @param mixed $width @param mixed $height @param mixed $maintainAspect @param bool $scaleUp
[ "Resizes", "the", "image", "with", "the", "given", "bounds", "." ]
e980ae6b524ce60f550064257eb7318dce331c1a
https://github.com/RhubarbPHP/Module.ImageProcessing/blob/e980ae6b524ce60f550064257eb7318dce331c1a/src/ImageMetrics.php#L135-L189
200,958
swokit/utils
src/Coroutine.php
Coroutine.tid
public static function tid(): int { if (!ServerUtil::coroutineIsEnabled()) { return -1; } $id = SwCoroutine::getuid(); return self::$idMap[$id] ?? $id; }
php
public static function tid(): int { if (!ServerUtil::coroutineIsEnabled()) { return -1; } $id = SwCoroutine::getuid(); return self::$idMap[$id] ?? $id; }
[ "public", "static", "function", "tid", "(", ")", ":", "int", "{", "if", "(", "!", "ServerUtil", "::", "coroutineIsEnabled", "(", ")", ")", "{", "return", "-", "1", ";", "}", "$", "id", "=", "SwCoroutine", "::", "getuid", "(", ")", ";", "return", "s...
get top coroutine id @return int
[ "get", "top", "coroutine", "id" ]
a91688ee6970e33be14047bf4714da3299796f56
https://github.com/swokit/utils/blob/a91688ee6970e33be14047bf4714da3299796f56/src/Coroutine.php#L48-L57
200,959
swokit/utils
src/Coroutine.php
Coroutine.create
public static function create(callable $cb) { if (!ServerUtil::coroutineIsEnabled()) { return false; } $tid = self::tid(); return SwCoroutine::create(function () use ($cb, $tid) { $id = SwCoroutine::getuid(); self::$idMap[$id] = $tid; ...
php
public static function create(callable $cb) { if (!ServerUtil::coroutineIsEnabled()) { return false; } $tid = self::tid(); return SwCoroutine::create(function () use ($cb, $tid) { $id = SwCoroutine::getuid(); self::$idMap[$id] = $tid; ...
[ "public", "static", "function", "create", "(", "callable", "$", "cb", ")", "{", "if", "(", "!", "ServerUtil", "::", "coroutineIsEnabled", "(", ")", ")", "{", "return", "false", ";", "}", "$", "tid", "=", "self", "::", "tid", "(", ")", ";", "return", ...
create a child coroutine @param callable $cb @return bool|int success return CID, fail return false.
[ "create", "a", "child", "coroutine" ]
a91688ee6970e33be14047bf4714da3299796f56
https://github.com/swokit/utils/blob/a91688ee6970e33be14047bf4714da3299796f56/src/Coroutine.php#L73-L88
200,960
PenoaksDev/Milky-Framework
src/Milky/Filesystem/FilesystemAdapter.php
FilesystemAdapter.parseVisibility
protected function parseVisibility( $visibility ) { if ( is_null( $visibility ) ) return null; switch ( $visibility ) { case FilesystemContract::VISIBILITY_PUBLIC: return AdapterInterface::VISIBILITY_PUBLIC; case FilesystemContract::VISIBILITY_PRIVATE: return AdapterInterface::VISIBILITY_PRIVAT...
php
protected function parseVisibility( $visibility ) { if ( is_null( $visibility ) ) return null; switch ( $visibility ) { case FilesystemContract::VISIBILITY_PUBLIC: return AdapterInterface::VISIBILITY_PUBLIC; case FilesystemContract::VISIBILITY_PRIVATE: return AdapterInterface::VISIBILITY_PRIVAT...
[ "protected", "function", "parseVisibility", "(", "$", "visibility", ")", "{", "if", "(", "is_null", "(", "$", "visibility", ")", ")", "return", "null", ";", "switch", "(", "$", "visibility", ")", "{", "case", "FilesystemContract", "::", "VISIBILITY_PUBLIC", ...
Parse the given visibility value. @param string|null $visibility @return string|null @throws \InvalidArgumentException
[ "Parse", "the", "given", "visibility", "value", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Filesystem/FilesystemAdapter.php#L371-L385
200,961
kkthek/diqa-util
src/Util/ParserFunctions/ReadObjectCache.php
ReadObjectCache.readObjectCache
static function readObjectCache(Parser &$parser, $key = '') { $parser->disableCache (); $cache = \ObjectCache::getInstance(CACHE_DB); global $wgDIQAAllowedObjectCacheKeys; if (!isset($wgDIQAAllowedObjectCacheKeys) || !in_array($key, $wgDIQAAllowedObjectCacheKeys)) { return 'not-a...
php
static function readObjectCache(Parser &$parser, $key = '') { $parser->disableCache (); $cache = \ObjectCache::getInstance(CACHE_DB); global $wgDIQAAllowedObjectCacheKeys; if (!isset($wgDIQAAllowedObjectCacheKeys) || !in_array($key, $wgDIQAAllowedObjectCacheKeys)) { return 'not-a...
[ "static", "function", "readObjectCache", "(", "Parser", "&", "$", "parser", ",", "$", "key", "=", "''", ")", "{", "$", "parser", "->", "disableCache", "(", ")", ";", "$", "cache", "=", "\\", "ObjectCache", "::", "getInstance", "(", "CACHE_DB", ")", ";"...
Read key from ObjectCache
[ "Read", "key", "from", "ObjectCache" ]
df35d16403b5dbf0f7570daded6cfa26814ae7e0
https://github.com/kkthek/diqa-util/blob/df35d16403b5dbf0f7570daded6cfa26814ae7e0/src/Util/ParserFunctions/ReadObjectCache.php#L18-L38
200,962
covex-nn/JooS
src/JooS/Loader.php
Loader.loadClass
public static function loadClass($className) { if (!class_exists($className)) { $path = self::getPath($className); $realPath = stream_resolve_include_path($path); if (file_exists($realPath)) { require_once($realPath); return class_exists($className); } return false...
php
public static function loadClass($className) { if (!class_exists($className)) { $path = self::getPath($className); $realPath = stream_resolve_include_path($path); if (file_exists($realPath)) { require_once($realPath); return class_exists($className); } return false...
[ "public", "static", "function", "loadClass", "(", "$", "className", ")", "{", "if", "(", "!", "class_exists", "(", "$", "className", ")", ")", "{", "$", "path", "=", "self", "::", "getPath", "(", "$", "className", ")", ";", "$", "realPath", "=", "str...
Loads class. @param string $className Class Name @return bool
[ "Loads", "class", "." ]
8dfb94edccecaf307787d4091ba7f20a674b7792
https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/Loader.php#L21-L37
200,963
covex-nn/JooS
src/JooS/Loader.php
Loader.getPath
public static function getPath($className, $ext = "php") { if (substr($className, 0, 1) == "\\") { $className = substr($className, 1); } $delimiters = array("_", "\\"); foreach ($delimiters as $symbol) { $className = str_replace($symbol, "/", $className); } return $className ....
php
public static function getPath($className, $ext = "php") { if (substr($className, 0, 1) == "\\") { $className = substr($className, 1); } $delimiters = array("_", "\\"); foreach ($delimiters as $symbol) { $className = str_replace($symbol, "/", $className); } return $className ....
[ "public", "static", "function", "getPath", "(", "$", "className", ",", "$", "ext", "=", "\"php\"", ")", "{", "if", "(", "substr", "(", "$", "className", ",", "0", ",", "1", ")", "==", "\"\\\\\"", ")", "{", "$", "className", "=", "substr", "(", "$",...
Returns class path. @param string $className Class Name @param string $ext Extention @return string
[ "Returns", "class", "path", "." ]
8dfb94edccecaf307787d4091ba7f20a674b7792
https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/Loader.php#L47-L58
200,964
covex-nn/JooS
src/JooS/Loader.php
Loader.getClassName
public static function getClassName($prefix, $name, $ucfirst = false) { if (substr($prefix, -1, 1) == "\\") { $className = $prefix; } else { $className = $prefix . "_"; } $className .= $name; if ($ucfirst) { $result = ""; $nsPath = explode("\\", $className); ...
php
public static function getClassName($prefix, $name, $ucfirst = false) { if (substr($prefix, -1, 1) == "\\") { $className = $prefix; } else { $className = $prefix . "_"; } $className .= $name; if ($ucfirst) { $result = ""; $nsPath = explode("\\", $className); ...
[ "public", "static", "function", "getClassName", "(", "$", "prefix", ",", "$", "name", ",", "$", "ucfirst", "=", "false", ")", "{", "if", "(", "substr", "(", "$", "prefix", ",", "-", "1", ",", "1", ")", "==", "\"\\\\\"", ")", "{", "$", "className", ...
Returns className. @param string $prefix Prefix @param string $name Name @param bool $ucfirst First letter - caps @return string
[ "Returns", "className", "." ]
8dfb94edccecaf307787d4091ba7f20a674b7792
https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/Loader.php#L69-L105
200,965
OxfordInfoLabs/kinikit-core
src/Util/Logging/CodeTimer.php
CodeTimer.timeFunction
public static function timeFunction($function, $description = null) { $duration = self::time($function); Logger::log("Code Block " . ($description ? '"' . $description . '"' : "") . " Executed in " . $duration . " Seconds"); return $duration; }
php
public static function timeFunction($function, $description = null) { $duration = self::time($function); Logger::log("Code Block " . ($description ? '"' . $description . '"' : "") . " Executed in " . $duration . " Seconds"); return $duration; }
[ "public", "static", "function", "timeFunction", "(", "$", "function", ",", "$", "description", "=", "null", ")", "{", "$", "duration", "=", "self", "::", "time", "(", "$", "function", ")", ";", "Logger", "::", "log", "(", "\"Code Block \"", ".", "(", "...
Time the passed function @param $function
[ "Time", "the", "passed", "function" ]
edc1b2e6ffabd595c4c7d322279b3dd1e59ef359
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Logging/CodeTimer.php#L19-L26
200,966
OxfordInfoLabs/kinikit-core
src/Util/Logging/CodeTimer.php
CodeTimer.recordFunctionTimingForGroup
public static function recordFunctionTimingForGroup($function, $group) { $functionTiming = CodeTimer::time($function); if (isset(CodeTimer::$groupTimings[$group])) { CodeTimer::$groupTimings[$group] += $functionTiming; } else { CodeTimer::$groupTimings[$group] = $functio...
php
public static function recordFunctionTimingForGroup($function, $group) { $functionTiming = CodeTimer::time($function); if (isset(CodeTimer::$groupTimings[$group])) { CodeTimer::$groupTimings[$group] += $functionTiming; } else { CodeTimer::$groupTimings[$group] = $functio...
[ "public", "static", "function", "recordFunctionTimingForGroup", "(", "$", "function", ",", "$", "group", ")", "{", "$", "functionTiming", "=", "CodeTimer", "::", "time", "(", "$", "function", ")", ";", "if", "(", "isset", "(", "CodeTimer", "::", "$", "grou...
Record the timing of a passed function against a group. All Timings for a group are added up. @param $function @param $group
[ "Record", "the", "timing", "of", "a", "passed", "function", "against", "a", "group", ".", "All", "Timings", "for", "a", "group", "are", "added", "up", "." ]
edc1b2e6ffabd595c4c7d322279b3dd1e59ef359
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Logging/CodeTimer.php#L35-L43
200,967
OxfordInfoLabs/kinikit-core
src/Util/Logging/CodeTimer.php
CodeTimer.reportTimingsForGroup
public static function reportTimingsForGroup($group) { if (isset(CodeTimer::$groupTimings[$group])) { Logger::log('Group "' . $group . '" Executed in ' . CodeTimer::$groupTimings[$group] . " Seconds"); return CodeTimer::$groupTimings[$group]; } else { Logger::log('No ...
php
public static function reportTimingsForGroup($group) { if (isset(CodeTimer::$groupTimings[$group])) { Logger::log('Group "' . $group . '" Executed in ' . CodeTimer::$groupTimings[$group] . " Seconds"); return CodeTimer::$groupTimings[$group]; } else { Logger::log('No ...
[ "public", "static", "function", "reportTimingsForGroup", "(", "$", "group", ")", "{", "if", "(", "isset", "(", "CodeTimer", "::", "$", "groupTimings", "[", "$", "group", "]", ")", ")", "{", "Logger", "::", "log", "(", "'Group \"'", ".", "$", "group", "...
Report timings for a group @param $group
[ "Report", "timings", "for", "a", "group" ]
edc1b2e6ffabd595c4c7d322279b3dd1e59ef359
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Logging/CodeTimer.php#L51-L59
200,968
CroudTech/laravel-repositories
src/RepositoryGenerator.php
RepositoryGenerator.makeRepository
protected function makeRepository() { $full_path = $this->getFullRepositoryPath(); if (file_exists($full_path)) { throw new RepositoryExistsException(sprintf('%s file already exists', $full_path)); } $contract_contents = str_replace( [ '%%MODEL...
php
protected function makeRepository() { $full_path = $this->getFullRepositoryPath(); if (file_exists($full_path)) { throw new RepositoryExistsException(sprintf('%s file already exists', $full_path)); } $contract_contents = str_replace( [ '%%MODEL...
[ "protected", "function", "makeRepository", "(", ")", "{", "$", "full_path", "=", "$", "this", "->", "getFullRepositoryPath", "(", ")", ";", "if", "(", "file_exists", "(", "$", "full_path", ")", ")", "{", "throw", "new", "RepositoryExistsException", "(", "spr...
Make repository file @method makeRepository @return string The fully qualified contract name
[ "Make", "repository", "file" ]
3146285be911728fe7b00cf27d2494ad22b773dc
https://github.com/CroudTech/laravel-repositories/blob/3146285be911728fe7b00cf27d2494ad22b773dc/src/RepositoryGenerator.php#L95-L123
200,969
CroudTech/laravel-repositories
src/RepositoryGenerator.php
RepositoryGenerator.makeContract
protected function makeContract() { $full_path = $this->getFullContractPath(); if (file_exists($full_path)) { return true; } $contract_contents = str_replace( [ '%%MODEL_BASENAME%%', '%%MODEL_NAME%%', '%%CLASS_NA...
php
protected function makeContract() { $full_path = $this->getFullContractPath(); if (file_exists($full_path)) { return true; } $contract_contents = str_replace( [ '%%MODEL_BASENAME%%', '%%MODEL_NAME%%', '%%CLASS_NA...
[ "protected", "function", "makeContract", "(", ")", "{", "$", "full_path", "=", "$", "this", "->", "getFullContractPath", "(", ")", ";", "if", "(", "file_exists", "(", "$", "full_path", ")", ")", "{", "return", "true", ";", "}", "$", "contract_contents", ...
Make contract file @method makeContract @return string The fully qualified contract name
[ "Make", "contract", "file" ]
3146285be911728fe7b00cf27d2494ad22b773dc
https://github.com/CroudTech/laravel-repositories/blob/3146285be911728fe7b00cf27d2494ad22b773dc/src/RepositoryGenerator.php#L131-L156
200,970
p2made/yii2-p2y2-base
helpers/AssetsSettings.php
AssetsSettings.assetsSettings
public static function assetsSettings() { if(isset(self::$_assetsSettings)) { return self::$_assetsSettings; } return self::getSettingsBlock(self::BLOCK_NAME); }
php
public static function assetsSettings() { if(isset(self::$_assetsSettings)) { return self::$_assetsSettings; } return self::getSettingsBlock(self::BLOCK_NAME); }
[ "public", "static", "function", "assetsSettings", "(", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "_assetsSettings", ")", ")", "{", "return", "self", "::", "$", "_assetsSettings", ";", "}", "return", "self", "::", "getSettingsBlock", "(", "self"...
Get assets settings @return array | false @default false
[ "Get", "assets", "settings" ]
face3df8794407cdc8178ed64c06cc760c449de2
https://github.com/p2made/yii2-p2y2-base/blob/face3df8794407cdc8178ed64c06cc760c449de2/helpers/AssetsSettings.php#L62-L69
200,971
p2made/yii2-p2y2-base
helpers/AssetsSettings.php
AssetsSettings.assetsUseStatic
public static function assetsUseStatic() { if(isset(self::$_useStatic)) { return self::$_useStatic; } return self::getSettingsItem( self::$_useStatic, self::assetsSettings(), self::USE_STATIC, self::DEFAULT_USE_STATIC ); }
php
public static function assetsUseStatic() { if(isset(self::$_useStatic)) { return self::$_useStatic; } return self::getSettingsItem( self::$_useStatic, self::assetsSettings(), self::USE_STATIC, self::DEFAULT_USE_STATIC ); }
[ "public", "static", "function", "assetsUseStatic", "(", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "_useStatic", ")", ")", "{", "return", "self", "::", "$", "_useStatic", ";", "}", "return", "self", "::", "getSettingsItem", "(", "self", "::", ...
Get assetsUseStatic setting - use static resources @return boolean @default false
[ "Get", "assetsUseStatic", "setting", "-", "use", "static", "resources" ]
face3df8794407cdc8178ed64c06cc760c449de2
https://github.com/p2made/yii2-p2y2-base/blob/face3df8794407cdc8178ed64c06cc760c449de2/helpers/AssetsSettings.php#L76-L88
200,972
p2made/yii2-p2y2-base
helpers/AssetsSettings.php
AssetsSettings.assetsStaticEnd
public static function assetsStaticEnd() { if(isset(self::$_staticEnd)) { return self::$_staticEnd; } return self::getSettingsItem( self::$_staticEnd, self::assetsSettings(), self::STATIC_END, self::DEFAULT_STATIC_END ); }
php
public static function assetsStaticEnd() { if(isset(self::$_staticEnd)) { return self::$_staticEnd; } return self::getSettingsItem( self::$_staticEnd, self::assetsSettings(), self::STATIC_END, self::DEFAULT_STATIC_END ); }
[ "public", "static", "function", "assetsStaticEnd", "(", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "_staticEnd", ")", ")", "{", "return", "self", "::", "$", "_staticEnd", ";", "}", "return", "self", "::", "getSettingsItem", "(", "self", "::", ...
Get assetsStaticEnd setting - static application end @return array | false @default false
[ "Get", "assetsStaticEnd", "setting", "-", "static", "application", "end" ]
face3df8794407cdc8178ed64c06cc760c449de2
https://github.com/p2made/yii2-p2y2-base/blob/face3df8794407cdc8178ed64c06cc760c449de2/helpers/AssetsSettings.php#L95-L107
200,973
InnovaLangues/LexiconBundle
Entity/Lemma.php
Lemma.setCategory
public function setCategory(\Innova\LexiconBundle\Entity\Category $category = null) { $this->category = $category; return $this; }
php
public function setCategory(\Innova\LexiconBundle\Entity\Category $category = null) { $this->category = $category; return $this; }
[ "public", "function", "setCategory", "(", "\\", "Innova", "\\", "LexiconBundle", "\\", "Entity", "\\", "Category", "$", "category", "=", "null", ")", "{", "$", "this", "->", "category", "=", "$", "category", ";", "return", "$", "this", ";", "}" ]
Set category. @param \Innova\LexiconBundle\Entity\Category $category @return Lemma
[ "Set", "category", "." ]
38684b8a6c9f4636c7eb4d97f793844c2f703cb7
https://github.com/InnovaLangues/LexiconBundle/blob/38684b8a6c9f4636c7eb4d97f793844c2f703cb7/Entity/Lemma.php#L185-L190
200,974
InnovaLangues/LexiconBundle
Entity/Lemma.php
Lemma.setSubcategory
public function setSubcategory(\Innova\LexiconBundle\Entity\Subcategory $subcategory = null) { $this->subcategory = $subcategory; return $this; }
php
public function setSubcategory(\Innova\LexiconBundle\Entity\Subcategory $subcategory = null) { $this->subcategory = $subcategory; return $this; }
[ "public", "function", "setSubcategory", "(", "\\", "Innova", "\\", "LexiconBundle", "\\", "Entity", "\\", "Subcategory", "$", "subcategory", "=", "null", ")", "{", "$", "this", "->", "subcategory", "=", "$", "subcategory", ";", "return", "$", "this", ";", ...
Set subcategory. @param \Innova\LexiconBundle\Entity\Subcategory $subcategory @return Lemma
[ "Set", "subcategory", "." ]
38684b8a6c9f4636c7eb4d97f793844c2f703cb7
https://github.com/InnovaLangues/LexiconBundle/blob/38684b8a6c9f4636c7eb4d97f793844c2f703cb7/Entity/Lemma.php#L209-L214
200,975
wearenolte/wp-acf
src/Acf/Transforms/PostObject.php
PostObject.transform_sub_post_fields
public static function transform_sub_post_fields( &$field ) { if ( is_array( $field['value'] ) ) { $data = []; foreach ( $field['value'] as $post_id ) { $data[] = Acf::get_post_field( $post_id ); } $field['value'] = $data; } else { $field['value'] = Acf::get_post_field( $field['value'] ); } }
php
public static function transform_sub_post_fields( &$field ) { if ( is_array( $field['value'] ) ) { $data = []; foreach ( $field['value'] as $post_id ) { $data[] = Acf::get_post_field( $post_id ); } $field['value'] = $data; } else { $field['value'] = Acf::get_post_field( $field['value'] ); } }
[ "public", "static", "function", "transform_sub_post_fields", "(", "&", "$", "field", ")", "{", "if", "(", "is_array", "(", "$", "field", "[", "'value'", "]", ")", ")", "{", "$", "data", "=", "[", "]", ";", "foreach", "(", "$", "field", "[", "'value'"...
Transform to get the WP and ACF fields of the sub post. @param array $field The field. @return array
[ "Transform", "to", "get", "the", "WP", "and", "ACF", "fields", "of", "the", "sub", "post", "." ]
2f5093438d637fa0eca42ad6d10f6b433ec078b2
https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf/Transforms/PostObject.php#L31-L41
200,976
koolkode/k2
src/Kernel/Kernel.php
Kernel.createContainer
protected function createContainer(ContainerModuleLoader $loader, ScopeLoader $scopes) { $contextCachePath = $this->cacheDirectory . DIRECTORY_SEPARATOR . $this->contextName; $cacheFile = $contextCachePath . DIRECTORY_SEPARATOR . 'container.php'; $containerTypeName = __NAMESPACE__ . '\\CompiledContainer'; $...
php
protected function createContainer(ContainerModuleLoader $loader, ScopeLoader $scopes) { $contextCachePath = $this->cacheDirectory . DIRECTORY_SEPARATOR . $this->contextName; $cacheFile = $contextCachePath . DIRECTORY_SEPARATOR . 'container.php'; $containerTypeName = __NAMESPACE__ . '\\CompiledContainer'; $...
[ "protected", "function", "createContainer", "(", "ContainerModuleLoader", "$", "loader", ",", "ScopeLoader", "$", "scopes", ")", "{", "$", "contextCachePath", "=", "$", "this", "->", "cacheDirectory", ".", "DIRECTORY_SEPARATOR", ".", "$", "this", "->", "contextNam...
Create the DI container instance. @param ScopeLoader $scopes @return ContainerInterface
[ "Create", "the", "DI", "container", "instance", "." ]
c425a1bc7d2f8c567b1b0cc724ca9e8be7087397
https://github.com/koolkode/k2/blob/c425a1bc7d2f8c567b1b0cc724ca9e8be7087397/src/Kernel/Kernel.php#L486-L538
200,977
koolkode/k2
src/Kernel/Kernel.php
Kernel.createContainerBuilder
protected function createContainerBuilder() { $builder = new ContainerBuilder(); foreach($this->getContainerParams() as $k => $v) { $builder->setParameter($k, $v); } return $builder; }
php
protected function createContainerBuilder() { $builder = new ContainerBuilder(); foreach($this->getContainerParams() as $k => $v) { $builder->setParameter($k, $v); } return $builder; }
[ "protected", "function", "createContainerBuilder", "(", ")", "{", "$", "builder", "=", "new", "ContainerBuilder", "(", ")", ";", "foreach", "(", "$", "this", "->", "getContainerParams", "(", ")", "as", "$", "k", "=>", "$", "v", ")", "{", "$", "builder", ...
Create the DI container builder instance. @return ContainerBuilder
[ "Create", "the", "DI", "container", "builder", "instance", "." ]
c425a1bc7d2f8c567b1b0cc724ca9e8be7087397
https://github.com/koolkode/k2/blob/c425a1bc7d2f8c567b1b0cc724ca9e8be7087397/src/Kernel/Kernel.php#L545-L555
200,978
koolkode/k2
src/Kernel/Kernel.php
Kernel.setupInstrumentationProcessor
protected function setupInstrumentationProcessor() { $file = $this->cacheDirectory . '/' . $this->contextName . '/instrument.php'; if(is_file($file)) { $this->instrumentationProcessor = new InstrumentationProcessor($this, require $file); $this->instrumentationProcessor->registertAutoload(); } }
php
protected function setupInstrumentationProcessor() { $file = $this->cacheDirectory . '/' . $this->contextName . '/instrument.php'; if(is_file($file)) { $this->instrumentationProcessor = new InstrumentationProcessor($this, require $file); $this->instrumentationProcessor->registertAutoload(); } }
[ "protected", "function", "setupInstrumentationProcessor", "(", ")", "{", "$", "file", "=", "$", "this", "->", "cacheDirectory", ".", "'/'", ".", "$", "this", "->", "contextName", ".", "'/instrument.php'", ";", "if", "(", "is_file", "(", "$", "file", ")", "...
Setup an instrumentation processor that hooks into the autoloader.
[ "Setup", "an", "instrumentation", "processor", "that", "hooks", "into", "the", "autoloader", "." ]
c425a1bc7d2f8c567b1b0cc724ca9e8be7087397
https://github.com/koolkode/k2/blob/c425a1bc7d2f8c567b1b0cc724ca9e8be7087397/src/Kernel/Kernel.php#L560-L569
200,979
koolkode/k2
src/Kernel/Kernel.php
Kernel.bindInitialInstances
protected function bindInitialInstances(ContainerInterface $container) { foreach($this->komponents as $komponent) { $container->bindInstance(get_class($komponent), $komponent); } }
php
protected function bindInitialInstances(ContainerInterface $container) { foreach($this->komponents as $komponent) { $container->bindInstance(get_class($komponent), $komponent); } }
[ "protected", "function", "bindInitialInstances", "(", "ContainerInterface", "$", "container", ")", "{", "foreach", "(", "$", "this", "->", "komponents", "as", "$", "komponent", ")", "{", "$", "container", "->", "bindInstance", "(", "get_class", "(", "$", "komp...
Bind initial object instances to the DI container.
[ "Bind", "initial", "object", "instances", "to", "the", "DI", "container", "." ]
c425a1bc7d2f8c567b1b0cc724ca9e8be7087397
https://github.com/koolkode/k2/blob/c425a1bc7d2f8c567b1b0cc724ca9e8be7087397/src/Kernel/Kernel.php#L574-L580
200,980
ARCANESOFT/Backups
src/Services/BackupStatuses.php
BackupStatuses.runBackups
public static function runBackups($disk = null) { try { $backupJob = BackupJobFactory::createFromArray(config('laravel-backup')); if ( ! is_null($disk)) { $backupJob->onlyBackupTo($disk); } $backupJob->run(); } catch (\Excepti...
php
public static function runBackups($disk = null) { try { $backupJob = BackupJobFactory::createFromArray(config('laravel-backup')); if ( ! is_null($disk)) { $backupJob->onlyBackupTo($disk); } $backupJob->run(); } catch (\Excepti...
[ "public", "static", "function", "runBackups", "(", "$", "disk", "=", "null", ")", "{", "try", "{", "$", "backupJob", "=", "BackupJobFactory", "::", "createFromArray", "(", "config", "(", "'laravel-backup'", ")", ")", ";", "if", "(", "!", "is_null", "(", ...
Run the backups. @param string|null $disk @return bool
[ "Run", "the", "backups", "." ]
e191f0ccf55c7684173b82b7244fce9c0803bfe0
https://github.com/ARCANESOFT/Backups/blob/e191f0ccf55c7684173b82b7244fce9c0803bfe0/src/Services/BackupStatuses.php#L50-L66
200,981
ARCANESOFT/Backups
src/Services/BackupStatuses.php
BackupStatuses.clearBackups
public static function clearBackups() { try { $config = config('laravel-backup'); $backupDestinations = BackupDestinationFactory::createFromArray($config['backup']); $strategy = app($config['cleanup']['strategy']); $disableNotification = false; // TODO: Cre...
php
public static function clearBackups() { try { $config = config('laravel-backup'); $backupDestinations = BackupDestinationFactory::createFromArray($config['backup']); $strategy = app($config['cleanup']['strategy']); $disableNotification = false; // TODO: Cre...
[ "public", "static", "function", "clearBackups", "(", ")", "{", "try", "{", "$", "config", "=", "config", "(", "'laravel-backup'", ")", ";", "$", "backupDestinations", "=", "BackupDestinationFactory", "::", "createFromArray", "(", "$", "config", "[", "'backup'", ...
Clean the backups. @return bool
[ "Clean", "the", "backups", "." ]
e191f0ccf55c7684173b82b7244fce9c0803bfe0
https://github.com/ARCANESOFT/Backups/blob/e191f0ccf55c7684173b82b7244fce9c0803bfe0/src/Services/BackupStatuses.php#L73-L91
200,982
itkg/core
src/Itkg/Core/Cache/Adapter/Chain/UseAllStrategy.php
UseAllStrategy.get
public function get(array $adapters, CacheableInterface $item) { foreach ($adapters as $adapter) { if (false !== $value = $adapter->get($item)) { return $value; } } return false; }
php
public function get(array $adapters, CacheableInterface $item) { foreach ($adapters as $adapter) { if (false !== $value = $adapter->get($item)) { return $value; } } return false; }
[ "public", "function", "get", "(", "array", "$", "adapters", ",", "CacheableInterface", "$", "item", ")", "{", "foreach", "(", "$", "adapters", "as", "$", "adapter", ")", "{", "if", "(", "false", "!==", "$", "value", "=", "$", "adapter", "->", "get", ...
Get cache from any adapter if contains @param array $adapters @param CacheableInterface $item @throws UnhandledCacheException @return mixed
[ "Get", "cache", "from", "any", "adapter", "if", "contains" ]
e5e4efb05feb4d23b0df41f2b21fd095103e593b
https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Cache/Adapter/Chain/UseAllStrategy.php#L37-L47
200,983
itkg/core
src/Itkg/Core/Cache/Adapter/Chain/UseAllStrategy.php
UseAllStrategy.set
public function set(array $adapters, CacheableInterface $item) { foreach ($adapters as $adapter) { $adapter->set($item); } }
php
public function set(array $adapters, CacheableInterface $item) { foreach ($adapters as $adapter) { $adapter->set($item); } }
[ "public", "function", "set", "(", "array", "$", "adapters", ",", "CacheableInterface", "$", "item", ")", "{", "foreach", "(", "$", "adapters", "as", "$", "adapter", ")", "{", "$", "adapter", "->", "set", "(", "$", "item", ")", ";", "}", "}" ]
Set cache to all adapters @param array $adapters @param CacheableInterface $item @throws UnhandledCacheException @return void
[ "Set", "cache", "to", "all", "adapters" ]
e5e4efb05feb4d23b0df41f2b21fd095103e593b
https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Cache/Adapter/Chain/UseAllStrategy.php#L57-L62
200,984
modulusphp/http
Middleware/MustNotExceedAllowedRequests.php
MustNotExceedAllowedRequests.autoAssign
private function autoAssign($attributes = null) { if (!is_array($attributes)) return false; $this->max = isset($attributes[0]) ? $attributes[0] : $this->max; $this->minutes = isset($attributes[1]) ? $attributes[1] : 1; $this->decay = isset($attributes[1]) ? strtotime($attributes[1] . ' minutes'...
php
private function autoAssign($attributes = null) { if (!is_array($attributes)) return false; $this->max = isset($attributes[0]) ? $attributes[0] : $this->max; $this->minutes = isset($attributes[1]) ? $attributes[1] : 1; $this->decay = isset($attributes[1]) ? strtotime($attributes[1] . ' minutes'...
[ "private", "function", "autoAssign", "(", "$", "attributes", "=", "null", ")", "{", "if", "(", "!", "is_array", "(", "$", "attributes", ")", ")", "return", "false", ";", "$", "this", "->", "max", "=", "isset", "(", "$", "attributes", "[", "0", "]", ...
Set request attributes @param array|mixed|null $attributes @return void
[ "Set", "request", "attributes" ]
fc5c0f2b582a04de1685578d3fb790686a0a240c
https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Middleware/MustNotExceedAllowedRequests.php#L98-L107
200,985
modulusphp/http
Middleware/MustNotExceedAllowedRequests.php
MustNotExceedAllowedRequests.canProceed
private function canProceed($request) : bool { $time = $this->decay - date('s'); if ($request->cookies->has('clusters')) { $value = $request->cookie('clusters'); $value = $this->hashids->decode($value)[0] - 1; if ($value == 0) { $this->withHeaders($request, $value, $time); ...
php
private function canProceed($request) : bool { $time = $this->decay - date('s'); if ($request->cookies->has('clusters')) { $value = $request->cookie('clusters'); $value = $this->hashids->decode($value)[0] - 1; if ($value == 0) { $this->withHeaders($request, $value, $time); ...
[ "private", "function", "canProceed", "(", "$", "request", ")", ":", "bool", "{", "$", "time", "=", "$", "this", "->", "decay", "-", "date", "(", "'s'", ")", ";", "if", "(", "$", "request", "->", "cookies", "->", "has", "(", "'clusters'", ")", ")", ...
Check if request can proceed @param \Modulus\Http\Request $request @return bool
[ "Check", "if", "request", "can", "proceed" ]
fc5c0f2b582a04de1685578d3fb790686a0a240c
https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Middleware/MustNotExceedAllowedRequests.php#L115-L140
200,986
RichardTrujilloTorres/validators
src/Validators/Traits/ArrayTrait.php
ArrayTrait.inArray
public function inArray($values, $args, $do, $strict = false) { if (!is_callable($do)) { throw new \InvalidArgumentException('Third argument must be a callable'); } foreach ($values as $single) { $result = $do($single, $args); if ($strict && !$result) { ...
php
public function inArray($values, $args, $do, $strict = false) { if (!is_callable($do)) { throw new \InvalidArgumentException('Third argument must be a callable'); } foreach ($values as $single) { $result = $do($single, $args); if ($strict && !$result) { ...
[ "public", "function", "inArray", "(", "$", "values", ",", "$", "args", ",", "$", "do", ",", "$", "strict", "=", "false", ")", "{", "if", "(", "!", "is_callable", "(", "$", "do", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", ...
Performs an operation in a given array. It stops if 'strict' is set to true and the result of the operation is false. @param array $values The array @param mixed $args The arguments to pass to the operation @param callable $do The operation @return bool
[ "Performs", "an", "operation", "in", "a", "given", "array", ".", "It", "stops", "if", "strict", "is", "set", "to", "true", "and", "the", "result", "of", "the", "operation", "is", "false", "." ]
e29ff479d816c3f8a931bfbefedd0642dc50ea91
https://github.com/RichardTrujilloTorres/validators/blob/e29ff479d816c3f8a931bfbefedd0642dc50ea91/src/Validators/Traits/ArrayTrait.php#L24-L38
200,987
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Loader/Bridge/Form/Type/EntityCollectionType.php
EntityCollectionType.registerLoader
public function registerLoader($alias, $loader) { if ($this->hasLoader($alias)) { throw new \RuntimeException(sprintf('Alias "%s" already used by another form loader', $alias)); } $this->loaders[$alias] = $loader; }
php
public function registerLoader($alias, $loader) { if ($this->hasLoader($alias)) { throw new \RuntimeException(sprintf('Alias "%s" already used by another form loader', $alias)); } $this->loaders[$alias] = $loader; }
[ "public", "function", "registerLoader", "(", "$", "alias", ",", "$", "loader", ")", "{", "if", "(", "$", "this", "->", "hasLoader", "(", "$", "alias", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "sprintf", "(", "'Alias \"%s\" already used...
Register a loader. @param $alias @param $loader
[ "Register", "a", "loader", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Loader/Bridge/Form/Type/EntityCollectionType.php#L94-L101
200,988
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Loader/Bridge/Form/Type/EntityCollectionType.php
EntityCollectionType.getLoader
private function getLoader($alias) { if (!$this->hasLoader($alias)) { throw new \RuntimeException(sprintf('Form loader with alias "%s" not found.', $alias)); } return $this->loaders[$alias]; }
php
private function getLoader($alias) { if (!$this->hasLoader($alias)) { throw new \RuntimeException(sprintf('Form loader with alias "%s" not found.', $alias)); } return $this->loaders[$alias]; }
[ "private", "function", "getLoader", "(", "$", "alias", ")", "{", "if", "(", "!", "$", "this", "->", "hasLoader", "(", "$", "alias", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "sprintf", "(", "'Form loader with alias \"%s\" not found.'", ",...
Get a loader by his alias. @param $alias @return mixed
[ "Get", "a", "loader", "by", "his", "alias", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Loader/Bridge/Form/Type/EntityCollectionType.php#L122-L129
200,989
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Map/C2MTableMap.php
C2MTableMap.doInsert
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(C2MTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for ...
php
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(C2MTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for ...
[ "public", "static", "function", "doInsert", "(", "$", "criteria", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "if", "(", "null", "===", "$", "con", ")", "{", "$", "con", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "ge...
Performs an INSERT on the database, given a C2M or Criteria object. @param mixed $criteria Criteria or C2M object containing data that is used to create the INSERT statement. @param ConnectionInterface $con the ConnectionInterface connection to use @return mixed The new primary key. @throws Pro...
[ "Performs", "an", "INSERT", "on", "the", "database", "given", "a", "C2M", "or", "Criteria", "object", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Map/C2MTableMap.php#L464-L485
200,990
asaokamei/ScoreSql
src/Paginate/Pager.php
Pager.loadQuery
protected function loadQuery() { if( !isset( $this->session[ $this->saveID ] ) ) { return; } $saved = $this->session[ $this->saveID ]; $this->inputs = array_merge( $saved[ 'inputs' ], $this->inputs ); $this->perPage = $saved[ 'perPage' ]; if( $currP...
php
protected function loadQuery() { if( !isset( $this->session[ $this->saveID ] ) ) { return; } $saved = $this->session[ $this->saveID ]; $this->inputs = array_merge( $saved[ 'inputs' ], $this->inputs ); $this->perPage = $saved[ 'perPage' ]; if( $currP...
[ "protected", "function", "loadQuery", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "session", "[", "$", "this", "->", "saveID", "]", ")", ")", "{", "return", ";", "}", "$", "saved", "=", "$", "this", "->", "session", "[", "$", ...
loads query information from saved session.
[ "loads", "query", "information", "from", "saved", "session", "." ]
f1fce28476629e98b3c4c1216859c7f5309de7a1
https://github.com/asaokamei/ScoreSql/blob/f1fce28476629e98b3c4c1216859c7f5309de7a1/src/Paginate/Pager.php#L111-L124
200,991
asaokamei/ScoreSql
src/Paginate/Pager.php
Pager.saveQuery
protected function saveQuery() { $this->session[ $this->saveID ] = [ 'perPage' => $this->perPage, 'currPage' => $this->currPage, 'inputs' => $this->inputs, ]; }
php
protected function saveQuery() { $this->session[ $this->saveID ] = [ 'perPage' => $this->perPage, 'currPage' => $this->currPage, 'inputs' => $this->inputs, ]; }
[ "protected", "function", "saveQuery", "(", ")", "{", "$", "this", "->", "session", "[", "$", "this", "->", "saveID", "]", "=", "[", "'perPage'", "=>", "$", "this", "->", "perPage", ",", "'currPage'", "=>", "$", "this", "->", "currPage", ",", "'inputs'"...
saves query information into session.
[ "saves", "query", "information", "into", "session", "." ]
f1fce28476629e98b3c4c1216859c7f5309de7a1
https://github.com/asaokamei/ScoreSql/blob/f1fce28476629e98b3c4c1216859c7f5309de7a1/src/Paginate/Pager.php#L129-L136
200,992
sndsgd/form
src/form/field/ValueField.php
ValueField.setDefaultValue
public function setDefaultValue($defaultValue): FieldInterface { if (!is_scalar($defaultValue) && !is_null($defaultValue)) { throw new \InvalidArgumentException( "invalid value provided for 'defaultValue'; ". "expecting either a scalar or null value" )...
php
public function setDefaultValue($defaultValue): FieldInterface { if (!is_scalar($defaultValue) && !is_null($defaultValue)) { throw new \InvalidArgumentException( "invalid value provided for 'defaultValue'; ". "expecting either a scalar or null value" )...
[ "public", "function", "setDefaultValue", "(", "$", "defaultValue", ")", ":", "FieldInterface", "{", "if", "(", "!", "is_scalar", "(", "$", "defaultValue", ")", "&&", "!", "is_null", "(", "$", "defaultValue", ")", ")", "{", "throw", "new", "\\", "InvalidArg...
Set the default value for the field @param mixed $defaultValue A scalar value @return \sndsgd\form\field\ValueField @throws \InvalidArgumentException
[ "Set", "the", "default", "value", "for", "the", "field" ]
56b5b9572a8942aea34c97c7c838b871e198e34f
https://github.com/sndsgd/form/blob/56b5b9572a8942aea34c97c7c838b871e198e34f/src/form/field/ValueField.php#L38-L48
200,993
maddoger/yii2-cms-user
backend/controllers/UserController.php
UserController.actionProfile
public function actionProfile() { /** @var User $user */ $user = Yii::$app->getUser()->getIdentity(); $model = new MultiModel([ 'models' => [ 'user' => $user, 'profile' => $user->profile, ], ]); if ($model->load(Yii::$a...
php
public function actionProfile() { /** @var User $user */ $user = Yii::$app->getUser()->getIdentity(); $model = new MultiModel([ 'models' => [ 'user' => $user, 'profile' => $user->profile, ], ]); if ($model->load(Yii::$a...
[ "public", "function", "actionProfile", "(", ")", "{", "/** @var User $user */", "$", "user", "=", "Yii", "::", "$", "app", "->", "getUser", "(", ")", "->", "getIdentity", "(", ")", ";", "$", "model", "=", "new", "MultiModel", "(", "[", "'models'", "=>", ...
Updates own profile. If update is successful, the browser will be redirected to the 'view' page. @return mixed
[ "Updates", "own", "profile", ".", "If", "update", "is", "successful", "the", "browser", "will", "be", "redirected", "to", "the", "view", "page", "." ]
6792d1d0d2c0bf01fe87729985b5659de4c1aac1
https://github.com/maddoger/yii2-cms-user/blob/6792d1d0d2c0bf01fe87729985b5659de4c1aac1/backend/controllers/UserController.php#L179-L198
200,994
gplcart/cli
controllers/commands/ProductClass.php
ProductClass.cmdGetProductClass
public function cmdGetProductClass() { $result = $this->getListProductClass(); $this->outputFormat($result); $this->outputFormatTableProductClass($result); $this->output(); }
php
public function cmdGetProductClass() { $result = $this->getListProductClass(); $this->outputFormat($result); $this->outputFormatTableProductClass($result); $this->output(); }
[ "public", "function", "cmdGetProductClass", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListProductClass", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableProductClass", "(", ...
Callback for "product-class-get" command
[ "Callback", "for", "product", "-", "class", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ProductClass.php#L40-L46
200,995
gplcart/cli
controllers/commands/ProductClass.php
ProductClass.cmdDeleteProductClass
public function cmdDeleteProductClass() { $id = $this->getParam(0); $result = null; if (isset($id)) { if (empty($id) || !is_numeric($id)) { $this->errorAndExit($this->text('Invalid argument')); } $result = $this->product_class->delete($...
php
public function cmdDeleteProductClass() { $id = $this->getParam(0); $result = null; if (isset($id)) { if (empty($id) || !is_numeric($id)) { $this->errorAndExit($this->text('Invalid argument')); } $result = $this->product_class->delete($...
[ "public", "function", "cmdDeleteProductClass", "(", ")", "{", "$", "id", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "$", "result", "=", "null", ";", "if", "(", "isset", "(", "$", "id", ")", ")", "{", "if", "(", "empty", "(", "$", "...
Callback for "product-class-delete" command
[ "Callback", "for", "product", "-", "class", "-", "delete", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ProductClass.php#L51-L84
200,996
gplcart/cli
controllers/commands/ProductClass.php
ProductClass.cmdUpdateProductClass
public function cmdUpdateProductClass() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
php
public function cmdUpdateProductClass() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
[ "public", "function", "cmdUpdateProductClass", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{"...
Callback for "product-class-update" command
[ "Callback", "for", "product", "-", "class", "-", "update", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ProductClass.php#L103-L121
200,997
gplcart/cli
controllers/commands/ProductClass.php
ProductClass.addProductClass
protected function addProductClass() { if (!$this->isError()) { $id = $this->product_class->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
php
protected function addProductClass() { if (!$this->isError()) { $id = $this->product_class->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
[ "protected", "function", "addProductClass", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", ")", "{", "$", "id", "=", "$", "this", "->", "product_class", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", ";"...
Add a new product class
[ "Add", "a", "new", "product", "class" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ProductClass.php#L176-L185
200,998
gplcart/cli
controllers/commands/ProductClass.php
ProductClass.submitAddProductClass
protected function submitAddProductClass() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('product_class'); $this->addProductClass(); }
php
protected function submitAddProductClass() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('product_class'); $this->addProductClass(); }
[ "protected", "function", "submitAddProductClass", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "validateComponent", "(", "'product_class'", ")", ";", "$", "this", ...
Add a new product class at once
[ "Add", "a", "new", "product", "class", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ProductClass.php#L201-L206
200,999
gplcart/cli
controllers/commands/ProductClass.php
ProductClass.wizardAddProductClass
protected function wizardAddProductClass() { $this->validatePrompt('title', $this->text('Title'), 'product_class'); $this->validatePrompt('status', $this->text('Status'), 'product_class', 0); $this->validateComponent('product_class'); $this->addProductClass(); }
php
protected function wizardAddProductClass() { $this->validatePrompt('title', $this->text('Title'), 'product_class'); $this->validatePrompt('status', $this->text('Status'), 'product_class', 0); $this->validateComponent('product_class'); $this->addProductClass(); }
[ "protected", "function", "wizardAddProductClass", "(", ")", "{", "$", "this", "->", "validatePrompt", "(", "'title'", ",", "$", "this", "->", "text", "(", "'Title'", ")", ",", "'product_class'", ")", ";", "$", "this", "->", "validatePrompt", "(", "'status'",...
Add a new product class step by step
[ "Add", "a", "new", "product", "class", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/ProductClass.php#L211-L217