repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
m4grio/bangkok-insurance-php
src/Client/ParamsMapperTrait.php
ParamsMapperTrait.mergeParams
public function mergeParams($method, Array $params = []) { $result = parent::mergeParams($method, $params); foreach ($this->map as $oldKey => $newKey) { if (array_key_exists($oldKey, $result[$method])) { $result[$method][$newKey] = $result[$method][$oldKey]; ...
php
public function mergeParams($method, Array $params = []) { $result = parent::mergeParams($method, $params); foreach ($this->map as $oldKey => $newKey) { if (array_key_exists($oldKey, $result[$method])) { $result[$method][$newKey] = $result[$method][$oldKey]; ...
[ "public", "function", "mergeParams", "(", "$", "method", ",", "Array", "$", "params", "=", "[", "]", ")", "{", "$", "result", "=", "parent", "::", "mergeParams", "(", "$", "method", ",", "$", "params", ")", ";", "foreach", "(", "$", "this", "->", "...
Merge and remap params @param $method @param array $params @return mixed
[ "Merge", "and", "remap", "params" ]
train
https://github.com/m4grio/bangkok-insurance-php/blob/400266d043abe6b7cacb9da36064cbb169149c2a/src/Client/ParamsMapperTrait.php#L27-L41
MASNathan/Parser
src/Type/Ini.php
Ini.encode
public static function encode($data) { $data = (array) $data; $resultString = self::loopEncode($data); return trim($resultString, PHP_EOL); }
php
public static function encode($data) { $data = (array) $data; $resultString = self::loopEncode($data); return trim($resultString, PHP_EOL); }
[ "public", "static", "function", "encode", "(", "$", "data", ")", "{", "$", "data", "=", "(", "array", ")", "$", "data", ";", "$", "resultString", "=", "self", "::", "loopEncode", "(", "$", "data", ")", ";", "return", "trim", "(", "$", "resultString",...
Encodes an array to ini strutcture @param array $data Data to encode @return string
[ "Encodes", "an", "array", "to", "ini", "strutcture" ]
train
https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Type/Ini.php#L12-L19
MASNathan/Parser
src/Type/Ini.php
Ini.loopEncode
public static function loopEncode($data, array $parent = array()) { $resultString = ''; foreach ($data as $key => $value) { if (is_array($value)) { //subsection case //merge all the sections into one array... $sec = array_merge((array) $par...
php
public static function loopEncode($data, array $parent = array()) { $resultString = ''; foreach ($data as $key => $value) { if (is_array($value)) { //subsection case //merge all the sections into one array... $sec = array_merge((array) $par...
[ "public", "static", "function", "loopEncode", "(", "$", "data", ",", "array", "$", "parent", "=", "array", "(", ")", ")", "{", "$", "resultString", "=", "''", ";", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", "value", ")", "{", "if", ...
Method to look the data and encode it to ini format @param array $data Data to encode @param array $parent Parent array, in case of recursive arrays @return string
[ "Method", "to", "look", "the", "data", "and", "encode", "it", "to", "ini", "format" ]
train
https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Type/Ini.php#L27-L45
NuclearCMS/Hierarchy
src/Tags/Tag.php
Tag.scopeSortable
public function scopeSortable($query, $key = null, $direction = null) { list($key, $direction) = $this->validateSortableParameters($key, $direction); if ($this->isTranslationAttribute($key)) { return $this->orderByTranslationAttribute($query, $key, $direction); } ...
php
public function scopeSortable($query, $key = null, $direction = null) { list($key, $direction) = $this->validateSortableParameters($key, $direction); if ($this->isTranslationAttribute($key)) { return $this->orderByTranslationAttribute($query, $key, $direction); } ...
[ "public", "function", "scopeSortable", "(", "$", "query", ",", "$", "key", "=", "null", ",", "$", "direction", "=", "null", ")", "{", "list", "(", "$", "key", ",", "$", "direction", ")", "=", "$", "this", "->", "validateSortableParameters", "(", "$", ...
Sortable by scope @param $query @param string|null $key @param string|null $direction @return Builder
[ "Sortable", "by", "scope" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Tags/Tag.php#L103-L113
NuclearCMS/Hierarchy
src/Tags/Tag.php
Tag.firstByTitleOrCreate
public static function firstByTitleOrCreate($title, $locale = null) { $tag = Tag::whereTranslation('title', $title, $locale)->first(); if (is_null($tag)) { $attributes = compact('title'); if ($locale) { $attributes = [$locale => $attribut...
php
public static function firstByTitleOrCreate($title, $locale = null) { $tag = Tag::whereTranslation('title', $title, $locale)->first(); if (is_null($tag)) { $attributes = compact('title'); if ($locale) { $attributes = [$locale => $attribut...
[ "public", "static", "function", "firstByTitleOrCreate", "(", "$", "title", ",", "$", "locale", "=", "null", ")", "{", "$", "tag", "=", "Tag", "::", "whereTranslation", "(", "'title'", ",", "$", "title", ",", "$", "locale", ")", "->", "first", "(", ")",...
Finds a tag by title or creates it @param string $title @param string $locale @return Tag
[ "Finds", "a", "tag", "by", "title", "or", "creates", "it" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Tags/Tag.php#L138-L155
NuclearCMS/Hierarchy
src/Tags/Tag.php
Tag.getLocaleForName
public function getLocaleForName($name) { foreach ($this->translations as $translation) { if ($translation->tag_name === $name) { return $translation->locale; } } return null; }
php
public function getLocaleForName($name) { foreach ($this->translations as $translation) { if ($translation->tag_name === $name) { return $translation->locale; } } return null; }
[ "public", "function", "getLocaleForName", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "translations", "as", "$", "translation", ")", "{", "if", "(", "$", "translation", "->", "tag_name", "===", "$", "name", ")", "{", "return", "$", "...
Returns locale for name @param string $name @return string
[ "Returns", "locale", "for", "name" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Tags/Tag.php#L163-L174
codezero-be/laravel-localizer
src/LocalizerServiceProvider.php
LocalizerServiceProvider.registerLocalizer
protected function registerLocalizer() { $this->app->bind(Localizer::class, function ($app) { $locales = $app['config']->get("{$this->name}.supported-locales"); $detectors = $app['config']->get("{$this->name}.detectors"); $stores = $app['config']->get("{$this->name}.store...
php
protected function registerLocalizer() { $this->app->bind(Localizer::class, function ($app) { $locales = $app['config']->get("{$this->name}.supported-locales"); $detectors = $app['config']->get("{$this->name}.detectors"); $stores = $app['config']->get("{$this->name}.store...
[ "protected", "function", "registerLocalizer", "(", ")", "{", "$", "this", "->", "app", "->", "bind", "(", "Localizer", "::", "class", ",", "function", "(", "$", "app", ")", "{", "$", "locales", "=", "$", "app", "[", "'config'", "]", "->", "get", "(",...
Register Localizer. @return void
[ "Register", "Localizer", "." ]
train
https://github.com/codezero-be/laravel-localizer/blob/812692796a73bd38fc205404d8ef90df5bfa0d83/src/LocalizerServiceProvider.php#L65-L74
InactiveProjects/limoncello-illuminate
app/Http/Requests/RolesRequest.php
RolesRequest.validateOnPost
protected function validateOnPost(ErrorCollection $errors) { $this->validateData([ Schema::KEYWORD_ID => $this->getId(), ], [ Schema::KEYWORD_ID => 'required|unique:' . Model::TABLE_NAME . ',' . Model::FIELD_ID, ], $errors); $this->validateAttributes([ ...
php
protected function validateOnPost(ErrorCollection $errors) { $this->validateData([ Schema::KEYWORD_ID => $this->getId(), ], [ Schema::KEYWORD_ID => 'required|unique:' . Model::TABLE_NAME . ',' . Model::FIELD_ID, ], $errors); $this->validateAttributes([ ...
[ "protected", "function", "validateOnPost", "(", "ErrorCollection", "$", "errors", ")", "{", "$", "this", "->", "validateData", "(", "[", "Schema", "::", "KEYWORD_ID", "=>", "$", "this", "->", "getId", "(", ")", ",", "]", ",", "[", "Schema", "::", "KEYWOR...
Validate input for 'store' action. @param ErrorCollection $errors @return void
[ "Validate", "input", "for", "store", "action", "." ]
train
https://github.com/InactiveProjects/limoncello-illuminate/blob/cae6fc26190efcf090495a5c3582c10fa2430897/app/Http/Requests/RolesRequest.php#L22-L33
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.get
public function get(string $name, ?array $parameters = null) { try { return $this->resolve($name, $parameters); } catch (Exception\ServiceNotFound $e) { return $this->wrapService($name, $parameters); } }
php
public function get(string $name, ?array $parameters = null) { try { return $this->resolve($name, $parameters); } catch (Exception\ServiceNotFound $e) { return $this->wrapService($name, $parameters); } }
[ "public", "function", "get", "(", "string", "$", "name", ",", "?", "array", "$", "parameters", "=", "null", ")", "{", "try", "{", "return", "$", "this", "->", "resolve", "(", "$", "name", ",", "$", "parameters", ")", ";", "}", "catch", "(", "Except...
Get service.
[ "Get", "service", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L97-L104
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.resolve
public function resolve(string $name, ?array $parameters = null) { if (isset($this->service[$name])) { return $this->service[$name]; } if ($this->config->has($name)) { return $this->wrapService($name, $parameters); } if (null !== $this->parent_servic...
php
public function resolve(string $name, ?array $parameters = null) { if (isset($this->service[$name])) { return $this->service[$name]; } if ($this->config->has($name)) { return $this->wrapService($name, $parameters); } if (null !== $this->parent_servic...
[ "public", "function", "resolve", "(", "string", "$", "name", ",", "?", "array", "$", "parameters", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "service", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "s...
Resolve service.
[ "Resolve", "service", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L109-L132
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.storeService
protected function storeService(string $name, array $config, $service) { if (false === $config['singleton']) { return $service; } $this->service[$name] = $service; if (isset($this->children[$name])) { $this->children[$name]->setParentService($service); ...
php
protected function storeService(string $name, array $config, $service) { if (false === $config['singleton']) { return $service; } $this->service[$name] = $service; if (isset($this->children[$name])) { $this->children[$name]->setParentService($service); ...
[ "protected", "function", "storeService", "(", "string", "$", "name", ",", "array", "$", "config", ",", "$", "service", ")", "{", "if", "(", "false", "===", "$", "config", "[", "'singleton'", "]", ")", "{", "return", "$", "service", ";", "}", "$", "th...
Store service.
[ "Store", "service", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L137-L149
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.wrapService
protected function wrapService(string $name, ?array $parameters = null) { $config = $this->config->get($name); if (true === $config['wrap']) { $that = $this; return function () use ($that, $name, $parameters) { return $that->autoWireClass($name, $parameters);...
php
protected function wrapService(string $name, ?array $parameters = null) { $config = $this->config->get($name); if (true === $config['wrap']) { $that = $this; return function () use ($that, $name, $parameters) { return $that->autoWireClass($name, $parameters);...
[ "protected", "function", "wrapService", "(", "string", "$", "name", ",", "?", "array", "$", "parameters", "=", "null", ")", "{", "$", "config", "=", "$", "this", "->", "config", "->", "get", "(", "$", "name", ")", ";", "if", "(", "true", "===", "$"...
Wrap resolved service in callable if enabled.
[ "Wrap", "resolved", "service", "in", "callable", "if", "enabled", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L154-L166
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.autoWireClass
protected function autoWireClass(string $name, ?array $parameters = null) { $config = $this->config->get($name); $class = $config['use']; if (null !== $parameters) { $config['singleton'] = false; } if (preg_match('#^\{([^{}]+)\}$#', $class, $match)) { ...
php
protected function autoWireClass(string $name, ?array $parameters = null) { $config = $this->config->get($name); $class = $config['use']; if (null !== $parameters) { $config['singleton'] = false; } if (preg_match('#^\{([^{}]+)\}$#', $class, $match)) { ...
[ "protected", "function", "autoWireClass", "(", "string", "$", "name", ",", "?", "array", "$", "parameters", "=", "null", ")", "{", "$", "config", "=", "$", "this", "->", "config", "->", "get", "(", "$", "name", ")", ";", "$", "class", "=", "$", "co...
Auto wire.
[ "Auto", "wire", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L171-L203
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.wireReference
protected function wireReference(string $name, string $reference, array $config) { $service = $this->get($reference); $reflection = new ReflectionClass(get_class($service)); $config = $this->config->get($name); $service = $this->prepareService($name, $service, $reflection, $config); ...
php
protected function wireReference(string $name, string $reference, array $config) { $service = $this->get($reference); $reflection = new ReflectionClass(get_class($service)); $config = $this->config->get($name); $service = $this->prepareService($name, $service, $reflection, $config); ...
[ "protected", "function", "wireReference", "(", "string", "$", "name", ",", "string", "$", "reference", ",", "array", "$", "config", ")", "{", "$", "service", "=", "$", "this", "->", "get", "(", "$", "reference", ")", ";", "$", "reflection", "=", "new",...
Wire named referenced service.
[ "Wire", "named", "referenced", "service", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L208-L216
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.createInstance
protected function createInstance(string $name, ReflectionClass $class, array $arguments, array $config) { if (true === $config['lazy']) { return $this->getProxyInstance($name, $class, $arguments, $config); } return $this->getRealInstance($name, $class, $arguments, $config); ...
php
protected function createInstance(string $name, ReflectionClass $class, array $arguments, array $config) { if (true === $config['lazy']) { return $this->getProxyInstance($name, $class, $arguments, $config); } return $this->getRealInstance($name, $class, $arguments, $config); ...
[ "protected", "function", "createInstance", "(", "string", "$", "name", ",", "ReflectionClass", "$", "class", ",", "array", "$", "arguments", ",", "array", "$", "config", ")", "{", "if", "(", "true", "===", "$", "config", "[", "'lazy'", "]", ")", "{", "...
Get instance (virtual or real instance).
[ "Get", "instance", "(", "virtual", "or", "real", "instance", ")", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L221-L228
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.getProxyInstance
protected function getProxyInstance(string $name, ReflectionClass $class, array $arguments, array $config) { $factory = new LazyLoadingValueHolderFactory(); $that = $this; return $factory->createProxy( $class->getName(), function (&$wrappedObject, $proxy, $method, $p...
php
protected function getProxyInstance(string $name, ReflectionClass $class, array $arguments, array $config) { $factory = new LazyLoadingValueHolderFactory(); $that = $this; return $factory->createProxy( $class->getName(), function (&$wrappedObject, $proxy, $method, $p...
[ "protected", "function", "getProxyInstance", "(", "string", "$", "name", ",", "ReflectionClass", "$", "class", ",", "array", "$", "arguments", ",", "array", "$", "config", ")", "{", "$", "factory", "=", "new", "LazyLoadingValueHolderFactory", "(", ")", ";", ...
Create proxy instance.
[ "Create", "proxy", "instance", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L233-L245
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.getRealInstance
protected function getRealInstance(string $name, ReflectionClass $class, array $arguments, array $config) { $instance = $class->newInstanceArgs($arguments); $instance = $this->prepareService($name, $instance, $class, $config); return $instance; }
php
protected function getRealInstance(string $name, ReflectionClass $class, array $arguments, array $config) { $instance = $class->newInstanceArgs($arguments); $instance = $this->prepareService($name, $instance, $class, $config); return $instance; }
[ "protected", "function", "getRealInstance", "(", "string", "$", "name", ",", "ReflectionClass", "$", "class", ",", "array", "$", "arguments", ",", "array", "$", "config", ")", "{", "$", "instance", "=", "$", "class", "->", "newInstanceArgs", "(", "$", "arg...
Create real instance.
[ "Create", "real", "instance", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L250-L256
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.prepareService
protected function prepareService(string $name, $service, ReflectionClass $class, array $config) { $this->storeService($name, $config, $service); foreach ($config['calls'] as $call) { if (!is_array($call)) { continue; } if (!isset($call['method']...
php
protected function prepareService(string $name, $service, ReflectionClass $class, array $config) { $this->storeService($name, $config, $service); foreach ($config['calls'] as $call) { if (!is_array($call)) { continue; } if (!isset($call['method']...
[ "protected", "function", "prepareService", "(", "string", "$", "name", ",", "$", "service", ",", "ReflectionClass", "$", "class", ",", "array", "$", "config", ")", "{", "$", "this", "->", "storeService", "(", "$", "name", ",", "$", "config", ",", "$", ...
Prepare service (execute sub selects and excute setter injections).
[ "Prepare", "service", "(", "execute", "sub", "selects", "and", "excute", "setter", "injections", ")", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L261-L293
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.autoWireMethod
protected function autoWireMethod(string $name, ReflectionMethod $method, array $config, ?array $parameters = null): array { $params = $method->getParameters(); $args = []; foreach ($params as $param) { $type = $param->getClass(); $param_name = $param->getName(); ...
php
protected function autoWireMethod(string $name, ReflectionMethod $method, array $config, ?array $parameters = null): array { $params = $method->getParameters(); $args = []; foreach ($params as $param) { $type = $param->getClass(); $param_name = $param->getName(); ...
[ "protected", "function", "autoWireMethod", "(", "string", "$", "name", ",", "ReflectionMethod", "$", "method", ",", "array", "$", "config", ",", "?", "array", "$", "parameters", "=", "null", ")", ":", "array", "{", "$", "params", "=", "$", "method", "->"...
Autowire method.
[ "Autowire", "method", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L298-L328
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.resolveServiceArgument
protected function resolveServiceArgument(string $name, ReflectionClass $type, ReflectionParameter $param) { $type_class = $type->getName(); if ($type_class === $name) { throw new RuntimeException('class '.$type_class.' can not depend on itself'); } try { re...
php
protected function resolveServiceArgument(string $name, ReflectionClass $type, ReflectionParameter $param) { $type_class = $type->getName(); if ($type_class === $name) { throw new RuntimeException('class '.$type_class.' can not depend on itself'); } try { re...
[ "protected", "function", "resolveServiceArgument", "(", "string", "$", "name", ",", "ReflectionClass", "$", "type", ",", "ReflectionParameter", "$", "param", ")", "{", "$", "type_class", "=", "$", "type", "->", "getName", "(", ")", ";", "if", "(", "$", "ty...
Resolve service argument.
[ "Resolve", "service", "argument", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L333-L350
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.parseParam
protected function parseParam($param, string $name) { if (is_iterable($param)) { foreach ($param as $key => $value) { $param[$key] = $this->parseParam($value, $name); } return $param; } if (is_string($param)) { $param = $this-...
php
protected function parseParam($param, string $name) { if (is_iterable($param)) { foreach ($param as $key => $value) { $param[$key] = $this->parseParam($value, $name); } return $param; } if (is_string($param)) { $param = $this-...
[ "protected", "function", "parseParam", "(", "$", "param", ",", "string", "$", "name", ")", "{", "if", "(", "is_iterable", "(", "$", "param", ")", ")", "{", "foreach", "(", "$", "param", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "param", ...
Parse param value.
[ "Parse", "param", "value", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L355-L379
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.traverseTree
protected function traverseTree(string $current_service, string $service) { if (isset($this->children[$current_service])) { return $this->children[$current_service]->get($service); } $config = $this->config->get($current_service); if (isset($config['services'])) { ...
php
protected function traverseTree(string $current_service, string $service) { if (isset($this->children[$current_service])) { return $this->children[$current_service]->get($service); } $config = $this->config->get($current_service); if (isset($config['services'])) { ...
[ "protected", "function", "traverseTree", "(", "string", "$", "current_service", ",", "string", "$", "service", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "children", "[", "$", "current_service", "]", ")", ")", "{", "return", "$", "this", "->",...
Locate service.
[ "Locate", "service", "." ]
train
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L384-L398
zicht/z
src/Zicht/Tool/Packager/Packager.php
Packager.package
public function package($targetFile, $force) { if (is_file($targetFile)) { if ($force) { unlink($targetFile); } else { throw new \RuntimeException("File {$targetFile} already exists"); } } $curDir = getcwd(); $buildF...
php
public function package($targetFile, $force) { if (is_file($targetFile)) { if ($force) { unlink($targetFile); } else { throw new \RuntimeException("File {$targetFile} already exists"); } } $curDir = getcwd(); $buildF...
[ "public", "function", "package", "(", "$", "targetFile", ",", "$", "force", ")", "{", "if", "(", "is_file", "(", "$", "targetFile", ")", ")", "{", "if", "(", "$", "force", ")", "{", "unlink", "(", "$", "targetFile", ")", ";", "}", "else", "{", "t...
Build the package file. Throws an exception if the file already exists. Pass $force as true to override this. @param string $targetFile @param bool $force @return string @throws \RuntimeException
[ "Build", "the", "package", "file", ".", "Throws", "an", "exception", "if", "the", "file", "already", "exists", ".", "Pass", "$force", "as", "true", "to", "override", "this", "." ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Packager/Packager.php#L48-L106
ZayconFoods/whatcounts
src/ZayconWhatCounts/Realm.php
Realm.setRealmId
public function setRealmId( $realm_id ) { $this->realm_id = (is_numeric($realm_id)) ? abs(round($realm_id)) : NULL; return $this; }
php
public function setRealmId( $realm_id ) { $this->realm_id = (is_numeric($realm_id)) ? abs(round($realm_id)) : NULL; return $this; }
[ "public", "function", "setRealmId", "(", "$", "realm_id", ")", "{", "$", "this", "->", "realm_id", "=", "(", "is_numeric", "(", "$", "realm_id", ")", ")", "?", "abs", "(", "round", "(", "$", "realm_id", ")", ")", ":", "NULL", ";", "return", "$", "t...
@param mixed $realm_id @return Realm
[ "@param", "mixed", "$realm_id" ]
train
https://github.com/ZayconFoods/whatcounts/blob/ff18491fc152571a72e4b558f8102f4fbb9bb7fd/src/ZayconWhatCounts/Realm.php#L30-L35
ZayconFoods/whatcounts
src/ZayconWhatCounts/Realm.php
Realm.setUseCustomerKey
public function setUseCustomerKey( $use_customer_key ) { $this->use_customer_key = ($use_customer_key == 1 || $use_customer_key == 'Y' || $use_customer_key === TRUE) ? TRUE : FALSE; return $this; }
php
public function setUseCustomerKey( $use_customer_key ) { $this->use_customer_key = ($use_customer_key == 1 || $use_customer_key == 'Y' || $use_customer_key === TRUE) ? TRUE : FALSE; return $this; }
[ "public", "function", "setUseCustomerKey", "(", "$", "use_customer_key", ")", "{", "$", "this", "->", "use_customer_key", "=", "(", "$", "use_customer_key", "==", "1", "||", "$", "use_customer_key", "==", "'Y'", "||", "$", "use_customer_key", "===", "TRUE", ")...
@param mixed $use_customer_key @return Realm
[ "@param", "mixed", "$use_customer_key" ]
train
https://github.com/ZayconFoods/whatcounts/blob/ff18491fc152571a72e4b558f8102f4fbb9bb7fd/src/ZayconWhatCounts/Realm.php#L50-L55
ZayconFoods/whatcounts
src/ZayconWhatCounts/Realm.php
Realm.setEnableRelationalDatabase
public function setEnableRelationalDatabase( $enable_relational_database ) { $this->enable_relational_database = ($enable_relational_database == 1 || $enable_relational_database == 'Y' || $enable_relational_database === TRUE) ? TRUE : FALSE; return $this; }
php
public function setEnableRelationalDatabase( $enable_relational_database ) { $this->enable_relational_database = ($enable_relational_database == 1 || $enable_relational_database == 'Y' || $enable_relational_database === TRUE) ? TRUE : FALSE; return $this; }
[ "public", "function", "setEnableRelationalDatabase", "(", "$", "enable_relational_database", ")", "{", "$", "this", "->", "enable_relational_database", "=", "(", "$", "enable_relational_database", "==", "1", "||", "$", "enable_relational_database", "==", "'Y'", "||", ...
@param mixed $enable_relational_database @return Realm
[ "@param", "mixed", "$enable_relational_database" ]
train
https://github.com/ZayconFoods/whatcounts/blob/ff18491fc152571a72e4b558f8102f4fbb9bb7fd/src/ZayconWhatCounts/Realm.php#L70-L75
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
SimpleRequest.setRequest
public function setRequest(RequestInterface $request, array $options = []): self { $this->requestOrign = $request; $this->requestOption = $options; return $this; }
php
public function setRequest(RequestInterface $request, array $options = []): self { $this->requestOrign = $request; $this->requestOption = $options; return $this; }
[ "public", "function", "setRequest", "(", "RequestInterface", "$", "request", ",", "array", "$", "options", "=", "[", "]", ")", ":", "self", "{", "$", "this", "->", "requestOrign", "=", "$", "request", ";", "$", "this", "->", "requestOption", "=", "$", ...
{@inheritDoc} @see \SimpleConcurrent\SimpleRequestInterface::setRequest()
[ "{" ]
train
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L220-L225
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
SimpleRequest.getPromise
public function getPromise(): PromiseInterface { if (! $this->requestOrign && ! $this->promise) throw new RequestBuildExpection('please give a request.'); if (! $this->promise) { $this->promise = $this->_getClient()->sendAsync($this->requestOrign, $this->requestOption); } ...
php
public function getPromise(): PromiseInterface { if (! $this->requestOrign && ! $this->promise) throw new RequestBuildExpection('please give a request.'); if (! $this->promise) { $this->promise = $this->_getClient()->sendAsync($this->requestOrign, $this->requestOption); } ...
[ "public", "function", "getPromise", "(", ")", ":", "PromiseInterface", "{", "if", "(", "!", "$", "this", "->", "requestOrign", "&&", "!", "$", "this", "->", "promise", ")", "throw", "new", "RequestBuildExpection", "(", "'please give a request.'", ")", ";", "...
{@inheritDoc} @see \SimpleConcurrent\SimpleRequestInterface::getPromise()
[ "{" ]
train
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L262-L275
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient._getClient
private function _getClient(): ClientInterface { if (! $this->client instanceof ClientInterface) $this->client = new Client($this->clientConfig); return $this->client; }
php
private function _getClient(): ClientInterface { if (! $this->client instanceof ClientInterface) $this->client = new Client($this->clientConfig); return $this->client; }
[ "private", "function", "_getClient", "(", ")", ":", "ClientInterface", "{", "if", "(", "!", "$", "this", "->", "client", "instanceof", "ClientInterface", ")", "$", "this", "->", "client", "=", "new", "Client", "(", "$", "this", "->", "clientConfig", ")", ...
get a client implements \GuzzleHttp\ClientInterface @return ClientInterface
[ "get", "a", "client", "implements", "\\", "GuzzleHttp", "\\", "ClientInterface" ]
train
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L434-L438
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient.addClientHeader
public function addClientHeader(string $headerName, $headerValue): self { $this->clientConfig['headers'][$headerName] = $headerValue; return $this; }
php
public function addClientHeader(string $headerName, $headerValue): self { $this->clientConfig['headers'][$headerName] = $headerValue; return $this; }
[ "public", "function", "addClientHeader", "(", "string", "$", "headerName", ",", "$", "headerValue", ")", ":", "self", "{", "$", "this", "->", "clientConfig", "[", "'headers'", "]", "[", "$", "headerName", "]", "=", "$", "headerValue", ";", "return", "$", ...
add a client request header @param string $headerName @param mixed $headerValue @return self
[ "add", "a", "client", "request", "header" ]
train
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L457-L461
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient._responseSuccessHandle
private function _responseSuccessHandle($response, $index) { try { if (! $response instanceof ResponseInterface) throw new UnknowResponseExpection($response); $result = $response->getBody()->getContents(); $cbk = $this->requestList[$index]->getSuccessCallbackList(); ...
php
private function _responseSuccessHandle($response, $index) { try { if (! $response instanceof ResponseInterface) throw new UnknowResponseExpection($response); $result = $response->getBody()->getContents(); $cbk = $this->requestList[$index]->getSuccessCallbackList(); ...
[ "private", "function", "_responseSuccessHandle", "(", "$", "response", ",", "$", "index", ")", "{", "try", "{", "if", "(", "!", "$", "response", "instanceof", "ResponseInterface", ")", "throw", "new", "UnknowResponseExpection", "(", "$", "response", ")", ";", ...
when request successed this method will be called @param mixed $response @param int $index @throws \Exception
[ "when", "request", "successed", "this", "method", "will", "be", "called" ]
train
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L557-L574
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient._responseFailHandle
private function _responseFailHandle($error, $index) { $cbk = $this->requestList[$index]->getFailCallbackList(); if (! empty($cbk)) { $error = array_reduce($cbk, function ($prev, $cb) { return $cb($prev); }, $error); } $response = new SimpleRes...
php
private function _responseFailHandle($error, $index) { $cbk = $this->requestList[$index]->getFailCallbackList(); if (! empty($cbk)) { $error = array_reduce($cbk, function ($prev, $cb) { return $cb($prev); }, $error); } $response = new SimpleRes...
[ "private", "function", "_responseFailHandle", "(", "$", "error", ",", "$", "index", ")", "{", "$", "cbk", "=", "$", "this", "->", "requestList", "[", "$", "index", "]", "->", "getFailCallbackList", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "c...
when request failed this method will be called @param mixed $error @param int $index
[ "when", "request", "failed", "this", "method", "will", "be", "called" ]
train
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L581-L592
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient._getRequestPool
private function _getRequestPool(): Pool { return new Pool($this->_getClient(), $this->_getRequestPromise(), [ 'concurrency' => max(1, $this->configOfConcurrency), 'fulfilled' => function () { call_user_func_array([$this, '_responseSuccessHandle'], func_get_args()); ...
php
private function _getRequestPool(): Pool { return new Pool($this->_getClient(), $this->_getRequestPromise(), [ 'concurrency' => max(1, $this->configOfConcurrency), 'fulfilled' => function () { call_user_func_array([$this, '_responseSuccessHandle'], func_get_args()); ...
[ "private", "function", "_getRequestPool", "(", ")", ":", "Pool", "{", "return", "new", "Pool", "(", "$", "this", "->", "_getClient", "(", ")", ",", "$", "this", "->", "_getRequestPromise", "(", ")", ",", "[", "'concurrency'", "=>", "max", "(", "1", ","...
build a request pool implements \GuzzleHttp\Pool @return Pool
[ "build", "a", "request", "pool", "implements", "\\", "GuzzleHttp", "\\", "Pool" ]
train
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L610-L621
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient.customSetting
public function customSetting(string $settingKey, $settingValue): self { $this->clientConfig[$settingKey] = $settingValue; return $this; }
php
public function customSetting(string $settingKey, $settingValue): self { $this->clientConfig[$settingKey] = $settingValue; return $this; }
[ "public", "function", "customSetting", "(", "string", "$", "settingKey", ",", "$", "settingValue", ")", ":", "self", "{", "$", "this", "->", "clientConfig", "[", "$", "settingKey", "]", "=", "$", "settingValue", ";", "return", "$", "this", ";", "}" ]
add or modify client config by custom @return self
[ "add", "or", "modify", "client", "config", "by", "custom" ]
train
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L648-L652
alevilar/ristorantino-vendor
Risto/Controller/Component/Auth/PinAuthenticate.php
PinAuthenticate._checkFields
protected function _checkFields(CakeRequest $request, $model, $fields) { if (empty($request->data[$model])) { return false; } foreach (array($fields['pin']) as $field) { $value = $request->data($model . '.' . $field); if (empty($value) && $value !== '0' || !is_string($value)) { return false; } }...
php
protected function _checkFields(CakeRequest $request, $model, $fields) { if (empty($request->data[$model])) { return false; } foreach (array($fields['pin']) as $field) { $value = $request->data($model . '.' . $field); if (empty($value) && $value !== '0' || !is_string($value)) { return false; } }...
[ "protected", "function", "_checkFields", "(", "CakeRequest", "$", "request", ",", "$", "model", ",", "$", "fields", ")", "{", "if", "(", "empty", "(", "$", "request", "->", "data", "[", "$", "model", "]", ")", ")", "{", "return", "false", ";", "}", ...
Checks the fields to ensure they are supplied. @param CakeRequest $request The request that contains login information. @param string $model The model used for login verification. @param array $fields The fields to be checked. @return bool False if the fields have not been supplied. True if they exist.
[ "Checks", "the", "fields", "to", "ensure", "they", "are", "supplied", "." ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Controller/Component/Auth/PinAuthenticate.php#L59-L70
alevilar/ristorantino-vendor
Risto/Controller/Component/Auth/PinAuthenticate.php
PinAuthenticate.authenticate
public function authenticate(CakeRequest $request, CakeResponse $response) { App::uses('MtSites', 'MtSites./Utility/MtSites'); // solo utilizar el logueo con PIN desde un Tenant if ( !MtSites::isTenant() ) { return false; } $userModel = $this->settings['userModel']; list(, $model) = pluginSplit($userMod...
php
public function authenticate(CakeRequest $request, CakeResponse $response) { App::uses('MtSites', 'MtSites./Utility/MtSites'); // solo utilizar el logueo con PIN desde un Tenant if ( !MtSites::isTenant() ) { return false; } $userModel = $this->settings['userModel']; list(, $model) = pluginSplit($userMod...
[ "public", "function", "authenticate", "(", "CakeRequest", "$", "request", ",", "CakeResponse", "$", "response", ")", "{", "App", "::", "uses", "(", "'MtSites'", ",", "'MtSites./Utility/MtSites'", ")", ";", "// solo utilizar el logueo con PIN desde un Tenant", "if", "(...
Authenticates the identity contained in a request. Will use the `settings.userModel`, and `settings.fields` to find POST data that is used to find a matching record in the `settings.userModel`. Will return false if there is no post data, either username or pin is missing, or if the scope conditions have not been met. ...
[ "Authenticates", "the", "identity", "contained", "in", "a", "request", ".", "Will", "use", "the", "settings", ".", "userModel", "and", "settings", ".", "fields", "to", "find", "POST", "data", "that", "is", "used", "to", "find", "a", "matching", "record", "...
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Controller/Component/Auth/PinAuthenticate.php#L81-L96
alevilar/ristorantino-vendor
Risto/Controller/Component/Auth/PinAuthenticate.php
PinAuthenticate._findUser
protected function _findUser($pin, $password = null) { App::uses("MtSites", "MtSites.Utility"); $userModel = $this->settings['userModel']; list(, $model) = pluginSplit($userModel); $fields = $this->settings['fields']; $conditions = array( $model . '.pin' => $pin ); if (!empty($this->settings['sc...
php
protected function _findUser($pin, $password = null) { App::uses("MtSites", "MtSites.Utility"); $userModel = $this->settings['userModel']; list(, $model) = pluginSplit($userModel); $fields = $this->settings['fields']; $conditions = array( $model . '.pin' => $pin ); if (!empty($this->settings['sc...
[ "protected", "function", "_findUser", "(", "$", "pin", ",", "$", "password", "=", "null", ")", "{", "App", "::", "uses", "(", "\"MtSites\"", ",", "\"MtSites.Utility\"", ")", ";", "$", "userModel", "=", "$", "this", "->", "settings", "[", "'userModel'", "...
Find a user record using the standard options. The $username parameter can be a (string)username or an array containing conditions for Model::find('first'). If the $pin param is not provided the pin field will be present in returned array. Input passwords will be hashed even when a user doesn't exist. This helps miti...
[ "Find", "a", "user", "record", "using", "the", "standard", "options", "." ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Controller/Component/Auth/PinAuthenticate.php#L114-L159
heidelpay/PhpDoc
src/phpDocumentor/Plugin/Scrybe/Converter/Metadata/Glossary.php
Glossary.addTerm
public function addTerm($term, $filename, $line_number) { if (!isset($this[$term])) { $this[$term] = array(); } if (!isset($this[$term][$filename])) { $this[$term][$filename] = array(); } $this[$term][$filename][] = $line_number; }
php
public function addTerm($term, $filename, $line_number) { if (!isset($this[$term])) { $this[$term] = array(); } if (!isset($this[$term][$filename])) { $this[$term][$filename] = array(); } $this[$term][$filename][] = $line_number; }
[ "public", "function", "addTerm", "(", "$", "term", ",", "$", "filename", ",", "$", "line_number", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "[", "$", "term", "]", ")", ")", "{", "$", "this", "[", "$", "term", "]", "=", "array", "(", ...
Adds a glossary term to the collection. @param string $term @param string $filename @param int $line_number @return void
[ "Adds", "a", "glossary", "term", "to", "the", "collection", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Converter/Metadata/Glossary.php#L48-L58
wenbinye/PhalconX
src/Db/Schema/Column.php
Column.fromColumn
public static function fromColumn(Db\Column $column) { $data = $column->toArray(); if (isset($data['type']) && is_integer($data['type'])) { $data['type'] = self::getTypeName($data['type']); } if (isset($data['bindType']) && is_integer($data['bindType'])) { $da...
php
public static function fromColumn(Db\Column $column) { $data = $column->toArray(); if (isset($data['type']) && is_integer($data['type'])) { $data['type'] = self::getTypeName($data['type']); } if (isset($data['bindType']) && is_integer($data['bindType'])) { $da...
[ "public", "static", "function", "fromColumn", "(", "Db", "\\", "Column", "$", "column", ")", "{", "$", "data", "=", "$", "column", "->", "toArray", "(", ")", ";", "if", "(", "isset", "(", "$", "data", "[", "'type'", "]", ")", "&&", "is_integer", "(...
create column object
[ "create", "column", "object" ]
train
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/Schema/Column.php#L42-L53
tyokinuhata/html-builder
lib/Core.php
Core.append
public function append($mode = 'min') { if ($mode === 'dev') { var_dump($this->buffer); } else if ($mode === 'prod') { // TODO: 実装 } else if ($mode === 'min') { echo implode('', $this->buffer); } }
php
public function append($mode = 'min') { if ($mode === 'dev') { var_dump($this->buffer); } else if ($mode === 'prod') { // TODO: 実装 } else if ($mode === 'min') { echo implode('', $this->buffer); } }
[ "public", "function", "append", "(", "$", "mode", "=", "'min'", ")", "{", "if", "(", "$", "mode", "===", "'dev'", ")", "{", "var_dump", "(", "$", "this", "->", "buffer", ")", ";", "}", "else", "if", "(", "$", "mode", "===", "'prod'", ")", "{", ...
dev: 開発者モード prod: プロダクトモード min: プロダクトモード(ミニファイ) で出力します @param $mode
[ "dev", ":", "開発者モード", "prod", ":", "プロダクトモード", "min", ":", "プロダクトモード", "(", "ミニファイ", ")", "で出力します" ]
train
https://github.com/tyokinuhata/html-builder/blob/e8deda5e275298694b35122ec0df3eeaef1f7804/lib/Core.php#L25-L39
tyokinuhata/html-builder
lib/Core.php
Core.build
public function build($path) { $fileName = $path . '.html'; if (!file_exists($fileName)) { touch($fileName); } file_put_contents($fileName, $this->buffer); }
php
public function build($path) { $fileName = $path . '.html'; if (!file_exists($fileName)) { touch($fileName); } file_put_contents($fileName, $this->buffer); }
[ "public", "function", "build", "(", "$", "path", ")", "{", "$", "fileName", "=", "$", "path", ".", "'.html'", ";", "if", "(", "!", "file_exists", "(", "$", "fileName", ")", ")", "{", "touch", "(", "$", "fileName", ")", ";", "}", "file_put_contents", ...
任意のパスに任意の名前のhtmlファイルを生成します @param $path
[ "任意のパスに任意の名前のhtmlファイルを生成します" ]
train
https://github.com/tyokinuhata/html-builder/blob/e8deda5e275298694b35122ec0df3eeaef1f7804/lib/Core.php#L45-L53
surebert/surebert-framework
src/sb/JSON/RPC2/Client.php
Client.useEncryption
public function useEncryption($key) { $this->encryptor = new \sb\Encryption\ForTransmission($key); $this->encryption_key = $key; }
php
public function useEncryption($key) { $this->encryptor = new \sb\Encryption\ForTransmission($key); $this->encryption_key = $key; }
[ "public", "function", "useEncryption", "(", "$", "key", ")", "{", "$", "this", "->", "encryptor", "=", "new", "\\", "sb", "\\", "Encryption", "\\", "ForTransmission", "(", "$", "key", ")", ";", "$", "this", "->", "encryption_key", "=", "$", "key", ";",...
Sets the key that data is encrypted with and turns on encryption, the server must use the same key @param $key String
[ "Sets", "the", "key", "that", "data", "is", "encrypted", "with", "and", "turns", "on", "encryption", "the", "server", "must", "use", "the", "same", "key" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/JSON/RPC2/Client.php#L114-L118
surebert/surebert-framework
src/sb/JSON/RPC2/Client.php
Client.addCookie
public function addCookie($cookie = Array()) { foreach ($cookie as $key => $val) { if (isset($this->encryption_key)) { $val = $this->encryptor->encrypt($val); } $this->cookies[$key] = $val; } }
php
public function addCookie($cookie = Array()) { foreach ($cookie as $key => $val) { if (isset($this->encryption_key)) { $val = $this->encryptor->encrypt($val); } $this->cookies[$key] = $val; } }
[ "public", "function", "addCookie", "(", "$", "cookie", "=", "Array", "(", ")", ")", "{", "foreach", "(", "$", "cookie", "as", "$", "key", "=>", "$", "val", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "encryption_key", ")", ")", "{", "$"...
Adds a cookie to send to the server @param $cookie Array('key' => 'val');
[ "Adds", "a", "cookie", "to", "send", "to", "the", "server" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/JSON/RPC2/Client.php#L124-L133
surebert/surebert-framework
src/sb/JSON/RPC2/Client.php
Client.dispatch
public function dispatch(\sb\JSON\RPC2\Request $request) { if (!(is_array($request->params) || is_object($request->params))) { $response = new \sb\JSON\RPC2\Response(); $response->error = new \sb\JSON\RPC2\Error('-32602'); $response->message = 'Invalid params'; ...
php
public function dispatch(\sb\JSON\RPC2\Request $request) { if (!(is_array($request->params) || is_object($request->params))) { $response = new \sb\JSON\RPC2\Response(); $response->error = new \sb\JSON\RPC2\Error('-32602'); $response->message = 'Invalid params'; ...
[ "public", "function", "dispatch", "(", "\\", "sb", "\\", "JSON", "\\", "RPC2", "\\", "Request", "$", "request", ")", "{", "if", "(", "!", "(", "is_array", "(", "$", "request", "->", "params", ")", "||", "is_object", "(", "$", "request", "->", "params...
Dispatches a \sb\JSON\RPC2\Request @param $request \sb\JSON\RPC2\Request An object instance that models that request @return \sb\JSON\RPC2\Response
[ "Dispatches", "a", "\\", "sb", "\\", "JSON", "\\", "RPC2", "\\", "Request" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/JSON/RPC2/Client.php#L140-L227
surebert/surebert-framework
src/sb/JSON/RPC2/Client.php
Client.processResponse
protected function processResponse($str) { if (!empty($this->encryption_key)) { $str = $this->encryptor->decrypt($str); } $this->logResponse($str); //check if response body is serialized json_response object and just unserialize and return if it is if ($this->p...
php
protected function processResponse($str) { if (!empty($this->encryption_key)) { $str = $this->encryptor->decrypt($str); } $this->logResponse($str); //check if response body is serialized json_response object and just unserialize and return if it is if ($this->p...
[ "protected", "function", "processResponse", "(", "$", "str", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "encryption_key", ")", ")", "{", "$", "str", "=", "$", "this", "->", "encryptor", "->", "decrypt", "(", "$", "str", ")", ";", "}...
Break down the received data into headers and response and then handle gz encoding, encryption, utf, etc @param $str The data returned from the socket connection @return string The body of the message
[ "Break", "down", "the", "received", "data", "into", "headers", "and", "response", "and", "then", "handle", "gz", "encoding", "encryption", "utf", "etc" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/JSON/RPC2/Client.php#L234-L267
MASNathan/Parser
src/Parser.php
Parser.files
public static function files(array $listOfFiles) { $listOfContents = array(); foreach ($listOfFiles as $key => $filepath) { $listOfContents[$key] = self::file($filepath); } return $listOfContents; }
php
public static function files(array $listOfFiles) { $listOfContents = array(); foreach ($listOfFiles as $key => $filepath) { $listOfContents[$key] = self::file($filepath); } return $listOfContents; }
[ "public", "static", "function", "files", "(", "array", "$", "listOfFiles", ")", "{", "$", "listOfContents", "=", "array", "(", ")", ";", "foreach", "(", "$", "listOfFiles", "as", "$", "key", "=>", "$", "filepath", ")", "{", "$", "listOfContents", "[", ...
Creates an array of objects from multiple files @param array $listOfFiles List of file paths @return array
[ "Creates", "an", "array", "of", "objects", "from", "multiple", "files" ]
train
https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Parser.php#L36-L43
DesignPond/newsletter
src/Http/Controllers/Backend/ContentController.php
ContentController.store
public function store(ContentRequest $request){ $data = $request->all(); $upload = new Helper(); // image resize if(isset($data['image']) && !empty($data['image'])) { $upload->resizeImage($data['image'],$data['type_id']); } $this->content->create($...
php
public function store(ContentRequest $request){ $data = $request->all(); $upload = new Helper(); // image resize if(isset($data['image']) && !empty($data['image'])) { $upload->resizeImage($data['image'],$data['type_id']); } $this->content->create($...
[ "public", "function", "store", "(", "ContentRequest", "$", "request", ")", "{", "$", "data", "=", "$", "request", "->", "all", "(", ")", ";", "$", "upload", "=", "new", "Helper", "(", ")", ";", "// image resize", "if", "(", "isset", "(", "$", "data",...
Add bloc to newsletter POST data @return Response
[ "Add", "bloc", "to", "newsletter", "POST", "data" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/ContentController.php#L42-L60
DesignPond/newsletter
src/Http/Controllers/Backend/ContentController.php
ContentController.update
public function update(Request $request){ $contents = $this->content->update($request->all()); alert()->success('Bloc édité'); return redirect('build/campagne/'.$contents->newsletter_campagne_id.'#componant'); }
php
public function update(Request $request){ $contents = $this->content->update($request->all()); alert()->success('Bloc édité'); return redirect('build/campagne/'.$contents->newsletter_campagne_id.'#componant'); }
[ "public", "function", "update", "(", "Request", "$", "request", ")", "{", "$", "contents", "=", "$", "this", "->", "content", "->", "update", "(", "$", "request", "->", "all", "(", ")", ")", ";", "alert", "(", ")", "->", "success", "(", "'Bloc édité'...
Edit bloc from newsletter POST data @return Response
[ "Edit", "bloc", "from", "newsletter", "POST", "data" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/ContentController.php#L67-L74
DesignPond/newsletter
src/Http/Controllers/Backend/ContentController.php
ContentController.sorting
public function sorting(Request $request){ $data = $request->all(); $contents = $this->content->updateSorting($data['bloc_rang']); return 'ok'; }
php
public function sorting(Request $request){ $data = $request->all(); $contents = $this->content->updateSorting($data['bloc_rang']); return 'ok'; }
[ "public", "function", "sorting", "(", "Request", "$", "request", ")", "{", "$", "data", "=", "$", "request", "->", "all", "(", ")", ";", "$", "contents", "=", "$", "this", "->", "content", "->", "updateSorting", "(", "$", "data", "[", "'bloc_rang'", ...
Sorting bloc newsletter POST remove AJAX @return Response
[ "Sorting", "bloc", "newsletter", "POST", "remove", "AJAX" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/ContentController.php#L95-L102
DesignPond/newsletter
src/Http/Controllers/Backend/ContentController.php
ContentController.sortingGroup
public function sortingGroup(Request $request){ $model = new \App\Droit\Arret\Entities\Groupe(); $helper = new Helper(); $data = $request->all(); $groupe_rang = $data['groupe_rang']; $groupe_id = $data['groupe_id']; $arrets = $helper->prepareCategories($groupe_rang)...
php
public function sortingGroup(Request $request){ $model = new \App\Droit\Arret\Entities\Groupe(); $helper = new Helper(); $data = $request->all(); $groupe_rang = $data['groupe_rang']; $groupe_id = $data['groupe_id']; $arrets = $helper->prepareCategories($groupe_rang)...
[ "public", "function", "sortingGroup", "(", "Request", "$", "request", ")", "{", "$", "model", "=", "new", "\\", "App", "\\", "Droit", "\\", "Arret", "\\", "Entities", "\\", "Groupe", "(", ")", ";", "$", "helper", "=", "new", "Helper", "(", ")", ";", ...
Sorting bloc newsletter POST remove AJAX @return Response
[ "Sorting", "bloc", "newsletter", "POST", "remove", "AJAX" ]
train
https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/ContentController.php#L110-L126
surebert/surebert-framework
src/sb/PDO/Mysql/Utf8.php
Utf8.convert
public function convert(\PDO $db) { $this->setMaxExecutionTime(86400); $this->setMemoryLimit(2000); //find all the tables in the db $tables = []; $sql = "SHOW TABLES"; $stmt = $db->prepare($sql); $result = $stmt->execute(); if ($result) { $ta...
php
public function convert(\PDO $db) { $this->setMaxExecutionTime(86400); $this->setMemoryLimit(2000); //find all the tables in the db $tables = []; $sql = "SHOW TABLES"; $stmt = $db->prepare($sql); $result = $stmt->execute(); if ($result) { $ta...
[ "public", "function", "convert", "(", "\\", "PDO", "$", "db", ")", "{", "$", "this", "->", "setMaxExecutionTime", "(", "86400", ")", ";", "$", "this", "->", "setMemoryLimit", "(", "2000", ")", ";", "//find all the tables in the db", "$", "tables", "=", "["...
Converts entire db to UTF8, only run once then delete @servable true
[ "Converts", "entire", "db", "to", "UTF8", "only", "run", "once", "then", "delete" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/PDO/Mysql/Utf8.php#L14-L100
ezsystems/ezcomments-ls-extension
datatypes/ezcomcomments/ezcomcommentstype.php
ezcomCommentsType.objectAttributeContent
function objectAttributeContent( $objectAttribute ) { $ini = eZINI::instance( 'ezcomments.ini' ); $defaultShown = $ini->variable( 'GlobalSettings', 'DefaultShown' ); $defaultEnabled = $ini->variable( 'GlobalSettings', 'DefaultEnabled' ); $showComments = false; switch ( $objec...
php
function objectAttributeContent( $objectAttribute ) { $ini = eZINI::instance( 'ezcomments.ini' ); $defaultShown = $ini->variable( 'GlobalSettings', 'DefaultShown' ); $defaultEnabled = $ini->variable( 'GlobalSettings', 'DefaultEnabled' ); $showComments = false; switch ( $objec...
[ "function", "objectAttributeContent", "(", "$", "objectAttribute", ")", "{", "$", "ini", "=", "eZINI", "::", "instance", "(", "'ezcomments.ini'", ")", ";", "$", "defaultShown", "=", "$", "ini", "->", "variable", "(", "'GlobalSettings'", ",", "'DefaultShown'", ...
data_float->show comment: 1 to show comment, -1 not to show comment, other value to get default setting data_int->enable commenting: 1 to show comment, -1 not to show comment, other value to get default setting @see kernel/classes/eZDataType#objectAttributeContent($objectAttribute)
[ "data_float", "-", ">", "show", "comment", ":", "1", "to", "show", "comment", "-", "1", "not", "to", "show", "comment", "other", "value", "to", "get", "default", "setting", "data_int", "-", ">", "enable", "commenting", ":", "1", "to", "show", "comment", ...
train
https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/datatypes/ezcomcomments/ezcomcommentstype.php#L74-L110
ezsystems/ezcomments-ls-extension
datatypes/ezcomcomments/ezcomcommentstype.php
ezcomCommentsType.fetchObjectAttributeHTTPInput
function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute ) { $enabledName = $base . '_ezcomcomments_enabled_' . $contentObjectAttribute->attribute( 'id' ); $shownName = $base . '_ezcomcomments_shown_' . $contentObjectAttribute->attribute( 'id' ); $enabledValue = -1; ...
php
function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute ) { $enabledName = $base . '_ezcomcomments_enabled_' . $contentObjectAttribute->attribute( 'id' ); $shownName = $base . '_ezcomcomments_shown_' . $contentObjectAttribute->attribute( 'id' ); $enabledValue = -1; ...
[ "function", "fetchObjectAttributeHTTPInput", "(", "$", "http", ",", "$", "base", ",", "$", "contentObjectAttribute", ")", "{", "$", "enabledName", "=", "$", "base", ".", "'_ezcomcomments_enabled_'", ".", "$", "contentObjectAttribute", "->", "attribute", "(", "'id'...
put the option enabled of ezcomcomment into data_int of contentobjectattribute @see kernel/classes/eZDataType#fetchObjectAttributeHTTPInput($http, $base, $objectAttribute)
[ "put", "the", "option", "enabled", "of", "ezcomcomment", "into", "data_int", "of", "contentobjectattribute" ]
train
https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/datatypes/ezcomcomments/ezcomcommentstype.php#L117-L134
ezsystems/ezcomments-ls-extension
datatypes/ezcomcomments/ezcomcommentstype.php
ezcomCommentsType.deleteStoredObjectAttribute
function deleteStoredObjectAttribute( $contentObjectAttribute, $version = null ) { $version = $contentObjectAttribute->objectVersion(); if ( !is_null( $version ) && $version->attribute( 'status' ) == eZContentObjectVersion::STATUS_PUBLISHED ) { $contentObjectID = $co...
php
function deleteStoredObjectAttribute( $contentObjectAttribute, $version = null ) { $version = $contentObjectAttribute->objectVersion(); if ( !is_null( $version ) && $version->attribute( 'status' ) == eZContentObjectVersion::STATUS_PUBLISHED ) { $contentObjectID = $co...
[ "function", "deleteStoredObjectAttribute", "(", "$", "contentObjectAttribute", ",", "$", "version", "=", "null", ")", "{", "$", "version", "=", "$", "contentObjectAttribute", "->", "objectVersion", "(", ")", ";", "if", "(", "!", "is_null", "(", "$", "version",...
When deleting the content object, deleting all the comments. @see kernel/classes/eZDataType#deleteStoredObjectAttribute($objectAttribute, $version)
[ "When", "deleting", "the", "content", "object", "deleting", "all", "the", "comments", "." ]
train
https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/datatypes/ezcomcomments/ezcomcommentstype.php#L152-L164
zhouyl/mellivora
Mellivora/Helper/ProtobufHelper.php
ProtobufHelper.repeatWrapper
public function repeatWrapper($message, array $multiples) { $repeated = []; foreach ($multiples as $array) { $repeated[] = $this->wrapper($message, $array)->raw(); } return $repeated; }
php
public function repeatWrapper($message, array $multiples) { $repeated = []; foreach ($multiples as $array) { $repeated[] = $this->wrapper($message, $array)->raw(); } return $repeated; }
[ "public", "function", "repeatWrapper", "(", "$", "message", ",", "array", "$", "multiples", ")", "{", "$", "repeated", "=", "[", "]", ";", "foreach", "(", "$", "multiples", "as", "$", "array", ")", "{", "$", "repeated", "[", "]", "=", "$", "this", ...
对 Protobuf repeated 数据进行包裹,并返回数组 @param object|string $message @param array $multiples @return array
[ "对", "Protobuf", "repeated", "数据进行包裹,并返回数组" ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Helper/ProtobufHelper.php#L46-L54
snapwp/snap-blade
src/Blade_Service_Provider.php
Blade_Service_Provider.register
public function register() { $this->add_config_location(\realpath(__DIR__ . '/../config')); $this->add_blade(); Container::add( Blade_Strategy::class, function (\Snap\Core\Container $container) { return $container->resolve(Blade_Strategy::class); ...
php
public function register() { $this->add_config_location(\realpath(__DIR__ . '/../config')); $this->add_blade(); Container::add( Blade_Strategy::class, function (\Snap\Core\Container $container) { return $container->resolve(Blade_Strategy::class); ...
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "add_config_location", "(", "\\", "realpath", "(", "__DIR__", ".", "'/../config'", ")", ")", ";", "$", "this", "->", "add_blade", "(", ")", ";", "Container", "::", "add", "(", "Blade_Str...
Register the Service. @since 1.0.0
[ "Register", "the", "Service", "." ]
train
https://github.com/snapwp/snap-blade/blob/41e004e93440f6b58638b64dc8d20cca4a0546fa/src/Blade_Service_Provider.php#L26-L51
snapwp/snap-blade
src/Blade_Service_Provider.php
Blade_Service_Provider.add_blade
public function add_blade() { $blade = new Snap_Blade( Theme_Utils::get_active_theme_path(Config::get('theme.templates_directory')), Theme_Utils::get_active_theme_path(\trailingslashit(Config::get('theme.cache_directory')) . 'templates'), Config::get('blade.development_mo...
php
public function add_blade() { $blade = new Snap_Blade( Theme_Utils::get_active_theme_path(Config::get('theme.templates_directory')), Theme_Utils::get_active_theme_path(\trailingslashit(Config::get('theme.cache_directory')) . 'templates'), Config::get('blade.development_mo...
[ "public", "function", "add_blade", "(", ")", "{", "$", "blade", "=", "new", "Snap_Blade", "(", "Theme_Utils", "::", "get_active_theme_path", "(", "Config", "::", "get", "(", "'theme.templates_directory'", ")", ")", ",", "Theme_Utils", "::", "get_active_theme_path"...
Creates the Snap_blade instance, and adds to service container. @since 1.0.0
[ "Creates", "the", "Snap_blade", "instance", "and", "adds", "to", "service", "container", "." ]
train
https://github.com/snapwp/snap-blade/blob/41e004e93440f6b58638b64dc8d20cca4a0546fa/src/Blade_Service_Provider.php#L58-L85
snapwp/snap-blade
src/Blade_Service_Provider.php
Blade_Service_Provider.set_auth_callbacks
private function set_auth_callbacks($blade) { // Set the current user. if (\is_user_logged_in()) { $current_user = \wp_get_current_user(); $blade->setAuth($current_user->data->display_name, User_Utils::get_user_role()->name); } // Set the @can directive. ...
php
private function set_auth_callbacks($blade) { // Set the current user. if (\is_user_logged_in()) { $current_user = \wp_get_current_user(); $blade->setAuth($current_user->data->display_name, User_Utils::get_user_role()->name); } // Set the @can directive. ...
[ "private", "function", "set_auth_callbacks", "(", "$", "blade", ")", "{", "// Set the current user.", "if", "(", "\\", "is_user_logged_in", "(", ")", ")", "{", "$", "current_user", "=", "\\", "wp_get_current_user", "(", ")", ";", "$", "blade", "->", "setAuth",...
Sets the authentication and can/cannot functionality. @since 1.0.0 @param BladeOne $blade The BladeOne service.
[ "Sets", "the", "authentication", "and", "can", "/", "cannot", "functionality", "." ]
train
https://github.com/snapwp/snap-blade/blob/41e004e93440f6b58638b64dc8d20cca4a0546fa/src/Blade_Service_Provider.php#L94-L125
snapwp/snap-blade
src/Blade_Service_Provider.php
Blade_Service_Provider.add_directives
private function add_directives($blade) { $blade->directive( 'simplemenu', function ($expression) { \preg_match('/\( *(.*) * as *([^\)]*)/', $expression, $matches); $iteratee = \trim($matches[1]); $iter...
php
private function add_directives($blade) { $blade->directive( 'simplemenu', function ($expression) { \preg_match('/\( *(.*) * as *([^\)]*)/', $expression, $matches); $iteratee = \trim($matches[1]); $iter...
[ "private", "function", "add_directives", "(", "$", "blade", ")", "{", "$", "blade", "->", "directive", "(", "'simplemenu'", ",", "function", "(", "$", "expression", ")", "{", "\\", "preg_match", "(", "'/\\( *(.*) * as *([^\\)]*)/'", ",", "$", "expression", ","...
Add custom directives to blade. @since 1.0.0 @param BladeOne $blade The BladeOne service.
[ "Add", "custom", "directives", "to", "blade", "." ]
train
https://github.com/snapwp/snap-blade/blob/41e004e93440f6b58638b64dc8d20cca4a0546fa/src/Blade_Service_Provider.php#L134-L225
snapwp/snap-blade
src/Blade_Service_Provider.php
Blade_Service_Provider.add_wp_directives
private function add_wp_directives($blade) { $blade->directive( 'wphead', function () { return '<?php wp_head(); ?>'; } ); $blade->directive( 'wpfooter', function () { return '<?php wp_footer(); ?>';...
php
private function add_wp_directives($blade) { $blade->directive( 'wphead', function () { return '<?php wp_head(); ?>'; } ); $blade->directive( 'wpfooter', function () { return '<?php wp_footer(); ?>';...
[ "private", "function", "add_wp_directives", "(", "$", "blade", ")", "{", "$", "blade", "->", "directive", "(", "'wphead'", ",", "function", "(", ")", "{", "return", "'<?php wp_head(); ?>'", ";", "}", ")", ";", "$", "blade", "->", "directive", "(", "'wpfoot...
Add custom directives for WordPress functions to blade. @since 1.0.0 @param BladeOne $blade The BladeOne service.
[ "Add", "custom", "directives", "for", "WordPress", "functions", "to", "blade", "." ]
train
https://github.com/snapwp/snap-blade/blob/41e004e93440f6b58638b64dc8d20cca4a0546fa/src/Blade_Service_Provider.php#L234-L305
NuclearCMS/Hierarchy
src/Repositories/NodeFieldRepository.php
NodeFieldRepository.create
public function create($id, array $attributes) { $typeModelName = $this->getTypeModelName(); $nodeType = $typeModelName::findOrFail($id); $nodeField = $nodeType->addField($attributes); $this->builderService->buildField( $nodeField->getName(), $nodeField->ge...
php
public function create($id, array $attributes) { $typeModelName = $this->getTypeModelName(); $nodeType = $typeModelName::findOrFail($id); $nodeField = $nodeType->addField($attributes); $this->builderService->buildField( $nodeField->getName(), $nodeField->ge...
[ "public", "function", "create", "(", "$", "id", ",", "array", "$", "attributes", ")", "{", "$", "typeModelName", "=", "$", "this", "->", "getTypeModelName", "(", ")", ";", "$", "nodeType", "=", "$", "typeModelName", "::", "findOrFail", "(", "$", "id", ...
Creates a node field @param int $id @param array $attributes @return NodeFieldContract
[ "Creates", "a", "node", "field" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Repositories/NodeFieldRepository.php#L15-L32
NuclearCMS/Hierarchy
src/Repositories/NodeFieldRepository.php
NodeFieldRepository.destroy
public function destroy($id) { $modelName = $this->getModelName(); $nodeField = $modelName::findOrFail($id); $nodeField->delete(); $this->builderService->destroyField( $nodeField->getName(), $nodeField->nodeType->getName(), $nodeField->nodeType ...
php
public function destroy($id) { $modelName = $this->getModelName(); $nodeField = $modelName::findOrFail($id); $nodeField->delete(); $this->builderService->destroyField( $nodeField->getName(), $nodeField->nodeType->getName(), $nodeField->nodeType ...
[ "public", "function", "destroy", "(", "$", "id", ")", "{", "$", "modelName", "=", "$", "this", "->", "getModelName", "(", ")", ";", "$", "nodeField", "=", "$", "modelName", "::", "findOrFail", "(", "$", "id", ")", ";", "$", "nodeField", "->", "delete...
Destroys a node field @param int $id @return NodeFieldContract
[ "Destroys", "a", "node", "field" ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Repositories/NodeFieldRepository.php#L40-L54
zicht/z
src/Zicht/Tool/Command/Descriptor/TextDescriptor.php
TextDescriptor.describeCommand
protected function describeCommand(Command $command, array $options = array()) { list($public, $internal) = $this->splitDefinition($command->getNativeDefinition()); $synopsis = new Command($command->getName()); $synopsis->setDefinition($public); $this->writeText('<comment>Usage:</c...
php
protected function describeCommand(Command $command, array $options = array()) { list($public, $internal) = $this->splitDefinition($command->getNativeDefinition()); $synopsis = new Command($command->getName()); $synopsis->setDefinition($public); $this->writeText('<comment>Usage:</c...
[ "protected", "function", "describeCommand", "(", "Command", "$", "command", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "list", "(", "$", "public", ",", "$", "internal", ")", "=", "$", "this", "->", "splitDefinition", "(", "$", "com...
{@inheritdoc}
[ "{" ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Command/Descriptor/TextDescriptor.php#L30-L65
zicht/z
src/Zicht/Tool/Command/Descriptor/TextDescriptor.php
TextDescriptor.splitDefinition
public function splitDefinition(InputDefinition $definition) { /** @var InputDefinition[] $ret */ $ret = array( new InputDefinition(), new InputDefinition() ); foreach ($definition->getArguments() as $arg) { $ret[0]->addArgument($arg); ...
php
public function splitDefinition(InputDefinition $definition) { /** @var InputDefinition[] $ret */ $ret = array( new InputDefinition(), new InputDefinition() ); foreach ($definition->getArguments() as $arg) { $ret[0]->addArgument($arg); ...
[ "public", "function", "splitDefinition", "(", "InputDefinition", "$", "definition", ")", "{", "/** @var InputDefinition[] $ret */", "$", "ret", "=", "array", "(", "new", "InputDefinition", "(", ")", ",", "new", "InputDefinition", "(", ")", ")", ";", "foreach", "...
Splits the definition in an internal and public one, the latter representing whatever is shown to the user, the former representing the options that are hidden. @param \Symfony\Component\Console\Input\InputDefinition $definition @return InputDefinition[]
[ "Splits", "the", "definition", "in", "an", "internal", "and", "public", "one", "the", "latter", "representing", "whatever", "is", "shown", "to", "the", "user", "the", "former", "representing", "the", "options", "that", "are", "hidden", "." ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Command/Descriptor/TextDescriptor.php#L74-L90
Isset/pushnotification
src/PushNotification/Core/Message/MessageEnvelopeQueueImpl.php
MessageEnvelopeQueueImpl.split
public function split($identifier): MessageEnvelopeQueue { $return = new self(); $items = $this->queue; $this->clear(); $currentQueue = $return; foreach ($items as $item) { $currentQueue->add($item); if ($item->getMessage()->getIdentifier() === $identi...
php
public function split($identifier): MessageEnvelopeQueue { $return = new self(); $items = $this->queue; $this->clear(); $currentQueue = $return; foreach ($items as $item) { $currentQueue->add($item); if ($item->getMessage()->getIdentifier() === $identi...
[ "public", "function", "split", "(", "$", "identifier", ")", ":", "MessageEnvelopeQueue", "{", "$", "return", "=", "new", "self", "(", ")", ";", "$", "items", "=", "$", "this", "->", "queue", ";", "$", "this", "->", "clear", "(", ")", ";", "$", "cur...
@param string $identifier @throws LogicException @return MessageEnvelopeQueue
[ "@param", "string", "$identifier" ]
train
https://github.com/Isset/pushnotification/blob/5e7634dc6b1cf4f7c371d1890243a25252db0d85/src/PushNotification/Core/Message/MessageEnvelopeQueueImpl.php#L45-L59
Isset/pushnotification
src/PushNotification/Core/Message/MessageEnvelopeQueueImpl.php
MessageEnvelopeQueueImpl.remove
public function remove($identifier): Option { foreach ($this->queue as $key => $item) { if ($item->getMessage()->getIdentifier() === $identifier) { unset($this->queue[$key]); return Option::fromValue($item); } } return None::create();...
php
public function remove($identifier): Option { foreach ($this->queue as $key => $item) { if ($item->getMessage()->getIdentifier() === $identifier) { unset($this->queue[$key]); return Option::fromValue($item); } } return None::create();...
[ "public", "function", "remove", "(", "$", "identifier", ")", ":", "Option", "{", "foreach", "(", "$", "this", "->", "queue", "as", "$", "key", "=>", "$", "item", ")", "{", "if", "(", "$", "item", "->", "getMessage", "(", ")", "->", "getIdentifier", ...
@param $identifier @return Option<MessageEnvelope>
[ "@param", "$identifier" ]
train
https://github.com/Isset/pushnotification/blob/5e7634dc6b1cf4f7c371d1890243a25252db0d85/src/PushNotification/Core/Message/MessageEnvelopeQueueImpl.php#L92-L103
Isset/pushnotification
src/PushNotification/Core/Message/MessageEnvelopeQueueImpl.php
MessageEnvelopeQueueImpl.has
public function has($identifier): bool { foreach ($this->queue as $item) { if ($item->getMessage()->getIdentifier() === $identifier) { return true; } } return false; }
php
public function has($identifier): bool { foreach ($this->queue as $item) { if ($item->getMessage()->getIdentifier() === $identifier) { return true; } } return false; }
[ "public", "function", "has", "(", "$", "identifier", ")", ":", "bool", "{", "foreach", "(", "$", "this", "->", "queue", "as", "$", "item", ")", "{", "if", "(", "$", "item", "->", "getMessage", "(", ")", "->", "getIdentifier", "(", ")", "===", "$", ...
@param $identifier @return bool
[ "@param", "$identifier" ]
train
https://github.com/Isset/pushnotification/blob/5e7634dc6b1cf4f7c371d1890243a25252db0d85/src/PushNotification/Core/Message/MessageEnvelopeQueueImpl.php#L110-L119
trunda/SmfMenu
src/Smf/Menu/Renderer/Manager.php
Manager.addRenderer
public function addRenderer($name, $renderer, $overwrite = false) { if (isset($this->renderers[$name]) && !$overwrite) { throw new InvalidArgumentException("Renderer with name '$name' is already registered."); } unset($this->renderers[$name]); // Is class? Exists? ...
php
public function addRenderer($name, $renderer, $overwrite = false) { if (isset($this->renderers[$name]) && !$overwrite) { throw new InvalidArgumentException("Renderer with name '$name' is already registered."); } unset($this->renderers[$name]); // Is class? Exists? ...
[ "public", "function", "addRenderer", "(", "$", "name", ",", "$", "renderer", ",", "$", "overwrite", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "renderers", "[", "$", "name", "]", ")", "&&", "!", "$", "overwrite", ")", "{", ...
Ads renderer with given name @param string $name Name of the renderer @param string|IRenderer $renderer Renderer class name or instance @param bool $overwrite Should be overwritten renderer with this name if exists? @return IManager Fluent interface @throws InvalidArgumentException If the renderer with given name alrea...
[ "Ads", "renderer", "with", "given", "name" ]
train
https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Renderer/Manager.php#L25-L37
trunda/SmfMenu
src/Smf/Menu/Renderer/Manager.php
Manager.getRenderer
public function getRenderer($name) { // default if ($name === null) { if ($this->defaultRenderer !== null) { $name = $this->defaultRenderer; } else if (count($this->renderers) > 0) { $name = key($this->renderers); } } ...
php
public function getRenderer($name) { // default if ($name === null) { if ($this->defaultRenderer !== null) { $name = $this->defaultRenderer; } else if (count($this->renderers) > 0) { $name = key($this->renderers); } } ...
[ "public", "function", "getRenderer", "(", "$", "name", ")", "{", "// default", "if", "(", "$", "name", "===", "null", ")", "{", "if", "(", "$", "this", "->", "defaultRenderer", "!==", "null", ")", "{", "$", "name", "=", "$", "this", "->", "defaultRen...
Returns instance of the renderer @param string $name Name of the renderer @return IRenderer Renderer instance @throws InvalidArgumentException If the renderer with given name does not exist
[ "Returns", "instance", "of", "the", "renderer" ]
train
https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Renderer/Manager.php#L59-L84
zicht/z
src/Zicht/Tool/Command/DumpCommand.php
DumpCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln(Yaml::dump($this->getContainer()->getValues(), 5, 4)); }
php
protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln(Yaml::dump($this->getContainer()->getValues(), 5, 4)); }
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "output", "->", "writeln", "(", "Yaml", "::", "dump", "(", "$", "this", "->", "getContainer", "(", ")", "->", "getValues", "(", ...
Executes the command @param InputInterface $input @param OutputInterface $output @return void
[ "Executes", "the", "command" ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Command/DumpCommand.php#L40-L43
digipolisgent/robo-digipolis-package
src/PackageProject.php
PackageProject.getFiles
protected function getFiles() { $this->mirrorDir(); $this->prepareMirrorDir(); $this->printTaskInfo('Retrieving files to package.'); $mirrorFinder = new Finder(); $mirrorFinder->ignoreDotFiles(false); $add = []; $mirrorFinder ->in($this->tmpDir) ...
php
protected function getFiles() { $this->mirrorDir(); $this->prepareMirrorDir(); $this->printTaskInfo('Retrieving files to package.'); $mirrorFinder = new Finder(); $mirrorFinder->ignoreDotFiles(false); $add = []; $mirrorFinder ->in($this->tmpDir) ...
[ "protected", "function", "getFiles", "(", ")", "{", "$", "this", "->", "mirrorDir", "(", ")", ";", "$", "this", "->", "prepareMirrorDir", "(", ")", ";", "$", "this", "->", "printTaskInfo", "(", "'Retrieving files to package.'", ")", ";", "$", "mirrorFinder",...
Get the files and directories to package. @return array The list of files and directories to package.
[ "Get", "the", "files", "and", "directories", "to", "package", "." ]
train
https://github.com/digipolisgent/robo-digipolis-package/blob/6f206f32d910992d27b2a1b4dda1c5e7d8259b75/src/PackageProject.php#L117-L132
digipolisgent/robo-digipolis-package
src/PackageProject.php
PackageProject.mirrorDir
protected function mirrorDir() { if (!$this->useTmpDir) { $this->tmpDir = $this->dir; return; } $this->tmpDir = md5(time()); if (file_exists($this->tmpDir)) { $this->fs->remove($this->tmpDir); } $this->printTaskInfo(sprintf( ...
php
protected function mirrorDir() { if (!$this->useTmpDir) { $this->tmpDir = $this->dir; return; } $this->tmpDir = md5(time()); if (file_exists($this->tmpDir)) { $this->fs->remove($this->tmpDir); } $this->printTaskInfo(sprintf( ...
[ "protected", "function", "mirrorDir", "(", ")", "{", "if", "(", "!", "$", "this", "->", "useTmpDir", ")", "{", "$", "this", "->", "tmpDir", "=", "$", "this", "->", "dir", ";", "return", ";", "}", "$", "this", "->", "tmpDir", "=", "md5", "(", "tim...
Mirror the directory to a temp directory.
[ "Mirror", "the", "directory", "to", "a", "temp", "directory", "." ]
train
https://github.com/digipolisgent/robo-digipolis-package/blob/6f206f32d910992d27b2a1b4dda1c5e7d8259b75/src/PackageProject.php#L137-L186
digipolisgent/robo-digipolis-package
src/PackageProject.php
PackageProject.prepareMirrorDir
protected function prepareMirrorDir() { $this->printTaskInfo(sprintf('Preparing directory %s.', $this->tmpDir)); if (empty($this->ignoreFileNames)) { return; } $files = new Finder(); $files->in($this->tmpDir); $files->ignoreDotFiles(false); $files-...
php
protected function prepareMirrorDir() { $this->printTaskInfo(sprintf('Preparing directory %s.', $this->tmpDir)); if (empty($this->ignoreFileNames)) { return; } $files = new Finder(); $files->in($this->tmpDir); $files->ignoreDotFiles(false); $files-...
[ "protected", "function", "prepareMirrorDir", "(", ")", "{", "$", "this", "->", "printTaskInfo", "(", "sprintf", "(", "'Preparing directory %s.'", ",", "$", "this", "->", "tmpDir", ")", ")", ";", "if", "(", "empty", "(", "$", "this", "->", "ignoreFileNames", ...
Removes files that should not be packaged from the mirrored directory.
[ "Removes", "files", "that", "should", "not", "be", "packaged", "from", "the", "mirrored", "directory", "." ]
train
https://github.com/digipolisgent/robo-digipolis-package/blob/6f206f32d910992d27b2a1b4dda1c5e7d8259b75/src/PackageProject.php#L191-L207
digipolisgent/robo-digipolis-package
src/PackageProject.php
PackageProject.run
public function run() { if (is_null($this->dir)) { $projectRoot = $this->getConfig()->get('digipolis.root.project', null); $this->dir = is_null($projectRoot) ? getcwd() : $projectRoot; } $this->add($this->getFiles()); $result = ...
php
public function run() { if (is_null($this->dir)) { $projectRoot = $this->getConfig()->get('digipolis.root.project', null); $this->dir = is_null($projectRoot) ? getcwd() : $projectRoot; } $this->add($this->getFiles()); $result = ...
[ "public", "function", "run", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "dir", ")", ")", "{", "$", "projectRoot", "=", "$", "this", "->", "getConfig", "(", ")", "->", "get", "(", "'digipolis.root.project'", ",", "null", ")", ";", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/digipolisgent/robo-digipolis-package/blob/6f206f32d910992d27b2a1b4dda1c5e7d8259b75/src/PackageProject.php#L212-L229
inhere/php-librarys
src/Helpers/UtilHelper.php
UtilHelper.fd
public static function fd($object, $type = 'log') { $types = array('log', 'debug', 'info', 'warn', 'error', 'assert'); if (!\in_array($type, $types, true)) { $type = 'log'; } $data = json_encode($object); echo '<script type="text/javascript">console.' . $type ....
php
public static function fd($object, $type = 'log') { $types = array('log', 'debug', 'info', 'warn', 'error', 'assert'); if (!\in_array($type, $types, true)) { $type = 'log'; } $data = json_encode($object); echo '<script type="text/javascript">console.' . $type ....
[ "public", "static", "function", "fd", "(", "$", "object", ",", "$", "type", "=", "'log'", ")", "{", "$", "types", "=", "array", "(", "'log'", ",", "'debug'", ",", "'info'", ",", "'warn'", ",", "'error'", ",", "'assert'", ")", ";", "if", "(", "!", ...
Display a var dump in firebug console @param mixed $object Object to display @param string $type
[ "Display", "a", "var", "dump", "in", "firebug", "console" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/UtilHelper.php#L16-L27
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.parse
public function parse() { $p = 0; do { $p = $this->scanner->position(); $this->consumeData(); // FIXME: Add infinite loop protection. } while ($this->carryOn); }
php
public function parse() { $p = 0; do { $p = $this->scanner->position(); $this->consumeData(); // FIXME: Add infinite loop protection. } while ($this->carryOn); }
[ "public", "function", "parse", "(", ")", "{", "$", "p", "=", "0", ";", "do", "{", "$", "p", "=", "$", "this", "->", "scanner", "->", "position", "(", ")", ";", "$", "this", "->", "consumeData", "(", ")", ";", "// FIXME: Add infinite loop protection.", ...
Begin parsing. This will begin scanning the document, tokenizing as it goes. Tokens are emitted into the event handler. Tokenizing will continue until the document is completely read. Errors are emitted into the event handler, but the parser will attempt to continue parsing until the entire input stream is read.
[ "Begin", "parsing", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L154-L162
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.setTextMode
public function setTextMode($textmode, $untilTag = null) { $this->textMode = $textmode & (HTML5_Elements::TEXT_RAW | HTML5_Elements::TEXT_RCDATA); $this->untilTag = $untilTag; }
php
public function setTextMode($textmode, $untilTag = null) { $this->textMode = $textmode & (HTML5_Elements::TEXT_RAW | HTML5_Elements::TEXT_RCDATA); $this->untilTag = $untilTag; }
[ "public", "function", "setTextMode", "(", "$", "textmode", ",", "$", "untilTag", "=", "null", ")", "{", "$", "this", "->", "textMode", "=", "$", "textmode", "&", "(", "HTML5_Elements", "::", "TEXT_RAW", "|", "HTML5_Elements", "::", "TEXT_RCDATA", ")", ";",...
Set the text mode for the character data reader. HTML5 defines three different modes for reading text: - Normal: Read until a tag is encountered. - RCDATA: Read until a tag is encountered, but skip a few otherwise- special characters. - Raw: Read until a special closing tag is encountered (viz. pre, script) This allo...
[ "Set", "the", "text", "mode", "for", "the", "character", "data", "reader", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L184-L187
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.consumeData
protected function consumeData() { // Character Ref /* * $this->characterReference() || $this->tagOpen() || $this->eof() || $this->characterData(); */ $this->characterReference(); $this->tagOpen(); $this->eof(); $this->characterData(); return $t...
php
protected function consumeData() { // Character Ref /* * $this->characterReference() || $this->tagOpen() || $this->eof() || $this->characterData(); */ $this->characterReference(); $this->tagOpen(); $this->eof(); $this->characterData(); return $t...
[ "protected", "function", "consumeData", "(", ")", "{", "// Character Ref", "/*\n * $this->characterReference() || $this->tagOpen() || $this->eof() || $this->characterData();\n */", "$", "this", "->", "characterReference", "(", ")", ";", "$", "this", "->", "tagOpen...
Consume a character and make a move. HTML5 8.2.4.1
[ "Consume", "a", "character", "and", "make", "a", "move", ".", "HTML5", "8", ".", "2", ".", "4", ".", "1" ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L193-L204
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.characterData
protected function characterData() { if ($this->scanner->current() === false) { return false; } switch ($this->textMode) { case HTML5_Elements::TEXT_RAW: return $this->rawText(); case HTML5_Elements::TEXT_RCDATA: return $this->r...
php
protected function characterData() { if ($this->scanner->current() === false) { return false; } switch ($this->textMode) { case HTML5_Elements::TEXT_RAW: return $this->rawText(); case HTML5_Elements::TEXT_RCDATA: return $this->r...
[ "protected", "function", "characterData", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "===", "false", ")", "{", "return", "false", ";", "}", "switch", "(", "$", "this", "->", "textMode", ")", "{", "case", "HTML5...
Parse anything that looks like character data. Different rules apply based on the current text mode. @see HTML5_Elements::TEXT_RAW HTML5_Elements::TEXT_RCDATA.
[ "Parse", "anything", "that", "looks", "like", "character", "data", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L213-L229
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.text
protected function text() { $tok = $this->scanner->current(); // This should never happen... if ($tok === false) { return false; } // Null if ($tok === "\00") { $this->parseError("Received null character."); } // fprintf(STDOUT, "W...
php
protected function text() { $tok = $this->scanner->current(); // This should never happen... if ($tok === false) { return false; } // Null if ($tok === "\00") { $this->parseError("Received null character."); } // fprintf(STDOUT, "W...
[ "protected", "function", "text", "(", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "// This should never happen...", "if", "(", "$", "tok", "===", "false", ")", "{", "return", "false", ";", "}", "// Null", "i...
This buffers the current token as character data.
[ "This", "buffers", "the", "current", "token", "as", "character", "data", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L234-L249
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.rawText
protected function rawText() { if (is_null($this->untilTag)) { return $this->text(); } $sequence = '</' . $this->untilTag . '>'; $txt = $this->readUntilSequence($sequence); $this->events->text($txt); $this->setTextMode(0); return $this->endTag(); }
php
protected function rawText() { if (is_null($this->untilTag)) { return $this->text(); } $sequence = '</' . $this->untilTag . '>'; $txt = $this->readUntilSequence($sequence); $this->events->text($txt); $this->setTextMode(0); return $this->endTag(); }
[ "protected", "function", "rawText", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "untilTag", ")", ")", "{", "return", "$", "this", "->", "text", "(", ")", ";", "}", "$", "sequence", "=", "'</'", ".", "$", "this", "->", "untilTag", ...
Read text in RAW mode.
[ "Read", "text", "in", "RAW", "mode", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L254-L263
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.rcdata
protected function rcdata() { if (is_null($this->untilTag)) { return $this->text(); } $sequence = '</' . $this->untilTag . '>'; $txt = ''; $tok = $this->scanner->current(); while ($tok !== false && !($tok == '<' && ($this->sequenceMatches($sequence) || $this->...
php
protected function rcdata() { if (is_null($this->untilTag)) { return $this->text(); } $sequence = '</' . $this->untilTag . '>'; $txt = ''; $tok = $this->scanner->current(); while ($tok !== false && !($tok == '<' && ($this->sequenceMatches($sequence) || $this->...
[ "protected", "function", "rcdata", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "untilTag", ")", ")", "{", "return", "$", "this", "->", "text", "(", ")", ";", "}", "$", "sequence", "=", "'</'", ".", "$", "this", "->", "untilTag", ...
Read text in RCDATA mode.
[ "Read", "text", "in", "RCDATA", "mode", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L268-L287
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.eof
protected function eof() { if ($this->scanner->current() === false) { // fprintf(STDOUT, "EOF"); $this->flushBuffer(); $this->events->eof(); $this->carryOn = false; return true; } return false; }
php
protected function eof() { if ($this->scanner->current() === false) { // fprintf(STDOUT, "EOF"); $this->flushBuffer(); $this->events->eof(); $this->carryOn = false; return true; } return false; }
[ "protected", "function", "eof", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "===", "false", ")", "{", "// fprintf(STDOUT, \"EOF\");", "$", "this", "->", "flushBuffer", "(", ")", ";", "$", "this", "->", "events", "...
If the document is read, emit an EOF event.
[ "If", "the", "document", "is", "read", "emit", "an", "EOF", "event", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L292-L301
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.characterReference
protected function characterReference() { $ref = $this->decodeCharacterReference(); if ($ref !== false) { $this->buffer($ref); return true; } return false; }
php
protected function characterReference() { $ref = $this->decodeCharacterReference(); if ($ref !== false) { $this->buffer($ref); return true; } return false; }
[ "protected", "function", "characterReference", "(", ")", "{", "$", "ref", "=", "$", "this", "->", "decodeCharacterReference", "(", ")", ";", "if", "(", "$", "ref", "!==", "false", ")", "{", "$", "this", "->", "buffer", "(", "$", "ref", ")", ";", "ret...
Handle character references (aka entities). This version is specific to PCDATA, as it buffers data into the text buffer. For a generic version, see decodeCharacterReference(). HTML5 8.2.4.2
[ "Handle", "character", "references", "(", "aka", "entities", ")", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L311-L318
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.tagOpen
protected function tagOpen() { if ($this->scanner->current() != '<') { return false; } // Any buffered text data can go out now. $this->flushBuffer(); $this->scanner->next(); return $this->markupDeclaration() || $this->endTag() || $this->processingInstructi...
php
protected function tagOpen() { if ($this->scanner->current() != '<') { return false; } // Any buffered text data can go out now. $this->flushBuffer(); $this->scanner->next(); return $this->markupDeclaration() || $this->endTag() || $this->processingInstructi...
[ "protected", "function", "tagOpen", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'<'", ")", "{", "return", "false", ";", "}", "// Any buffered text data can go out now.", "$", "this", "->", "flushBuffer", "(", "...
Emit a tagStart event on encountering a tag. 8.2.4.8
[ "Emit", "a", "tagStart", "event", "on", "encountering", "a", "tag", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L325-L338
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.markupDeclaration
protected function markupDeclaration() { if ($this->scanner->current() != '!') { return false; } $tok = $this->scanner->next(); // Comment: if ($tok == '-' && $this->scanner->peek() == '-') { $this->scanner->next(); // Consume the other '-' $...
php
protected function markupDeclaration() { if ($this->scanner->current() != '!') { return false; } $tok = $this->scanner->next(); // Comment: if ($tok == '-' && $this->scanner->peek() == '-') { $this->scanner->next(); // Consume the other '-' $...
[ "protected", "function", "markupDeclaration", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'!'", ")", "{", "return", "false", ";", "}", "$", "tok", "=", "$", "this", "->", "scanner", "->", "next", "(", "...
Look for markup.
[ "Look", "for", "markup", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L343-L365
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.endTag
protected function endTag() { if ($this->scanner->current() != '/') { return false; } $tok = $this->scanner->next(); // a-zA-Z -> tagname // > -> parse error // EOF -> parse error // -> parse error if (!ctype_alpha($tok)) { $this->...
php
protected function endTag() { if ($this->scanner->current() != '/') { return false; } $tok = $this->scanner->next(); // a-zA-Z -> tagname // > -> parse error // EOF -> parse error // -> parse error if (!ctype_alpha($tok)) { $this->...
[ "protected", "function", "endTag", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'/'", ")", "{", "return", "false", ";", "}", "$", "tok", "=", "$", "this", "->", "scanner", "->", "next", "(", ")", ";", ...
Consume an end tag. 8.2.4.9
[ "Consume", "an", "end", "tag", ".", "8", ".", "2", ".", "4", ".", "9" ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L371-L402
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.tagName
protected function tagName() { $tok = $this->scanner->current(); if (!ctype_alpha($tok)) { return false; } // We know this is at least one char. $name = strtolower($this->scanner->charsWhile(":_-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")); ...
php
protected function tagName() { $tok = $this->scanner->current(); if (!ctype_alpha($tok)) { return false; } // We know this is at least one char. $name = strtolower($this->scanner->charsWhile(":_-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")); ...
[ "protected", "function", "tagName", "(", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "if", "(", "!", "ctype_alpha", "(", "$", "tok", ")", ")", "{", "return", "false", ";", "}", "// We know this is at least o...
Consume a tag name and body. 8.2.4.10
[ "Consume", "a", "tag", "name", "and", "body", ".", "8", ".", "2", ".", "4", ".", "10" ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L408-L442
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.isTagEnd
protected function isTagEnd(&$selfClose) { $tok = $this->scanner->current(); if ($tok == '/') { $this->scanner->next(); $this->scanner->whitespace(); if ($this->scanner->current() == '>') { $selfClose = true; return true; } ...
php
protected function isTagEnd(&$selfClose) { $tok = $this->scanner->current(); if ($tok == '/') { $this->scanner->next(); $this->scanner->whitespace(); if ($this->scanner->current() == '>') { $selfClose = true; return true; } ...
[ "protected", "function", "isTagEnd", "(", "&", "$", "selfClose", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "if", "(", "$", "tok", "==", "'/'", ")", "{", "$", "this", "->", "scanner", "->", "next", "(...
Check if the scanner has reached the end of a tag.
[ "Check", "if", "the", "scanner", "has", "reached", "the", "end", "of", "a", "tag", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L447-L475
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.attribute
protected function attribute(&$attributes) { $tok = $this->scanner->current(); if ($tok == '/' || $tok == '>' || $tok === false) { return false; } if ($tok == '<') { $this->parseError("Unexepcted '<' inside of attributes list."); // Push the < back on...
php
protected function attribute(&$attributes) { $tok = $this->scanner->current(); if ($tok == '/' || $tok == '>' || $tok === false) { return false; } if ($tok == '<') { $this->parseError("Unexepcted '<' inside of attributes list."); // Push the < back on...
[ "protected", "function", "attribute", "(", "&", "$", "attributes", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "if", "(", "$", "tok", "==", "'/'", "||", "$", "tok", "==", "'>'", "||", "$", "tok", "==="...
Parse attributes from inside of a tag.
[ "Parse", "attributes", "from", "inside", "of", "a", "tag", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L480-L531
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.attributeValue
protected function attributeValue() { if ($this->scanner->current() != '=') { return null; } $this->scanner->next(); // 8.1.2.3 $this->scanner->whitespace(); $tok = $this->scanner->current(); switch ($tok) { case "\n": case "\f...
php
protected function attributeValue() { if ($this->scanner->current() != '=') { return null; } $this->scanner->next(); // 8.1.2.3 $this->scanner->whitespace(); $tok = $this->scanner->current(); switch ($tok) { case "\n": case "\f...
[ "protected", "function", "attributeValue", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'='", ")", "{", "return", "null", ";", "}", "$", "this", "->", "scanner", "->", "next", "(", ")", ";", "// 8.1.2.3", ...
Consume an attribute value. 8.2.4.37 and after.
[ "Consume", "an", "attribute", "value", ".", "8", ".", "2", ".", "4", ".", "37", "and", "after", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L537-L568
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.quotedAttributeValue
protected function quotedAttributeValue($quote) { $stoplist = "\f" . $quote; $val = ''; $tok = $this->scanner->current(); while (strspn($tok, $stoplist) == 0 && $tok !== false) { if ($tok == '&') { $val .= $this->decodeCharacterReference(true); ...
php
protected function quotedAttributeValue($quote) { $stoplist = "\f" . $quote; $val = ''; $tok = $this->scanner->current(); while (strspn($tok, $stoplist) == 0 && $tok !== false) { if ($tok == '&') { $val .= $this->decodeCharacterReference(true); ...
[ "protected", "function", "quotedAttributeValue", "(", "$", "quote", ")", "{", "$", "stoplist", "=", "\"\\f\"", ".", "$", "quote", ";", "$", "val", "=", "''", ";", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "while",...
Get an attribute value string. @param string $quote IMPORTANT: This is a series of chars! Any one of which will be considered termination of an attribute's value. E.g. "\"'" will stop at either ' or ". @return string The attribute value.
[ "Get", "an", "attribute", "value", "string", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L579-L594
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.bogusComment
protected function bogusComment($leading = '') { // TODO: This can be done more efficiently when the // scanner exposes a readUntil() method. $comment = $leading; $tok = $this->scanner->current(); do { $comment .= $tok; $tok = $this->scanner->next(); ...
php
protected function bogusComment($leading = '') { // TODO: This can be done more efficiently when the // scanner exposes a readUntil() method. $comment = $leading; $tok = $this->scanner->current(); do { $comment .= $tok; $tok = $this->scanner->next(); ...
[ "protected", "function", "bogusComment", "(", "$", "leading", "=", "''", ")", "{", "// TODO: This can be done more efficiently when the", "// scanner exposes a readUntil() method.", "$", "comment", "=", "$", "leading", ";", "$", "tok", "=", "$", "this", "->", "scanner...
Consume malformed markup as if it were a comment. 8.2.4.44 The spec requires that the ENTIRE tag-like thing be enclosed inside of the comment. So this will generate comments like: &lt;!--&lt/+foo&gt;--&gt; @param string $leading Prepend any leading characters. This essentially negates the need to backtrack, but it's...
[ "Consume", "malformed", "markup", "as", "if", "it", "were", "a", "comment", ".", "8", ".", "2", ".", "4", ".", "44" ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L629-L645
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.comment
protected function comment() { $tok = $this->scanner->current(); $comment = ''; // <!-->. Emit an empty comment because 8.2.4.46 says to. if ($tok == '>') { // Parse error. Emit the comment token. $this->parseError("Expected comment data, got '>'"); $...
php
protected function comment() { $tok = $this->scanner->current(); $comment = ''; // <!-->. Emit an empty comment because 8.2.4.46 says to. if ($tok == '>') { // Parse error. Emit the comment token. $this->parseError("Expected comment data, got '>'"); $...
[ "protected", "function", "comment", "(", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "$", "comment", "=", "''", ";", "// <!-->. Emit an empty comment because 8.2.4.46 says to.", "if", "(", "$", "tok", "==", "'>'",...
Read a comment. Expects the first tok to be inside of the comment.
[ "Read", "a", "comment", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L652-L677
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.isCommentEnd
protected function isCommentEnd() { // EOF if ($this->scanner->current() === false) { // Hit the end. $this->parseError("Unexpected EOF in a comment."); return true; } // If it doesn't start with -, not the end. if ($this->scanner->current() !...
php
protected function isCommentEnd() { // EOF if ($this->scanner->current() === false) { // Hit the end. $this->parseError("Unexpected EOF in a comment."); return true; } // If it doesn't start with -, not the end. if ($this->scanner->current() !...
[ "protected", "function", "isCommentEnd", "(", ")", "{", "// EOF", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "===", "false", ")", "{", "// Hit the end.", "$", "this", "->", "parseError", "(", "\"Unexpected EOF in a comment.\"", ")", ...
Check if the scanner has reached the end of a comment.
[ "Check", "if", "the", "scanner", "has", "reached", "the", "end", "of", "a", "comment", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L682-L703
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.doctype
protected function doctype() { if (strcasecmp($this->scanner->current(), 'D')) { return false; } // Check that string is DOCTYPE. $chars = $this->scanner->charsWhile("DOCTYPEdoctype"); if (strcasecmp($chars, 'DOCTYPE')) { $this->parseError('Expected DOCTYP...
php
protected function doctype() { if (strcasecmp($this->scanner->current(), 'D')) { return false; } // Check that string is DOCTYPE. $chars = $this->scanner->charsWhile("DOCTYPEdoctype"); if (strcasecmp($chars, 'DOCTYPE')) { $this->parseError('Expected DOCTYP...
[ "protected", "function", "doctype", "(", ")", "{", "if", "(", "strcasecmp", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", ",", "'D'", ")", ")", "{", "return", "false", ";", "}", "// Check that string is DOCTYPE.", "$", "chars", "=", "$", ...
Parse a DOCTYPE. Parse a DOCTYPE declaration. This method has strong bearing on whether or not Quirksmode is enabled on the event handler. @todo This method is a little long. Should probably refactor.
[ "Parse", "a", "DOCTYPE", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L713-L817
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.quotedString
protected function quotedString($stopchars) { $tok = $this->scanner->current(); if ($tok == '"' || $tok == "'") { $this->scanner->next(); $ret = $this->scanner->charsUntil($tok . $stopchars); if ($this->scanner->current() == $tok) { $this->scanner->nex...
php
protected function quotedString($stopchars) { $tok = $this->scanner->current(); if ($tok == '"' || $tok == "'") { $this->scanner->next(); $ret = $this->scanner->charsUntil($tok . $stopchars); if ($this->scanner->current() == $tok) { $this->scanner->nex...
[ "protected", "function", "quotedString", "(", "$", "stopchars", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "if", "(", "$", "tok", "==", "'\"'", "||", "$", "tok", "==", "\"'\"", ")", "{", "$", "this", ...
Utility for reading a quoted string. @param string $stopchars Characters (in addition to a close-quote) that should stop the string. E.g. sometimes '>' is higher precedence than '"' or "'". @return mixed String if one is found (quotations omitted)
[ "Utility", "for", "reading", "a", "quoted", "string", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L827-L841
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.cdataSection
protected function cdataSection() { if ($this->scanner->current() != '[') { return false; } $cdata = ''; $this->scanner->next(); $chars = $this->scanner->charsWhile('CDAT'); if ($chars != 'CDATA' || $this->scanner->current() != '[') { $this->parse...
php
protected function cdataSection() { if ($this->scanner->current() != '[') { return false; } $cdata = ''; $this->scanner->next(); $chars = $this->scanner->charsWhile('CDAT'); if ($chars != 'CDATA' || $this->scanner->current() != '[') { $this->parse...
[ "protected", "function", "cdataSection", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'['", ")", "{", "return", "false", ";", "}", "$", "cdata", "=", "''", ";", "$", "this", "->", "scanner", "->", "next"...
Handle a CDATA section.
[ "Handle", "a", "CDATA", "section", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L846-L875
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.processingInstruction
protected function processingInstruction() { if ($this->scanner->current() != '?') { return false; } $tok = $this->scanner->next(); $procName = $this->scanner->getAsciiAlpha(); $white = strlen($this->scanner->whitespace()); // If not a PI, send to bogusComme...
php
protected function processingInstruction() { if ($this->scanner->current() != '?') { return false; } $tok = $this->scanner->next(); $procName = $this->scanner->getAsciiAlpha(); $white = strlen($this->scanner->whitespace()); // If not a PI, send to bogusComme...
[ "protected", "function", "processingInstruction", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'?'", ")", "{", "return", "false", ";", "}", "$", "tok", "=", "$", "this", "->", "scanner", "->", "next", "(",...
Handle a processing instruction. XML processing instructions are supposed to be ignored in HTML5, treated as "bogus comments". However, since we're not a user agent, we allow them. We consume until ?> and then issue a EventListener::processingInstruction() event.
[ "Handle", "a", "processing", "instruction", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L888-L921
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.readUntilSequence
protected function readUntilSequence($sequence) { $buffer = ''; // Optimization for reading larger blocks faster. $first = substr($sequence, 0, 1); while ($this->scanner->current() !== false) { $buffer .= $this->scanner->charsUntil($first); // Stop as soon as we...
php
protected function readUntilSequence($sequence) { $buffer = ''; // Optimization for reading larger blocks faster. $first = substr($sequence, 0, 1); while ($this->scanner->current() !== false) { $buffer .= $this->scanner->charsUntil($first); // Stop as soon as we...
[ "protected", "function", "readUntilSequence", "(", "$", "sequence", ")", "{", "$", "buffer", "=", "''", ";", "// Optimization for reading larger blocks faster.", "$", "first", "=", "substr", "(", "$", "sequence", ",", "0", ",", "1", ")", ";", "while", "(", "...
Read from the input stream until we get to the desired sequene or hit the end of the input stream.
[ "Read", "from", "the", "input", "stream", "until", "we", "get", "to", "the", "desired", "sequene", "or", "hit", "the", "end", "of", "the", "input", "stream", "." ]
train
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L931-L950