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
yuncms/framework
src/console/controllers/TaskController.php
TaskController.actionRun
public function actionRun() { $crontab = Task::findAll(['switch' => Task::SWITCH_ACTIVE]); $tasks = []; foreach ($crontab as $task) { // 第一次运行,先计算下次运行时间 if (!$task->next_rundate) { $task->next_rundate = $task->getNextRunDate(); $task->...
php
public function actionRun() { $crontab = Task::findAll(['switch' => Task::SWITCH_ACTIVE]); $tasks = []; foreach ($crontab as $task) { // 第一次运行,先计算下次运行时间 if (!$task->next_rundate) { $task->next_rundate = $task->getNextRunDate(); $task->...
[ "public", "function", "actionRun", "(", ")", "{", "$", "crontab", "=", "Task", "::", "findAll", "(", "[", "'switch'", "=>", "Task", "::", "SWITCH_ACTIVE", "]", ")", ";", "$", "tasks", "=", "[", "]", ";", "foreach", "(", "$", "crontab", "as", "$", "...
定时任务入口 @return int Exit code
[ "定时任务入口" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/console/controllers/TaskController.php#L31-L51
yuncms/framework
src/console/controllers/TaskController.php
TaskController.getCurrentTime
private function getCurrentTime() { list ($msec, $sec) = explode(" ", microtime()); return (float)$msec + (float)$sec; }
php
private function getCurrentTime() { list ($msec, $sec) = explode(" ", microtime()); return (float)$msec + (float)$sec; }
[ "private", "function", "getCurrentTime", "(", ")", "{", "list", "(", "$", "msec", ",", "$", "sec", ")", "=", "explode", "(", "\" \"", ",", "microtime", "(", ")", ")", ";", "return", "(", "float", ")", "$", "msec", "+", "(", "float", ")", "$", "se...
获取当前时间 @return float
[ "获取当前时间" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/console/controllers/TaskController.php#L94-L98
photogabble/laravel-remember-uploads
src/ViewComposers/RememberedFilesComposer.php
RememberedFilesComposer.compose
public function compose(View $view) { /** @var RememberedFileBag $rememberedFiles */ $rememberedFiles = $this->session->get('_remembered_files', new RememberedFileBag()); $view->with('rememberedFiles', $rememberedFiles->toFileBag()); }
php
public function compose(View $view) { /** @var RememberedFileBag $rememberedFiles */ $rememberedFiles = $this->session->get('_remembered_files', new RememberedFileBag()); $view->with('rememberedFiles', $rememberedFiles->toFileBag()); }
[ "public", "function", "compose", "(", "View", "$", "view", ")", "{", "/** @var RememberedFileBag $rememberedFiles */", "$", "rememberedFiles", "=", "$", "this", "->", "session", "->", "get", "(", "'_remembered_files'", ",", "new", "RememberedFileBag", "(", ")", ")...
Bind data to the view. @param View $view @return void
[ "Bind", "data", "to", "the", "view", "." ]
train
https://github.com/photogabble/laravel-remember-uploads/blob/28d0667d2de74e5cd4f1980920df828cc5f99514/src/ViewComposers/RememberedFilesComposer.php#L33-L38
askupasoftware/amarkal
Extensions/WordPress/Plugin/AbstractPlugin.php
AbstractPlugin.register_hooks
private function register_hooks() { register_activation_hook( $this->plugin_file, get_called_class().'::activate' ); register_deactivation_hook( $this->plugin_file, get_called_class().'::deactivate' ); register_uninstall_hook...
php
private function register_hooks() { register_activation_hook( $this->plugin_file, get_called_class().'::activate' ); register_deactivation_hook( $this->plugin_file, get_called_class().'::deactivate' ); register_uninstall_hook...
[ "private", "function", "register_hooks", "(", ")", "{", "register_activation_hook", "(", "$", "this", "->", "plugin_file", ",", "get_called_class", "(", ")", ".", "'::activate'", ")", ";", "register_deactivation_hook", "(", "$", "this", "->", "plugin_file", ",", ...
Register hooks that are fired when the plugin is activated, deactivated, and uninstalled, respectively. The array's first argument is the name of the plugin defined in `class-plugin-name.php`
[ "Register", "hooks", "that", "are", "fired", "when", "the", "plugin", "is", "activated", "deactivated", "and", "uninstalled", "respectively", ".", "The", "array", "s", "first", "argument", "is", "the", "name", "of", "the", "plugin", "defined", "in", "class", ...
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Plugin/AbstractPlugin.php#L33-L49
yuncms/framework
src/behaviors/UUIDBehavior.php
UUIDBehavior.init
public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_VALIDATE => $this->attribute]; } }
php
public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_VALIDATE => $this->attribute]; } }
[ "public", "function", "init", "(", ")", "{", "parent", "::", "init", "(", ")", ";", "if", "(", "empty", "(", "$", "this", "->", "attributes", ")", ")", "{", "$", "this", "->", "attributes", "=", "[", "BaseActiveRecord", "::", "EVENT_BEFORE_VALIDATE", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/behaviors/UUIDBehavior.php#L80-L86
yuncms/framework
src/behaviors/UUIDBehavior.php
UUIDBehavior.getValue
protected function getValue($event) { if (!empty($this->owner->{$this->attribute})) { return $this->owner->{$this->attribute}; } if ($this->value === null) { $uuid = $this->generateUUID(); } else { $uuid = parent::getValue($event); } ...
php
protected function getValue($event) { if (!empty($this->owner->{$this->attribute})) { return $this->owner->{$this->attribute}; } if ($this->value === null) { $uuid = $this->generateUUID(); } else { $uuid = parent::getValue($event); } ...
[ "protected", "function", "getValue", "(", "$", "event", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "owner", "->", "{", "$", "this", "->", "attribute", "}", ")", ")", "{", "return", "$", "this", "->", "owner", "->", "{", "$", "this...
{@inheritdoc} @throws \Exception
[ "{" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/behaviors/UUIDBehavior.php#L92-L103
yuncms/framework
src/behaviors/UUIDBehavior.php
UUIDBehavior.makeUnique
protected function makeUnique($uuid): string { $uniqueUUID = $uuid; $iteration = 0; while (!$this->validateUUID($uniqueUUID)) { $iteration++; $uniqueUUID = $this->generateUUID(); } return $uniqueUUID; }
php
protected function makeUnique($uuid): string { $uniqueUUID = $uuid; $iteration = 0; while (!$this->validateUUID($uniqueUUID)) { $iteration++; $uniqueUUID = $this->generateUUID(); } return $uniqueUUID; }
[ "protected", "function", "makeUnique", "(", "$", "uuid", ")", ":", "string", "{", "$", "uniqueUUID", "=", "$", "uuid", ";", "$", "iteration", "=", "0", ";", "while", "(", "!", "$", "this", "->", "validateUUID", "(", "$", "uniqueUUID", ")", ")", "{", ...
This method is called by [[getValue]] when [[ensureUnique]] is true to generate the unique uuid. @param string $uuid @return string unique uuid @throws InvalidConfigException @throws \Exception @see getValue
[ "This", "method", "is", "called", "by", "[[", "getValue", "]]", "when", "[[", "ensureUnique", "]]", "is", "true", "to", "generate", "the", "unique", "uuid", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/behaviors/UUIDBehavior.php#L124-L133
yuncms/framework
src/behaviors/UUIDBehavior.php
UUIDBehavior.validateUUID
protected function validateUUID($uuid) { /* @var $validator UniqueValidator */ /* @var $model BaseActiveRecord */ $validator = Yii::createObject(array_merge([ 'class' => UniqueValidator::class, ], $this->uniqueValidator)); $model = clone $this->owner; $mo...
php
protected function validateUUID($uuid) { /* @var $validator UniqueValidator */ /* @var $model BaseActiveRecord */ $validator = Yii::createObject(array_merge([ 'class' => UniqueValidator::class, ], $this->uniqueValidator)); $model = clone $this->owner; $mo...
[ "protected", "function", "validateUUID", "(", "$", "uuid", ")", "{", "/* @var $validator UniqueValidator */", "/* @var $model BaseActiveRecord */", "$", "validator", "=", "Yii", "::", "createObject", "(", "array_merge", "(", "[", "'class'", "=>", "UniqueValidator", "::"...
Checks if given uuid value is unique. @param string $uuid slug value @return bool whether slug is unique. @throws InvalidConfigException
[ "Checks", "if", "given", "uuid", "value", "is", "unique", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/behaviors/UUIDBehavior.php#L141-L155
parsnick/steak
src/Source.php
Source.changeExtension
public function changeExtension($rename) { $search = ''; $replace = ''; if (is_array($rename)) { $search = key($rename); $replace = current($rename); } if (is_string($rename)) { $search = pathinfo($this->outputPathname, PATHINFO_EXTENSION...
php
public function changeExtension($rename) { $search = ''; $replace = ''; if (is_array($rename)) { $search = key($rename); $replace = current($rename); } if (is_string($rename)) { $search = pathinfo($this->outputPathname, PATHINFO_EXTENSION...
[ "public", "function", "changeExtension", "(", "$", "rename", ")", "{", "$", "search", "=", "''", ";", "$", "replace", "=", "''", ";", "if", "(", "is_array", "(", "$", "rename", ")", ")", "{", "$", "search", "=", "key", "(", "$", "rename", ")", ";...
Change the extension of the output pathname. @param array|string|null $rename @return $this
[ "Change", "the", "extension", "of", "the", "output", "pathname", "." ]
train
https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Source.php#L33-L51
symfony-bundle/bootstrap-bundle
src/Anezi/Bundle/BootstrapBundle/Command/BootstrapExtraAssetsInstallCommand.php
BootstrapExtraAssetsInstallCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $targetArg = rtrim($input->getArgument('target'), '/'); if (!is_dir($targetArg)) { throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target'))); ...
php
protected function execute(InputInterface $input, OutputInterface $output) { $targetArg = rtrim($input->getArgument('target'), '/'); if (!is_dir($targetArg)) { throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target'))); ...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "targetArg", "=", "rtrim", "(", "$", "input", "->", "getArgument", "(", "'target'", ")", ",", "'/'", ")", ";", "if", "(", "!", ...
{@inheritdoc} @throws \InvalidArgumentException When the target directory does not exist or symlink cannot be used
[ "{", "@inheritdoc", "}" ]
train
https://github.com/symfony-bundle/bootstrap-bundle/blob/b4e3f10f0ae2ebcea7636234c5c01771746dd81c/src/Anezi/Bundle/BootstrapBundle/Command/BootstrapExtraAssetsInstallCommand.php#L42-L85
arsengoian/viper-framework
src/Viper/Core/Model/Traits/Depictable.php
Depictable.setImg
final public function setImg(array $picture_arr, string $address) { $this -> set("img", self::registerImg($picture_arr, $address)); }
php
final public function setImg(array $picture_arr, string $address) { $this -> set("img", self::registerImg($picture_arr, $address)); }
[ "final", "public", "function", "setImg", "(", "array", "$", "picture_arr", ",", "string", "$", "address", ")", "{", "$", "this", "->", "set", "(", "\"img\"", ",", "self", "::", "registerImg", "(", "$", "picture_arr", ",", "$", "address", ")", ")", ";",...
TODO add parameters
[ "TODO", "add", "parameters" ]
train
https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Core/Model/Traits/Depictable.php#L15-L17
arsengoian/viper-framework
src/Viper/Core/Model/Traits/Depictable.php
Depictable.cropimage
final public static function cropimage(string $address) { $w = getimagesize($address)[0]; $h = getimagesize($address)[1]; if ($w == $h) return; $img = WideImage::load($address); if ($w > $h) $cr = $img -> crop(floor(($w - $h)/2), 0, $h, $h); el...
php
final public static function cropimage(string $address) { $w = getimagesize($address)[0]; $h = getimagesize($address)[1]; if ($w == $h) return; $img = WideImage::load($address); if ($w > $h) $cr = $img -> crop(floor(($w - $h)/2), 0, $h, $h); el...
[ "final", "public", "static", "function", "cropimage", "(", "string", "$", "address", ")", "{", "$", "w", "=", "getimagesize", "(", "$", "address", ")", "[", "0", "]", ";", "$", "h", "=", "getimagesize", "(", "$", "address", ")", "[", "1", "]", ";",...
TODO add proportions
[ "TODO", "add", "proportions" ]
train
https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Core/Model/Traits/Depictable.php#L68-L84
mihai-stancu/serializer
Serializer/Encoder/YamlEncoder.php
YamlEncoder.encode
public function encode($data, $format, array $context = array()) { if ($this->native) { return yaml_emit($data, YAML_UTF8_ENCODING, YAML_LN_BREAK); } return $this->encoder->dump($data); }
php
public function encode($data, $format, array $context = array()) { if ($this->native) { return yaml_emit($data, YAML_UTF8_ENCODING, YAML_LN_BREAK); } return $this->encoder->dump($data); }
[ "public", "function", "encode", "(", "$", "data", ",", "$", "format", ",", "array", "$", "context", "=", "array", "(", ")", ")", "{", "if", "(", "$", "this", "->", "native", ")", "{", "return", "yaml_emit", "(", "$", "data", ",", "YAML_UTF8_ENCODING"...
@param mixed $data @param string $format @param array $context @return string
[ "@param", "mixed", "$data", "@param", "string", "$format", "@param", "array", "$context" ]
train
https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Encoder/YamlEncoder.php#L62-L69
mihai-stancu/serializer
Serializer/Encoder/YamlEncoder.php
YamlEncoder.decode
public function decode($data, $format, array $context = array()) { if ($this->native) { return yaml_parse($data); } return $this->decoder->parse($data); }
php
public function decode($data, $format, array $context = array()) { if ($this->native) { return yaml_parse($data); } return $this->decoder->parse($data); }
[ "public", "function", "decode", "(", "$", "data", ",", "$", "format", ",", "array", "$", "context", "=", "array", "(", ")", ")", "{", "if", "(", "$", "this", "->", "native", ")", "{", "return", "yaml_parse", "(", "$", "data", ")", ";", "}", "retu...
@param string $data @param string $format @param array $context @return mixed
[ "@param", "string", "$data", "@param", "string", "$format", "@param", "array", "$context" ]
train
https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Encoder/YamlEncoder.php#L78-L85
aedart/laravel-helpers
src/Traits/Auth/PasswordBrokerManagerTrait.php
PasswordBrokerManagerTrait.getPasswordBrokerManager
public function getPasswordBrokerManager(): ?PasswordBrokerManager { if (!$this->hasPasswordBrokerManager()) { $this->setPasswordBrokerManager($this->getDefaultPasswordBrokerManager()); } return $this->passwordBrokerManager; }
php
public function getPasswordBrokerManager(): ?PasswordBrokerManager { if (!$this->hasPasswordBrokerManager()) { $this->setPasswordBrokerManager($this->getDefaultPasswordBrokerManager()); } return $this->passwordBrokerManager; }
[ "public", "function", "getPasswordBrokerManager", "(", ")", ":", "?", "PasswordBrokerManager", "{", "if", "(", "!", "$", "this", "->", "hasPasswordBrokerManager", "(", ")", ")", "{", "$", "this", "->", "setPasswordBrokerManager", "(", "$", "this", "->", "getDe...
Get password broker manager If no password broker manager has been set, this method will set and return a default password broker manager, if any such value is available @see getDefaultPasswordBrokerManager() @return PasswordBrokerManager|null password broker manager or null if none password broker manager has been ...
[ "Get", "password", "broker", "manager" ]
train
https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Auth/PasswordBrokerManagerTrait.php#L53-L59
VincentChalnot/SidusAdminBundle
Action/DeleteAction.php
DeleteAction.applyAction
protected function applyAction(Request $request, FormInterface $form, $data): Response { $this->doctrineHelper->deleteEntity($this->action, $data, $request->getSession()); return $this->routingHelper->redirectToAction( $this->action->getAdmin()->getAction( $this->action-...
php
protected function applyAction(Request $request, FormInterface $form, $data): Response { $this->doctrineHelper->deleteEntity($this->action, $data, $request->getSession()); return $this->routingHelper->redirectToAction( $this->action->getAdmin()->getAction( $this->action-...
[ "protected", "function", "applyAction", "(", "Request", "$", "request", ",", "FormInterface", "$", "form", ",", "$", "data", ")", ":", "Response", "{", "$", "this", "->", "doctrineHelper", "->", "deleteEntity", "(", "$", "this", "->", "action", ",", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/VincentChalnot/SidusAdminBundle/blob/3366f3f1525435860cf275ed2f1f0b58cf6eea18/Action/DeleteAction.php#L45-L54
krzysztofmazur/php-object-mapper
src/KrzysztofMazur/ObjectMapper/Mapping/Field/ValueWriter/AbstractValueWriter.php
AbstractValueWriter.write
public function write($object, $value) { if ($object === null) { throw new \InvalidArgumentException("Unexpected null value"); } $reference = $object; if ($this->valueReader !== null) { $reference = $this->valueReader->read($reference); } $thi...
php
public function write($object, $value) { if ($object === null) { throw new \InvalidArgumentException("Unexpected null value"); } $reference = $object; if ($this->valueReader !== null) { $reference = $this->valueReader->read($reference); } $thi...
[ "public", "function", "write", "(", "$", "object", ",", "$", "value", ")", "{", "if", "(", "$", "object", "===", "null", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"Unexpected null value\"", ")", ";", "}", "$", "reference", "=", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/krzysztofmazur/php-object-mapper/blob/2c22acad9634cfe8e9a75d72e665d450ada8d4e3/src/KrzysztofMazur/ObjectMapper/Mapping/Field/ValueWriter/AbstractValueWriter.php#L42-L53
tylerjuniorcollege/slim-layout
src/Asset/Container.php
Container.insertAsset
public function insertAsset(AssetAbstract $asset, $location) { array_splice($this->assets, $location, 0, array($asset)); return $this; }
php
public function insertAsset(AssetAbstract $asset, $location) { array_splice($this->assets, $location, 0, array($asset)); return $this; }
[ "public", "function", "insertAsset", "(", "AssetAbstract", "$", "asset", ",", "$", "location", ")", "{", "array_splice", "(", "$", "this", "->", "assets", ",", "$", "location", ",", "0", ",", "array", "(", "$", "asset", ")", ")", ";", "return", "$", ...
This will insert an asset in to a specific location in the array and then shift the element keys.
[ "This", "will", "insert", "an", "asset", "in", "to", "a", "specific", "location", "in", "the", "array", "and", "then", "shift", "the", "element", "keys", "." ]
train
https://github.com/tylerjuniorcollege/slim-layout/blob/60939b9f7502b90bf319fe741a747dd40ef61bfe/src/Asset/Container.php#L30-L33
phpmob/changmin
src/PhpMob/CoreBundle/Context/UserSettingContext.php
UserSettingContext.get
public function get($path) { return $this->settingManager->get($path, $this->tokenStorage->getToken()->getUsername()); }
php
public function get($path) { return $this->settingManager->get($path, $this->tokenStorage->getToken()->getUsername()); }
[ "public", "function", "get", "(", "$", "path", ")", "{", "return", "$", "this", "->", "settingManager", "->", "get", "(", "$", "path", ",", "$", "this", "->", "tokenStorage", "->", "getToken", "(", ")", "->", "getUsername", "(", ")", ")", ";", "}" ]
@param string $path eg. section.key @return mixed
[ "@param", "string", "$path", "eg", ".", "section", ".", "key" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CoreBundle/Context/UserSettingContext.php#L49-L52
factorio-item-browser/export-data
src/Entity/Mod/Dependency.php
Dependency.writeData
public function writeData(): array { $dataBuilder = new DataBuilder(); $dataBuilder->setString('m', $this->requiredModName, '') ->setString('v', $this->requiredVersion, '') ->setInteger('r', $this->isMandatory ? 1 : 0, 0); return $dataBuilder->getData(...
php
public function writeData(): array { $dataBuilder = new DataBuilder(); $dataBuilder->setString('m', $this->requiredModName, '') ->setString('v', $this->requiredVersion, '') ->setInteger('r', $this->isMandatory ? 1 : 0, 0); return $dataBuilder->getData(...
[ "public", "function", "writeData", "(", ")", ":", "array", "{", "$", "dataBuilder", "=", "new", "DataBuilder", "(", ")", ";", "$", "dataBuilder", "->", "setString", "(", "'m'", ",", "$", "this", "->", "requiredModName", ",", "''", ")", "->", "setString",...
Writes the entity data to an array. @return array
[ "Writes", "the", "entity", "data", "to", "an", "array", "." ]
train
https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Mod/Dependency.php#L102-L109
factorio-item-browser/export-data
src/Entity/Mod/Dependency.php
Dependency.readData
public function readData(DataContainer $data) { $this->requiredModName = $data->getString('m', ''); $this->requiredVersion = $data->getString('v', ''); $this->isMandatory = $data->getInteger('r', 0) === 1; return $this; }
php
public function readData(DataContainer $data) { $this->requiredModName = $data->getString('m', ''); $this->requiredVersion = $data->getString('v', ''); $this->isMandatory = $data->getInteger('r', 0) === 1; return $this; }
[ "public", "function", "readData", "(", "DataContainer", "$", "data", ")", "{", "$", "this", "->", "requiredModName", "=", "$", "data", "->", "getString", "(", "'m'", ",", "''", ")", ";", "$", "this", "->", "requiredVersion", "=", "$", "data", "->", "ge...
Reads the entity data. @param DataContainer $data @return $this
[ "Reads", "the", "entity", "data", "." ]
train
https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Mod/Dependency.php#L116-L122
factorio-item-browser/export-data
src/Entity/Mod/Dependency.php
Dependency.calculateHash
public function calculateHash(): string { return EntityUtils::calculateHashOfArray([ $this->requiredModName, $this->requiredVersion, $this->isMandatory, ]); }
php
public function calculateHash(): string { return EntityUtils::calculateHashOfArray([ $this->requiredModName, $this->requiredVersion, $this->isMandatory, ]); }
[ "public", "function", "calculateHash", "(", ")", ":", "string", "{", "return", "EntityUtils", "::", "calculateHashOfArray", "(", "[", "$", "this", "->", "requiredModName", ",", "$", "this", "->", "requiredVersion", ",", "$", "this", "->", "isMandatory", ",", ...
Calculates a hash value representing the entity. @return string
[ "Calculates", "a", "hash", "value", "representing", "the", "entity", "." ]
train
https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Mod/Dependency.php#L128-L135
yuncms/framework
src/notifications/Notification.php
Notification.getContent
public function getContent() { $params = $this->getData(); $p = []; foreach ($params as $name => $value) { $p['{' . $name . '}'] = $value; } return strtr($this->getTemplate(), $p); }
php
public function getContent() { $params = $this->getData(); $p = []; foreach ($params as $name => $value) { $p['{' . $name . '}'] = $value; } return strtr($this->getTemplate(), $p); }
[ "public", "function", "getContent", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getData", "(", ")", ";", "$", "p", "=", "[", "]", ";", "foreach", "(", "$", "params", "as", "$", "name", "=>", "$", "value", ")", "{", "$", "p", "[", "...
获取详细内容 @return string
[ "获取详细内容" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/notifications/Notification.php#L89-L97
yuncms/framework
src/notifications/Notification.php
Notification.toCloudPush
public function toCloudPush() { return Yii::createObject([ 'class' => CloudPushMessage::class, 'title' => $this->getTitle(), 'content' => $this->getContent(), 'extParameters' => $this->getData() ]); }
php
public function toCloudPush() { return Yii::createObject([ 'class' => CloudPushMessage::class, 'title' => $this->getTitle(), 'content' => $this->getContent(), 'extParameters' => $this->getData() ]); }
[ "public", "function", "toCloudPush", "(", ")", "{", "return", "Yii", "::", "createObject", "(", "[", "'class'", "=>", "CloudPushMessage", "::", "class", ",", "'title'", "=>", "$", "this", "->", "getTitle", "(", ")", ",", "'content'", "=>", "$", "this", "...
推送到CloudPush 渠道 @return CloudPushMessage @throws \yii\base\InvalidConfigException
[ "推送到CloudPush", "渠道" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/notifications/Notification.php#L126-L134
yuncms/framework
src/rest/models/AvatarForm.php
AvatarForm.save
public function save() { if ($this->validate()) { try { if (AvatarHelper::save($this->getUser(), $this->_originalImage)) { $this->file = null; $this->faceUrl = AvatarHelper::getAvatar($this->getUser()); return true; ...
php
public function save() { if ($this->validate()) { try { if (AvatarHelper::save($this->getUser(), $this->_originalImage)) { $this->file = null; $this->faceUrl = AvatarHelper::getAvatar($this->getUser()); return true; ...
[ "public", "function", "save", "(", ")", "{", "if", "(", "$", "this", "->", "validate", "(", ")", ")", "{", "try", "{", "if", "(", "AvatarHelper", "::", "save", "(", "$", "this", "->", "getUser", "(", ")", ",", "$", "this", "->", "_originalImage", ...
保存头像 @return boolean
[ "保存头像" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/models/AvatarForm.php#L60-L78
yuncms/framework
src/rest/models/AvatarForm.php
AvatarForm.afterValidate
public function afterValidate() { //保存原图 if (($this->_originalImage = $this->file->saveAsTempFile()) == false) { $this->addError('file', Yii::t('yuncms', 'Failed to save the image.')); } parent::afterValidate(); }
php
public function afterValidate() { //保存原图 if (($this->_originalImage = $this->file->saveAsTempFile()) == false) { $this->addError('file', Yii::t('yuncms', 'Failed to save the image.')); } parent::afterValidate(); }
[ "public", "function", "afterValidate", "(", ")", "{", "//保存原图", "if", "(", "(", "$", "this", "->", "_originalImage", "=", "$", "this", "->", "file", "->", "saveAsTempFile", "(", ")", ")", "==", "false", ")", "{", "$", "this", "->", "addError", "(", "...
验证后保存原图 @throws \yii\base\Exception
[ "验证后保存原图" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/models/AvatarForm.php#L90-L97
webforge-labs/psc-cms
lib/Psc/PHPExcel/RangeReadFilter.php
RangeReadFilter.readCell
public function readCell($column, $row, $worksheetName = '') { return ($row >= $this->firstRow && $row <= $this->lastRow && array_key_exists($column, $this->range)); }
php
public function readCell($column, $row, $worksheetName = '') { return ($row >= $this->firstRow && $row <= $this->lastRow && array_key_exists($column, $this->range)); }
[ "public", "function", "readCell", "(", "$", "column", ",", "$", "row", ",", "$", "worksheetName", "=", "''", ")", "{", "return", "(", "$", "row", ">=", "$", "this", "->", "firstRow", "&&", "$", "row", "<=", "$", "this", "->", "lastRow", "&&", "arra...
Should this cell be read? @param $column String column index @param $row Row index @param $worksheetName Optional worksheet name @return boolean
[ "Should", "this", "cell", "be", "read?" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/PHPExcel/RangeReadFilter.php#L51-L55
ruvents/ruwork-upload-bundle
Source/SourceResolver.php
SourceResolver.resolve
public function resolve($source): ResolvedSourceInterface { foreach ($this->handlers as $handler) { if ($handler->supports($source)) { return $this->createResolvedSource($source, $handler); } } throw new \RuntimeException('No handler.'); }
php
public function resolve($source): ResolvedSourceInterface { foreach ($this->handlers as $handler) { if ($handler->supports($source)) { return $this->createResolvedSource($source, $handler); } } throw new \RuntimeException('No handler.'); }
[ "public", "function", "resolve", "(", "$", "source", ")", ":", "ResolvedSourceInterface", "{", "foreach", "(", "$", "this", "->", "handlers", "as", "$", "handler", ")", "{", "if", "(", "$", "handler", "->", "supports", "(", "$", "source", ")", ")", "{"...
{@inheritdoc}
[ "{" ]
train
https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Source/SourceResolver.php#L48-L57
orchestral/theme-installer
src/ThemeInstaller.php
ThemeInstaller.getInstallPath
public function getInstallPath(PackageInterface $package) { $name = $package->getExtra()['theme-name'] ?? null; if (is_null($name)) { [, $name] = $package->getPrettyName(); $name = str_replace('-theme', '', $name); } return 'public/themes/'.$name; }
php
public function getInstallPath(PackageInterface $package) { $name = $package->getExtra()['theme-name'] ?? null; if (is_null($name)) { [, $name] = $package->getPrettyName(); $name = str_replace('-theme', '', $name); } return 'public/themes/'.$name; }
[ "public", "function", "getInstallPath", "(", "PackageInterface", "$", "package", ")", "{", "$", "name", "=", "$", "package", "->", "getExtra", "(", ")", "[", "'theme-name'", "]", "??", "null", ";", "if", "(", "is_null", "(", "$", "name", ")", ")", "{",...
{@inheritdoc}
[ "{" ]
train
https://github.com/orchestral/theme-installer/blob/ddc84f8f0c8993229a35e11786b42faa123d0b85/src/ThemeInstaller.php#L13-L24
forxer/tao
src/Tao/Templating/Helpers/FormElements.php
FormElements.select
public function select($mNameId, $aData, $mDefault = null, $sClass = null, $iTabindex = null, $bDisabled = false, $bMultiple = false, $sExtraHtml = null) { self::getNameAndId($mNameId, $sName, $sId); $res = '<select name="' . $sName . '"'; $res .= null === $sId ? '' : ' id="' . $sId . '"'; ...
php
public function select($mNameId, $aData, $mDefault = null, $sClass = null, $iTabindex = null, $bDisabled = false, $bMultiple = false, $sExtraHtml = null) { self::getNameAndId($mNameId, $sName, $sId); $res = '<select name="' . $sName . '"'; $res .= null === $sId ? '' : ' id="' . $sId . '"'; ...
[ "public", "function", "select", "(", "$", "mNameId", ",", "$", "aData", ",", "$", "mDefault", "=", "null", ",", "$", "sClass", "=", "null", ",", "$", "iTabindex", "=", "null", ",", "$", "bDisabled", "=", "false", ",", "$", "bMultiple", "=", "false", ...
Retourne un champ de formulaire de type select. @param mixed $mNameId Le nom et l'identifiant du champ @param array $aData Le tableau contenant les lignes d'option du select @param mixed $mDefault La valeur sélectionnée par défaut @param string $sClass La classe CSS de l'élément @param integer $iTabindex Le tabindex d...
[ "Retourne", "un", "champ", "de", "formulaire", "de", "type", "select", "." ]
train
https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Templating/Helpers/FormElements.php#L21-L39
forxer/tao
src/Tao/Templating/Helpers/FormElements.php
FormElements.selectOptions
public function selectOptions($aData, $mDefault) { $res = ''; $option = '<option value="%1$s"%3$s>%2$s</option>' . PHP_EOL; $optgroup = '<optgroup label="%1$s">' . PHP_EOL . '%2$s' . "</optgroup>\n"; foreach ($aData as $k => $v) { if (is_array($v)) { ...
php
public function selectOptions($aData, $mDefault) { $res = ''; $option = '<option value="%1$s"%3$s>%2$s</option>' . PHP_EOL; $optgroup = '<optgroup label="%1$s">' . PHP_EOL . '%2$s' . "</optgroup>\n"; foreach ($aData as $k => $v) { if (is_array($v)) { ...
[ "public", "function", "selectOptions", "(", "$", "aData", ",", "$", "mDefault", ")", "{", "$", "res", "=", "''", ";", "$", "option", "=", "'<option value=\"%1$s\"%3$s>%2$s</option>'", ".", "PHP_EOL", ";", "$", "optgroup", "=", "'<optgroup label=\"%1$s\">'", ".",...
Retourne les options d'un élément select. @param array $aData Le tableau contenant les lignes d'option du select @param mixed $mDefault La valeur sélectionnée par défaut @return string
[ "Retourne", "les", "options", "d", "un", "élément", "select", "." ]
train
https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Templating/Helpers/FormElements.php#L48-L76
forxer/tao
src/Tao/Templating/Helpers/FormElements.php
FormElements.checkbox
public function checkbox($mNameId, $value, $checked = '', $sClass = null, $iTabindex = null, $bDisabled = false, $sExtraHtml = null) { self::getNameAndId($mNameId, $sName, $sId); $res = '<input type="checkbox" name="' . $sName . '" value="' . $value . '"'; $res .= null === $sId ? '' : ' id=...
php
public function checkbox($mNameId, $value, $checked = '', $sClass = null, $iTabindex = null, $bDisabled = false, $sExtraHtml = null) { self::getNameAndId($mNameId, $sName, $sId); $res = '<input type="checkbox" name="' . $sName . '" value="' . $value . '"'; $res .= null === $sId ? '' : ' id=...
[ "public", "function", "checkbox", "(", "$", "mNameId", ",", "$", "value", ",", "$", "checked", "=", "''", ",", "$", "sClass", "=", "null", ",", "$", "iTabindex", "=", "null", ",", "$", "bDisabled", "=", "false", ",", "$", "sExtraHtml", "=", "null", ...
Retourne un champ de formulaire de type checkbox. @param mixed $mNameId Le nom et l'identifiant du champ @param mixed $value La valeur de l'élément @param boolean $checked L'état par défaut de l'élément @param string $sClass La classe CSS de l'élément @param integer $iTabindex Le tabindex de l'élément @param boolean $...
[ "Retourne", "un", "champ", "de", "formulaire", "de", "type", "checkbox", "." ]
train
https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Templating/Helpers/FormElements.php#L118-L132
forxer/tao
src/Tao/Templating/Helpers/FormElements.php
FormElements.text
public function text($mNameId, $size, $max = null, $sDefault = null, $sClass = null, $sPlaceholder = null, $iTabindex = null, $bDisabled = false, $sExtraHtml = null) { self::getNameAndId($mNameId, $sName, $sId); $res = '<input type="text" size="' . $size . '" name="' . $sName . '"'; $res .=...
php
public function text($mNameId, $size, $max = null, $sDefault = null, $sClass = null, $sPlaceholder = null, $iTabindex = null, $bDisabled = false, $sExtraHtml = null) { self::getNameAndId($mNameId, $sName, $sId); $res = '<input type="text" size="' . $size . '" name="' . $sName . '"'; $res .=...
[ "public", "function", "text", "(", "$", "mNameId", ",", "$", "size", ",", "$", "max", "=", "null", ",", "$", "sDefault", "=", "null", ",", "$", "sClass", "=", "null", ",", "$", "sPlaceholder", "=", "null", ",", "$", "iTabindex", "=", "null", ",", ...
Retourne un champ de formulaire de type text. @param mixed $mNameId Le nom et l'identifiant du champ @param integer $size La taille de l'élément en nombre de caractères @param integer $max Le nombre maximum de caractères @param string $sDefault La valeur par défaut de lélément @param string $sClass La classe CSS de l'...
[ "Retourne", "un", "champ", "de", "formulaire", "de", "type", "text", "." ]
train
https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Templating/Helpers/FormElements.php#L148-L164
forxer/tao
src/Tao/Templating/Helpers/FormElements.php
FormElements.file
public function file($mNameId, $sDefault = null, $sClass = null, $iTabindex = null, $bDisabled = false, $sExtraHtml = null) { self::getNameAndId($mNameId, $sName, $sId); $res = '<input type="file" name="' . $sName . '"'; $res .= null === $sId ? '' : ' id="' . $sId . '"'; $res .= nul...
php
public function file($mNameId, $sDefault = null, $sClass = null, $iTabindex = null, $bDisabled = false, $sExtraHtml = null) { self::getNameAndId($mNameId, $sName, $sId); $res = '<input type="file" name="' . $sName . '"'; $res .= null === $sId ? '' : ' id="' . $sId . '"'; $res .= nul...
[ "public", "function", "file", "(", "$", "mNameId", ",", "$", "sDefault", "=", "null", ",", "$", "sClass", "=", "null", ",", "$", "iTabindex", "=", "null", ",", "$", "bDisabled", "=", "false", ",", "$", "sExtraHtml", "=", "null", ")", "{", "self", "...
Retourne un champ de formulaire de type file. @param mixed $mNameId Le nom et l'identifiant du champ @param string $sDefault La valeur par défaut de lélément @param string $sClass La classe CSS de l'élément @param integer $iTabindex Le tabindex de l'élément @param boolean $bDisabled Désactiver ou non le champ @param s...
[ "Retourne", "un", "champ", "de", "formulaire", "de", "type", "file", "." ]
train
https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Templating/Helpers/FormElements.php#L177-L191
forxer/tao
src/Tao/Templating/Helpers/FormElements.php
FormElements.textarea
public function textarea($mNameId, $iCols = null, $iRows = null, $sDefault = null, $sClass = null, $sPlaceholder = null, $iTabindex = null, $bDisabled = false, $sExtraHtml = null) { self::getNameAndId($mNameId, $sName, $sId); $res = '<textarea'; $res .= null === $iCols ? '' : ' cols="' . $i...
php
public function textarea($mNameId, $iCols = null, $iRows = null, $sDefault = null, $sClass = null, $sPlaceholder = null, $iTabindex = null, $bDisabled = false, $sExtraHtml = null) { self::getNameAndId($mNameId, $sName, $sId); $res = '<textarea'; $res .= null === $iCols ? '' : ' cols="' . $i...
[ "public", "function", "textarea", "(", "$", "mNameId", ",", "$", "iCols", "=", "null", ",", "$", "iRows", "=", "null", ",", "$", "sDefault", "=", "null", ",", "$", "sClass", "=", "null", ",", "$", "sPlaceholder", "=", "null", ",", "$", "iTabindex", ...
Retourne un champ de formulaire de type textarea. @param mixed $mNameId Le nom et l'identifiant du champ @param integer $iCols Le nombre de colonnes @param integer $iRows Le nombre de lignes @param string $sDefault La valeur par défaut de lélément @param string $sClass La classe CSS de l'élément @param string $sPlaceh...
[ "Retourne", "un", "champ", "de", "formulaire", "de", "type", "textarea", "." ]
train
https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Templating/Helpers/FormElements.php#L237-L255
forxer/tao
src/Tao/Templating/Helpers/FormElements.php
FormElements.hidden
public function hidden($mNameId, $value) { self::getNameAndId($mNameId, $sName, $sId); $res = '<input type="hidden" name="' . $sName . '" value="' . $value . '" '; $res .= null === $sId ? '' : ' id="' . $sId . '"'; $res .= '>'; return $res; }
php
public function hidden($mNameId, $value) { self::getNameAndId($mNameId, $sName, $sId); $res = '<input type="hidden" name="' . $sName . '" value="' . $value . '" '; $res .= null === $sId ? '' : ' id="' . $sId . '"'; $res .= '>'; return $res; }
[ "public", "function", "hidden", "(", "$", "mNameId", ",", "$", "value", ")", "{", "self", "::", "getNameAndId", "(", "$", "mNameId", ",", "$", "sName", ",", "$", "sId", ")", ";", "$", "res", "=", "'<input type=\"hidden\" name=\"'", ".", "$", "sName", "...
Retourne un champ de formulaire de type hidden. @param mixed $mNameId Le nom et l'identifiant du champ @param string $value La valeur par de lélément @return string
[ "Retourne", "un", "champ", "de", "formulaire", "de", "type", "hidden", "." ]
train
https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Templating/Helpers/FormElements.php#L264-L273
forxer/tao
src/Tao/Templating/Helpers/FormElements.php
FormElements.getNameAndId
protected static function getNameAndId($mNameId, &$sName, &$sId) { if (is_array($mNameId)) { $sName = $mNameId[0]; $sId = !empty($mNameId[1]) ? $mNameId[1] : null; } else { $sName = $sId = $mNameId; } }
php
protected static function getNameAndId($mNameId, &$sName, &$sId) { if (is_array($mNameId)) { $sName = $mNameId[0]; $sId = !empty($mNameId[1]) ? $mNameId[1] : null; } else { $sName = $sId = $mNameId; } }
[ "protected", "static", "function", "getNameAndId", "(", "$", "mNameId", ",", "&", "$", "sName", ",", "&", "$", "sId", ")", "{", "if", "(", "is_array", "(", "$", "mNameId", ")", ")", "{", "$", "sName", "=", "$", "mNameId", "[", "0", "]", ";", "$",...
Retourne l'identifiant et le nom du champ en fonction des paramètres passés en argument. @param mixed $mNameId @param string $sName @param string $sId
[ "Retourne", "l", "identifiant", "et", "le", "nom", "du", "champ", "en", "fonction", "des", "paramètres", "passés", "en", "argument", "." ]
train
https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Templating/Helpers/FormElements.php#L283-L293
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByStreet
public function filterByStreet($street = null, $comparison = null) { if (null === $comparison) { if (is_array($street)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $street)) { $street = str_replace('*', '%', $street); ...
php
public function filterByStreet($street = null, $comparison = null) { if (null === $comparison) { if (is_array($street)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $street)) { $street = str_replace('*', '%', $street); ...
[ "public", "function", "filterByStreet", "(", "$", "street", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "null", "===", "$", "comparison", ")", "{", "if", "(", "is_array", "(", "$", "street", ")", ")", "{", "$", "comparison"...
Filter the query on the street column Example usage: <code> $query->filterByStreet('fooValue'); // WHERE street = 'fooValue' $query->filterByStreet('%fooValue%'); // WHERE street LIKE '%fooValue%' </code> @param string $street The value to use as filter. Accepts wildcards (* and % trigger a LIKE) @param str...
[ "Filter", "the", "query", "on", "the", "street", "column" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L376-L388
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByZip
public function filterByZip($zip = null, $comparison = null) { if (null === $comparison) { if (is_array($zip)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $zip)) { $zip = str_replace('*', '%', $zip); $comparison = Cri...
php
public function filterByZip($zip = null, $comparison = null) { if (null === $comparison) { if (is_array($zip)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $zip)) { $zip = str_replace('*', '%', $zip); $comparison = Cri...
[ "public", "function", "filterByZip", "(", "$", "zip", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "null", "===", "$", "comparison", ")", "{", "if", "(", "is_array", "(", "$", "zip", ")", ")", "{", "$", "comparison", "=", ...
Filter the query on the zip column Example usage: <code> $query->filterByZip('fooValue'); // WHERE zip = 'fooValue' $query->filterByZip('%fooValue%'); // WHERE zip LIKE '%fooValue%' </code> @param string $zip The value to use as filter. Accepts wildcards (* and % trigger a LIKE) @param string $comparison Op...
[ "Filter", "the", "query", "on", "the", "zip", "column" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L405-L417
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByCity
public function filterByCity($city = null, $comparison = null) { if (null === $comparison) { if (is_array($city)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $city)) { $city = str_replace('*', '%', $city); $comparison...
php
public function filterByCity($city = null, $comparison = null) { if (null === $comparison) { if (is_array($city)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $city)) { $city = str_replace('*', '%', $city); $comparison...
[ "public", "function", "filterByCity", "(", "$", "city", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "null", "===", "$", "comparison", ")", "{", "if", "(", "is_array", "(", "$", "city", ")", ")", "{", "$", "comparison", "=...
Filter the query on the city column Example usage: <code> $query->filterByCity('fooValue'); // WHERE city = 'fooValue' $query->filterByCity('%fooValue%'); // WHERE city LIKE '%fooValue%' </code> @param string $city The value to use as filter. Accepts wildcards (* and % trigger a LIKE) @param string $compari...
[ "Filter", "the", "query", "on", "the", "city", "column" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L434-L446
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByCountryId
public function filterByCountryId($countryId = null, $comparison = null) { if (is_array($countryId)) { $useMinMax = false; if (isset($countryId['min'])) { $this->addUsingAlias(CustomerPeer::COUNTRY_ID, $countryId['min'], Criteria::GREATER_EQUAL); $useM...
php
public function filterByCountryId($countryId = null, $comparison = null) { if (is_array($countryId)) { $useMinMax = false; if (isset($countryId['min'])) { $this->addUsingAlias(CustomerPeer::COUNTRY_ID, $countryId['min'], Criteria::GREATER_EQUAL); $useM...
[ "public", "function", "filterByCountryId", "(", "$", "countryId", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "countryId", ")", ")", "{", "$", "useMinMax", "=", "false", ";", "if", "(", "isset", "(", "...
Filter the query on the country_id column Example usage: <code> $query->filterByCountryId(1234); // WHERE country_id = 1234 $query->filterByCountryId(array(12, 34)); // WHERE country_id IN (12, 34) $query->filterByCountryId(array('min' => 12)); // WHERE country_id >= 12 $query->filterByCountryId(array('max' => 12)); /...
[ "Filter", "the", "query", "on", "the", "country_id", "column" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L469-L490
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByFax
public function filterByFax($fax = null, $comparison = null) { if (null === $comparison) { if (is_array($fax)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $fax)) { $fax = str_replace('*', '%', $fax); $comparison = Cri...
php
public function filterByFax($fax = null, $comparison = null) { if (null === $comparison) { if (is_array($fax)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $fax)) { $fax = str_replace('*', '%', $fax); $comparison = Cri...
[ "public", "function", "filterByFax", "(", "$", "fax", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "null", "===", "$", "comparison", ")", "{", "if", "(", "is_array", "(", "$", "fax", ")", ")", "{", "$", "comparison", "=", ...
Filter the query on the fax column Example usage: <code> $query->filterByFax('fooValue'); // WHERE fax = 'fooValue' $query->filterByFax('%fooValue%'); // WHERE fax LIKE '%fooValue%' </code> @param string $fax The value to use as filter. Accepts wildcards (* and % trigger a LIKE) @param string $comparison Op...
[ "Filter", "the", "query", "on", "the", "fax", "column" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L536-L548
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByEmail
public function filterByEmail($email = null, $comparison = null) { if (null === $comparison) { if (is_array($email)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $email)) { $email = str_replace('*', '%', $email); $comp...
php
public function filterByEmail($email = null, $comparison = null) { if (null === $comparison) { if (is_array($email)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $email)) { $email = str_replace('*', '%', $email); $comp...
[ "public", "function", "filterByEmail", "(", "$", "email", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "null", "===", "$", "comparison", ")", "{", "if", "(", "is_array", "(", "$", "email", ")", ")", "{", "$", "comparison", ...
Filter the query on the email column Example usage: <code> $query->filterByEmail('fooValue'); // WHERE email = 'fooValue' $query->filterByEmail('%fooValue%'); // WHERE email LIKE '%fooValue%' </code> @param string $email The value to use as filter. Accepts wildcards (* and % trigger a LIKE) @param string $c...
[ "Filter", "the", "query", "on", "the", "email", "column" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L565-L577
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByLegalform
public function filterByLegalform($legalform = null, $comparison = null) { if (null === $comparison) { if (is_array($legalform)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $legalform)) { $legalform = str_replace('*', '%', $legalform...
php
public function filterByLegalform($legalform = null, $comparison = null) { if (null === $comparison) { if (is_array($legalform)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $legalform)) { $legalform = str_replace('*', '%', $legalform...
[ "public", "function", "filterByLegalform", "(", "$", "legalform", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "null", "===", "$", "comparison", ")", "{", "if", "(", "is_array", "(", "$", "legalform", ")", ")", "{", "$", "co...
Filter the query on the legalform column Example usage: <code> $query->filterByLegalform('fooValue'); // WHERE legalform = 'fooValue' $query->filterByLegalform('%fooValue%'); // WHERE legalform LIKE '%fooValue%' </code> @param string $legalform The value to use as filter. Accepts wildcards (* and % trigger a LI...
[ "Filter", "the", "query", "on", "the", "legalform", "column" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L594-L606
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByLogo
public function filterByLogo($logo = null, $comparison = null) { if (null === $comparison) { if (is_array($logo)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $logo)) { $logo = str_replace('*', '%', $logo); $comparison...
php
public function filterByLogo($logo = null, $comparison = null) { if (null === $comparison) { if (is_array($logo)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $logo)) { $logo = str_replace('*', '%', $logo); $comparison...
[ "public", "function", "filterByLogo", "(", "$", "logo", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "null", "===", "$", "comparison", ")", "{", "if", "(", "is_array", "(", "$", "logo", ")", ")", "{", "$", "comparison", "=...
Filter the query on the logo column Example usage: <code> $query->filterByLogo('fooValue'); // WHERE logo = 'fooValue' $query->filterByLogo('%fooValue%'); // WHERE logo LIKE '%fooValue%' </code> @param string $logo The value to use as filter. Accepts wildcards (* and % trigger a LIKE) @param string $compari...
[ "Filter", "the", "query", "on", "the", "logo", "column" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L623-L635
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByCreated
public function filterByCreated($created = null, $comparison = null) { if (is_array($created)) { $useMinMax = false; if (isset($created['min'])) { $this->addUsingAlias(CustomerPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL); $useMinMax = true;...
php
public function filterByCreated($created = null, $comparison = null) { if (is_array($created)) { $useMinMax = false; if (isset($created['min'])) { $this->addUsingAlias(CustomerPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL); $useMinMax = true;...
[ "public", "function", "filterByCreated", "(", "$", "created", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "created", ")", ")", "{", "$", "useMinMax", "=", "false", ";", "if", "(", "isset", "(", "$", ...
Filter the query on the created column Example usage: <code> $query->filterByCreated('2011-03-14'); // WHERE created = '2011-03-14' $query->filterByCreated('now'); // WHERE created = '2011-03-14' $query->filterByCreated(array('max' => 'yesterday')); // WHERE created < '2011-03-13' </code> @param mixed $created Th...
[ "Filter", "the", "query", "on", "the", "created", "column" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L657-L678
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByNotes
public function filterByNotes($notes = null, $comparison = null) { if (null === $comparison) { if (is_array($notes)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $notes)) { $notes = str_replace('*', '%', $notes); $comp...
php
public function filterByNotes($notes = null, $comparison = null) { if (null === $comparison) { if (is_array($notes)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $notes)) { $notes = str_replace('*', '%', $notes); $comp...
[ "public", "function", "filterByNotes", "(", "$", "notes", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "null", "===", "$", "comparison", ")", "{", "if", "(", "is_array", "(", "$", "notes", ")", ")", "{", "$", "comparison", ...
Filter the query on the notes column Example usage: <code> $query->filterByNotes('fooValue'); // WHERE notes = 'fooValue' $query->filterByNotes('%fooValue%'); // WHERE notes LIKE '%fooValue%' </code> @param string $notes The value to use as filter. Accepts wildcards (* and % trigger a LIKE) @param string $c...
[ "Filter", "the", "query", "on", "the", "notes", "column" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L695-L707
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByCountry
public function filterByCountry($country, $comparison = null) { if ($country instanceof Country) { return $this ->addUsingAlias(CustomerPeer::COUNTRY_ID, $country->getId(), $comparison); } elseif ($country instanceof PropelObjectCollection) { if (null === $com...
php
public function filterByCountry($country, $comparison = null) { if ($country instanceof Country) { return $this ->addUsingAlias(CustomerPeer::COUNTRY_ID, $country->getId(), $comparison); } elseif ($country instanceof PropelObjectCollection) { if (null === $com...
[ "public", "function", "filterByCountry", "(", "$", "country", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "$", "country", "instanceof", "Country", ")", "{", "return", "$", "this", "->", "addUsingAlias", "(", "CustomerPeer", "::", "COUNTRY_ID", ...
Filter the query by a related Country object @param Country|PropelObjectCollection $country The related object(s) to use as filter @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL @return CustomerQuery The current query, for fluid interface @throws...
[ "Filter", "the", "query", "by", "a", "related", "Country", "object" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L718-L733
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.useCountryQuery
public function useCountryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinCountry($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'Country', '\Slashworks\AppBundle\Model\CountryQuery'); }
php
public function useCountryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinCountry($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'Country', '\Slashworks\AppBundle\Model\CountryQuery'); }
[ "public", "function", "useCountryQuery", "(", "$", "relationAlias", "=", "null", ",", "$", "joinType", "=", "Criteria", "::", "INNER_JOIN", ")", "{", "return", "$", "this", "->", "joinCountry", "(", "$", "relationAlias", ",", "$", "joinType", ")", "->", "u...
Use the Country relation Country object @see useQuery() @param string $relationAlias optional alias for the relation, to be used as main alias in the secondary query @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' @return \Slashworks\AppBundle\Model\CountryQu...
[ "Use", "the", "Country", "relation", "Country", "object" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L778-L783
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByRemoteApp
public function filterByRemoteApp($remoteApp, $comparison = null) { if ($remoteApp instanceof RemoteApp) { return $this ->addUsingAlias(CustomerPeer::ID, $remoteApp->getCustomerId(), $comparison); } elseif ($remoteApp instanceof PropelObjectCollection) { retur...
php
public function filterByRemoteApp($remoteApp, $comparison = null) { if ($remoteApp instanceof RemoteApp) { return $this ->addUsingAlias(CustomerPeer::ID, $remoteApp->getCustomerId(), $comparison); } elseif ($remoteApp instanceof PropelObjectCollection) { retur...
[ "public", "function", "filterByRemoteApp", "(", "$", "remoteApp", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "$", "remoteApp", "instanceof", "RemoteApp", ")", "{", "return", "$", "this", "->", "addUsingAlias", "(", "CustomerPeer", "::", "ID", ...
Filter the query by a related RemoteApp object @param RemoteApp|PropelObjectCollection $remoteApp the related object to use as filter @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL @return CustomerQuery The current query, for fluid interface @th...
[ "Filter", "the", "query", "by", "a", "related", "RemoteApp", "object" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L794-L807
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.filterByUserCustomerRelation
public function filterByUserCustomerRelation($userCustomerRelation, $comparison = null) { if ($userCustomerRelation instanceof UserCustomerRelation) { return $this ->addUsingAlias(CustomerPeer::ID, $userCustomerRelation->getCustomerId(), $comparison); } elseif ($userCusto...
php
public function filterByUserCustomerRelation($userCustomerRelation, $comparison = null) { if ($userCustomerRelation instanceof UserCustomerRelation) { return $this ->addUsingAlias(CustomerPeer::ID, $userCustomerRelation->getCustomerId(), $comparison); } elseif ($userCusto...
[ "public", "function", "filterByUserCustomerRelation", "(", "$", "userCustomerRelation", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "$", "userCustomerRelation", "instanceof", "UserCustomerRelation", ")", "{", "return", "$", "this", "->", "addUsingAlias...
Filter the query by a related UserCustomerRelation object @param UserCustomerRelation|PropelObjectCollection $userCustomerRelation the related object to use as filter @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL @return CustomerQuery The curre...
[ "Filter", "the", "query", "by", "a", "related", "UserCustomerRelation", "object" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L868-L881
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.useUserCustomerRelationQuery
public function useUserCustomerRelationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinUserCustomerRelation($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'UserCustomerRelation', '\Slashworks\AppBundle\Model\UserCustomerRel...
php
public function useUserCustomerRelationQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinUserCustomerRelation($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'UserCustomerRelation', '\Slashworks\AppBundle\Model\UserCustomerRel...
[ "public", "function", "useUserCustomerRelationQuery", "(", "$", "relationAlias", "=", "null", ",", "$", "joinType", "=", "Criteria", "::", "INNER_JOIN", ")", "{", "return", "$", "this", "->", "joinUserCustomerRelation", "(", "$", "relationAlias", ",", "$", "join...
Use the UserCustomerRelation relation UserCustomerRelation object @see useQuery() @param string $relationAlias optional alias for the relation, to be used as main alias in the secondary query @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' @return \Slashworks...
[ "Use", "the", "UserCustomerRelation", "relation", "UserCustomerRelation", "object" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L926-L931
slashworks/control-bundle
src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php
BaseCustomerQuery.prune
public function prune($customer = null) { if ($customer) { $this->addUsingAlias(CustomerPeer::ID, $customer->getId(), Criteria::NOT_EQUAL); } return $this; }
php
public function prune($customer = null) { if ($customer) { $this->addUsingAlias(CustomerPeer::ID, $customer->getId(), Criteria::NOT_EQUAL); } return $this; }
[ "public", "function", "prune", "(", "$", "customer", "=", "null", ")", "{", "if", "(", "$", "customer", ")", "{", "$", "this", "->", "addUsingAlias", "(", "CustomerPeer", "::", "ID", ",", "$", "customer", "->", "getId", "(", ")", ",", "Criteria", "::...
Exclude object from result @param Customer $customer Object to remove from the list of results @return CustomerQuery The current query, for fluid interface
[ "Exclude", "object", "from", "result" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomerQuery.php#L940-L947
fyuze/framework
src/Fyuze/Http/Message/Request.php
Request.getRequestTarget
public function getRequestTarget() { if ($this->requestTarget !== null) { return $this->requestTarget; } if (!$this->uri) { return '/'; } $requestTarget = $this->getUri()->getPath(); if ($query = $this->getUri()->getQuery()) { $re...
php
public function getRequestTarget() { if ($this->requestTarget !== null) { return $this->requestTarget; } if (!$this->uri) { return '/'; } $requestTarget = $this->getUri()->getPath(); if ($query = $this->getUri()->getQuery()) { $re...
[ "public", "function", "getRequestTarget", "(", ")", "{", "if", "(", "$", "this", "->", "requestTarget", "!==", "null", ")", "{", "return", "$", "this", "->", "requestTarget", ";", "}", "if", "(", "!", "$", "this", "->", "uri", ")", "{", "return", "'/...
{@inheritdoc} @return string
[ "{", "@inheritdoc", "}" ]
train
https://github.com/fyuze/framework/blob/89b3984f7225e24bfcdafb090ee197275b3222c9/src/Fyuze/Http/Message/Request.php#L29-L45
fyuze/framework
src/Fyuze/Http/Message/Request.php
Request.withMethod
public function withMethod($method) { $method = strtoupper($method); if (false === in_array($method, ['GET', 'HEAD', 'POST', 'PUT', 'OPTIONS', 'DELETE'])) { throw new \InvalidArgumentException( sprintf('Invalid HTTP method: %s', $method) ); } ...
php
public function withMethod($method) { $method = strtoupper($method); if (false === in_array($method, ['GET', 'HEAD', 'POST', 'PUT', 'OPTIONS', 'DELETE'])) { throw new \InvalidArgumentException( sprintf('Invalid HTTP method: %s', $method) ); } ...
[ "public", "function", "withMethod", "(", "$", "method", ")", "{", "$", "method", "=", "strtoupper", "(", "$", "method", ")", ";", "if", "(", "false", "===", "in_array", "(", "$", "method", ",", "[", "'GET'", ",", "'HEAD'", ",", "'POST'", ",", "'PUT'"...
{@inheritdoc} @param string $method Case-sensitive method. @return self @throws \InvalidArgumentException for invalid HTTP methods.
[ "{", "@inheritdoc", "}" ]
train
https://github.com/fyuze/framework/blob/89b3984f7225e24bfcdafb090ee197275b3222c9/src/Fyuze/Http/Message/Request.php#L89-L100
fyuze/framework
src/Fyuze/Http/Message/Request.php
Request.withUri
public function withUri(UriInterface $uri, $preserveHost = false) { $clone = $this->_clone('uri', $uri); if ($preserveHost === true || $uri->getHost() === null) { return $clone; } $clone->headers['host'] = $uri->getHost(); return $clone; }
php
public function withUri(UriInterface $uri, $preserveHost = false) { $clone = $this->_clone('uri', $uri); if ($preserveHost === true || $uri->getHost() === null) { return $clone; } $clone->headers['host'] = $uri->getHost(); return $clone; }
[ "public", "function", "withUri", "(", "UriInterface", "$", "uri", ",", "$", "preserveHost", "=", "false", ")", "{", "$", "clone", "=", "$", "this", "->", "_clone", "(", "'uri'", ",", "$", "uri", ")", ";", "if", "(", "$", "preserveHost", "===", "true"...
{@inheritdoc} @link http://tools.ietf.org/html/rfc3986#section-4.3 @param UriInterface $uri New request URI to use. @param bool $preserveHost Preserve the original state of the Host header. @return self
[ "{", "@inheritdoc", "}" ]
train
https://github.com/fyuze/framework/blob/89b3984f7225e24bfcdafb090ee197275b3222c9/src/Fyuze/Http/Message/Request.php#L110-L123
spiral-modules/scaffolder
source/Scaffolder/Declarations/CommandDeclaration.php
CommandDeclaration.declareStructure
private function declareStructure() { $perform = $this->method('perform')->setAccess(MethodDeclaration::ACCESS_PROTECTED); $perform->setComment("Perform command"); $this->constant('NAME'); $this->constant('NAME')->setValue(''); $this->constant('DESCRIPTION'); $this-...
php
private function declareStructure() { $perform = $this->method('perform')->setAccess(MethodDeclaration::ACCESS_PROTECTED); $perform->setComment("Perform command"); $this->constant('NAME'); $this->constant('NAME')->setValue(''); $this->constant('DESCRIPTION'); $this-...
[ "private", "function", "declareStructure", "(", ")", "{", "$", "perform", "=", "$", "this", "->", "method", "(", "'perform'", ")", "->", "setAccess", "(", "MethodDeclaration", "::", "ACCESS_PROTECTED", ")", ";", "$", "perform", "->", "setComment", "(", "\"Pe...
Declare default __invoke method body.
[ "Declare", "default", "__invoke", "method", "body", "." ]
train
https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Declarations/CommandDeclaration.php#L74-L90
yuncms/framework
src/filesystem/FilesystemManager.php
FilesystemManager.cloud
public function cloud($disk = null) { $disk = !is_null($disk) ? $disk : $this->cloud; return $this->get($disk); }
php
public function cloud($disk = null) { $disk = !is_null($disk) ? $disk : $this->cloud; return $this->get($disk); }
[ "public", "function", "cloud", "(", "$", "disk", "=", "null", ")", "{", "$", "disk", "=", "!", "is_null", "(", "$", "disk", ")", "?", "$", "disk", ":", "$", "this", "->", "cloud", ";", "return", "$", "this", "->", "get", "(", "$", "disk", ")", ...
获取磁盘 @param string|null $disk @return \yuncms\filesystem\Filesystem|\yuncms\filesystem\Cloud @throws \yii\base\InvalidConfigException
[ "获取磁盘" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemManager.php#L71-L75
yuncms/framework
src/filesystem/FilesystemManager.php
FilesystemManager.resolve
protected function resolve($name) { $config = $this->disks[$name]; if (isset($config['class'])) { return Yii::createObject($config); } else if (isset($config['adapter'])) { $driverMethod = 'create' . ucfirst($config['adapter']) . 'Adapter'; if (method_exis...
php
protected function resolve($name) { $config = $this->disks[$name]; if (isset($config['class'])) { return Yii::createObject($config); } else if (isset($config['adapter'])) { $driverMethod = 'create' . ucfirst($config['adapter']) . 'Adapter'; if (method_exis...
[ "protected", "function", "resolve", "(", "$", "name", ")", "{", "$", "config", "=", "$", "this", "->", "disks", "[", "$", "name", "]", ";", "if", "(", "isset", "(", "$", "config", "[", "'class'", "]", ")", ")", "{", "return", "Yii", "::", "create...
Resolve the given disk. @param string $name @return object|Filesystem @throws \yii\base\InvalidConfigException
[ "Resolve", "the", "given", "disk", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemManager.php#L120-L135
yuncms/framework
src/filesystem/FilesystemManager.php
FilesystemManager.createLocalAdapter
public function createLocalAdapter(array $config) { $permissions = $config['permissions'] ?? []; $root = Yii::getAlias($config['root']); $links = ($config['links'] ?? null) === 'skip' ? LocalAdapter::SKIP_LINKS : LocalAdapter::DISALLOW_LINKS; return $this->a...
php
public function createLocalAdapter(array $config) { $permissions = $config['permissions'] ?? []; $root = Yii::getAlias($config['root']); $links = ($config['links'] ?? null) === 'skip' ? LocalAdapter::SKIP_LINKS : LocalAdapter::DISALLOW_LINKS; return $this->a...
[ "public", "function", "createLocalAdapter", "(", "array", "$", "config", ")", "{", "$", "permissions", "=", "$", "config", "[", "'permissions'", "]", "??", "[", "]", ";", "$", "root", "=", "Yii", "::", "getAlias", "(", "$", "config", "[", "'root'", "]"...
Create an instance of the local adapter. @param array $config @return \yuncms\filesystem\Filesystem
[ "Create", "an", "instance", "of", "the", "local", "adapter", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemManager.php#L143-L155
yuncms/framework
src/filesystem/FilesystemManager.php
FilesystemManager.createOssAdapter
public function createOssAdapter(array $config) { $root = $config['root'] ?? null; $oss = new OssClient($config['access_id'], $config['access_secret'], $config['endpoint'], $config['isCName'] ?? false, $config['securityToken'] ?? null, $config['proxy'] ?? null ...
php
public function createOssAdapter(array $config) { $root = $config['root'] ?? null; $oss = new OssClient($config['access_id'], $config['access_secret'], $config['endpoint'], $config['isCName'] ?? false, $config['securityToken'] ?? null, $config['proxy'] ?? null ...
[ "public", "function", "createOssAdapter", "(", "array", "$", "config", ")", "{", "$", "root", "=", "$", "config", "[", "'root'", "]", "??", "null", ";", "$", "oss", "=", "new", "OssClient", "(", "$", "config", "[", "'access_id'", "]", ",", "$", "conf...
Create an instance of the oss driver. @param array $config @return \yuncms\filesystem\Filesystem @throws \OSS\Core\OssException @throws \Exception
[ "Create", "an", "instance", "of", "the", "oss", "driver", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemManager.php#L165-L179
yuncms/framework
src/filesystem/FilesystemManager.php
FilesystemManager.formatS3Config
protected function formatS3Config(array $config) { $config += ['version' => 'latest']; if ($config['key'] && $config['secret']) { $config['credentials'] = ArrayHelper::only($config, ['key', 'secret']); } return $config; }
php
protected function formatS3Config(array $config) { $config += ['version' => 'latest']; if ($config['key'] && $config['secret']) { $config['credentials'] = ArrayHelper::only($config, ['key', 'secret']); } return $config; }
[ "protected", "function", "formatS3Config", "(", "array", "$", "config", ")", "{", "$", "config", "+=", "[", "'version'", "=>", "'latest'", "]", ";", "if", "(", "$", "config", "[", "'key'", "]", "&&", "$", "config", "[", "'secret'", "]", ")", "{", "$"...
Format the given S3 configuration with the default options. @param array $config @return array
[ "Format", "the", "given", "S3", "configuration", "with", "the", "default", "options", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemManager.php#L216-L223
yuncms/framework
src/filesystem/FilesystemManager.php
FilesystemManager.createFlysystem
protected function createFlysystem(AdapterInterface $adapter, array $config) { $cache = ArrayHelper::pull($config, 'cache'); $config = ArrayHelper::only($config, ['visibility', 'disable_asserts', 'url']); if ($cache) { $adapter = new CachedAdapter($adapter, $this->createCacheStor...
php
protected function createFlysystem(AdapterInterface $adapter, array $config) { $cache = ArrayHelper::pull($config, 'cache'); $config = ArrayHelper::only($config, ['visibility', 'disable_asserts', 'url']); if ($cache) { $adapter = new CachedAdapter($adapter, $this->createCacheStor...
[ "protected", "function", "createFlysystem", "(", "AdapterInterface", "$", "adapter", ",", "array", "$", "config", ")", "{", "$", "cache", "=", "ArrayHelper", "::", "pull", "(", "$", "config", ",", "'cache'", ")", ";", "$", "config", "=", "ArrayHelper", "::...
Create a Flysystem instance with the given adapter. @param \League\Flysystem\AdapterInterface $adapter @param array $config @return \League\Flysystem\FilesystemInterface
[ "Create", "a", "Flysystem", "instance", "with", "the", "given", "adapter", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemManager.php#L232-L240
yuncms/framework
src/filesystem/FilesystemManager.php
FilesystemManager.createCacheStore
protected function createCacheStore($config) { if ($config === true) { return new MemoryStore; } return new Cache(Yii::$app->cache, $config['prefix'] ?? 'flysystem', $config['duration'] ?? null ); }
php
protected function createCacheStore($config) { if ($config === true) { return new MemoryStore; } return new Cache(Yii::$app->cache, $config['prefix'] ?? 'flysystem', $config['duration'] ?? null ); }
[ "protected", "function", "createCacheStore", "(", "$", "config", ")", "{", "if", "(", "$", "config", "===", "true", ")", "{", "return", "new", "MemoryStore", ";", "}", "return", "new", "Cache", "(", "Yii", "::", "$", "app", "->", "cache", ",", "$", "...
Create a cache store instance. @param mixed $config @return \League\Flysystem\Cached\CacheInterface @throws \InvalidArgumentException
[ "Create", "a", "cache", "store", "instance", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemManager.php#L249-L258
andynoelker/laravel-5-view-generator
src/ViewMakeCommand.php
ViewMakeCommand.handle
public function handle() { $name = $this->argument('name'); $path = $this->getPath($name); $this->makeDirectory($path); if (file_exists($path)) { if ($this->confirm('View already exists. Do you wish to overwrite it?')) { $this->createView($path); ...
php
public function handle() { $name = $this->argument('name'); $path = $this->getPath($name); $this->makeDirectory($path); if (file_exists($path)) { if ($this->confirm('View already exists. Do you wish to overwrite it?')) { $this->createView($path); ...
[ "public", "function", "handle", "(", ")", "{", "$", "name", "=", "$", "this", "->", "argument", "(", "'name'", ")", ";", "$", "path", "=", "$", "this", "->", "getPath", "(", "$", "name", ")", ";", "$", "this", "->", "makeDirectory", "(", "$", "pa...
Execute the console command. @return mixed
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/andynoelker/laravel-5-view-generator/blob/c18b1d9e0959cb5d7c5f83650b47464b81ea287d/src/ViewMakeCommand.php#L40-L54
andynoelker/laravel-5-view-generator
src/ViewMakeCommand.php
ViewMakeCommand.createView
protected function createView($path) { $contents = $this->getViewContents(); file_put_contents($path,$contents); $this->info('View created successfully.'); }
php
protected function createView($path) { $contents = $this->getViewContents(); file_put_contents($path,$contents); $this->info('View created successfully.'); }
[ "protected", "function", "createView", "(", "$", "path", ")", "{", "$", "contents", "=", "$", "this", "->", "getViewContents", "(", ")", ";", "file_put_contents", "(", "$", "path", ",", "$", "contents", ")", ";", "$", "this", "->", "info", "(", "'View ...
Generate the Blade view. @param string $path The path of the view. @return void
[ "Generate", "the", "Blade", "view", "." ]
train
https://github.com/andynoelker/laravel-5-view-generator/blob/c18b1d9e0959cb5d7c5f83650b47464b81ea287d/src/ViewMakeCommand.php#L62-L69
andynoelker/laravel-5-view-generator
src/ViewMakeCommand.php
ViewMakeCommand.makeDirectory
protected function makeDirectory($path) { $dir = dirname($path); if (!file_exists($dir)) { mkdir($dir, 0777, true); } }
php
protected function makeDirectory($path) { $dir = dirname($path); if (!file_exists($dir)) { mkdir($dir, 0777, true); } }
[ "protected", "function", "makeDirectory", "(", "$", "path", ")", "{", "$", "dir", "=", "dirname", "(", "$", "path", ")", ";", "if", "(", "!", "file_exists", "(", "$", "dir", ")", ")", "{", "mkdir", "(", "$", "dir", ",", "0777", ",", "true", ")", ...
Create the directory for the view if it does not already exist. @param string $path The full path of the view file. @return void
[ "Create", "the", "directory", "for", "the", "view", "if", "it", "does", "not", "already", "exist", "." ]
train
https://github.com/andynoelker/laravel-5-view-generator/blob/c18b1d9e0959cb5d7c5f83650b47464b81ea287d/src/ViewMakeCommand.php#L92-L99
aedart/laravel-helpers
src/Traits/Bus/QueueingBusTrait.php
QueueingBusTrait.getQueueingBus
public function getQueueingBus(): ?QueueingDispatcher { if (!$this->hasQueueingBus()) { $this->setQueueingBus($this->getDefaultQueueingBus()); } return $this->queueingBus; }
php
public function getQueueingBus(): ?QueueingDispatcher { if (!$this->hasQueueingBus()) { $this->setQueueingBus($this->getDefaultQueueingBus()); } return $this->queueingBus; }
[ "public", "function", "getQueueingBus", "(", ")", ":", "?", "QueueingDispatcher", "{", "if", "(", "!", "$", "this", "->", "hasQueueingBus", "(", ")", ")", "{", "$", "this", "->", "setQueueingBus", "(", "$", "this", "->", "getDefaultQueueingBus", "(", ")", ...
Get queueing bus If no queueing bus has been set, this method will set and return a default queueing bus, if any such value is available @see getDefaultQueueingBus() @return QueueingDispatcher|null queueing bus or null if none queueing bus has been set
[ "Get", "queueing", "bus" ]
train
https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Bus/QueueingBusTrait.php#L53-L59
yuncms/framework
src/admin/migrations/m180324_104125_create_admin_rbac_table.php
m180324_104125_create_admin_rbac_table.safeUp
public function safeUp() { $tableOptions = null; if ($this->db->driverName === 'mysql') { // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci $tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=Inn...
php
public function safeUp() { $tableOptions = null; if ($this->db->driverName === 'mysql') { // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci $tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=Inn...
[ "public", "function", "safeUp", "(", ")", "{", "$", "tableOptions", "=", "null", ";", "if", "(", "$", "this", "->", "db", "->", "driverName", "===", "'mysql'", ")", "{", "// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-...
{@inheritdoc}
[ "{" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/migrations/m180324_104125_create_admin_rbac_table.php#L13-L437
comodojo/cookies
src/Comodojo/Cookies/SecureCookie.php
SecureCookie.encryptKey
protected static function encryptKey($key) { if ( isset($_SERVER['REMOTE_ADDR']) ) { $client_hash = md5($_SERVER['REMOTE_ADDR'].(isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : ''), true); $server_hash = md5($key, true); $cookie_key = ...
php
protected static function encryptKey($key) { if ( isset($_SERVER['REMOTE_ADDR']) ) { $client_hash = md5($_SERVER['REMOTE_ADDR'].(isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : ''), true); $server_hash = md5($key, true); $cookie_key = ...
[ "protected", "static", "function", "encryptKey", "(", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "_SERVER", "[", "'REMOTE_ADDR'", "]", ")", ")", "{", "$", "client_hash", "=", "md5", "(", "$", "_SERVER", "[", "'REMOTE_ADDR'", "]", ".", "(", "...
Create a client-specific key using provided key, the client remote address and (in case) the value of HTTP_X_FORWARDED_FOR header @param string $key @return string
[ "Create", "a", "client", "-", "specific", "key", "using", "provided", "key", "the", "client", "remote", "address", "and", "(", "in", "case", ")", "the", "value", "of", "HTTP_X_FORWARDED_FOR", "header" ]
train
https://github.com/comodojo/cookies/blob/a81c7dff37d52c1a75462c0ad30db75d0c3b0081/src/Comodojo/Cookies/SecureCookie.php#L32-L50
vi-kon/laravel-auth
src/ViKon/Auth/Middleware/PermissionMiddleware.php
PermissionMiddleware.handle
public function handle(Request $request, \Closure $next, $permission) { if (!$this->keeper->check() || !$this->keeper->hasPermission($permission)) { $router = $this->container->make('router'); $log = $this->container->make('log'); $currentRoute = $router->current(); ...
php
public function handle(Request $request, \Closure $next, $permission) { if (!$this->keeper->check() || !$this->keeper->hasPermission($permission)) { $router = $this->container->make('router'); $log = $this->container->make('log'); $currentRoute = $router->current(); ...
[ "public", "function", "handle", "(", "Request", "$", "request", ",", "\\", "Closure", "$", "next", ",", "$", "permission", ")", "{", "if", "(", "!", "$", "this", "->", "keeper", "->", "check", "(", ")", "||", "!", "$", "this", "->", "keeper", "->",...
@param \Illuminate\Http\Request $request @param \Closure $next @param string $permission @return \Illuminate\Http\RedirectResponse
[ "@param", "\\", "Illuminate", "\\", "Http", "\\", "Request", "$request", "@param", "\\", "Closure", "$next", "@param", "string", "$permission" ]
train
https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/Middleware/PermissionMiddleware.php#L42-L77
tableau-mkt/eggs-n-cereal
src/Serializer.php
Serializer.serialize
public function serialize(TranslatableInterface $translatable, $targetLang) { $output = $this->beginExport($translatable, $targetLang); $output .= $this->exportTranslatable($translatable, $targetLang); $output .= $this->endExport(); return $output; }
php
public function serialize(TranslatableInterface $translatable, $targetLang) { $output = $this->beginExport($translatable, $targetLang); $output .= $this->exportTranslatable($translatable, $targetLang); $output .= $this->endExport(); return $output; }
[ "public", "function", "serialize", "(", "TranslatableInterface", "$", "translatable", ",", "$", "targetLang", ")", "{", "$", "output", "=", "$", "this", "->", "beginExport", "(", "$", "translatable", ",", "$", "targetLang", ")", ";", "$", "output", ".=", "...
Serializes a given translatable into an XLIFF file with the specified target language. @param TranslatableInterface $translatable The translatable to be serialized. @param string $targetLang The desired target language. @return string The resultant XLIFF file as a string.
[ "Serializes", "a", "given", "translatable", "into", "an", "XLIFF", "file", "with", "the", "specified", "target", "language", "." ]
train
https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Serializer.php#L69-L74
tableau-mkt/eggs-n-cereal
src/Serializer.php
Serializer.unserialize
public function unserialize(TranslatableInterface $translatable, $targetLang, $xliff, $callSetData = TRUE) { // First, validate the provided xliff. if ($this->validateImport($translatable, $targetLang, $xliff)) { // If valid, return the imported data as an array. $data = $this->import($xliff); ...
php
public function unserialize(TranslatableInterface $translatable, $targetLang, $xliff, $callSetData = TRUE) { // First, validate the provided xliff. if ($this->validateImport($translatable, $targetLang, $xliff)) { // If valid, return the imported data as an array. $data = $this->import($xliff); ...
[ "public", "function", "unserialize", "(", "TranslatableInterface", "$", "translatable", ",", "$", "targetLang", ",", "$", "xliff", ",", "$", "callSetData", "=", "TRUE", ")", "{", "// First, validate the provided xliff.", "if", "(", "$", "this", "->", "validateImpo...
Unserializes given XLIFF data; before unserialization occurs, the provided XLIFF is also validated against the provided translatable and target language. @param TranslatableInterface $translatable The translatable against which validation will occur. @param $targetLang The language code of the target language (used f...
[ "Unserializes", "given", "XLIFF", "data", ";", "before", "unserialization", "occurs", "the", "provided", "XLIFF", "is", "also", "validated", "against", "the", "provided", "translatable", "and", "target", "language", "." ]
train
https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Serializer.php#L99-L116
tableau-mkt/eggs-n-cereal
src/Serializer.php
Serializer.beginExport
public function beginExport(TranslatableInterface $translatable, $targetLang) { $this->openMemory(); $this->setIndent(TRUE); $this->setIndentString(' '); $this->startDocument('1.0', 'UTF-8'); // Root element with schema definition. $this->startElement('xliff'); $this->writeAttribute('versi...
php
public function beginExport(TranslatableInterface $translatable, $targetLang) { $this->openMemory(); $this->setIndent(TRUE); $this->setIndentString(' '); $this->startDocument('1.0', 'UTF-8'); // Root element with schema definition. $this->startElement('xliff'); $this->writeAttribute('versi...
[ "public", "function", "beginExport", "(", "TranslatableInterface", "$", "translatable", ",", "$", "targetLang", ")", "{", "$", "this", "->", "openMemory", "(", ")", ";", "$", "this", "->", "setIndent", "(", "TRUE", ")", ";", "$", "this", "->", "setIndentSt...
Starts an export. @param TranslatableInterface $translatable The translatable for which we will be generating an XLIFF. @param string $targetLang The language code of the target language for this XLIFF. @return string The generated XML.
[ "Starts", "an", "export", "." ]
train
https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Serializer.php#L130-L172
tableau-mkt/eggs-n-cereal
src/Serializer.php
Serializer.exportTranslatable
public function exportTranslatable(TranslatableInterface $translatable, $targetLang) { $this->openMemory(); $this->setIndent(TRUE); $this->setIndentString(' '); $this->startElement('xlf:group'); $this->writeAttribute('id', $translatable->getIdentifier()); $this->writeAttribute('restype', 'x-egg...
php
public function exportTranslatable(TranslatableInterface $translatable, $targetLang) { $this->openMemory(); $this->setIndent(TRUE); $this->setIndentString(' '); $this->startElement('xlf:group'); $this->writeAttribute('id', $translatable->getIdentifier()); $this->writeAttribute('restype', 'x-egg...
[ "public", "function", "exportTranslatable", "(", "TranslatableInterface", "$", "translatable", ",", "$", "targetLang", ")", "{", "$", "this", "->", "openMemory", "(", ")", ";", "$", "this", "->", "setIndent", "(", "TRUE", ")", ";", "$", "this", "->", "setI...
Adds a translatable item to the XML export. @param TranslatableInterface $translatable The translatable to serialize. @param string $targetLang The desired translatable. @return string The generated XML.
[ "Adds", "a", "translatable", "item", "to", "the", "XML", "export", "." ]
train
https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Serializer.php#L186-L206
tableau-mkt/eggs-n-cereal
src/Serializer.php
Serializer.addTransUnit
protected function addTransUnit($key, $element, $targetLang) { $this->startElement('xlf:group'); $this->writeAttribute('id', $key); $this->writeAttribute('resname', $key); $this->writeAttribute('restype', 'x-eggs-n-cereal-field'); //escape named html entities prior to conversion $list = get_htm...
php
protected function addTransUnit($key, $element, $targetLang) { $this->startElement('xlf:group'); $this->writeAttribute('id', $key); $this->writeAttribute('resname', $key); $this->writeAttribute('restype', 'x-eggs-n-cereal-field'); //escape named html entities prior to conversion $list = get_htm...
[ "protected", "function", "addTransUnit", "(", "$", "key", ",", "$", "element", ",", "$", "targetLang", ")", "{", "$", "this", "->", "startElement", "(", "'xlf:group'", ")", ";", "$", "this", "->", "writeAttribute", "(", "'id'", ",", "$", "key", ")", ";...
Adds a single translation unit for a data element. @param string $key The unique identifier for this data element. @param string $element An element array with the following properties: - #text: The text string to be translated. - #label: (Optional) Label, intended for translators, that provides more context around t...
[ "Adds", "a", "single", "translation", "unit", "for", "a", "data", "element", "." ]
train
https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Serializer.php#L226-L266
tableau-mkt/eggs-n-cereal
src/Serializer.php
Serializer.oldImport
public function oldImport(\SimpleXMLElement $xml) { $data = array(); foreach ($xml->xpath('//trans-unit') as $unit) { $data[(string) $unit['id']]['#text'] = (string) $unit->target; } return Data::unflattenData($data); }
php
public function oldImport(\SimpleXMLElement $xml) { $data = array(); foreach ($xml->xpath('//trans-unit') as $unit) { $data[(string) $unit['id']]['#text'] = (string) $unit->target; } return Data::unflattenData($data); }
[ "public", "function", "oldImport", "(", "\\", "SimpleXMLElement", "$", "xml", ")", "{", "$", "data", "=", "array", "(", ")", ";", "foreach", "(", "$", "xml", "->", "xpath", "(", "'//trans-unit'", ")", "as", "$", "unit", ")", "{", "$", "data", "[", ...
@todo Remove? Imports a file. @param \SimpleXMLElement $xml The XML to be imported. @return array The resultant unserialized, flattened data array.
[ "@todo", "Remove?", "Imports", "a", "file", "." ]
train
https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Serializer.php#L329-L335
tableau-mkt/eggs-n-cereal
src/Serializer.php
Serializer.serializerSimplexmlLoadString
public function serializerSimplexmlLoadString($xmlString){ $numericTable = array(); //commonly present restricted characters that can safely be replaced $numericTable['&'] = '&#38;'; $entBitmask = defined('ENT_HTML5') ? ENT_QUOTES | ENT_HTML5 : ENT_QUOTES; $trans = get_html_translation_table(HTML_EN...
php
public function serializerSimplexmlLoadString($xmlString){ $numericTable = array(); //commonly present restricted characters that can safely be replaced $numericTable['&'] = '&#38;'; $entBitmask = defined('ENT_HTML5') ? ENT_QUOTES | ENT_HTML5 : ENT_QUOTES; $trans = get_html_translation_table(HTML_EN...
[ "public", "function", "serializerSimplexmlLoadString", "(", "$", "xmlString", ")", "{", "$", "numericTable", "=", "array", "(", ")", ";", "//commonly present restricted characters that can safely be replaced", "$", "numericTable", "[", "'&'", "]", "=", "'&#38;'", ";", ...
Converts xml to string and handles entity encoding. @param string $xmlString The xml string to convert to xml. @return \SimpleXMLElement Returns SimpleXml element
[ "Converts", "xml", "to", "string", "and", "handles", "entity", "encoding", "." ]
train
https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Serializer.php#L346-L357
tableau-mkt/eggs-n-cereal
src/Serializer.php
Serializer.validateImport
public function validateImport(TranslatableInterface $translatable, $targetLang, $xmlString) { $xmlString = Converter::filterXmlControlCharacters($xmlString); $error = $this->errorStart(); // XML does not support most named HTML entities (eg, &nbsp;), but should be // able to handle the UTF-8 uncoded ...
php
public function validateImport(TranslatableInterface $translatable, $targetLang, $xmlString) { $xmlString = Converter::filterXmlControlCharacters($xmlString); $error = $this->errorStart(); // XML does not support most named HTML entities (eg, &nbsp;), but should be // able to handle the UTF-8 uncoded ...
[ "public", "function", "validateImport", "(", "TranslatableInterface", "$", "translatable", ",", "$", "targetLang", ",", "$", "xmlString", ")", "{", "$", "xmlString", "=", "Converter", "::", "filterXmlControlCharacters", "(", "$", "xmlString", ")", ";", "$", "err...
Validates an import. @param TranslatableInterface $translatable A translatable object. @param string $targetLang The target language for this translatable. @param string $xmlString The XLIFF data as a string to validate. @return bool Returns TRUE on success or FALSE on failure.
[ "Validates", "an", "import", "." ]
train
https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Serializer.php#L372-L437
tableau-mkt/eggs-n-cereal
src/Serializer.php
Serializer.errorStop
protected function errorStop($use) { foreach (libxml_get_errors() as $error) { switch ($error->level) { case LIBXML_ERR_WARNING: case LIBXML_ERR_ERROR: $level = LogLevel::WARNING; break; case LIBXML_ERR_FATAL: $level = LogLevel::ERROR; break; ...
php
protected function errorStop($use) { foreach (libxml_get_errors() as $error) { switch ($error->level) { case LIBXML_ERR_WARNING: case LIBXML_ERR_ERROR: $level = LogLevel::WARNING; break; case LIBXML_ERR_FATAL: $level = LogLevel::ERROR; break; ...
[ "protected", "function", "errorStop", "(", "$", "use", ")", "{", "foreach", "(", "libxml_get_errors", "(", ")", "as", "$", "error", ")", "{", "switch", "(", "$", "error", "->", "level", ")", "{", "case", "LIBXML_ERR_WARNING", ":", "case", "LIBXML_ERR_ERROR...
Ends custom error handling. @param bool $use The return value of Serializer::errorStart().
[ "Ends", "custom", "error", "handling", "." ]
train
https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Serializer.php#L455-L479
prowebcraft/dot
src/Dot.php
Dot.getValue
public static function getValue($array, $key, $default = null) { if (is_string($key)) { // Iterate path $keys = explode('.', $key); foreach ($keys as $key) { if (!isset($array[$key])) { return $default; } ...
php
public static function getValue($array, $key, $default = null) { if (is_string($key)) { // Iterate path $keys = explode('.', $key); foreach ($keys as $key) { if (!isset($array[$key])) { return $default; } ...
[ "public", "static", "function", "getValue", "(", "$", "array", ",", "$", "key", ",", "$", "default", "=", "null", ")", "{", "if", "(", "is_string", "(", "$", "key", ")", ")", "{", "// Iterate path", "$", "keys", "=", "explode", "(", "'.'", ",", "$"...
Get value of path, default value if path doesn't exist or all data @param array $array Source Array @param mixed|null $key Path @param mixed|null $default Default value @return mixed Value of path
[ "Get", "value", "of", "path", "default", "value", "if", "path", "doesn", "t", "exist", "or", "all", "data" ]
train
https://github.com/prowebcraft/dot/blob/de47137ec650f39c6835f30474a42cd9548063c4/src/Dot.php#L39-L57
prowebcraft/dot
src/Dot.php
Dot.setValue
public static function setValue(&$array, $key, $value) { if (is_string($key)) { // Iterate path $keys = explode('.', $key); foreach ($keys as $key) { if (!isset($array[$key]) || !is_array($array[$key])) { $array[$key] = []; ...
php
public static function setValue(&$array, $key, $value) { if (is_string($key)) { // Iterate path $keys = explode('.', $key); foreach ($keys as $key) { if (!isset($array[$key]) || !is_array($array[$key])) { $array[$key] = []; ...
[ "public", "static", "function", "setValue", "(", "&", "$", "array", ",", "$", "key", ",", "$", "value", ")", "{", "if", "(", "is_string", "(", "$", "key", ")", ")", "{", "// Iterate path", "$", "keys", "=", "explode", "(", "'.'", ",", "$", "key", ...
Set value or array of values to path @param array $array Target array with data @param mixed $key Path or array of paths and values @param mixed|null $value Value to set if path is not an array
[ "Set", "value", "or", "array", "of", "values", "to", "path" ]
train
https://github.com/prowebcraft/dot/blob/de47137ec650f39c6835f30474a42cd9548063c4/src/Dot.php#L66-L85
prowebcraft/dot
src/Dot.php
Dot.addValue
public static function addValue(&$array, $key, $value = null, $pop = false) { if (is_string($key)) { // Iterate path $keys = explode('.', $key); if ($pop === true) { array_pop($keys); } foreach ($keys as $key) { if (...
php
public static function addValue(&$array, $key, $value = null, $pop = false) { if (is_string($key)) { // Iterate path $keys = explode('.', $key); if ($pop === true) { array_pop($keys); } foreach ($keys as $key) { if (...
[ "public", "static", "function", "addValue", "(", "&", "$", "array", ",", "$", "key", ",", "$", "value", "=", "null", ",", "$", "pop", "=", "false", ")", "{", "if", "(", "is_string", "(", "$", "key", ")", ")", "{", "// Iterate path", "$", "keys", ...
Add value or array of values to path @param array $array Target array with data @param mixed $key Path or array of paths and values @param mixed|null $value Value to set if path is not an array @param boolean $pop Helper to pop out last key if value is an array
[ "Add", "value", "or", "array", "of", "values", "to", "path" ]
train
https://github.com/prowebcraft/dot/blob/de47137ec650f39c6835f30474a42cd9548063c4/src/Dot.php#L95-L117
prowebcraft/dot
src/Dot.php
Dot.deleteValue
public static function deleteValue(&$array, $key) { if (is_string($key)) { // Iterate path $keys = explode('.', $key); $last = array_pop($keys); foreach ($keys as $key) { if (!isset($array[$key])) { return; }...
php
public static function deleteValue(&$array, $key) { if (is_string($key)) { // Iterate path $keys = explode('.', $key); $last = array_pop($keys); foreach ($keys as $key) { if (!isset($array[$key])) { return; }...
[ "public", "static", "function", "deleteValue", "(", "&", "$", "array", ",", "$", "key", ")", "{", "if", "(", "is_string", "(", "$", "key", ")", ")", "{", "// Iterate path", "$", "keys", "=", "explode", "(", "'.'", ",", "$", "key", ")", ";", "$", ...
Delete path or array of paths @param array $array Target array with data @param mixed $key Path or array of paths to delete
[ "Delete", "path", "or", "array", "of", "paths" ]
train
https://github.com/prowebcraft/dot/blob/de47137ec650f39c6835f30474a42cd9548063c4/src/Dot.php#L125-L147
prowebcraft/dot
src/Dot.php
Dot.set
public function set($key, $value = null) { return self::setValue($this->data, $key, $value); }
php
public function set($key, $value = null) { return self::setValue($this->data, $key, $value); }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "return", "self", "::", "setValue", "(", "$", "this", "->", "data", ",", "$", "key", ",", "$", "value", ")", ";", "}" ]
Set value or array of values to path @param mixed $key Path or array of paths and values @param mixed|null $value Value to set if path is not an array
[ "Set", "value", "or", "array", "of", "values", "to", "path" ]
train
https://github.com/prowebcraft/dot/blob/de47137ec650f39c6835f30474a42cd9548063c4/src/Dot.php#L168-L171
prowebcraft/dot
src/Dot.php
Dot.add
public function add($key, $value = null, $pop = false) { return self::addValue($this->data, $key, $value, $pop); }
php
public function add($key, $value = null, $pop = false) { return self::addValue($this->data, $key, $value, $pop); }
[ "public", "function", "add", "(", "$", "key", ",", "$", "value", "=", "null", ",", "$", "pop", "=", "false", ")", "{", "return", "self", "::", "addValue", "(", "$", "this", "->", "data", ",", "$", "key", ",", "$", "value", ",", "$", "pop", ")",...
Add value or array of values to path @param mixed $key Path or array of paths and values @param mixed|null $value Value to set if path is not an array @param boolean $pop Helper to pop out last key if value is an array
[ "Add", "value", "or", "array", "of", "values", "to", "path" ]
train
https://github.com/prowebcraft/dot/blob/de47137ec650f39c6835f30474a42cd9548063c4/src/Dot.php#L180-L183
prowebcraft/dot
src/Dot.php
Dot.has
public function has($key) { $keys = explode('.', (string)$key); $data = &$this->data; foreach ($keys as $key) { if (!isset($data[$key])) { return false; } $data = &$data[$key]; } return true; }
php
public function has($key) { $keys = explode('.', (string)$key); $data = &$this->data; foreach ($keys as $key) { if (!isset($data[$key])) { return false; } $data = &$data[$key]; } return true; }
[ "public", "function", "has", "(", "$", "key", ")", "{", "$", "keys", "=", "explode", "(", "'.'", ",", "(", "string", ")", "$", "key", ")", ";", "$", "data", "=", "&", "$", "this", "->", "data", ";", "foreach", "(", "$", "keys", "as", "$", "ke...
Check if path exists @param string $key Path @return boolean
[ "Check", "if", "path", "exists" ]
train
https://github.com/prowebcraft/dot/blob/de47137ec650f39c6835f30474a42cd9548063c4/src/Dot.php#L191-L203
prowebcraft/dot
src/Dot.php
Dot.clear
public function clear($key = null, $format = false) { if (is_string($key)) { // Iterate path $keys = explode('.', $key); $data = &$this->data; foreach ($keys as $key) { if (!isset($data[$key]) || !is_array($data[$key])) { if...
php
public function clear($key = null, $format = false) { if (is_string($key)) { // Iterate path $keys = explode('.', $key); $data = &$this->data; foreach ($keys as $key) { if (!isset($data[$key]) || !is_array($data[$key])) { if...
[ "public", "function", "clear", "(", "$", "key", "=", "null", ",", "$", "format", "=", "false", ")", "{", "if", "(", "is_string", "(", "$", "key", ")", ")", "{", "// Iterate path", "$", "keys", "=", "explode", "(", "'.'", ",", "$", "key", ")", ";"...
Delete all data, data from path or array of paths and optionally format path if it doesn't exist @param mixed|null $key Path or array of paths to clean @param boolean $format Format option
[ "Delete", "all", "data", "data", "from", "path", "or", "array", "of", "paths", "and", "optionally", "format", "path", "if", "it", "doesn", "t", "exist" ]
train
https://github.com/prowebcraft/dot/blob/de47137ec650f39c6835f30474a42cd9548063c4/src/Dot.php#L222-L249
lmammino/e-foundation
src/Variation/Model/OptionSubjectTrait.php
OptionSubjectTrait.setOptions
public function setOptions(Collection $options) { /** @var OptionInterface $option */ foreach ($options as $option) { $this->addOption($option); } return $this; }
php
public function setOptions(Collection $options) { /** @var OptionInterface $option */ foreach ($options as $option) { $this->addOption($option); } return $this; }
[ "public", "function", "setOptions", "(", "Collection", "$", "options", ")", "{", "/** @var OptionInterface $option */", "foreach", "(", "$", "options", "as", "$", "option", ")", "{", "$", "this", "->", "addOption", "(", "$", "option", ")", ";", "}", "return"...
Set options @param Collection $options @return $this
[ "Set", "options" ]
train
https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/OptionSubjectTrait.php#L44-L52
lmammino/e-foundation
src/Variation/Model/OptionSubjectTrait.php
OptionSubjectTrait.addOption
public function addOption(OptionInterface $option) { if (!$this->hasOption($option)) { $this->options->add($option); } return $this; }
php
public function addOption(OptionInterface $option) { if (!$this->hasOption($option)) { $this->options->add($option); } return $this; }
[ "public", "function", "addOption", "(", "OptionInterface", "$", "option", ")", "{", "if", "(", "!", "$", "this", "->", "hasOption", "(", "$", "option", ")", ")", "{", "$", "this", "->", "options", "->", "add", "(", "$", "option", ")", ";", "}", "re...
Add a given option @param OptionInterface $option @return $this
[ "Add", "a", "given", "option" ]
train
https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/OptionSubjectTrait.php#L71-L78
lmammino/e-foundation
src/Variation/Model/OptionSubjectTrait.php
OptionSubjectTrait.removeOption
public function removeOption(OptionInterface $option) { if ($this->hasOption($option)) { $this->options->removeElement($option); } return $this; }
php
public function removeOption(OptionInterface $option) { if ($this->hasOption($option)) { $this->options->removeElement($option); } return $this; }
[ "public", "function", "removeOption", "(", "OptionInterface", "$", "option", ")", "{", "if", "(", "$", "this", "->", "hasOption", "(", "$", "option", ")", ")", "{", "$", "this", "->", "options", "->", "removeElement", "(", "$", "option", ")", ";", "}",...
Remove a given option @param OptionInterface $option @return $this
[ "Remove", "a", "given", "option" ]
train
https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/OptionSubjectTrait.php#L86-L93
atkrad/data-tables
src/Column/Action.php
Action.initialize
public function initialize(Table $table) { $this->table = $table; if (!$this->builder instanceof ActionBuilder) { $this->builder = new ActionBuilder($this->table); } }
php
public function initialize(Table $table) { $this->table = $table; if (!$this->builder instanceof ActionBuilder) { $this->builder = new ActionBuilder($this->table); } }
[ "public", "function", "initialize", "(", "Table", "$", "table", ")", "{", "$", "this", "->", "table", "=", "$", "table", ";", "if", "(", "!", "$", "this", "->", "builder", "instanceof", "ActionBuilder", ")", "{", "$", "this", "->", "builder", "=", "n...
Initialize table @param Table $table Table object @return void
[ "Initialize", "table" ]
train
https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Column/Action.php#L59-L66
atkrad/data-tables
src/Column/Action.php
Action.getContent
public function getContent($rowResult) { if ($this->callManager($rowResult) === false) { return ''; } return $this->builder->render($this->template); }
php
public function getContent($rowResult) { if ($this->callManager($rowResult) === false) { return ''; } return $this->builder->render($this->template); }
[ "public", "function", "getContent", "(", "$", "rowResult", ")", "{", "if", "(", "$", "this", "->", "callManager", "(", "$", "rowResult", ")", "===", "false", ")", "{", "return", "''", ";", "}", "return", "$", "this", "->", "builder", "->", "render", ...
Get column content @param mixed $rowResult Per row result @return string
[ "Get", "column", "content" ]
train
https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Column/Action.php#L75-L82
atkrad/data-tables
src/Column/Action.php
Action.setManager
public function setManager(Closure $manager) { if (!is_callable($manager)) { throw new Exception('Manager must be callable.'); } $this->manager = $manager; return $this; }
php
public function setManager(Closure $manager) { if (!is_callable($manager)) { throw new Exception('Manager must be callable.'); } $this->manager = $manager; return $this; }
[ "public", "function", "setManager", "(", "Closure", "$", "manager", ")", "{", "if", "(", "!", "is_callable", "(", "$", "manager", ")", ")", "{", "throw", "new", "Exception", "(", "'Manager must be callable.'", ")", ";", "}", "$", "this", "->", "manager", ...
Set action manager @param callable $manager @throws \DataTable\Exception @return Action
[ "Set", "action", "manager" ]
train
https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Column/Action.php#L92-L101
atkrad/data-tables
src/Column/Action.php
Action.callManager
protected function callManager($rowResult) { if (is_callable($this->manager)) { call_user_func_array($this->manager, [$this->builder, $rowResult]); return true; } else { return false; } }
php
protected function callManager($rowResult) { if (is_callable($this->manager)) { call_user_func_array($this->manager, [$this->builder, $rowResult]); return true; } else { return false; } }
[ "protected", "function", "callManager", "(", "$", "rowResult", ")", "{", "if", "(", "is_callable", "(", "$", "this", "->", "manager", ")", ")", "{", "call_user_func_array", "(", "$", "this", "->", "manager", ",", "[", "$", "this", "->", "builder", ",", ...
Call manager @param mixed $rowResult Per row result @return bool
[ "Call", "manager" ]
train
https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Column/Action.php#L110-L119
vi-kon/laravel-auth
src/database/migrations/2014_08_27_000001_create_user_roles_table.php
CreateUserRolesTable.up
public function up() { $schema = app()->make('db')->connection()->getSchemaBuilder(); $schema->create(config('vi-kon.auth.table.user_roles'), function (Blueprint $table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->string('token') ...
php
public function up() { $schema = app()->make('db')->connection()->getSchemaBuilder(); $schema->create(config('vi-kon.auth.table.user_roles'), function (Blueprint $table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->string('token') ...
[ "public", "function", "up", "(", ")", "{", "$", "schema", "=", "app", "(", ")", "->", "make", "(", "'db'", ")", "->", "connection", "(", ")", "->", "getSchemaBuilder", "(", ")", ";", "$", "schema", "->", "create", "(", "config", "(", "'vi-kon.auth.ta...
Run the migrations. @return void
[ "Run", "the", "migrations", "." ]
train
https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/database/migrations/2014_08_27_000001_create_user_roles_table.php#L18-L35
barebone-php/barebone-core
lib/Controller.php
Controller.render
protected function render($template, $data = [], $status = 200) { $rendered = View::render($template, $data); $this->response->getBody()->write($rendered); return $this->getResponse() ->withStatus($status) ->withHeader('Content-Type', 'text/html; charset=utf-8'); ...
php
protected function render($template, $data = [], $status = 200) { $rendered = View::render($template, $data); $this->response->getBody()->write($rendered); return $this->getResponse() ->withStatus($status) ->withHeader('Content-Type', 'text/html; charset=utf-8'); ...
[ "protected", "function", "render", "(", "$", "template", ",", "$", "data", "=", "[", "]", ",", "$", "status", "=", "200", ")", "{", "$", "rendered", "=", "View", "::", "render", "(", "$", "template", ",", "$", "data", ")", ";", "$", "this", "->",...
Render a view template with optional data @param string $template Relative Path to Template File @param array|object $data Associate Array or Object (key => value) @param int $status HTTP status code (100-599, default 200) @return Response
[ "Render", "a", "view", "template", "with", "optional", "data" ]
train
https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Controller.php#L109-L118
barebone-php/barebone-core
lib/Controller.php
Controller.renderJSON
protected function renderJSON($data = [], $status = 200, $flags = null) { $rendered = View::renderJSON($data, $flags); $this->response->getBody()->rewind(); $this->response->getBody()->write($rendered); return $this->getResponse() ->withStatus($status) ->wit...
php
protected function renderJSON($data = [], $status = 200, $flags = null) { $rendered = View::renderJSON($data, $flags); $this->response->getBody()->rewind(); $this->response->getBody()->write($rendered); return $this->getResponse() ->withStatus($status) ->wit...
[ "protected", "function", "renderJSON", "(", "$", "data", "=", "[", "]", ",", "$", "status", "=", "200", ",", "$", "flags", "=", "null", ")", "{", "$", "rendered", "=", "View", "::", "renderJSON", "(", "$", "data", ",", "$", "flags", ")", ";", "$"...
Render data variable as application/json string @param array|object $data Associate Array or Object (key => value) @param int $status HTTP status code (100-599, default 200) @param int $flags JSON Encoding Flags @return Response
[ "Render", "data", "variable", "as", "application", "/", "json", "string" ]
train
https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Controller.php#L129-L139
barebone-php/barebone-core
lib/Controller.php
Controller.redirect
protected function redirect($url, $status = 302) { return $this->getResponse() ->withStatus($status) ->withHeader('Location', (string)$url); }
php
protected function redirect($url, $status = 302) { return $this->getResponse() ->withStatus($status) ->withHeader('Location', (string)$url); }
[ "protected", "function", "redirect", "(", "$", "url", ",", "$", "status", "=", "302", ")", "{", "return", "$", "this", "->", "getResponse", "(", ")", "->", "withStatus", "(", "$", "status", ")", "->", "withHeader", "(", "'Location'", ",", "(", "string"...
Redirect to URL with optional status @param string $url The redirect destination. @param int $status The redirect HTTP status code (between 100 and 599). @return Response
[ "Redirect", "to", "URL", "with", "optional", "status" ]
train
https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Controller.php#L150-L155
barebone-php/barebone-core
lib/Controller.php
Controller.routerError
public function routerError($error = null, $subject = null) { switch ($error) { case Router::ERR_NOT_FOUND: $status = 404; $template = 'router/error404'; break; case Router::ERR_BAD_METHOD: $status = 405; $template = 'router/error40...
php
public function routerError($error = null, $subject = null) { switch ($error) { case Router::ERR_NOT_FOUND: $status = 404; $template = 'router/error404'; break; case Router::ERR_BAD_METHOD: $status = 405; $template = 'router/error40...
[ "public", "function", "routerError", "(", "$", "error", "=", "null", ",", "$", "subject", "=", "null", ")", "{", "switch", "(", "$", "error", ")", "{", "case", "Router", "::", "ERR_NOT_FOUND", ":", "$", "status", "=", "404", ";", "$", "template", "="...
Router Error Action @param string $error Router::ERR_* @param mixed $subject Optional value for the error template @return Response
[ "Router", "Error", "Action" ]
train
https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Controller.php#L165-L185