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
190,900
hasbridge/php-json-schema
src/Json/Validator.php
Validator.checkUniqueItems
protected function checkUniqueItems($entity, $schema, $entityName) { if (isset($schema->uniqueItems) && $schema->uniqueItems) { if (count(array_unique($entity)) != count($entity)) { throw new ValidationException(sprintf('All items in array [%s] must be unique', $entityName)); ...
php
protected function checkUniqueItems($entity, $schema, $entityName) { if (isset($schema->uniqueItems) && $schema->uniqueItems) { if (count(array_unique($entity)) != count($entity)) { throw new ValidationException(sprintf('All items in array [%s] must be unique', $entityName)); ...
[ "protected", "function", "checkUniqueItems", "(", "$", "entity", ",", "$", "schema", ",", "$", "entityName", ")", "{", "if", "(", "isset", "(", "$", "schema", "->", "uniqueItems", ")", "&&", "$", "schema", "->", "uniqueItems", ")", "{", "if", "(", "cou...
Check array unique items @param array $entity @param object $schema @param string $entityName @return Validator
[ "Check", "array", "unique", "items" ]
f12881be0739375994986e7a85896d0fa43e6c88
https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L600-L609
190,901
hasbridge/php-json-schema
src/Json/Validator.php
Validator.checkEnum
protected function checkEnum($entity, $schema, $entityName) { $valid = true; if (isset($schema->enum) && $schema->enum) { if (!is_array($schema->enum)) { throw new SchemaException(sprintf('Enum property must be an array for [%s]', $entityName)); } ...
php
protected function checkEnum($entity, $schema, $entityName) { $valid = true; if (isset($schema->enum) && $schema->enum) { if (!is_array($schema->enum)) { throw new SchemaException(sprintf('Enum property must be an array for [%s]', $entityName)); } ...
[ "protected", "function", "checkEnum", "(", "$", "entity", ",", "$", "schema", ",", "$", "entityName", ")", "{", "$", "valid", "=", "true", ";", "if", "(", "isset", "(", "$", "schema", "->", "enum", ")", "&&", "$", "schema", "->", "enum", ")", "{", ...
Check enum restriction @param array $entity @param object $schema @param string $entityName @return Validator
[ "Check", "enum", "restriction" ]
f12881be0739375994986e7a85896d0fa43e6c88
https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L620-L645
190,902
hasbridge/php-json-schema
src/Json/Validator.php
Validator.checkItems
protected function checkItems($entity, $schema, $entityName) { if (isset($schema->items) && $schema->items) { // Item restriction is an array of schemas if (is_array($schema->items)) { foreach($entity as $index => $node) { $nodeEntityName = $entity...
php
protected function checkItems($entity, $schema, $entityName) { if (isset($schema->items) && $schema->items) { // Item restriction is an array of schemas if (is_array($schema->items)) { foreach($entity as $index => $node) { $nodeEntityName = $entity...
[ "protected", "function", "checkItems", "(", "$", "entity", ",", "$", "schema", ",", "$", "entityName", ")", "{", "if", "(", "isset", "(", "$", "schema", "->", "items", ")", "&&", "$", "schema", "->", "items", ")", "{", "// Item restriction is an array of s...
Check items restriction @param array $entity @param object $schema @param string $entityName @return Validator
[ "Check", "items", "restriction" ]
f12881be0739375994986e7a85896d0fa43e6c88
https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L656-L698
190,903
hasbridge/php-json-schema
src/Json/Validator.php
Validator.checkDisallow
protected function checkDisallow($entity, $schema, $entityName) { if (isset($schema->disallow) && $schema->disallow) { $thisSchema = clone $schema; $thisSchema->type = $schema->disallow; unset($thisSchema->disallow); // We are expecting an exception - if one ...
php
protected function checkDisallow($entity, $schema, $entityName) { if (isset($schema->disallow) && $schema->disallow) { $thisSchema = clone $schema; $thisSchema->type = $schema->disallow; unset($thisSchema->disallow); // We are expecting an exception - if one ...
[ "protected", "function", "checkDisallow", "(", "$", "entity", ",", "$", "schema", ",", "$", "entityName", ")", "{", "if", "(", "isset", "(", "$", "schema", "->", "disallow", ")", "&&", "$", "schema", "->", "disallow", ")", "{", "$", "thisSchema", "=", ...
Check disallowed entity type @param mixed $entity @param object $schema @param string $entityName @return Validator
[ "Check", "disallowed", "entity", "type" ]
f12881be0739375994986e7a85896d0fa43e6c88
https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L709-L734
190,904
hasbridge/php-json-schema
src/Json/Validator.php
Validator.checkDivisibleBy
protected function checkDivisibleBy($entity, $schema, $entityName) { if (isset($schema->divisibleBy) && $schema->divisibleBy) { if (!is_numeric($schema->divisibleBy)) { throw new SchemaException(sprintf('Invalid divisibleBy value for [%s], must be numeric', $entityName)); ...
php
protected function checkDivisibleBy($entity, $schema, $entityName) { if (isset($schema->divisibleBy) && $schema->divisibleBy) { if (!is_numeric($schema->divisibleBy)) { throw new SchemaException(sprintf('Invalid divisibleBy value for [%s], must be numeric', $entityName)); ...
[ "protected", "function", "checkDivisibleBy", "(", "$", "entity", ",", "$", "schema", ",", "$", "entityName", ")", "{", "if", "(", "isset", "(", "$", "schema", "->", "divisibleBy", ")", "&&", "$", "schema", "->", "divisibleBy", ")", "{", "if", "(", "!",...
Check divisibleby restriction @param int|float $entity @param object $schema @param string $entityName @return Validator
[ "Check", "divisibleby", "restriction" ]
f12881be0739375994986e7a85896d0fa43e6c88
https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L745-L758
190,905
Cyvelnet/laravel5-fractal
src/Cyvelnet/Laravel5Fractal/FractalServices.php
FractalServices.addMeta
public function addMeta($key, $data = null) { if (is_array($key)) { $this->meta += $key; } else { $this->meta[$key] = $data; } return $this; }
php
public function addMeta($key, $data = null) { if (is_array($key)) { $this->meta += $key; } else { $this->meta[$key] = $data; } return $this; }
[ "public", "function", "addMeta", "(", "$", "key", ",", "$", "data", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "key", ")", ")", "{", "$", "this", "->", "meta", "+=", "$", "key", ";", "}", "else", "{", "$", "this", "->", "meta", "...
add additional meta data to transformed data. @param $key @param $data @return $this
[ "add", "additional", "meta", "data", "to", "transformed", "data", "." ]
05c91776557ba32f8b075279e084e743bf2fbcd0
https://github.com/Cyvelnet/laravel5-fractal/blob/05c91776557ba32f8b075279e084e743bf2fbcd0/src/Cyvelnet/Laravel5Fractal/FractalServices.php#L72-L81
190,906
Cyvelnet/laravel5-fractal
src/Cyvelnet/Laravel5Fractal/FractalServices.php
FractalServices.excludes
public function excludes($excludes) { if (is_string($excludes)) { $excludes = explode(',', $excludes); } // when autoload is enable, we need to merge user requested includes with the predefined includes. if ($this->autoload and $this->request->get($this->exclude_key)) { ...
php
public function excludes($excludes) { if (is_string($excludes)) { $excludes = explode(',', $excludes); } // when autoload is enable, we need to merge user requested includes with the predefined includes. if ($this->autoload and $this->request->get($this->exclude_key)) { ...
[ "public", "function", "excludes", "(", "$", "excludes", ")", "{", "if", "(", "is_string", "(", "$", "excludes", ")", ")", "{", "$", "excludes", "=", "explode", "(", "','", ",", "$", "excludes", ")", ";", "}", "// when autoload is enable, we need to merge use...
excludes sub level from data transformer. @param string|array $excludes @return $this
[ "excludes", "sub", "level", "from", "data", "transformer", "." ]
05c91776557ba32f8b075279e084e743bf2fbcd0
https://github.com/Cyvelnet/laravel5-fractal/blob/05c91776557ba32f8b075279e084e743bf2fbcd0/src/Cyvelnet/Laravel5Fractal/FractalServices.php#L122-L136
190,907
Cyvelnet/laravel5-fractal
src/Cyvelnet/Laravel5Fractal/FractalServices.php
FractalServices.includes
public function includes($includes) { if (is_string($includes)) { $includes = explode(',', $includes); } // when autoload is enable, we need to merge user requested includes with the predefined includes. if ($this->autoload and $this->request->get($this->input_key)) { ...
php
public function includes($includes) { if (is_string($includes)) { $includes = explode(',', $includes); } // when autoload is enable, we need to merge user requested includes with the predefined includes. if ($this->autoload and $this->request->get($this->input_key)) { ...
[ "public", "function", "includes", "(", "$", "includes", ")", "{", "if", "(", "is_string", "(", "$", "includes", ")", ")", "{", "$", "includes", "=", "explode", "(", "','", ",", "$", "includes", ")", ";", "}", "// when autoload is enable, we need to merge use...
includes sub level data transformer. @param string|array $includes @return $this
[ "includes", "sub", "level", "data", "transformer", "." ]
05c91776557ba32f8b075279e084e743bf2fbcd0
https://github.com/Cyvelnet/laravel5-fractal/blob/05c91776557ba32f8b075279e084e743bf2fbcd0/src/Cyvelnet/Laravel5Fractal/FractalServices.php#L169-L183
190,908
Cyvelnet/laravel5-fractal
src/Cyvelnet/Laravel5Fractal/FractalServices.php
FractalServices.scope
private function scope(ResourceInterface $resource) { return new ScopeDataAdapter($this->manager->parseFieldsets($this->fieldsets)->createData($resource)); }
php
private function scope(ResourceInterface $resource) { return new ScopeDataAdapter($this->manager->parseFieldsets($this->fieldsets)->createData($resource)); }
[ "private", "function", "scope", "(", "ResourceInterface", "$", "resource", ")", "{", "return", "new", "ScopeDataAdapter", "(", "$", "this", "->", "manager", "->", "parseFieldsets", "(", "$", "this", "->", "fieldsets", ")", "->", "createData", "(", "$", "reso...
return result scope. @param ResourceInterface $resource @return \Cyvelnet\Laravel5Fractal\Adapters\ScopeDataAdapter
[ "return", "result", "scope", "." ]
05c91776557ba32f8b075279e084e743bf2fbcd0
https://github.com/Cyvelnet/laravel5-fractal/blob/05c91776557ba32f8b075279e084e743bf2fbcd0/src/Cyvelnet/Laravel5Fractal/FractalServices.php#L247-L250
190,909
c006/yii2-migration-utility
controllers/DefaultController.php
OutputString.addStr
public function addStr($str) { $str = str_replace($this->tab, '', $str); $this->outputStringArray[] = str_repeat($this->tab, $this->tabLevel) . $str; }
php
public function addStr($str) { $str = str_replace($this->tab, '', $str); $this->outputStringArray[] = str_repeat($this->tab, $this->tabLevel) . $str; }
[ "public", "function", "addStr", "(", "$", "str", ")", "{", "$", "str", "=", "str_replace", "(", "$", "this", "->", "tab", ",", "''", ",", "$", "str", ")", ";", "$", "this", "->", "outputStringArray", "[", "]", "=", "str_repeat", "(", "$", "this", ...
Adds string to output string array with "tab" prefix @var string $str
[ "Adds", "string", "to", "output", "string", "array", "with", "tab", "prefix" ]
986cd6c069d3f6b674b92a9e360da7fce5439b5a
https://github.com/c006/yii2-migration-utility/blob/986cd6c069d3f6b674b92a9e360da7fce5439b5a/controllers/DefaultController.php#L317-L321
190,910
Cyvelnet/laravel5-fractal
src/Cyvelnet/Laravel5Fractal/Commands/Command.php
Command.getCasting
protected function getCasting($type) { if ($type instanceof \Doctrine\DBAL\Types\DecimalType or $type instanceof \Doctrine\DBAL\Types\FloatType ) { return 'double'; } else { if ($type instanceof \Doctrine\DBAL\Types\IntegerType or $type instanceof \Doctrin...
php
protected function getCasting($type) { if ($type instanceof \Doctrine\DBAL\Types\DecimalType or $type instanceof \Doctrine\DBAL\Types\FloatType ) { return 'double'; } else { if ($type instanceof \Doctrine\DBAL\Types\IntegerType or $type instanceof \Doctrin...
[ "protected", "function", "getCasting", "(", "$", "type", ")", "{", "if", "(", "$", "type", "instanceof", "\\", "Doctrine", "\\", "DBAL", "\\", "Types", "\\", "DecimalType", "or", "$", "type", "instanceof", "\\", "Doctrine", "\\", "DBAL", "\\", "Types", "...
get value cast type. @param $type @return null|string
[ "get", "value", "cast", "type", "." ]
05c91776557ba32f8b075279e084e743bf2fbcd0
https://github.com/Cyvelnet/laravel5-fractal/blob/05c91776557ba32f8b075279e084e743bf2fbcd0/src/Cyvelnet/Laravel5Fractal/Commands/Command.php#L155-L168
190,911
Cyvelnet/laravel5-fractal
src/Cyvelnet/Laravel5Fractal/Traits/Transformable.php
Transformable.transform
public function transform($data, $transformer = null, $resourceKey = null, PaginatorInterface $adapter = null) { if (!$transformer) { $transformer = $this->getTransformer(); } $fractal = $this->getService(); if ($this->isCollection($data)) { return $fractal-...
php
public function transform($data, $transformer = null, $resourceKey = null, PaginatorInterface $adapter = null) { if (!$transformer) { $transformer = $this->getTransformer(); } $fractal = $this->getService(); if ($this->isCollection($data)) { return $fractal-...
[ "public", "function", "transform", "(", "$", "data", ",", "$", "transformer", "=", "null", ",", "$", "resourceKey", "=", "null", ",", "PaginatorInterface", "$", "adapter", "=", "null", ")", "{", "if", "(", "!", "$", "transformer", ")", "{", "$", "trans...
transform data. @param $data @param null|mixed|\Callable $transformer @param null $resourceKey @param \League\Fractal\Pagination\PaginatorInterface|null $adapter @return \Cyvelnet\Laravel5Fra...
[ "transform", "data", "." ]
05c91776557ba32f8b075279e084e743bf2fbcd0
https://github.com/Cyvelnet/laravel5-fractal/blob/05c91776557ba32f8b075279e084e743bf2fbcd0/src/Cyvelnet/Laravel5Fractal/Traits/Transformable.php#L129-L142
190,912
Cyvelnet/laravel5-fractal
src/Cyvelnet/Laravel5Fractal/Traits/Transformable.php
Transformable.getTransformer
protected function getTransformer() { if (property_exists($this, $transformer = $this->getTransformerProperty())) { return app($this->{$transformer}); } return false; }
php
protected function getTransformer() { if (property_exists($this, $transformer = $this->getTransformerProperty())) { return app($this->{$transformer}); } return false; }
[ "protected", "function", "getTransformer", "(", ")", "{", "if", "(", "property_exists", "(", "$", "this", ",", "$", "transformer", "=", "$", "this", "->", "getTransformerProperty", "(", ")", ")", ")", "{", "return", "app", "(", "$", "this", "->", "{", ...
get transformer defined in class scope. @return mixed|bool
[ "get", "transformer", "defined", "in", "class", "scope", "." ]
05c91776557ba32f8b075279e084e743bf2fbcd0
https://github.com/Cyvelnet/laravel5-fractal/blob/05c91776557ba32f8b075279e084e743bf2fbcd0/src/Cyvelnet/Laravel5Fractal/Traits/Transformable.php#L173-L180
190,913
Cyvelnet/laravel5-fractal
src/Cyvelnet/Laravel5Fractal/Traits/Transformable.php
Transformable.isCollection
protected function isCollection($data) { if (is_array($data) || $data instanceof \Illuminate\Support\Collection || $data instanceof Paginator) { return true; } $length = count($this->getCollectionClass()); for ($i = 0; $i < $length; $i++) { $class = \Illumin...
php
protected function isCollection($data) { if (is_array($data) || $data instanceof \Illuminate\Support\Collection || $data instanceof Paginator) { return true; } $length = count($this->getCollectionClass()); for ($i = 0; $i < $length; $i++) { $class = \Illumin...
[ "protected", "function", "isCollection", "(", "$", "data", ")", "{", "if", "(", "is_array", "(", "$", "data", ")", "||", "$", "data", "instanceof", "\\", "Illuminate", "\\", "Support", "\\", "Collection", "||", "$", "data", "instanceof", "Paginator", ")", ...
determine if an object should be recognize as collection. @return bool
[ "determine", "if", "an", "object", "should", "be", "recognize", "as", "collection", "." ]
05c91776557ba32f8b075279e084e743bf2fbcd0
https://github.com/Cyvelnet/laravel5-fractal/blob/05c91776557ba32f8b075279e084e743bf2fbcd0/src/Cyvelnet/Laravel5Fractal/Traits/Transformable.php#L215-L232
190,914
bitrix-expert/tools
src/Loader.php
Loader.initialize
public static function initialize() { if (static::$isConfigurationLoaded === true) { return; } foreach (static::$handlers as $handler) { EventManager::getInstance()->addEventHandler($handler[0], $handler[1], $handler[2], $handler[3]); } stati...
php
public static function initialize() { if (static::$isConfigurationLoaded === true) { return; } foreach (static::$handlers as $handler) { EventManager::getInstance()->addEventHandler($handler[0], $handler[1], $handler[2], $handler[3]); } stati...
[ "public", "static", "function", "initialize", "(", ")", "{", "if", "(", "static", "::", "$", "isConfigurationLoaded", "===", "true", ")", "{", "return", ";", "}", "foreach", "(", "static", "::", "$", "handlers", "as", "$", "handler", ")", "{", "EventMana...
Initialize. Register handlers of the Bitrix events.
[ "Initialize", ".", "Register", "handlers", "of", "the", "Bitrix", "events", "." ]
93fe560e0eb08331935a19cb1c0440a50c296a07
https://github.com/bitrix-expert/tools/blob/93fe560e0eb08331935a19cb1c0440a50c296a07/src/Loader.php#L49-L60
190,915
mmghv/lumen-route-binding
src/BindingResolver.php
BindingResolver.resolveBindings
public function resolveBindings(array $vars) { // First check if the route $vars as a whole matches any registered composite binding if (count($vars) > 1 && !empty($this->compositeBindings)) { if ($r = $this->resolveCompositeBinding($vars)) { return $r; } ...
php
public function resolveBindings(array $vars) { // First check if the route $vars as a whole matches any registered composite binding if (count($vars) > 1 && !empty($this->compositeBindings)) { if ($r = $this->resolveCompositeBinding($vars)) { return $r; } ...
[ "public", "function", "resolveBindings", "(", "array", "$", "vars", ")", "{", "// First check if the route $vars as a whole matches any registered composite binding", "if", "(", "count", "(", "$", "vars", ")", ">", "1", "&&", "!", "empty", "(", "$", "this", "->", ...
Resolve bindings for route parameters @param array $vars route parameters @return array route parameters with bindings resolved
[ "Resolve", "bindings", "for", "route", "parameters" ]
c375be373dd0d5cda8d6b967b18ca8604519ae26
https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/BindingResolver.php#L58-L75
190,916
mmghv/lumen-route-binding
src/BindingResolver.php
BindingResolver.resolveCompositeBinding
protected function resolveCompositeBinding($vars) { $keys = array_keys($vars); foreach ($this->compositeBindings as $binding) { if ($keys === $binding[0]) { $binder = $binding[1]; $errorHandler = $binding[2]; $callable = $this->getBinding...
php
protected function resolveCompositeBinding($vars) { $keys = array_keys($vars); foreach ($this->compositeBindings as $binding) { if ($keys === $binding[0]) { $binder = $binding[1]; $errorHandler = $binding[2]; $callable = $this->getBinding...
[ "protected", "function", "resolveCompositeBinding", "(", "$", "vars", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "vars", ")", ";", "foreach", "(", "$", "this", "->", "compositeBindings", "as", "$", "binding", ")", "{", "if", "(", "$", "keys", ...
Check for and resolve the composite bindings if a match found @param array $vars the wildcards array @return array|null the wildcards array after been resolved, or NULL if no match found
[ "Check", "for", "and", "resolve", "the", "composite", "bindings", "if", "a", "match", "found" ]
c375be373dd0d5cda8d6b967b18ca8604519ae26
https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/BindingResolver.php#L84-L104
190,917
mmghv/lumen-route-binding
src/BindingResolver.php
BindingResolver.resolveBinding
protected function resolveBinding($key, $value) { // Explicit binding if (isset($this->bindings[$key])) { list($binder, $errorHandler) = $this->bindings[$key]; $callable = $this->getBindingCallable($binder, $value); return $this->callBindingCallable($callable, $...
php
protected function resolveBinding($key, $value) { // Explicit binding if (isset($this->bindings[$key])) { list($binder, $errorHandler) = $this->bindings[$key]; $callable = $this->getBindingCallable($binder, $value); return $this->callBindingCallable($callable, $...
[ "protected", "function", "resolveBinding", "(", "$", "key", ",", "$", "value", ")", "{", "// Explicit binding", "if", "(", "isset", "(", "$", "this", "->", "bindings", "[", "$", "key", "]", ")", ")", "{", "list", "(", "$", "binder", ",", "$", "errorH...
Resolve binding for the given wildcard @param string $key wildcard key @param string $value wildcard value @return mixed resolved binding
[ "Resolve", "binding", "for", "the", "given", "wildcard" ]
c375be373dd0d5cda8d6b967b18ca8604519ae26
https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/BindingResolver.php#L114-L149
190,918
mmghv/lumen-route-binding
src/BindingResolver.php
BindingResolver.getBindingCallable
protected function getBindingCallable($binder, $value) { // If $binder is a callable then use it, otherwise resolve the callable : if (is_callable($binder)) { return $binder; // If $binder is string (class name or Class@method) } elseif (is_string($binder)) { ...
php
protected function getBindingCallable($binder, $value) { // If $binder is a callable then use it, otherwise resolve the callable : if (is_callable($binder)) { return $binder; // If $binder is string (class name or Class@method) } elseif (is_string($binder)) { ...
[ "protected", "function", "getBindingCallable", "(", "$", "binder", ",", "$", "value", ")", "{", "// If $binder is a callable then use it, otherwise resolve the callable :", "if", "(", "is_callable", "(", "$", "binder", ")", ")", "{", "return", "$", "binder", ";", "/...
Get the callable for the binding @param mixed $binder @param string $value @return callable @throws Exception @throws InvalidArgumentException
[ "Get", "the", "callable", "for", "the", "binding" ]
c375be373dd0d5cda8d6b967b18ca8604519ae26
https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/BindingResolver.php#L162-L193
190,919
mmghv/lumen-route-binding
src/BindingResolver.php
BindingResolver.getDefaultBindingResolver
protected function getDefaultBindingResolver($instance, $value) { $instance = $instance->where($instance->getRouteKeyName(), $value); // Only the 'firstOrFail' is included in the binding callable to exclude the // exceptions of undefined methods (where, getRouteKeyName) from the errorHandle...
php
protected function getDefaultBindingResolver($instance, $value) { $instance = $instance->where($instance->getRouteKeyName(), $value); // Only the 'firstOrFail' is included in the binding callable to exclude the // exceptions of undefined methods (where, getRouteKeyName) from the errorHandle...
[ "protected", "function", "getDefaultBindingResolver", "(", "$", "instance", ",", "$", "value", ")", "{", "$", "instance", "=", "$", "instance", "->", "where", "(", "$", "instance", "->", "getRouteKeyName", "(", ")", ",", "$", "value", ")", ";", "// Only th...
Get the default binding resolver callable @param string $instance @param string $value @return \Closure
[ "Get", "the", "default", "binding", "resolver", "callable" ]
c375be373dd0d5cda8d6b967b18ca8604519ae26
https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/BindingResolver.php#L203-L212
190,920
mmghv/lumen-route-binding
src/BindingResolver.php
BindingResolver.implicitBind
public function implicitBind($namespace, $prefix = '', $suffix = '', $method = null, callable $errorHandler = null) { $this->implicitBindings[] = compact('namespace', 'prefix', 'suffix', 'method', 'errorHandler'); }
php
public function implicitBind($namespace, $prefix = '', $suffix = '', $method = null, callable $errorHandler = null) { $this->implicitBindings[] = compact('namespace', 'prefix', 'suffix', 'method', 'errorHandler'); }
[ "public", "function", "implicitBind", "(", "$", "namespace", ",", "$", "prefix", "=", "''", ",", "$", "suffix", "=", "''", ",", "$", "method", "=", "null", ",", "callable", "$", "errorHandler", "=", "null", ")", "{", "$", "this", "->", "implicitBinding...
Implicit bind all models in the given namespace @param string $namespace the namespace where classes are resolved @param string $prefix prefix to be added before class name @param string $suffix suffix to be added after class name @param null|string $method method na...
[ "Implicit", "bind", "all", "models", "in", "the", "given", "namespace" ]
c375be373dd0d5cda8d6b967b18ca8604519ae26
https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/BindingResolver.php#L304-L307
190,921
mmghv/lumen-route-binding
src/FastRouteDispatcher.php
FastRouteDispatcher.dispatch
public function dispatch($httpMethod, $uri) { // If routes resolver callback is set, call it to get the routes data if ($this->routesResolver) { list($this->staticRouteMap, $this->variableRouteData) = call_user_func($this->routesResolver); } // Pass the call to the paren...
php
public function dispatch($httpMethod, $uri) { // If routes resolver callback is set, call it to get the routes data if ($this->routesResolver) { list($this->staticRouteMap, $this->variableRouteData) = call_user_func($this->routesResolver); } // Pass the call to the paren...
[ "public", "function", "dispatch", "(", "$", "httpMethod", ",", "$", "uri", ")", "{", "// If routes resolver callback is set, call it to get the routes data", "if", "(", "$", "this", "->", "routesResolver", ")", "{", "list", "(", "$", "this", "->", "staticRouteMap", ...
Dispatch the request after getting the routes data if not set at the instantiation. @param string $httpMethod @param atring $uri @return integer
[ "Dispatch", "the", "request", "after", "getting", "the", "routes", "data", "if", "not", "set", "at", "the", "instantiation", "." ]
c375be373dd0d5cda8d6b967b18ca8604519ae26
https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/FastRouteDispatcher.php#L59-L68
190,922
mmghv/lumen-route-binding
src/FastRouteDispatcher.php
FastRouteDispatcher.dispatchVariableRoute
protected function dispatchVariableRoute($routeData, $uri) { $routeInfo = parent::dispatchVariableRoute($routeData, $uri); if ($this->bindingResolver && isset($routeInfo[2])) { $routeInfo[2] = $this->bindingResolver->resolveBindings($routeInfo[2]); } return $routeInfo; ...
php
protected function dispatchVariableRoute($routeData, $uri) { $routeInfo = parent::dispatchVariableRoute($routeData, $uri); if ($this->bindingResolver && isset($routeInfo[2])) { $routeInfo[2] = $this->bindingResolver->resolveBindings($routeInfo[2]); } return $routeInfo; ...
[ "protected", "function", "dispatchVariableRoute", "(", "$", "routeData", ",", "$", "uri", ")", "{", "$", "routeInfo", "=", "parent", "::", "dispatchVariableRoute", "(", "$", "routeData", ",", "$", "uri", ")", ";", "if", "(", "$", "this", "->", "bindingReso...
Dispatch the route and it's variables, then resolve the route bindings. @param array $routeData @param string $uri @return array
[ "Dispatch", "the", "route", "and", "it", "s", "variables", "then", "resolve", "the", "route", "bindings", "." ]
c375be373dd0d5cda8d6b967b18ca8604519ae26
https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/FastRouteDispatcher.php#L79-L88
190,923
bitrix-expert/tools
src/Iblock/IblockFinder.php
IblockFinder.runCacheCollector
public static function runCacheCollector($iblockType = null, $iblockCode = null) { if (!$iblockType || !$iblockCode) { $iblock = IblockTable::query() ->setFilter(['!CODE' => false]) ->setLimit(1) ->setSelect(['IBLOCK_TYPE_ID', 'CODE']) ...
php
public static function runCacheCollector($iblockType = null, $iblockCode = null) { if (!$iblockType || !$iblockCode) { $iblock = IblockTable::query() ->setFilter(['!CODE' => false]) ->setLimit(1) ->setSelect(['IBLOCK_TYPE_ID', 'CODE']) ...
[ "public", "static", "function", "runCacheCollector", "(", "$", "iblockType", "=", "null", ",", "$", "iblockCode", "=", "null", ")", "{", "if", "(", "!", "$", "iblockType", "||", "!", "$", "iblockCode", ")", "{", "$", "iblock", "=", "IblockTable", "::", ...
Preliminary collection of cache. @param string $iblockType Type of info block. @param string $iblockCode Code of info block.
[ "Preliminary", "collection", "of", "cache", "." ]
93fe560e0eb08331935a19cb1c0440a50c296a07
https://github.com/bitrix-expert/tools/blob/93fe560e0eb08331935a19cb1c0440a50c296a07/src/Iblock/IblockFinder.php#L149-L165
190,924
2amigos/yiiwheels
widgets/html5editor/WhHtml5Editor.php
WhHtml5Editor.normalizeStylesheetsProperty
private function normalizeStylesheetsProperty() { if (empty($this->pluginOptions['stylesheets'])) $this->pluginOptions['stylesheets'] = array(); else if (is_array($this->pluginOptions['stylesheets'])) $this->pluginOptions['stylesheets'] = array_filter($this->pluginOptions['st...
php
private function normalizeStylesheetsProperty() { if (empty($this->pluginOptions['stylesheets'])) $this->pluginOptions['stylesheets'] = array(); else if (is_array($this->pluginOptions['stylesheets'])) $this->pluginOptions['stylesheets'] = array_filter($this->pluginOptions['st...
[ "private", "function", "normalizeStylesheetsProperty", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "pluginOptions", "[", "'stylesheets'", "]", ")", ")", "$", "this", "->", "pluginOptions", "[", "'stylesheets'", "]", "=", "array", "(", ")", "...
Normalizes stylesheet property
[ "Normalizes", "stylesheet", "property" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/html5editor/WhHtml5Editor.php#L125-L135
190,925
johannesschobel/laravel-shoppingcart
src/JohannesSchobel/ShoppingCart/Traits/CanBePurchased.php
CanBePurchased.getBuyablePrice
public function getBuyablePrice($options = null) { if (property_exists($this, 'price')) return $this->price; if (property_exists($this, 'cost')) return $this->cost; if (property_exists($this, 'value')) return $this->value; return null; }
php
public function getBuyablePrice($options = null) { if (property_exists($this, 'price')) return $this->price; if (property_exists($this, 'cost')) return $this->cost; if (property_exists($this, 'value')) return $this->value; return null; }
[ "public", "function", "getBuyablePrice", "(", "$", "options", "=", "null", ")", "{", "if", "(", "property_exists", "(", "$", "this", ",", "'price'", ")", ")", "return", "$", "this", "->", "price", ";", "if", "(", "property_exists", "(", "$", "this", ",...
Get the price of the Buyable item. @return Money|null
[ "Get", "the", "price", "of", "the", "Buyable", "item", "." ]
ffa2a3530a5be1f793f5a783de30b31a8b7cab78
https://github.com/johannesschobel/laravel-shoppingcart/blob/ffa2a3530a5be1f793f5a783de30b31a8b7cab78/src/JohannesSchobel/ShoppingCart/Traits/CanBePurchased.php#L38-L45
190,926
2amigos/yiiwheels
widgets/formhelpers/WhTimePickerHelper.php
WhTimePickerHelper.registerClientScript
public function registerClientScript() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->getClientScript(); $cs->registerCssFile($assetsUrl ....
php
public function registerClientScript() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->getClientScript(); $cs->registerCssFile($assetsUrl ....
[ "public", "function", "registerClientScript", "(", ")", "{", "/* publish assets dir */", "$", "path", "=", "dirname", "(", "__FILE__", ")", ".", "DIRECTORY_SEPARATOR", ".", "'assets'", ";", "$", "assetsUrl", "=", "$", "this", "->", "getAssetsUrl", "(", "$", "p...
Registers client script
[ "Registers", "client", "script" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/formhelpers/WhTimePickerHelper.php#L112-L128
190,927
jpina/oci8
src/Oci8Connection.php
Oci8Connection.connect
protected function connect( $username, $password, $connectionString = null, $characterSet = null, $sessionMode = null ) { set_error_handler(static::getErrorHandler()); $connection = oci_new_connect($username, $password, $connectionString, $characterSet, $sessi...
php
protected function connect( $username, $password, $connectionString = null, $characterSet = null, $sessionMode = null ) { set_error_handler(static::getErrorHandler()); $connection = oci_new_connect($username, $password, $connectionString, $characterSet, $sessi...
[ "protected", "function", "connect", "(", "$", "username", ",", "$", "password", ",", "$", "connectionString", "=", "null", ",", "$", "characterSet", "=", "null", ",", "$", "sessionMode", "=", "null", ")", "{", "set_error_handler", "(", "static", "::", "get...
Connect to the Oracle server using a unique connection @param string $username @param string $password @param string $connectionString @param string $characterSet @param int $sessionMode @return resource @throws \Jpina\Oci8\Oci8Exception @see http://php.net/manual/en/function.oci-new-connect.php
[ "Connect", "to", "the", "Oracle", "server", "using", "a", "unique", "connection" ]
6d3c089386fcfa2b7e263ad03ec4bd9b2b58447c
https://github.com/jpina/oci8/blob/6d3c089386fcfa2b7e263ad03ec4bd9b2b58447c/src/Oci8Connection.php#L75-L86
190,928
2amigos/yiiwheels
widgets/switch/WhSwitch.php
WhSwitch.renderField
public function renderField() { list($name, $id) = $this->resolveNameID(); TbArray::defaultValue('id', $id, $this->htmlOptions); TbArray::defaultValue('name', $name, $this->htmlOptions); $this->pluginOptions['id'] = $this->htmlOptions['id'] . '_switch'; echo CHtml::openTag(...
php
public function renderField() { list($name, $id) = $this->resolveNameID(); TbArray::defaultValue('id', $id, $this->htmlOptions); TbArray::defaultValue('name', $name, $this->htmlOptions); $this->pluginOptions['id'] = $this->htmlOptions['id'] . '_switch'; echo CHtml::openTag(...
[ "public", "function", "renderField", "(", ")", "{", "list", "(", "$", "name", ",", "$", "id", ")", "=", "$", "this", "->", "resolveNameID", "(", ")", ";", "TbArray", "::", "defaultValue", "(", "'id'", ",", "$", "id", ",", "$", "this", "->", "htmlOp...
Renders the typeahead field
[ "Renders", "the", "typeahead", "field" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/switch/WhSwitch.php#L117-L136
190,929
2amigos/yiiwheels
widgets/switch/WhSwitch.php
WhSwitch.registerClientScript
public function registerClientScript() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->getClientScript(); $min = $this->debugMode ...
php
public function registerClientScript() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->getClientScript(); $min = $this->debugMode ...
[ "public", "function", "registerClientScript", "(", ")", "{", "/* publish assets dir */", "$", "path", "=", "dirname", "(", "__FILE__", ")", ".", "DIRECTORY_SEPARATOR", ".", "'assets'", ";", "$", "assetsUrl", "=", "$", "this", "->", "getAssetsUrl", "(", "$", "p...
Registers required client script for bootstrap typeahead. It is not used through bootstrap->registerPlugin in order to attach events if any
[ "Registers", "required", "client", "script", "for", "bootstrap", "typeahead", ".", "It", "is", "not", "used", "through", "bootstrap", "-", ">", "registerPlugin", "in", "order", "to", "attach", "events", "if", "any" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/switch/WhSwitch.php#L142-L164
190,930
2amigos/yiiwheels
widgets/grid/WhGridView.php
WhGridView.getColumnByName
public function getColumnByName($name) { foreach ($this->columns as $column) { if (strcmp($column->name, $name) === 0) { return $column; } } return null; }
php
public function getColumnByName($name) { foreach ($this->columns as $column) { if (strcmp($column->name, $name) === 0) { return $column; } } return null; }
[ "public", "function", "getColumnByName", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "columns", "as", "$", "column", ")", "{", "if", "(", "strcmp", "(", "$", "column", "->", "name", ",", "$", "name", ")", "===", "0", ")", "{", ...
Helper function to get a column by its name @param string $name @return CDataColumn|null
[ "Helper", "function", "to", "get", "a", "column", "by", "its", "name" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/grid/WhGridView.php#L395-L403
190,931
2amigos/yiiwheels
widgets/grid/WhGridView.php
WhGridView.parseColumnValue
protected function parseColumnValue($column, $row) { ob_start(); $column->renderDataCell($row); $value = ob_get_clean(); if ($column instanceof CDataColumn && array_key_exists($column->name, $this->extendedSummary['columns'])) { // lets get the configuration ...
php
protected function parseColumnValue($column, $row) { ob_start(); $column->renderDataCell($row); $value = ob_get_clean(); if ($column instanceof CDataColumn && array_key_exists($column->name, $this->extendedSummary['columns'])) { // lets get the configuration ...
[ "protected", "function", "parseColumnValue", "(", "$", "column", ",", "$", "row", ")", "{", "ob_start", "(", ")", ";", "$", "column", "->", "renderDataCell", "(", "$", "row", ")", ";", "$", "value", "=", "ob_get_clean", "(", ")", ";", "if", "(", "$",...
Parses the value of a column by an operation @param CDataColumn $column @param integer $row the current row number @return string
[ "Parses", "the", "value", "of", "a", "column", "by", "an", "operation" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/grid/WhGridView.php#L425-L442
190,932
2amigos/yiiwheels
widgets/fineuploader/WhFineUploader.php
WhFineUploader.renderTag
public function renderTag() { echo CHtml::tag($this->tagName, $this->htmlOptions, '<noscript>' . $this->noScriptText . '</noscript>', true); }
php
public function renderTag() { echo CHtml::tag($this->tagName, $this->htmlOptions, '<noscript>' . $this->noScriptText . '</noscript>', true); }
[ "public", "function", "renderTag", "(", ")", "{", "echo", "CHtml", "::", "tag", "(", "$", "this", "->", "tagName", ",", "$", "this", "->", "htmlOptions", ",", "'<noscript>'", ".", "$", "this", "->", "noScriptText", ".", "'</noscript>'", ",", "true", ")",...
Renders the tag where the button is going to be rendered
[ "Renders", "the", "tag", "where", "the", "button", "is", "going", "to", "be", "rendered" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/fineuploader/WhFineUploader.php#L83-L86
190,933
2amigos/yiiwheels
widgets/timeago/WhTimeAgoFormatter.php
WhTimeAgoFormatter.setLocale
private function setLocale($locale) { $path = __DIR__ . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'php' . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR . $locale . '.php'; if (!file_exists($path)) { $this->locale = 'en'; ...
php
private function setLocale($locale) { $path = __DIR__ . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'php' . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR . $locale . '.php'; if (!file_exists($path)) { $this->locale = 'en'; ...
[ "private", "function", "setLocale", "(", "$", "locale", ")", "{", "$", "path", "=", "__DIR__", ".", "DIRECTORY_SEPARATOR", ".", "'assets'", ".", "DIRECTORY_SEPARATOR", ".", "'php'", ".", "DIRECTORY_SEPARATOR", ".", "'locale'", ".", "DIRECTORY_SEPARATOR", ".", "$...
Includes file with locale-specific data array. When locale isnt exists used default 'en' locale @param string $locale locale name (like 'ru', 'en_short' etc.)
[ "Includes", "file", "with", "locale", "-", "specific", "data", "array", ".", "When", "locale", "isnt", "exists", "used", "default", "en", "locale" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/timeago/WhTimeAgoFormatter.php#L50-L65
190,934
2amigos/yiiwheels
widgets/timeago/WhTimeAgoFormatter.php
WhTimeAgoFormatter.formatTimeago
public function formatTimeago($value) { if ($value instanceof DateTime) { $value = date_timestamp_get($value); } else if (!is_numeric($value) && is_string($value)) { $value = strtotime($value); } return $this->inWords((time() - $value)); }
php
public function formatTimeago($value) { if ($value instanceof DateTime) { $value = date_timestamp_get($value); } else if (!is_numeric($value) && is_string($value)) { $value = strtotime($value); } return $this->inWords((time() - $value)); }
[ "public", "function", "formatTimeago", "(", "$", "value", ")", "{", "if", "(", "$", "value", "instanceof", "DateTime", ")", "{", "$", "value", "=", "date_timestamp_get", "(", "$", "value", ")", ";", "}", "else", "if", "(", "!", "is_numeric", "(", "$", ...
Formats value in timeago formatted string @param mixed $value timestamp, DateTime or date-formatted string @return string timeago formatted string
[ "Formats", "value", "in", "timeago", "formatted", "string" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/timeago/WhTimeAgoFormatter.php#L74-L84
190,935
2amigos/yiiwheels
widgets/timeago/WhTimeAgoFormatter.php
WhTimeAgoFormatter.inWords
public function inWords($seconds) { $prefix = $this->data['prefixAgo']; $suffix = $this->data['suffixAgo']; if ($this->allowFuture && $seconds < 0) { $prefix = $this->data['prefixFromNow']; $suffix = $this->data['suffixFromNow']; } $seconds = abs($sec...
php
public function inWords($seconds) { $prefix = $this->data['prefixAgo']; $suffix = $this->data['suffixAgo']; if ($this->allowFuture && $seconds < 0) { $prefix = $this->data['prefixFromNow']; $suffix = $this->data['suffixFromNow']; } $seconds = abs($sec...
[ "public", "function", "inWords", "(", "$", "seconds", ")", "{", "$", "prefix", "=", "$", "this", "->", "data", "[", "'prefixAgo'", "]", ";", "$", "suffix", "=", "$", "this", "->", "data", "[", "'suffixAgo'", "]", ";", "if", "(", "$", "this", "->", ...
Converts time delta to timeago formatted string @param integer $seconds time delta in seconds @return string timeago formatted string
[ "Converts", "time", "delta", "to", "timeago", "formatted", "string" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/timeago/WhTimeAgoFormatter.php#L93-L152
190,936
2amigos/yiiwheels
widgets/ace/WhAceEditor.php
WhAceEditor.registerClientScript
public function registerClientScript() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->getClientScript(); $cs->registerScriptFile($assetsUr...
php
public function registerClientScript() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->getClientScript(); $cs->registerScriptFile($assetsUr...
[ "public", "function", "registerClientScript", "(", ")", "{", "/* publish assets dir */", "$", "path", "=", "dirname", "(", "__FILE__", ")", ".", "DIRECTORY_SEPARATOR", ".", "'assets'", ";", "$", "assetsUrl", "=", "$", "this", "->", "getAssetsUrl", "(", "$", "p...
Registers required client script for bootstrap ace editor.
[ "Registers", "required", "client", "script", "for", "bootstrap", "ace", "editor", "." ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/ace/WhAceEditor.php#L107-L152
190,937
2amigos/yiiwheels
widgets/gallery/WhVideoCarousel.php
WhVideoCarousel.registerClientScript
public function registerClientScript() { $this->registerGalleryScriptFiles(); $items = CJavaScript::encode($this->items); $options = CJavaScript::encode($this->pluginOptions); $js = ";blueimp.Gallery({$items}, {$options});"; Yii::app()->clientScript->registerScript(__CLASS_...
php
public function registerClientScript() { $this->registerGalleryScriptFiles(); $items = CJavaScript::encode($this->items); $options = CJavaScript::encode($this->pluginOptions); $js = ";blueimp.Gallery({$items}, {$options});"; Yii::app()->clientScript->registerScript(__CLASS_...
[ "public", "function", "registerClientScript", "(", ")", "{", "$", "this", "->", "registerGalleryScriptFiles", "(", ")", ";", "$", "items", "=", "CJavaScript", "::", "encode", "(", "$", "this", "->", "items", ")", ";", "$", "options", "=", "CJavaScript", ":...
Registers the script
[ "Registers", "the", "script" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/gallery/WhVideoCarousel.php#L71-L80
190,938
2amigos/yiiwheels
widgets/daterangepicker/WhDateRangePicker.php
WhDateRangePicker.setDaysOfWeekNames
private function setDaysOfWeekNames() { if (empty($this->pluginOptions['locale']['daysOfWeek'])) { $this->pluginOptions['locale']['daysOfWeek'] = Yii::app()->locale->getWeekDayNames('narrow', true); } }
php
private function setDaysOfWeekNames() { if (empty($this->pluginOptions['locale']['daysOfWeek'])) { $this->pluginOptions['locale']['daysOfWeek'] = Yii::app()->locale->getWeekDayNames('narrow', true); } }
[ "private", "function", "setDaysOfWeekNames", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "pluginOptions", "[", "'locale'", "]", "[", "'daysOfWeek'", "]", ")", ")", "{", "$", "this", "->", "pluginOptions", "[", "'locale'", "]", "[", "'daysO...
Sets days of week names if no locale settings were made to the plugin options.
[ "Sets", "days", "of", "week", "names", "if", "no", "locale", "settings", "were", "made", "to", "the", "plugin", "options", "." ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/daterangepicker/WhDateRangePicker.php#L92-L97
190,939
2amigos/yiiwheels
widgets/editable/WhEditableDetailView.php
WhEditableDetailView.renderItem
protected function renderItem($options, $templateData) { //apply editable if not set 'editable' params or set and not false $apply = !empty($options['name']) && (!isset($options['editable']) || $options['editable'] !== false); if ($apply) { //ensure $options['editable'] is array...
php
protected function renderItem($options, $templateData) { //apply editable if not set 'editable' params or set and not false $apply = !empty($options['name']) && (!isset($options['editable']) || $options['editable'] !== false); if ($apply) { //ensure $options['editable'] is array...
[ "protected", "function", "renderItem", "(", "$", "options", ",", "$", "templateData", ")", "{", "//apply editable if not set 'editable' params or set and not false", "$", "apply", "=", "!", "empty", "(", "$", "options", "[", "'name'", "]", ")", "&&", "(", "!", "...
Renders an item @param array $options @param string $templateData
[ "Renders", "an", "item" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/editable/WhEditableDetailView.php#L62-L99
190,940
2amigos/yiiwheels
widgets/grid/actions/WhToggleAction.php
WhToggleAction.loadModel
protected function loadModel($id) { if (empty($this->additionalCriteriaOnLoadModel)) { $model = CActiveRecord::model($this->modelName)->findByPk($id); } else { $finder = CActiveRecord::model($this->modelName); $c = new CDbCriteria($this->additionalCriteriaOnLoadMo...
php
protected function loadModel($id) { if (empty($this->additionalCriteriaOnLoadModel)) { $model = CActiveRecord::model($this->modelName)->findByPk($id); } else { $finder = CActiveRecord::model($this->modelName); $c = new CDbCriteria($this->additionalCriteriaOnLoadMo...
[ "protected", "function", "loadModel", "(", "$", "id", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "additionalCriteriaOnLoadModel", ")", ")", "{", "$", "model", "=", "CActiveRecord", "::", "model", "(", "$", "this", "->", "modelName", ")", "->",...
Loads the requested data model. @param integer $id the model ID @return CActiveRecord the model instance. @throws CHttpException if the model cannot be found
[ "Loads", "the", "requested", "data", "model", "." ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/grid/actions/WhToggleAction.php#L95-L116
190,941
johannesschobel/laravel-shoppingcart
src/JohannesSchobel/ShoppingCart/Models/CartItem.php
CartItem.getTax
public function getTax() { $rate = $this->taxRate / 100; $value = $this->price->multiply($rate); return $value; }
php
public function getTax() { $rate = $this->taxRate / 100; $value = $this->price->multiply($rate); return $value; }
[ "public", "function", "getTax", "(", ")", "{", "$", "rate", "=", "$", "this", "->", "taxRate", "/", "100", ";", "$", "value", "=", "$", "this", "->", "price", "->", "multiply", "(", "$", "rate", ")", ";", "return", "$", "value", ";", "}" ]
Returns the tax for one single item. @return Money
[ "Returns", "the", "tax", "for", "one", "single", "item", "." ]
ffa2a3530a5be1f793f5a783de30b31a8b7cab78
https://github.com/johannesschobel/laravel-shoppingcart/blob/ffa2a3530a5be1f793f5a783de30b31a8b7cab78/src/JohannesSchobel/ShoppingCart/Models/CartItem.php#L176-L181
190,942
johannesschobel/laravel-shoppingcart
src/JohannesSchobel/ShoppingCart/Models/CartItem.php
CartItem.setTaxRate
public function setTaxRate($taxRate) { if (empty($taxRate) || ! is_numeric($taxRate)) { throw new \InvalidArgumentException('Please supply a valid tax rate.'); } $this->taxRate = $taxRate; return $this; }
php
public function setTaxRate($taxRate) { if (empty($taxRate) || ! is_numeric($taxRate)) { throw new \InvalidArgumentException('Please supply a valid tax rate.'); } $this->taxRate = $taxRate; return $this; }
[ "public", "function", "setTaxRate", "(", "$", "taxRate", ")", "{", "if", "(", "empty", "(", "$", "taxRate", ")", "||", "!", "is_numeric", "(", "$", "taxRate", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Please supply a valid tax r...
Set the tax rate. @param int $taxRate @return CartItem @throws \InvalidArgumentException
[ "Set", "the", "tax", "rate", "." ]
ffa2a3530a5be1f793f5a783de30b31a8b7cab78
https://github.com/johannesschobel/laravel-shoppingcart/blob/ffa2a3530a5be1f793f5a783de30b31a8b7cab78/src/JohannesSchobel/ShoppingCart/Models/CartItem.php#L285-L294
190,943
2amigos/yiiwheels
behaviors/WhPlugin.php
WhPlugin.getYiiWheels
public function getYiiWheels() { if (self::$_wheels === null) { self::$_wheels = Yii::app()->getComponent('yiiwheels'); } return self::$_wheels; }
php
public function getYiiWheels() { if (self::$_wheels === null) { self::$_wheels = Yii::app()->getComponent('yiiwheels'); } return self::$_wheels; }
[ "public", "function", "getYiiWheels", "(", ")", "{", "if", "(", "self", "::", "$", "_wheels", "===", "null", ")", "{", "self", "::", "$", "_wheels", "=", "Yii", "::", "app", "(", ")", "->", "getComponent", "(", "'yiiwheels'", ")", ";", "}", "return",...
Returns the main component @return YiiWheels
[ "Returns", "the", "main", "component" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/behaviors/WhPlugin.php#L59-L65
190,944
2amigos/yiiwheels
widgets/rangeslider/WhRangeSlider.php
WhRangeSlider.renderField
public function renderField() { list($name, $id) = $this->resolveNameID(); if ($this->hasModel()) { echo CHtml::activeHiddenField($this->model, $this->attribute, $this->htmlOptions); } else { echo CHtml::hiddenField($name, $this->value, $this->htmlOptions); }...
php
public function renderField() { list($name, $id) = $this->resolveNameID(); if ($this->hasModel()) { echo CHtml::activeHiddenField($this->model, $this->attribute, $this->htmlOptions); } else { echo CHtml::hiddenField($name, $this->value, $this->htmlOptions); }...
[ "public", "function", "renderField", "(", ")", "{", "list", "(", "$", "name", ",", "$", "id", ")", "=", "$", "this", "->", "resolveNameID", "(", ")", ";", "if", "(", "$", "this", "->", "hasModel", "(", ")", ")", "{", "echo", "CHtml", "::", "activ...
Renders field and tag
[ "Renders", "field", "and", "tag" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/rangeslider/WhRangeSlider.php#L265-L276
190,945
2amigos/yiiwheels
widgets/rangeslider/WhRangeSlider.php
WhRangeSlider.registerClientScript
public function registerClientScript() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); $id = TbArray::getValue('id', $this->htmlOptions, $this->getId()); $jsFile = !empty($this->scales) ...
php
public function registerClientScript() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); $id = TbArray::getValue('id', $this->htmlOptions, $this->getId()); $jsFile = !empty($this->scales) ...
[ "public", "function", "registerClientScript", "(", ")", "{", "/* publish assets dir */", "$", "path", "=", "dirname", "(", "__FILE__", ")", ".", "DIRECTORY_SEPARATOR", ".", "'assets'", ";", "$", "assetsUrl", "=", "$", "this", "->", "getAssetsUrl", "(", "$", "p...
Registers required files and initialization script
[ "Registers", "required", "files", "and", "initialization", "script" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/rangeslider/WhRangeSlider.php#L281-L327
190,946
2amigos/yiiwheels
widgets/rangeslider/WhRangeSlider.php
WhRangeSlider.buildOptions
protected function buildOptions() { $options = array( 'arrows' => $this->arrows, 'delayOut' => $this->delayOut, 'durationIn' => $this->durationIn, 'durationOut' => $this->durationOut, 'valueLabels' => $this->valueLabels, 'formatter' => ...
php
protected function buildOptions() { $options = array( 'arrows' => $this->arrows, 'delayOut' => $this->delayOut, 'durationIn' => $this->durationIn, 'durationOut' => $this->durationOut, 'valueLabels' => $this->valueLabels, 'formatter' => ...
[ "protected", "function", "buildOptions", "(", ")", "{", "$", "options", "=", "array", "(", "'arrows'", "=>", "$", "this", "->", "arrows", ",", "'delayOut'", "=>", "$", "this", "->", "delayOut", ",", "'durationIn'", "=>", "$", "this", "->", "durationIn", ...
Builds the options
[ "Builds", "the", "options" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/rangeslider/WhRangeSlider.php#L332-L371
190,947
2amigos/yiiwheels
widgets/rangeslider/WhRangeSlider.php
WhRangeSlider.checkOptionAttribute
protected function checkOptionAttribute($attribute, $availableOptions, $name) { if (!in_array($attribute, $availableOptions)) { throw new CException(Yii::t( 'zii', 'Unsupported "{attribute}" setting.', array('{attribute}' => $name) )); ...
php
protected function checkOptionAttribute($attribute, $availableOptions, $name) { if (!in_array($attribute, $availableOptions)) { throw new CException(Yii::t( 'zii', 'Unsupported "{attribute}" setting.', array('{attribute}' => $name) )); ...
[ "protected", "function", "checkOptionAttribute", "(", "$", "attribute", ",", "$", "availableOptions", ",", "$", "name", ")", "{", "if", "(", "!", "in_array", "(", "$", "attribute", ",", "$", "availableOptions", ")", ")", "{", "throw", "new", "CException", ...
Checks whether the option set is supported by the plugin @param mixed $attribute attribute @param array $availableOptions the possible values @param string $name the name of the attribute @throws CException
[ "Checks", "whether", "the", "option", "set", "is", "supported", "by", "the", "plugin" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/rangeslider/WhRangeSlider.php#L382-L391
190,948
2amigos/yiiwheels
widgets/select2/WhSelect2.php
WhSelect2.renderField
public function renderField() { list($name, $id) = $this->resolveNameID(); TbArray::defaultValue('id', $id, $this->htmlOptions); TbArray::defaultValue('name', $name, $this->htmlOptions); if ($this->hasModel()) { echo $this->asDropDownList ? TbHtml::activ...
php
public function renderField() { list($name, $id) = $this->resolveNameID(); TbArray::defaultValue('id', $id, $this->htmlOptions); TbArray::defaultValue('name', $name, $this->htmlOptions); if ($this->hasModel()) { echo $this->asDropDownList ? TbHtml::activ...
[ "public", "function", "renderField", "(", ")", "{", "list", "(", "$", "name", ",", "$", "id", ")", "=", "$", "this", "->", "resolveNameID", "(", ")", ";", "TbArray", "::", "defaultValue", "(", "'id'", ",", "$", "id", ",", "$", "this", "->", "htmlOp...
Renders the select2 field
[ "Renders", "the", "select2", "field" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/select2/WhSelect2.php#L69-L86
190,949
jpina/oci8
src/Oci8PersistentConnection.php
Oci8PersistentConnection.connect
protected function connect( $username, $password, $connectionString = null, $characterSet = null, $sessionMode = null ) { set_error_handler($this->getErrorHandler()); $connection = oci_pconnect($username, $password, $connectionString, $characterSet, $sessionMo...
php
protected function connect( $username, $password, $connectionString = null, $characterSet = null, $sessionMode = null ) { set_error_handler($this->getErrorHandler()); $connection = oci_pconnect($username, $password, $connectionString, $characterSet, $sessionMo...
[ "protected", "function", "connect", "(", "$", "username", ",", "$", "password", ",", "$", "connectionString", "=", "null", ",", "$", "characterSet", "=", "null", ",", "$", "sessionMode", "=", "null", ")", "{", "set_error_handler", "(", "$", "this", "->", ...
Connect to an Oracle database using a persistent connection New instances of this class will use the same connection across multiple requests. @param string $username @param string $password @param string $connectionString @param string $characterSet @param int $sessionMode @return resource @see http://php.net/manual...
[ "Connect", "to", "an", "Oracle", "database", "using", "a", "persistent", "connection" ]
6d3c089386fcfa2b7e263ad03ec4bd9b2b58447c
https://github.com/jpina/oci8/blob/6d3c089386fcfa2b7e263ad03ec4bd9b2b58447c/src/Oci8PersistentConnection.php#L25-L36
190,950
2amigos/yiiwheels
widgets/multiselect/WhMultiSelect.php
WhMultiSelect.renderField
public function renderField() { list($name, $id) = $this->resolveNameID(); TbArray::defaultValue('id', $id, $this->htmlOptions); TbArray::defaultValue('name', $name, $this->htmlOptions); // fixes #32: 'multiple' will be forced later in jQuery plugin $this->htmlOptions['mult...
php
public function renderField() { list($name, $id) = $this->resolveNameID(); TbArray::defaultValue('id', $id, $this->htmlOptions); TbArray::defaultValue('name', $name, $this->htmlOptions); // fixes #32: 'multiple' will be forced later in jQuery plugin $this->htmlOptions['mult...
[ "public", "function", "renderField", "(", ")", "{", "list", "(", "$", "name", ",", "$", "id", ")", "=", "$", "this", "->", "resolveNameID", "(", ")", ";", "TbArray", "::", "defaultValue", "(", "'id'", ",", "$", "id", ",", "$", "this", "->", "htmlOp...
Renders the multiselect field
[ "Renders", "the", "multiselect", "field" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/multiselect/WhMultiSelect.php#L61-L76
190,951
johannesschobel/laravel-shoppingcart
src/JohannesSchobel/ShoppingCart/Traits/FormatsMoneyTrait.php
FormatsMoneyTrait.formatMoney
public function formatMoney(Money $value) { $currencies = new ISOCurrencies(); $moneyFormatter = new DecimalMoneyFormatter($currencies); return $moneyFormatter->format($value); }
php
public function formatMoney(Money $value) { $currencies = new ISOCurrencies(); $moneyFormatter = new DecimalMoneyFormatter($currencies); return $moneyFormatter->format($value); }
[ "public", "function", "formatMoney", "(", "Money", "$", "value", ")", "{", "$", "currencies", "=", "new", "ISOCurrencies", "(", ")", ";", "$", "moneyFormatter", "=", "new", "DecimalMoneyFormatter", "(", "$", "currencies", ")", ";", "return", "$", "moneyForma...
Format a money string @param Money $value @return string
[ "Format", "a", "money", "string" ]
ffa2a3530a5be1f793f5a783de30b31a8b7cab78
https://github.com/johannesschobel/laravel-shoppingcart/blob/ffa2a3530a5be1f793f5a783de30b31a8b7cab78/src/JohannesSchobel/ShoppingCart/Traits/FormatsMoneyTrait.php#L18-L24
190,952
2amigos/yiiwheels
widgets/gallery/WhGallery.php
WhGallery.renderTemplate
public function renderTemplate() { $options = array( 'id' => $this->htmlOptions['id'] . '-gallery', 'class' => 'blueimp-gallery' ); if ($this->displayControls) { TbHtml::addCssClass('blueimp-gallery-controls', $options); } echo CHtml::openT...
php
public function renderTemplate() { $options = array( 'id' => $this->htmlOptions['id'] . '-gallery', 'class' => 'blueimp-gallery' ); if ($this->displayControls) { TbHtml::addCssClass('blueimp-gallery-controls', $options); } echo CHtml::openT...
[ "public", "function", "renderTemplate", "(", ")", "{", "$", "options", "=", "array", "(", "'id'", "=>", "$", "this", "->", "htmlOptions", "[", "'id'", "]", ".", "'-gallery'", ",", "'class'", "=>", "'blueimp-gallery'", ")", ";", "if", "(", "$", "this", ...
Renders gallery template
[ "Renders", "gallery", "template" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/gallery/WhGallery.php#L99-L117
190,953
2amigos/yiiwheels
widgets/gallery/WhGallery.php
WhGallery.registerGalleryScriptFiles
public function registerGalleryScriptFiles() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->getClientScript(); $cs->registerScriptFile($as...
php
public function registerGalleryScriptFiles() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->getClientScript(); $cs->registerScriptFile($as...
[ "public", "function", "registerGalleryScriptFiles", "(", ")", "{", "/* publish assets dir */", "$", "path", "=", "dirname", "(", "__FILE__", ")", ".", "DIRECTORY_SEPARATOR", ".", "'assets'", ";", "$", "assetsUrl", "=", "$", "this", "->", "getAssetsUrl", "(", "$"...
Registers gallery script files
[ "Registers", "gallery", "script", "files" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/gallery/WhGallery.php#L122-L134
190,954
2amigos/yiiwheels
widgets/maskinput/WhMaskInput.php
WhMaskInput.registerClientScript
public function registerClientScript() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->getClientScript(); $cs->registerScriptFile($assetsUr...
php
public function registerClientScript() { /* publish assets dir */ $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->getClientScript(); $cs->registerScriptFile($assetsUr...
[ "public", "function", "registerClientScript", "(", ")", "{", "/* publish assets dir */", "$", "path", "=", "dirname", "(", "__FILE__", ")", ".", "DIRECTORY_SEPARATOR", ".", "'assets'", ";", "$", "assetsUrl", "=", "$", "this", "->", "getAssetsUrl", "(", "$", "p...
Registers required client script for jquery mask plugin. It doesn't use bootstrap->registerPlugin.
[ "Registers", "required", "client", "script", "for", "jquery", "mask", "plugin", ".", "It", "doesn", "t", "use", "bootstrap", "-", ">", "registerPlugin", "." ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/maskinput/WhMaskInput.php#L69-L86
190,955
2amigos/yiiwheels
widgets/grid/WhToggleColumn.php
WhToggleColumn.getButtonLabel
private function getButtonLabel($value) { return $value === null ? $this->emptyButtonLabel : ($value ? $this->checkedButtonLabel : $this->uncheckedButtonLabel); }
php
private function getButtonLabel($value) { return $value === null ? $this->emptyButtonLabel : ($value ? $this->checkedButtonLabel : $this->uncheckedButtonLabel); }
[ "private", "function", "getButtonLabel", "(", "$", "value", ")", "{", "return", "$", "value", "===", "null", "?", "$", "this", "->", "emptyButtonLabel", ":", "(", "$", "value", "?", "$", "this", "->", "checkedButtonLabel", ":", "$", "this", "->", "unchec...
Returns the button label @param $value @return string
[ "Returns", "the", "button", "label" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/grid/WhToggleColumn.php#L262-L265
190,956
2amigos/yiiwheels
YiiWheels.php
YiiWheels.getAssetsUrl
public function getAssetsUrl() { if (isset($this->_assetsUrl)) { return $this->_assetsUrl; } else { $forceCopyAssets = $this->getApi()->forceCopyAssets; $path = Yii::getPathOfAlias('yiiwheels'); $assetsUrl = Yii::app()->assetManager->publish( ...
php
public function getAssetsUrl() { if (isset($this->_assetsUrl)) { return $this->_assetsUrl; } else { $forceCopyAssets = $this->getApi()->forceCopyAssets; $path = Yii::getPathOfAlias('yiiwheels'); $assetsUrl = Yii::app()->assetManager->publish( ...
[ "public", "function", "getAssetsUrl", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_assetsUrl", ")", ")", "{", "return", "$", "this", "->", "_assetsUrl", ";", "}", "else", "{", "$", "forceCopyAssets", "=", "$", "this", "->", "getApi", ...
Returns the assets URL. Assets folder has few orphan and very useful utility libraries. @return string
[ "Returns", "the", "assets", "URL", ".", "Assets", "folder", "has", "few", "orphan", "and", "very", "useful", "utility", "libraries", "." ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/YiiWheels.php#L84-L100
190,957
2amigos/yiiwheels
YiiWheels.php
YiiWheels.registerAssetJs
public function registerAssetJs($jsFile, $position = CClientScript::POS_END) { Yii::app()->getClientScript()->registerScriptFile($this->getAssetsUrl() . "/js/{$jsFile}", $position); return $this; }
php
public function registerAssetJs($jsFile, $position = CClientScript::POS_END) { Yii::app()->getClientScript()->registerScriptFile($this->getAssetsUrl() . "/js/{$jsFile}", $position); return $this; }
[ "public", "function", "registerAssetJs", "(", "$", "jsFile", ",", "$", "position", "=", "CClientScript", "::", "POS_END", ")", "{", "Yii", "::", "app", "(", ")", "->", "getClientScript", "(", ")", "->", "registerScriptFile", "(", "$", "this", "->", "getAss...
Register a specific js file in the asset's js folder @param string $jsFile @param int $position the position of the JavaScript code. @see CClientScript::registerScriptFile @return $this
[ "Register", "a", "specific", "js", "file", "in", "the", "asset", "s", "js", "folder" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/YiiWheels.php#L111-L115
190,958
2amigos/yiiwheels
YiiWheels.php
YiiWheels.registerAssetCss
public function registerAssetCss($cssFile, $media = '') { Yii::app()->getClientScript()->registerCssFile($this->getAssetsUrl() . "/css/{$cssFile}", $media); return $this; }
php
public function registerAssetCss($cssFile, $media = '') { Yii::app()->getClientScript()->registerCssFile($this->getAssetsUrl() . "/css/{$cssFile}", $media); return $this; }
[ "public", "function", "registerAssetCss", "(", "$", "cssFile", ",", "$", "media", "=", "''", ")", "{", "Yii", "::", "app", "(", ")", "->", "getClientScript", "(", ")", "->", "registerCssFile", "(", "$", "this", "->", "getAssetsUrl", "(", ")", ".", "\"/...
Registers a specific css in the asset's css folder @param string $cssFile the css file name to register @param string $media the media that the CSS file should be applied to. If empty, it means all media types. @return $this
[ "Registers", "a", "specific", "css", "in", "the", "asset", "s", "css", "folder" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/YiiWheels.php#L125-L129
190,959
2amigos/yiiwheels
widgets/toggle/WhToggleButton.php
WhToggleButton.renderField
public function renderField() { list($name, $id) = $this->resolveNameID(); echo CHtml::openTag($this->tagName, array('id' => 'wrapper-' . $id)); if ($this->hasModel()) { echo CHtml::activeCheckBox($this->model, $this->attribute, $this->htmlOptions); } else { ...
php
public function renderField() { list($name, $id) = $this->resolveNameID(); echo CHtml::openTag($this->tagName, array('id' => 'wrapper-' . $id)); if ($this->hasModel()) { echo CHtml::activeCheckBox($this->model, $this->attribute, $this->htmlOptions); } else { ...
[ "public", "function", "renderField", "(", ")", "{", "list", "(", "$", "name", ",", "$", "id", ")", "=", "$", "this", "->", "resolveNameID", "(", ")", ";", "echo", "CHtml", "::", "openTag", "(", "$", "this", "->", "tagName", ",", "array", "(", "'id'...
Renders the input field
[ "Renders", "the", "input", "field" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/toggle/WhToggleButton.php#L136-L149
190,960
2amigos/yiiwheels
widgets/toggle/WhToggleButton.php
WhToggleButton.registerClientScript
protected function registerClientScript() { $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->clientScript; $cs->registerCoreScript('jquery'); $cs->registerCssFi...
php
protected function registerClientScript() { $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $assetsUrl = $this->getAssetsUrl($path); /* @var $cs CClientScript */ $cs = Yii::app()->clientScript; $cs->registerCoreScript('jquery'); $cs->registerCssFi...
[ "protected", "function", "registerClientScript", "(", ")", "{", "$", "path", "=", "dirname", "(", "__FILE__", ")", ".", "DIRECTORY_SEPARATOR", ".", "'assets'", ";", "$", "assetsUrl", "=", "$", "this", "->", "getAssetsUrl", "(", "$", "path", ")", ";", "/* @...
Registers client scripts
[ "Registers", "client", "scripts" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/toggle/WhToggleButton.php#L154-L178
190,961
johannesschobel/laravel-shoppingcart
src/JohannesSchobel/ShoppingCart/Models/ShoppingCart.php
ShoppingCart.load
public function load($identifier, $name = null) { $name = $name ?: self::DEFAULT_NAME; $classname = config('shoppingcart.models.shoppingcart'); $shoppingcart = $classname::firstOrNew($this->defaultValues($identifier, $name)); return $shoppingcart; }
php
public function load($identifier, $name = null) { $name = $name ?: self::DEFAULT_NAME; $classname = config('shoppingcart.models.shoppingcart'); $shoppingcart = $classname::firstOrNew($this->defaultValues($identifier, $name)); return $shoppingcart; }
[ "public", "function", "load", "(", "$", "identifier", ",", "$", "name", "=", "null", ")", "{", "$", "name", "=", "$", "name", "?", ":", "self", "::", "DEFAULT_NAME", ";", "$", "classname", "=", "config", "(", "'shoppingcart.models.shoppingcart'", ")", ";...
Load a cart from the database. If no cart exists, an empty cart is returned @param array|string $identifier @param null $name @return mixed
[ "Load", "a", "cart", "from", "the", "database", ".", "If", "no", "cart", "exists", "an", "empty", "cart", "is", "returned" ]
ffa2a3530a5be1f793f5a783de30b31a8b7cab78
https://github.com/johannesschobel/laravel-shoppingcart/blob/ffa2a3530a5be1f793f5a783de30b31a8b7cab78/src/JohannesSchobel/ShoppingCart/Models/ShoppingCart.php#L43-L51
190,962
johannesschobel/laravel-shoppingcart
src/JohannesSchobel/ShoppingCart/Models/ShoppingCart.php
ShoppingCart.removeItem
public function removeItem($row) { $content = $this->getContent(); // the cart contains this row - so remove it if ($content->has($row)) { $content->pull($row); $this->content = serialize($content); $this->save(); } return $this; }
php
public function removeItem($row) { $content = $this->getContent(); // the cart contains this row - so remove it if ($content->has($row)) { $content->pull($row); $this->content = serialize($content); $this->save(); } return $this; }
[ "public", "function", "removeItem", "(", "$", "row", ")", "{", "$", "content", "=", "$", "this", "->", "getContent", "(", ")", ";", "// the cart contains this row - so remove it", "if", "(", "$", "content", "->", "has", "(", "$", "row", ")", ")", "{", "$...
Remove a specified row from the shoppingcart @param $row @return $this
[ "Remove", "a", "specified", "row", "from", "the", "shoppingcart" ]
ffa2a3530a5be1f793f5a783de30b31a8b7cab78
https://github.com/johannesschobel/laravel-shoppingcart/blob/ffa2a3530a5be1f793f5a783de30b31a8b7cab78/src/JohannesSchobel/ShoppingCart/Models/ShoppingCart.php#L120-L133
190,963
2amigos/yiiwheels
widgets/editable/WhEditableColumn.php
WhEditableColumn.renderHeaderCellContent
protected function renderHeaderCellContent() { if ($this->grid->enableSorting && $this->sortable && $this->name !== null) { $sort = $this->grid->dataProvider->getSort(); $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name); if ($sort->resolve...
php
protected function renderHeaderCellContent() { if ($this->grid->enableSorting && $this->sortable && $this->name !== null) { $sort = $this->grid->dataProvider->getSort(); $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name); if ($sort->resolve...
[ "protected", "function", "renderHeaderCellContent", "(", ")", "{", "if", "(", "$", "this", "->", "grid", "->", "enableSorting", "&&", "$", "this", "->", "sortable", "&&", "$", "this", "->", "name", "!==", "null", ")", "{", "$", "sort", "=", "$", "this"...
Require this overwrite to show bootstrap sort icons
[ "Require", "this", "overwrite", "to", "show", "bootstrap", "sort", "icons" ]
bf2fd27dc1d5713b20ae071820a57f4f79fd61ad
https://github.com/2amigos/yiiwheels/blob/bf2fd27dc1d5713b20ae071820a57f4f79fd61ad/widgets/editable/WhEditableColumn.php#L119-L139
190,964
xtreamwayz/html-form-validator
src/Form.php
Form.buildInputFilterFromForm
private function buildInputFilterFromForm(InputFilterInterface $inputFilter) : void { /** @var DOMElement $node */ foreach ($this->getNodeList() as $name => $node) { if ($inputFilter->has($name)) { continue; } // Detect element type $t...
php
private function buildInputFilterFromForm(InputFilterInterface $inputFilter) : void { /** @var DOMElement $node */ foreach ($this->getNodeList() as $name => $node) { if ($inputFilter->has($name)) { continue; } // Detect element type $t...
[ "private", "function", "buildInputFilterFromForm", "(", "InputFilterInterface", "$", "inputFilter", ")", ":", "void", "{", "/** @var DOMElement $node */", "foreach", "(", "$", "this", "->", "getNodeList", "(", ")", "as", "$", "name", "=>", "$", "node", ")", "{",...
Build the InputFilter, validators and filters from form fields
[ "Build", "the", "InputFilter", "validators", "and", "filters", "from", "form", "fields" ]
c0901cbb70ceacb399a077450de1fd119790b00c
https://github.com/xtreamwayz/html-form-validator/blob/c0901cbb70ceacb399a077450de1fd119790b00c/src/Form.php#L180-L209
190,965
xtreamwayz/html-form-validator
src/Form.php
Form.getNodeList
private function getNodeList() : Generator { $xpath = new DOMXPath($this->document); $nodeList = $xpath->query('//input | //textarea | //select | //div[@data-input-name]'); /** @var DOMElement $node */ foreach ($nodeList as $node) { $name = $node->getAttribute('name')...
php
private function getNodeList() : Generator { $xpath = new DOMXPath($this->document); $nodeList = $xpath->query('//input | //textarea | //select | //div[@data-input-name]'); /** @var DOMElement $node */ foreach ($nodeList as $node) { $name = $node->getAttribute('name')...
[ "private", "function", "getNodeList", "(", ")", ":", "Generator", "{", "$", "xpath", "=", "new", "DOMXPath", "(", "$", "this", "->", "document", ")", ";", "$", "nodeList", "=", "$", "xpath", "->", "query", "(", "'//input | //textarea | //select | //div[@data-i...
Get form elements and create an id if needed return Generator<string, DOMElement>
[ "Get", "form", "elements", "and", "create", "an", "id", "if", "needed" ]
c0901cbb70ceacb399a077450de1fd119790b00c
https://github.com/xtreamwayz/html-form-validator/blob/c0901cbb70ceacb399a077450de1fd119790b00c/src/Form.php#L216-L241
190,966
xtreamwayz/html-form-validator
src/Form.php
Form.getSubmitStateNodeList
private function getSubmitStateNodeList() : Generator { $xpath = new DOMXPath($this->document); $nodeList = $xpath->query('//input[@type="submit"] | //button[@type="submit"]'); /** @var DOMElement $node */ foreach ($nodeList as $node) { $name = $node->getAttribute('na...
php
private function getSubmitStateNodeList() : Generator { $xpath = new DOMXPath($this->document); $nodeList = $xpath->query('//input[@type="submit"] | //button[@type="submit"]'); /** @var DOMElement $node */ foreach ($nodeList as $node) { $name = $node->getAttribute('na...
[ "private", "function", "getSubmitStateNodeList", "(", ")", ":", "Generator", "{", "$", "xpath", "=", "new", "DOMXPath", "(", "$", "this", "->", "document", ")", ";", "$", "nodeList", "=", "$", "xpath", "->", "query", "(", "'//input[@type=\"submit\"] | //button...
Get names of available named submit elements
[ "Get", "names", "of", "available", "named", "submit", "elements" ]
c0901cbb70ceacb399a077450de1fd119790b00c
https://github.com/xtreamwayz/html-form-validator/blob/c0901cbb70ceacb399a077450de1fd119790b00c/src/Form.php#L246-L261
190,967
xtreamwayz/html-form-validator
src/Form.php
Form.setData
private function setData(array $data, ?bool $force = null) : void { $force = $force ?? false; /** @var DOMElement $node */ foreach ($this->getNodeList() as $name => $node) { if (! array_key_exists($name, $data)) { // No value set for this element ...
php
private function setData(array $data, ?bool $force = null) : void { $force = $force ?? false; /** @var DOMElement $node */ foreach ($this->getNodeList() as $name => $node) { if (! array_key_exists($name, $data)) { // No value set for this element ...
[ "private", "function", "setData", "(", "array", "$", "data", ",", "?", "bool", "$", "force", "=", "null", ")", ":", "void", "{", "$", "force", "=", "$", "force", "??", "false", ";", "/** @var DOMElement $node */", "foreach", "(", "$", "this", "->", "ge...
Set values and element checked and selected states
[ "Set", "values", "and", "element", "checked", "and", "selected", "states" ]
c0901cbb70ceacb399a077450de1fd119790b00c
https://github.com/xtreamwayz/html-form-validator/blob/c0901cbb70ceacb399a077450de1fd119790b00c/src/Form.php#L266-L311
190,968
xtreamwayz/html-form-validator
src/Form.php
Form.setMessages
private function setMessages(array $data) : void { /** * @var string $name * @var array $errors */ foreach ($data as $name => $errors) { // Not sure if this can be optimized and create the DOMXPath only once. // At this point the dom is constantly ...
php
private function setMessages(array $data) : void { /** * @var string $name * @var array $errors */ foreach ($data as $name => $errors) { // Not sure if this can be optimized and create the DOMXPath only once. // At this point the dom is constantly ...
[ "private", "function", "setMessages", "(", "array", "$", "data", ")", ":", "void", "{", "/**\n * @var string $name\n * @var array $errors\n */", "foreach", "(", "$", "data", "as", "$", "name", "=>", "$", "errors", ")", "{", "// Not sure if thi...
Set validation messages, bootstrap style
[ "Set", "validation", "messages", "bootstrap", "style" ]
c0901cbb70ceacb399a077450de1fd119790b00c
https://github.com/xtreamwayz/html-form-validator/blob/c0901cbb70ceacb399a077450de1fd119790b00c/src/Form.php#L316-L359
190,969
Tigrov/yii2-pgsql
src/ColumnSchema.php
ColumnSchema.phpTypecastComposite
public function phpTypecastComposite($value) { if (is_string($value)) { $value = $this->getCompositeParser()->parse($value); } if (is_array($value)) { $result = []; $fields = array_keys($this->columns); foreach ($value as $i => $item) { ...
php
public function phpTypecastComposite($value) { if (is_string($value)) { $value = $this->getCompositeParser()->parse($value); } if (is_array($value)) { $result = []; $fields = array_keys($this->columns); foreach ($value as $i => $item) { ...
[ "public", "function", "phpTypecastComposite", "(", "$", "value", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", ")", "{", "$", "value", "=", "$", "this", "->", "getCompositeParser", "(", ")", "->", "parse", "(", "$", "value", ")", ";", "}"...
Converts the composite type to PHP @param array|string|object|null $value the value to be converted @return array|object|null Composite object as described in `ColumnSchema::$phpType` (@see `Schema::$compositeMap`) or `null`
[ "Converts", "the", "composite", "type", "to", "PHP" ]
5ac437bb227c957cc0a66da4350e893eee33d13b
https://github.com/Tigrov/yii2-pgsql/blob/5ac437bb227c957cc0a66da4350e893eee33d13b/src/ColumnSchema.php#L148-L169
190,970
Tigrov/yii2-pgsql
src/ColumnSchema.php
ColumnSchema.createCompositeObject
public function createCompositeObject($values) { switch ($this->phpType) { case 'array': return $values; case 'object': return (object)$values; } return \Yii::createObject($this->phpType, [$values]); }
php
public function createCompositeObject($values) { switch ($this->phpType) { case 'array': return $values; case 'object': return (object)$values; } return \Yii::createObject($this->phpType, [$values]); }
[ "public", "function", "createCompositeObject", "(", "$", "values", ")", "{", "switch", "(", "$", "this", "->", "phpType", ")", "{", "case", "'array'", ":", "return", "$", "values", ";", "case", "'object'", ":", "return", "(", "object", ")", "$", "values"...
Creates an object for the composite type. @param array $values to be passed to the class constructor @return mixed
[ "Creates", "an", "object", "for", "the", "composite", "type", "." ]
5ac437bb227c957cc0a66da4350e893eee33d13b
https://github.com/Tigrov/yii2-pgsql/blob/5ac437bb227c957cc0a66da4350e893eee33d13b/src/ColumnSchema.php#L176-L186
190,971
adammbalogh/box-php-sdk
src/Client/OAuthClient.php
OAuthClient.getCode
protected function getCode() { $queryData = [ 'response_type' => 'code', 'client_id' => $this->clientId, 'redirect_uri' => $this->redirectUri ]; header('Location: ' . self::AUTHORIZE_URI . '?' . http_build_query($queryData)); throw new ExitExcepti...
php
protected function getCode() { $queryData = [ 'response_type' => 'code', 'client_id' => $this->clientId, 'redirect_uri' => $this->redirectUri ]; header('Location: ' . self::AUTHORIZE_URI . '?' . http_build_query($queryData)); throw new ExitExcepti...
[ "protected", "function", "getCode", "(", ")", "{", "$", "queryData", "=", "[", "'response_type'", "=>", "'code'", ",", "'client_id'", "=>", "$", "this", "->", "clientId", ",", "'redirect_uri'", "=>", "$", "this", "->", "redirectUri", "]", ";", "header", "(...
Authorize - First step @throws ExitException
[ "Authorize", "-", "First", "step" ]
5a7b76aa4b996d03dfa0c913853fed3ad6b04c22
https://github.com/adammbalogh/box-php-sdk/blob/5a7b76aa4b996d03dfa0c913853fed3ad6b04c22/src/Client/OAuthClient.php#L199-L209
190,972
adammbalogh/box-php-sdk
src/Client/OAuthClient.php
OAuthClient.getToken
protected function getToken() { /* @var ResponseInterface $response */ $response = $this->post(self::TOKEN_URI, [ 'body' => [ 'grant_type' => 'authorization_code', 'code' => $this->getCodeQueryField(), 'client_id' => $this->clientId, ...
php
protected function getToken() { /* @var ResponseInterface $response */ $response = $this->post(self::TOKEN_URI, [ 'body' => [ 'grant_type' => 'authorization_code', 'code' => $this->getCodeQueryField(), 'client_id' => $this->clientId, ...
[ "protected", "function", "getToken", "(", ")", "{", "/* @var ResponseInterface $response */", "$", "response", "=", "$", "this", "->", "post", "(", "self", "::", "TOKEN_URI", ",", "[", "'body'", "=>", "[", "'grant_type'", "=>", "'authorization_code'", ",", "'cod...
Authorize - Second step @throws ClientException e.g. on a Bad Request. The authorization code is only valid for 30 seconds. @throws OAuthException
[ "Authorize", "-", "Second", "step" ]
5a7b76aa4b996d03dfa0c913853fed3ad6b04c22
https://github.com/adammbalogh/box-php-sdk/blob/5a7b76aa4b996d03dfa0c913853fed3ad6b04c22/src/Client/OAuthClient.php#L217-L237
190,973
xtreamwayz/html-form-validator
src/FormElement/BaseFormElement.php
BaseFormElement.parseDataAttribute
protected function parseDataAttribute(string $dataAttribute) : Generator { $matches = []; preg_match_all('/([a-zA-Z]+)([^|]*)/', $dataAttribute, $matches, PREG_SET_ORDER); foreach ($matches as $match) { $name = $match[1]; $options = []; if (isset($mat...
php
protected function parseDataAttribute(string $dataAttribute) : Generator { $matches = []; preg_match_all('/([a-zA-Z]+)([^|]*)/', $dataAttribute, $matches, PREG_SET_ORDER); foreach ($matches as $match) { $name = $match[1]; $options = []; if (isset($mat...
[ "protected", "function", "parseDataAttribute", "(", "string", "$", "dataAttribute", ")", ":", "Generator", "{", "$", "matches", "=", "[", "]", ";", "preg_match_all", "(", "'/([a-zA-Z]+)([^|]*)/'", ",", "$", "dataAttribute", ",", "$", "matches", ",", "PREG_SET_OR...
Parse data attribute value for validators, filters and options
[ "Parse", "data", "attribute", "value", "for", "validators", "filters", "and", "options" ]
c0901cbb70ceacb399a077450de1fd119790b00c
https://github.com/xtreamwayz/html-form-validator/blob/c0901cbb70ceacb399a077450de1fd119790b00c/src/FormElement/BaseFormElement.php#L104-L127
190,974
Tigrov/yii2-pgsql
src/CompositeParser.php
CompositeParser.parse
public function parse($value) { if ($value === null) { return null; } if ($value == '()') { return [null]; } return $this->parseComposite($value); }
php
public function parse($value) { if ($value === null) { return null; } if ($value == '()') { return [null]; } return $this->parseComposite($value); }
[ "public", "function", "parse", "(", "$", "value", ")", "{", "if", "(", "$", "value", "===", "null", ")", "{", "return", "null", ";", "}", "if", "(", "$", "value", "==", "'()'", ")", "{", "return", "[", "null", "]", ";", "}", "return", "$", "thi...
Converts PostgreSQL composite type representation to PHP array @param string $value string to be converted @return array|null
[ "Converts", "PostgreSQL", "composite", "type", "representation", "to", "PHP", "array" ]
5ac437bb227c957cc0a66da4350e893eee33d13b
https://github.com/Tigrov/yii2-pgsql/blob/5ac437bb227c957cc0a66da4350e893eee33d13b/src/CompositeParser.php#L22-L33
190,975
Tigrov/yii2-pgsql
src/CompositeParser.php
CompositeParser.parseComposite
private function parseComposite($value, &$i = 0) { $result = []; $length = strlen($value); for(++$i; $i < $length; ++$i) { switch ($value[$i]) { case ')': break 2; case ',': if (empty($result)) { ...
php
private function parseComposite($value, &$i = 0) { $result = []; $length = strlen($value); for(++$i; $i < $length; ++$i) { switch ($value[$i]) { case ')': break 2; case ',': if (empty($result)) { ...
[ "private", "function", "parseComposite", "(", "$", "value", ",", "&", "$", "i", "=", "0", ")", "{", "$", "result", "=", "[", "]", ";", "$", "length", "=", "strlen", "(", "$", "value", ")", ";", "for", "(", "++", "$", "i", ";", "$", "i", "<", ...
Parses PostgreSQL composite type encoded in string @param string $value @param int $i parse starting position @return array
[ "Parses", "PostgreSQL", "composite", "type", "encoded", "in", "string" ]
5ac437bb227c957cc0a66da4350e893eee33d13b
https://github.com/Tigrov/yii2-pgsql/blob/5ac437bb227c957cc0a66da4350e893eee33d13b/src/CompositeParser.php#L42-L64
190,976
Tigrov/yii2-pgsql
src/CompositeParser.php
CompositeParser.parseString
private function parseString($value, &$i) { $isQuoted = $value[$i] === '"'; $endChars = $isQuoted ? ['"'] : [',', ')']; $result = ''; $length = strlen($value); for ($i += $isQuoted ? 1 : 0; $i < $length; ++$i) { if (in_array($value[$i], ['\\', '"'], true) && in_ar...
php
private function parseString($value, &$i) { $isQuoted = $value[$i] === '"'; $endChars = $isQuoted ? ['"'] : [',', ')']; $result = ''; $length = strlen($value); for ($i += $isQuoted ? 1 : 0; $i < $length; ++$i) { if (in_array($value[$i], ['\\', '"'], true) && in_ar...
[ "private", "function", "parseString", "(", "$", "value", ",", "&", "$", "i", ")", "{", "$", "isQuoted", "=", "$", "value", "[", "$", "i", "]", "===", "'\"'", ";", "$", "endChars", "=", "$", "isQuoted", "?", "[", "'\"'", "]", ":", "[", "','", ",...
Parses PostgreSQL encoded string @param string $value @param int $i parse starting position @return string
[ "Parses", "PostgreSQL", "encoded", "string" ]
5ac437bb227c957cc0a66da4350e893eee33d13b
https://github.com/Tigrov/yii2-pgsql/blob/5ac437bb227c957cc0a66da4350e893eee33d13b/src/CompositeParser.php#L73-L92
190,977
sciactive/hookphp
src/Hook.php
Hook.addCallback
public static function addCallback($hook, $order, $function) { $callback = array($order, $function); if (!isset(Hook::$hooks[$hook])) { Hook::$hooks[$hook] = array(); } Hook::$hooks[$hook][] = $callback; uasort(Hook::$hooks[$hook], '\\SciActive\\Hook::sortCallbacks'); return array_keys(Hoo...
php
public static function addCallback($hook, $order, $function) { $callback = array($order, $function); if (!isset(Hook::$hooks[$hook])) { Hook::$hooks[$hook] = array(); } Hook::$hooks[$hook][] = $callback; uasort(Hook::$hooks[$hook], '\\SciActive\\Hook::sortCallbacks'); return array_keys(Hoo...
[ "public", "static", "function", "addCallback", "(", "$", "hook", ",", "$", "order", ",", "$", "function", ")", "{", "$", "callback", "=", "array", "(", "$", "order", ",", "$", "function", ")", ";", "if", "(", "!", "isset", "(", "Hook", "::", "$", ...
Add a callback. A callback is called either before a method runs or after. The callback is passed an array of arguments or return value which it can freely manipulate. If the callback runs before the method and sets the arguments array to false (or causes an error), the method will not be run. Callbacks before a metho...
[ "Add", "a", "callback", "." ]
adde48e776bd98d01a639c9bccff0fbca0cea6d6
https://github.com/sciactive/hookphp/blob/adde48e776bd98d01a639c9bccff0fbca0cea6d6/src/Hook.php#L87-L95
190,978
sciactive/hookphp
src/Hook.php
Hook.delCallbackByID
public static function delCallbackByID($hook, $id) { if (!isset(Hook::$hooks[$hook][$id])) { return 2; } unset(Hook::$hooks[$hook][$id]); return 1; }
php
public static function delCallbackByID($hook, $id) { if (!isset(Hook::$hooks[$hook][$id])) { return 2; } unset(Hook::$hooks[$hook][$id]); return 1; }
[ "public", "static", "function", "delCallbackByID", "(", "$", "hook", ",", "$", "id", ")", "{", "if", "(", "!", "isset", "(", "Hook", "::", "$", "hooks", "[", "$", "hook", "]", "[", "$", "id", "]", ")", ")", "{", "return", "2", ";", "}", "unset"...
Delete a callback by its ID. @param string $hook The name of the callback's hook. @param int $id The ID of the callback. @return int 1 if the callback was deleted, 2 if it didn't exist.
[ "Delete", "a", "callback", "by", "its", "ID", "." ]
adde48e776bd98d01a639c9bccff0fbca0cea6d6
https://github.com/sciactive/hookphp/blob/adde48e776bd98d01a639c9bccff0fbca0cea6d6/src/Hook.php#L104-L110
190,979
sciactive/hookphp
src/Hook.php
Hook.runCallbacks
public static function runCallbacks($name, &$arguments = array(), $type = 'all', &$object = null, &$function = null, &$data = array()) { if (isset(Hook::$hooks['all'])) { foreach (Hook::$hooks['all'] as $curCallback) { if (($type == 'all' && $curCallback[0] != 0) || ($type == 'before' && $curCallback[...
php
public static function runCallbacks($name, &$arguments = array(), $type = 'all', &$object = null, &$function = null, &$data = array()) { if (isset(Hook::$hooks['all'])) { foreach (Hook::$hooks['all'] as $curCallback) { if (($type == 'all' && $curCallback[0] != 0) || ($type == 'before' && $curCallback[...
[ "public", "static", "function", "runCallbacks", "(", "$", "name", ",", "&", "$", "arguments", "=", "array", "(", ")", ",", "$", "type", "=", "'all'", ",", "&", "$", "object", "=", "null", ",", "&", "$", "function", "=", "null", ",", "&", "$", "da...
Run the callbacks for a given hook. Each callback is run and passed the array of arguments, and the name of the given hook. If any callback changes $arguments to FALSE, the following callbacks will not be called, and FALSE will be returned. @param string $name The name of the hook. @param array &$arguments An array o...
[ "Run", "the", "callbacks", "for", "a", "given", "hook", "." ]
adde48e776bd98d01a639c9bccff0fbca0cea6d6
https://github.com/sciactive/hookphp/blob/adde48e776bd98d01a639c9bccff0fbca0cea6d6/src/Hook.php#L259-L280
190,980
phossa2/event
src/Event/EventManager.php
EventManager.detach
public function detach($event, $callback) { if ($this->hasEvent($event)) { $this->removeEventCallable($event, $callback); } elseif ('' === $event) { $this->events = []; // remove all events } return true; }
php
public function detach($event, $callback) { if ($this->hasEvent($event)) { $this->removeEventCallable($event, $callback); } elseif ('' === $event) { $this->events = []; // remove all events } return true; }
[ "public", "function", "detach", "(", "$", "event", ",", "$", "callback", ")", "{", "if", "(", "$", "this", "->", "hasEvent", "(", "$", "event", ")", ")", "{", "$", "this", "->", "removeEventCallable", "(", "$", "event", ",", "$", "callback", ")", "...
if call is NULL, clear this event. if event is '', clear all events {@inheritDoc}
[ "if", "call", "is", "NULL", "clear", "this", "event", ".", "if", "event", "is", "clear", "all", "events" ]
dad12a5cb93a6fc62c6eb96278e6c3a52995fc24
https://github.com/phossa2/event/blob/dad12a5cb93a6fc62c6eb96278e6c3a52995fc24/src/Event/EventManager.php#L71-L79
190,981
phossa2/event
src/Event/EventManager.php
EventManager.newEvent
protected function newEvent( $eventName, $target = null, array $parameters = [] )/*# : EventInterface */ { if (is_object($eventName)) { return $eventName; } else { return new Event($eventName, $target, $parameters); } }
php
protected function newEvent( $eventName, $target = null, array $parameters = [] )/*# : EventInterface */ { if (is_object($eventName)) { return $eventName; } else { return new Event($eventName, $target, $parameters); } }
[ "protected", "function", "newEvent", "(", "$", "eventName", ",", "$", "target", "=", "null", ",", "array", "$", "parameters", "=", "[", "]", ")", "/*# : EventInterface */", "{", "if", "(", "is_object", "(", "$", "eventName", ")", ")", "{", "return", "$",...
Create a new event @param string|EventInterface $eventName @param object|string|null $target @param array $parameters @return EventInterface @access protected
[ "Create", "a", "new", "event" ]
dad12a5cb93a6fc62c6eb96278e6c3a52995fc24
https://github.com/phossa2/event/blob/dad12a5cb93a6fc62c6eb96278e6c3a52995fc24/src/Event/EventManager.php#L136-L146
190,982
phossa2/event
src/Event/EventManager.php
EventManager.removeEventCallable
protected function removeEventCallable( /*# string */ $eventName, $callable ) { if (null === $callable) { // remove all callables $this->events[$eventName]->flush(); } else { // remove one callable $this->events[$eventName]->remove($cal...
php
protected function removeEventCallable( /*# string */ $eventName, $callable ) { if (null === $callable) { // remove all callables $this->events[$eventName]->flush(); } else { // remove one callable $this->events[$eventName]->remove($cal...
[ "protected", "function", "removeEventCallable", "(", "/*# string */", "$", "eventName", ",", "$", "callable", ")", "{", "if", "(", "null", "===", "$", "callable", ")", "{", "// remove all callables", "$", "this", "->", "events", "[", "$", "eventName", "]", "...
Remove event or its callable @param string $eventName @param callable|null $callable @access protected
[ "Remove", "event", "or", "its", "callable" ]
dad12a5cb93a6fc62c6eb96278e6c3a52995fc24
https://github.com/phossa2/event/blob/dad12a5cb93a6fc62c6eb96278e6c3a52995fc24/src/Event/EventManager.php#L183-L199
190,983
machour/yii2-google-apiclient
components/GoogleApiClient.php
GoogleApiClient.getClient
public function getClient($accessToken) { $client = new Google_Client(); $client->setApplicationName($this->applicationName); $client->setAccessType('offline'); $client->setAccessToken($accessToken); // Refresh the token if it's expired. if ($client->isAccessTokenExpire...
php
public function getClient($accessToken) { $client = new Google_Client(); $client->setApplicationName($this->applicationName); $client->setAccessType('offline'); $client->setAccessToken($accessToken); // Refresh the token if it's expired. if ($client->isAccessTokenExpire...
[ "public", "function", "getClient", "(", "$", "accessToken", ")", "{", "$", "client", "=", "new", "Google_Client", "(", ")", ";", "$", "client", "->", "setApplicationName", "(", "$", "this", "->", "applicationName", ")", ";", "$", "client", "->", "setAccess...
Returns an authorized API client. @param $accessToken string the access token @return Google_Client the authorized client object
[ "Returns", "an", "authorized", "API", "client", "." ]
37dcc139823c5bfdd1737648fd5054615043ad11
https://github.com/machour/yii2-google-apiclient/blob/37dcc139823c5bfdd1737648fd5054615043ad11/components/GoogleApiClient.php#L81-L95
190,984
joomlatools/joomlatools-composer
src/Joomlatools/Joomla/Util.php
Util.isJoomla
public static function isJoomla() { $directories = array('./libraries/cms', './libraries/joomla', './index.php', './administrator/index.php'); foreach ($directories as $directory) { $path = realpath($directory); if (!file_exists($path)) { return fals...
php
public static function isJoomla() { $directories = array('./libraries/cms', './libraries/joomla', './index.php', './administrator/index.php'); foreach ($directories as $directory) { $path = realpath($directory); if (!file_exists($path)) { return fals...
[ "public", "static", "function", "isJoomla", "(", ")", "{", "$", "directories", "=", "array", "(", "'./libraries/cms'", ",", "'./libraries/joomla'", ",", "'./index.php'", ",", "'./administrator/index.php'", ")", ";", "foreach", "(", "$", "directories", "as", "$", ...
Validate if the current working directory has a valid Joomla installation @return bool
[ "Validate", "if", "the", "current", "working", "directory", "has", "a", "valid", "Joomla", "installation" ]
b4164897dc5da5d6ff560ed3189a36c0d251fa33
https://github.com/joomlatools/joomlatools-composer/blob/b4164897dc5da5d6ff560ed3189a36c0d251fa33/src/Joomlatools/Joomla/Util.php#L32-L46
190,985
joomlatools/joomlatools-composer
src/Joomlatools/Joomla/Util.php
Util.isJoomlatoolsPlatform
public static function isJoomlatoolsPlatform() { $manifest = realpath('./composer.json'); if (file_exists($manifest)) { $contents = file_get_contents($manifest); $package = json_decode($contents); if (isset($package->name) && in_array($package->name, ar...
php
public static function isJoomlatoolsPlatform() { $manifest = realpath('./composer.json'); if (file_exists($manifest)) { $contents = file_get_contents($manifest); $package = json_decode($contents); if (isset($package->name) && in_array($package->name, ar...
[ "public", "static", "function", "isJoomlatoolsPlatform", "(", ")", "{", "$", "manifest", "=", "realpath", "(", "'./composer.json'", ")", ";", "if", "(", "file_exists", "(", "$", "manifest", ")", ")", "{", "$", "contents", "=", "file_get_contents", "(", "$", ...
Check if the working directory has Joomlatools Platform installed @return bool
[ "Check", "if", "the", "working", "directory", "has", "Joomlatools", "Platform", "installed" ]
b4164897dc5da5d6ff560ed3189a36c0d251fa33
https://github.com/joomlatools/joomlatools-composer/blob/b4164897dc5da5d6ff560ed3189a36c0d251fa33/src/Joomlatools/Joomla/Util.php#L53-L68
190,986
joomlatools/joomlatools-composer
src/Joomlatools/Joomla/Util.php
Util.getPackageManifest
public static function getPackageManifest($installPath) { if (!array_key_exists($installPath, self::$__manifests)) { self::$__manifests[$installPath] = false; $directories = new \RecursiveDirectoryIterator($installPath); $iterator = new \RecursiveIteratorItera...
php
public static function getPackageManifest($installPath) { if (!array_key_exists($installPath, self::$__manifests)) { self::$__manifests[$installPath] = false; $directories = new \RecursiveDirectoryIterator($installPath); $iterator = new \RecursiveIteratorItera...
[ "public", "static", "function", "getPackageManifest", "(", "$", "installPath", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "installPath", ",", "self", "::", "$", "__manifests", ")", ")", "{", "self", "::", "$", "__manifests", "[", "$", "install...
Find the XML manifest of the installation package @param string $installPath Install path of package @return string Full path to manifest file
[ "Find", "the", "XML", "manifest", "of", "the", "installation", "package" ]
b4164897dc5da5d6ff560ed3189a36c0d251fa33
https://github.com/joomlatools/joomlatools-composer/blob/b4164897dc5da5d6ff560ed3189a36c0d251fa33/src/Joomlatools/Joomla/Util.php#L84-L129
190,987
joomlatools/joomlatools-composer
src/Joomlatools/Joomla/Util.php
Util.getNameFromManifest
public static function getNameFromManifest($installPath) { $manifest = self::getPackageManifest($installPath); if ($manifest === false) { return false; } $xml = simplexml_load_file($manifest); if (!($xml instanceof \SimpleXMLElement)) { return false...
php
public static function getNameFromManifest($installPath) { $manifest = self::getPackageManifest($installPath); if ($manifest === false) { return false; } $xml = simplexml_load_file($manifest); if (!($xml instanceof \SimpleXMLElement)) { return false...
[ "public", "static", "function", "getNameFromManifest", "(", "$", "installPath", ")", "{", "$", "manifest", "=", "self", "::", "getPackageManifest", "(", "$", "installPath", ")", ";", "if", "(", "$", "manifest", "===", "false", ")", "{", "return", "false", ...
Get the element name from the XML manifest @param string $manifest Path to the installation package @return string|bool Extension name or FALSE on failure
[ "Get", "the", "element", "name", "from", "the", "XML", "manifest" ]
b4164897dc5da5d6ff560ed3189a36c0d251fa33
https://github.com/joomlatools/joomlatools-composer/blob/b4164897dc5da5d6ff560ed3189a36c0d251fa33/src/Joomlatools/Joomla/Util.php#L151-L216
190,988
joomlatools/joomlatools-composer
src/Joomlatools/Composer/ExtensionInstaller.php
ExtensionInstaller._enablePlugin
protected function _enablePlugin(PackageInterface $package, $installPath, $subdirectory = '') { $path = realpath($installPath . '/' . $subdirectory); $file = Util::getPackageManifest($path); if($file !== false) { $manifest = simplexml_load_file($file); $type ...
php
protected function _enablePlugin(PackageInterface $package, $installPath, $subdirectory = '') { $path = realpath($installPath . '/' . $subdirectory); $file = Util::getPackageManifest($path); if($file !== false) { $manifest = simplexml_load_file($file); $type ...
[ "protected", "function", "_enablePlugin", "(", "PackageInterface", "$", "package", ",", "$", "installPath", ",", "$", "subdirectory", "=", "''", ")", "{", "$", "path", "=", "realpath", "(", "$", "installPath", ".", "'/'", ".", "$", "subdirectory", ")", ";"...
Enable all plugins that were installed with this package. @param PackageInterface $package @param string $subdirectory Subdirectory in package install path to look for plugin manifests
[ "Enable", "all", "plugins", "that", "were", "installed", "with", "this", "package", "." ]
b4164897dc5da5d6ff560ed3189a36c0d251fa33
https://github.com/joomlatools/joomlatools-composer/blob/b4164897dc5da5d6ff560ed3189a36c0d251fa33/src/Joomlatools/Composer/ExtensionInstaller.php#L265-L301
190,989
PurpleBooth/git-lint-validators
src/PurpleBooth/GitLintValidators/ValidateMessageImplementation.php
ValidateMessageImplementation.validate
public function validate(Message $message) { /** @var Validator $validator */ foreach ($this->validators as $validator) { $validator->validate($message); } }
php
public function validate(Message $message) { /** @var Validator $validator */ foreach ($this->validators as $validator) { $validator->validate($message); } }
[ "public", "function", "validate", "(", "Message", "$", "message", ")", "{", "/** @var Validator $validator */", "foreach", "(", "$", "this", "->", "validators", "as", "$", "validator", ")", "{", "$", "validator", "->", "validate", "(", "$", "message", ")", "...
Test a message against a number of validators. @param Message $message
[ "Test", "a", "message", "against", "a", "number", "of", "validators", "." ]
8d435743e086865290a9f8bd43da275a56800e6b
https://github.com/PurpleBooth/git-lint-validators/blob/8d435743e086865290a9f8bd43da275a56800e6b/src/PurpleBooth/GitLintValidators/ValidateMessageImplementation.php#L45-L51
190,990
silverstripe/silverstripe-elemental-fileblock
src/Block/FileBlock.php
FileBlock.provideBlockSchema
protected function provideBlockSchema() { $blockSchema = parent::provideBlockSchema(); if ($this->File() && $this->File()->exists() && $this->File()->getIsImage()) { $blockSchema['fileURL'] = $this->File()->CMSThumbnail()->getURL(); $blockSchema['fileTitle'] = $this->File()->...
php
protected function provideBlockSchema() { $blockSchema = parent::provideBlockSchema(); if ($this->File() && $this->File()->exists() && $this->File()->getIsImage()) { $blockSchema['fileURL'] = $this->File()->CMSThumbnail()->getURL(); $blockSchema['fileTitle'] = $this->File()->...
[ "protected", "function", "provideBlockSchema", "(", ")", "{", "$", "blockSchema", "=", "parent", "::", "provideBlockSchema", "(", ")", ";", "if", "(", "$", "this", "->", "File", "(", ")", "&&", "$", "this", "->", "File", "(", ")", "->", "exists", "(", ...
Return file title and thumbnail for summary section of ElementEditor @return array
[ "Return", "file", "title", "and", "thumbnail", "for", "summary", "section", "of", "ElementEditor" ]
a7c9be84f0b2f7d8687c9854dce346676e1d3a96
https://github.com/silverstripe/silverstripe-elemental-fileblock/blob/a7c9be84f0b2f7d8687c9854dce346676e1d3a96/src/Block/FileBlock.php#L60-L68
190,991
phossa2/event
src/Event/Traits/ListenerAwareTrait.php
ListenerAwareTrait.listenerEvents
protected function listenerEvents( ListenerInterface $listener )/*# : array */ { $result = []; foreach ($listener->eventsListening() as $eventName => $data) { $newData = $this->expandToHandler($data); foreach ($newData as $handler) { $result[] = $this-...
php
protected function listenerEvents( ListenerInterface $listener )/*# : array */ { $result = []; foreach ($listener->eventsListening() as $eventName => $data) { $newData = $this->expandToHandler($data); foreach ($newData as $handler) { $result[] = $this-...
[ "protected", "function", "listenerEvents", "(", "ListenerInterface", "$", "listener", ")", "/*# : array */", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "listener", "->", "eventsListening", "(", ")", "as", "$", "eventName", "=>", "$", "data"...
standardize events definition @param ListenerInterface $listener @return array @access protected
[ "standardize", "events", "definition" ]
dad12a5cb93a6fc62c6eb96278e6c3a52995fc24
https://github.com/phossa2/event/blob/dad12a5cb93a6fc62c6eb96278e6c3a52995fc24/src/Event/Traits/ListenerAwareTrait.php#L85-L100
190,992
machour/yii2-google-apiclient
commands/GoogleController.php
GoogleController.actionList
public function actionList($showAllVersions = false) { foreach ($this->apis as $id => $versions) { foreach ($versions as $version => $api) { if (!$showAllVersions) { $this->stdout($api->name . ' - ' . $api->title . "\n"); break; ...
php
public function actionList($showAllVersions = false) { foreach ($this->apis as $id => $versions) { foreach ($versions as $version => $api) { if (!$showAllVersions) { $this->stdout($api->name . ' - ' . $api->title . "\n"); break; ...
[ "public", "function", "actionList", "(", "$", "showAllVersions", "=", "false", ")", "{", "foreach", "(", "$", "this", "->", "apis", "as", "$", "id", "=>", "$", "versions", ")", "{", "foreach", "(", "$", "versions", "as", "$", "version", "=>", "$", "a...
List all the available APIs @param bool|false $showAllVersions Whether to show all versions of each API
[ "List", "all", "the", "available", "APIs" ]
37dcc139823c5bfdd1737648fd5054615043ad11
https://github.com/machour/yii2-google-apiclient/blob/37dcc139823c5bfdd1737648fd5054615043ad11/commands/GoogleController.php#L151-L163
190,993
machour/yii2-google-apiclient
commands/GoogleController.php
GoogleController.getApis
public function getApis() { if (empty($this->theApis)) { $response = Json::decode(file_get_contents(self::DISCOVERY_URL), false); $theApis = []; foreach ($response->items as $item) { if (!isset($theApis[$item->name])) { $theApis[$item-...
php
public function getApis() { if (empty($this->theApis)) { $response = Json::decode(file_get_contents(self::DISCOVERY_URL), false); $theApis = []; foreach ($response->items as $item) { if (!isset($theApis[$item->name])) { $theApis[$item-...
[ "public", "function", "getApis", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "theApis", ")", ")", "{", "$", "response", "=", "Json", "::", "decode", "(", "file_get_contents", "(", "self", "::", "DISCOVERY_URL", ")", ",", "false", ")", ...
Fetches the Google API list @return array
[ "Fetches", "the", "Google", "API", "list" ]
37dcc139823c5bfdd1737648fd5054615043ad11
https://github.com/machour/yii2-google-apiclient/blob/37dcc139823c5bfdd1737648fd5054615043ad11/commands/GoogleController.php#L170-L188
190,994
machour/yii2-google-apiclient
commands/GoogleController.php
GoogleController.generateCredentialsFile
private function generateCredentialsFile($api, $scopes) { $credentialsPath = Yii::getAlias($this->configPath) . '/' . $api . '_' . $this->getUuid() . '.json'; $client = new Google_Client(); $client->setAuthConfigFile($this->clientSecretPath); $client->setAccessType('offline'); ...
php
private function generateCredentialsFile($api, $scopes) { $credentialsPath = Yii::getAlias($this->configPath) . '/' . $api . '_' . $this->getUuid() . '.json'; $client = new Google_Client(); $client->setAuthConfigFile($this->clientSecretPath); $client->setAccessType('offline'); ...
[ "private", "function", "generateCredentialsFile", "(", "$", "api", ",", "$", "scopes", ")", "{", "$", "credentialsPath", "=", "Yii", "::", "getAlias", "(", "$", "this", "->", "configPath", ")", ".", "'/'", ".", "$", "api", ".", "'_'", ".", "$", "this",...
Generates the credential file, prompting the user for the verification code @param string $api The API name @param Array $scopes The desired scopes @return string
[ "Generates", "the", "credential", "file", "prompting", "the", "user", "for", "the", "verification", "code" ]
37dcc139823c5bfdd1737648fd5054615043ad11
https://github.com/machour/yii2-google-apiclient/blob/37dcc139823c5bfdd1737648fd5054615043ad11/commands/GoogleController.php#L196-L232
190,995
PurpleBooth/git-lint-validators
src/PurpleBooth/GitLintValidators/Composer/Scripts.php
Scripts.installGitMessageHook
public static function installGitMessageHook(Event $event) { $hookContent = self::HOOK_CONTENTS; $inputOutput = $event->getIO(); $question = 'Do you want to install and activate the Git '; $question .= 'commit message hook? '; if ($inputOutput->askConfirmation($question, fal...
php
public static function installGitMessageHook(Event $event) { $hookContent = self::HOOK_CONTENTS; $inputOutput = $event->getIO(); $question = 'Do you want to install and activate the Git '; $question .= 'commit message hook? '; if ($inputOutput->askConfirmation($question, fal...
[ "public", "static", "function", "installGitMessageHook", "(", "Event", "$", "event", ")", "{", "$", "hookContent", "=", "self", "::", "HOOK_CONTENTS", ";", "$", "inputOutput", "=", "$", "event", "->", "getIO", "(", ")", ";", "$", "question", "=", "'Do you ...
Installs and activates the Git commit message hook when confirmed by the user. An existing hook is backed with the .bak extension. @param Event $event The script event @return bool
[ "Installs", "and", "activates", "the", "Git", "commit", "message", "hook", "when", "confirmed", "by", "the", "user", ".", "An", "existing", "hook", "is", "backed", "with", "the", ".", "bak", "extension", "." ]
8d435743e086865290a9f8bd43da275a56800e6b
https://github.com/PurpleBooth/git-lint-validators/blob/8d435743e086865290a9f8bd43da275a56800e6b/src/PurpleBooth/GitLintValidators/Composer/Scripts.php#L67-L115
190,996
PurpleBooth/git-lint-validators
src/PurpleBooth/GitLintValidators/Composer/Scripts.php
Scripts.installGitCommitMessageTemplate
public static function installGitCommitMessageTemplate(Event $event) { $templateContent = self::TEMPLATE_CONTENTS; $inputOutput = $event->getIO(); $question = 'Do you want to install and configure the Git '; $question .= 'commit message template? '; if ($inputOutput->askConf...
php
public static function installGitCommitMessageTemplate(Event $event) { $templateContent = self::TEMPLATE_CONTENTS; $inputOutput = $event->getIO(); $question = 'Do you want to install and configure the Git '; $question .= 'commit message template? '; if ($inputOutput->askConf...
[ "public", "static", "function", "installGitCommitMessageTemplate", "(", "Event", "$", "event", ")", "{", "$", "templateContent", "=", "self", "::", "TEMPLATE_CONTENTS", ";", "$", "inputOutput", "=", "$", "event", "->", "getIO", "(", ")", ";", "$", "question", ...
Installs and configures the Git commit message template when confirmed by the user. @param Event $event The script event @return bool
[ "Installs", "and", "configures", "the", "Git", "commit", "message", "template", "when", "confirmed", "by", "the", "user", "." ]
8d435743e086865290a9f8bd43da275a56800e6b
https://github.com/PurpleBooth/git-lint-validators/blob/8d435743e086865290a9f8bd43da275a56800e6b/src/PurpleBooth/GitLintValidators/Composer/Scripts.php#L125-L163
190,997
PurpleBooth/git-lint-validators
src/PurpleBooth/GitLintValidators/MessageImplementation.php
MessageImplementation.isTitleCapitalised
public function isTitleCapitalised(): bool { if (0 == $this->getTitleLength()) { return false; } return $this->commitMessage[0][0] === strtoupper($this->commitMessage[0]){0}; }
php
public function isTitleCapitalised(): bool { if (0 == $this->getTitleLength()) { return false; } return $this->commitMessage[0][0] === strtoupper($this->commitMessage[0]){0}; }
[ "public", "function", "isTitleCapitalised", "(", ")", ":", "bool", "{", "if", "(", "0", "==", "$", "this", "->", "getTitleLength", "(", ")", ")", "{", "return", "false", ";", "}", "return", "$", "this", "->", "commitMessage", "[", "0", "]", "[", "0",...
Is the title capitalised. @return bool
[ "Is", "the", "title", "capitalised", "." ]
8d435743e086865290a9f8bd43da275a56800e6b
https://github.com/PurpleBooth/git-lint-validators/blob/8d435743e086865290a9f8bd43da275a56800e6b/src/PurpleBooth/GitLintValidators/MessageImplementation.php#L46-L54
190,998
PurpleBooth/git-lint-validators
src/PurpleBooth/GitLintValidators/MessageImplementation.php
MessageImplementation.hasTitleAFullStop
public function hasTitleAFullStop(): bool { if (0 == $this->getTitleLength()) { return false; } $lastCharacter = trim($this->commitMessage[0]){$this->getTitleLength() - 1}; return '.' == $lastCharacter; }
php
public function hasTitleAFullStop(): bool { if (0 == $this->getTitleLength()) { return false; } $lastCharacter = trim($this->commitMessage[0]){$this->getTitleLength() - 1}; return '.' == $lastCharacter; }
[ "public", "function", "hasTitleAFullStop", "(", ")", ":", "bool", "{", "if", "(", "0", "==", "$", "this", "->", "getTitleLength", "(", ")", ")", "{", "return", "false", ";", "}", "$", "lastCharacter", "=", "trim", "(", "$", "this", "->", "commitMessage...
Title ends with a full stop. @return bool
[ "Title", "ends", "with", "a", "full", "stop", "." ]
8d435743e086865290a9f8bd43da275a56800e6b
https://github.com/PurpleBooth/git-lint-validators/blob/8d435743e086865290a9f8bd43da275a56800e6b/src/PurpleBooth/GitLintValidators/MessageImplementation.php#L71-L80
190,999
PurpleBooth/git-lint-validators
src/PurpleBooth/GitLintValidators/MessageImplementation.php
MessageImplementation.getBodyWrapLength
public function getBodyWrapLength(): int { if (count($this->commitMessage) < 3) { return 0; } $body = array_slice($this->commitMessage, 2); $longestLineLength = 0; foreach ($body as $line) { if (strlen($line) > $longestLineLength) { $...
php
public function getBodyWrapLength(): int { if (count($this->commitMessage) < 3) { return 0; } $body = array_slice($this->commitMessage, 2); $longestLineLength = 0; foreach ($body as $line) { if (strlen($line) > $longestLineLength) { $...
[ "public", "function", "getBodyWrapLength", "(", ")", ":", "int", "{", "if", "(", "count", "(", "$", "this", "->", "commitMessage", ")", "<", "3", ")", "{", "return", "0", ";", "}", "$", "body", "=", "array_slice", "(", "$", "this", "->", "commitMessa...
The length at which the message wraps. @return int
[ "The", "length", "at", "which", "the", "message", "wraps", "." ]
8d435743e086865290a9f8bd43da275a56800e6b
https://github.com/PurpleBooth/git-lint-validators/blob/8d435743e086865290a9f8bd43da275a56800e6b/src/PurpleBooth/GitLintValidators/MessageImplementation.php#L117-L133