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
kecik-framework/kecik
Kecik/Kecik.php
Kecik.run
public function run( $yield = NULL ) { if ( php_sapi_name() == 'cli-server' ) { if ( is_file( route::$BasePath . str_replace( '/', DIRECTORY_SEPARATOR, $_SERVER['REQUEST_URI'] ) ) && file_exists( route::$BasePath . str_replace( '/', DIRECTORY_SEPARATOR, $_SERVER['REQUEST_URI'] ) ) && substr...
php
public function run( $yield = NULL ) { if ( php_sapi_name() == 'cli-server' ) { if ( is_file( route::$BasePath . str_replace( '/', DIRECTORY_SEPARATOR, $_SERVER['REQUEST_URI'] ) ) && file_exists( route::$BasePath . str_replace( '/', DIRECTORY_SEPARATOR, $_SERVER['REQUEST_URI'] ) ) && substr...
[ "public", "function", "run", "(", "$", "yield", "=", "NULL", ")", "{", "if", "(", "php_sapi_name", "(", ")", "==", "'cli-server'", ")", "{", "if", "(", "is_file", "(", "route", "::", "$", "BasePath", ".", "str_replace", "(", "'/'", ",", "DIRECTORY_SEPA...
Run Kecik Framework @param null $yield @return bool
[ "Run", "Kecik", "Framework" ]
train
https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Kecik.php#L708-L853
kecik-framework/kecik
Kecik/Kecik.php
Kecik.render
public function render( $file, $response = "" ) { ob_start(); include $file; self::$FullRender = ob_get_clean(); $config = $this->config; self::$FullRender = preg_replace_callback( array( '/(\\\)?' . addslashes( $this->config->get( 'template.open_tag' ) ) . '=?' . '/', '/(\\\)...
php
public function render( $file, $response = "" ) { ob_start(); include $file; self::$FullRender = ob_get_clean(); $config = $this->config; self::$FullRender = preg_replace_callback( array( '/(\\\)?' . addslashes( $this->config->get( 'template.open_tag' ) ) . '=?' . '/', '/(\\\)...
[ "public", "function", "render", "(", "$", "file", ",", "$", "response", "=", "\"\"", ")", "{", "ob_start", "(", ")", ";", "include", "$", "file", ";", "self", "::", "$", "FullRender", "=", "ob_get_clean", "(", ")", ";", "$", "config", "=", "$", "th...
Render the template @param $file @param string $response @return string
[ "Render", "the", "template" ]
train
https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Kecik.php#L863-L916
kecik-framework/kecik
Kecik/Kecik.php
Kecik.error
public function error( $code ) { header( $_SERVER["SERVER_PROTOCOL"] . Route::$HttpResponse[ $code ] ); if ( $this->config->get( "error.$code" ) != '' ) { echo $this->render( $this->config->get( 'path.template' ) . '/' . $this->config->get( "error.$code" ) . '.php' ); } else { die( Route::$HttpRespon...
php
public function error( $code ) { header( $_SERVER["SERVER_PROTOCOL"] . Route::$HttpResponse[ $code ] ); if ( $this->config->get( "error.$code" ) != '' ) { echo $this->render( $this->config->get( 'path.template' ) . '/' . $this->config->get( "error.$code" ) . '.php' ); } else { die( Route::$HttpRespon...
[ "public", "function", "error", "(", "$", "code", ")", "{", "header", "(", "$", "_SERVER", "[", "\"SERVER_PROTOCOL\"", "]", ".", "Route", "::", "$", "HttpResponse", "[", "$", "code", "]", ")", ";", "if", "(", "$", "this", "->", "config", "->", "get", ...
Set error @param $code
[ "Set", "error" ]
train
https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Kecik.php#L923-L932
kecik-framework/kecik
Kecik/Kecik.php
Kecik.header
public function header( $code = 200 ) { if ( ! is_array( $code ) ) { $code = array( $code ); } self::$header = array(); foreach ( $code as $value ) { if ( is_int( $value ) ) { self::$header[] = $_SERVER["SERVER_PROTOCOL"] . ' ' . Route::$HttpResponse[ $value ]; } else { self::$...
php
public function header( $code = 200 ) { if ( ! is_array( $code ) ) { $code = array( $code ); } self::$header = array(); foreach ( $code as $value ) { if ( is_int( $value ) ) { self::$header[] = $_SERVER["SERVER_PROTOCOL"] . ' ' . Route::$HttpResponse[ $value ]; } else { self::$...
[ "public", "function", "header", "(", "$", "code", "=", "200", ")", "{", "if", "(", "!", "is_array", "(", "$", "code", ")", ")", "{", "$", "code", "=", "array", "(", "$", "code", ")", ";", "}", "self", "::", "$", "header", "=", "array", "(", "...
Set Header Response @param int $code
[ "Set", "Header", "Response" ]
train
https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Kecik.php#L946-L964
php-lug/lug
src/Bundle/ResourceBundle/Form/Extension/AbstractLabelExtension.php
AbstractLabelExtension.finishView
public function finishView(FormView $view, FormInterface $form, array $options) { if ($view->vars['label'] !== null) { return; } $view->vars['label'] = $label = $this->createLabelPrefix($view, $form); if (array_key_exists('label_add', $view->vars) && $view->vars['label_...
php
public function finishView(FormView $view, FormInterface $form, array $options) { if ($view->vars['label'] !== null) { return; } $view->vars['label'] = $label = $this->createLabelPrefix($view, $form); if (array_key_exists('label_add', $view->vars) && $view->vars['label_...
[ "public", "function", "finishView", "(", "FormView", "$", "view", ",", "FormInterface", "$", "form", ",", "array", "$", "options", ")", "{", "if", "(", "$", "view", "->", "vars", "[", "'label'", "]", "!==", "null", ")", "{", "return", ";", "}", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Form/Extension/AbstractLabelExtension.php#L35-L52
php-lug/lug
src/Bundle/ResourceBundle/Form/Extension/AbstractLabelExtension.php
AbstractLabelExtension.createLabelPrefix
private function createLabelPrefix(FormView $view, FormInterface $form, $depth = 1) { if (($labelPrefix = $form->getConfig()->getOption('label_prefix')) === null) { return $this->createParentLabelPrefix($view, $form, $depth); } if ($depth === 1 && ($rootLabelPrefix = $this->crea...
php
private function createLabelPrefix(FormView $view, FormInterface $form, $depth = 1) { if (($labelPrefix = $form->getConfig()->getOption('label_prefix')) === null) { return $this->createParentLabelPrefix($view, $form, $depth); } if ($depth === 1 && ($rootLabelPrefix = $this->crea...
[ "private", "function", "createLabelPrefix", "(", "FormView", "$", "view", ",", "FormInterface", "$", "form", ",", "$", "depth", "=", "1", ")", "{", "if", "(", "(", "$", "labelPrefix", "=", "$", "form", "->", "getConfig", "(", ")", "->", "getOption", "(...
@param FormView $view @param FormInterface $form @param int $depth @return string|null
[ "@param", "FormView", "$view", "@param", "FormInterface", "$form", "@param", "int", "$depth" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Form/Extension/AbstractLabelExtension.php#L75-L86
php-lug/lug
src/Bundle/ResourceBundle/Form/Extension/AbstractLabelExtension.php
AbstractLabelExtension.createParentLabelPrefix
private function createParentLabelPrefix(FormView $view, FormInterface $form, $depth) { if ($view->parent !== null && $form->getParent() !== null && ($label = $this->createLabelPrefix($view->parent, $form->getParent(), ++$depth)) !== null) { return $label.'.'.$view->vars[...
php
private function createParentLabelPrefix(FormView $view, FormInterface $form, $depth) { if ($view->parent !== null && $form->getParent() !== null && ($label = $this->createLabelPrefix($view->parent, $form->getParent(), ++$depth)) !== null) { return $label.'.'.$view->vars[...
[ "private", "function", "createParentLabelPrefix", "(", "FormView", "$", "view", ",", "FormInterface", "$", "form", ",", "$", "depth", ")", "{", "if", "(", "$", "view", "->", "parent", "!==", "null", "&&", "$", "form", "->", "getParent", "(", ")", "!==", ...
@param FormView $view @param FormInterface $form @param int $depth @return string|null
[ "@param", "FormView", "$view", "@param", "FormInterface", "$form", "@param", "int", "$depth" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Form/Extension/AbstractLabelExtension.php#L95-L102
jaeger-app/db-mysql
src/Traits/MySQL/Mycnf.php
Mycnf.createMyCnf
private function createMyCnf(array $db_info, $path) { $this->db_info = $db_info; $data = array( 'head' => '[client]', 'user' => 'user = ' . $this->db_info['user'], 'password' => 'password = ' . $this->db_info['password'], 'host' => 'host = ' . $this->d...
php
private function createMyCnf(array $db_info, $path) { $this->db_info = $db_info; $data = array( 'head' => '[client]', 'user' => 'user = ' . $this->db_info['user'], 'password' => 'password = ' . $this->db_info['password'], 'host' => 'host = ' . $this->d...
[ "private", "function", "createMyCnf", "(", "array", "$", "db_info", ",", "$", "path", ")", "{", "$", "this", "->", "db_info", "=", "$", "db_info", ";", "$", "data", "=", "array", "(", "'head'", "=>", "'[client]'", ",", "'user'", "=>", "'user = '", ".",...
Creates the my.cnf file for @param array $db_info @param unknown $path @return string
[ "Creates", "the", "my", ".", "cnf", "file", "for" ]
train
https://github.com/jaeger-app/db-mysql/blob/8211957b97dbcebeb7e65e0e5ab686c12992da72/src/Traits/MySQL/Mycnf.php#L30-L47
petrica/php-statsd-system
Model/TopCommand.php
TopCommand.run
public function run() { $result = $this->getCommand()->run(); if ($result->getExitCode() != 0) { throw new \RuntimeException(sprintf( 'Command failed. Exit code %d, output %s', $result->getExitCode(), $result->getStdErr())); } ...
php
public function run() { $result = $this->getCommand()->run(); if ($result->getExitCode() != 0) { throw new \RuntimeException(sprintf( 'Command failed. Exit code %d, output %s', $result->getExitCode(), $result->getStdErr())); } ...
[ "public", "function", "run", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getCommand", "(", ")", "->", "run", "(", ")", ";", "if", "(", "$", "result", "->", "getExitCode", "(", ")", "!=", "0", ")", "{", "throw", "new", "\\", "RuntimeExc...
Run configured command @return string
[ "Run", "configured", "command" ]
train
https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Model/TopCommand.php#L39-L51
petrica/php-statsd-system
Model/TopCommand.php
TopCommand.parse
protected function parse($output) { $lines = explode(PHP_EOL, $output); $stats = array(); foreach ($lines as $line) { $data = explode(' ', $line); array_walk($data, 'trim'); $stats[] = array_values(array_filter($data, function ($value) { re...
php
protected function parse($output) { $lines = explode(PHP_EOL, $output); $stats = array(); foreach ($lines as $line) { $data = explode(' ', $line); array_walk($data, 'trim'); $stats[] = array_values(array_filter($data, function ($value) { re...
[ "protected", "function", "parse", "(", "$", "output", ")", "{", "$", "lines", "=", "explode", "(", "PHP_EOL", ",", "$", "output", ")", ";", "$", "stats", "=", "array", "(", ")", ";", "foreach", "(", "$", "lines", "as", "$", "line", ")", "{", "$",...
Parse top utility command output Returns an array of lines with the same top columns @param $output @return array
[ "Parse", "top", "utility", "command", "output" ]
train
https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Model/TopCommand.php#L61-L74
petrica/php-statsd-system
Model/TopCommand.php
TopCommand.buildCommand
protected function buildCommand() { $command = new Command(\Tivie\Command\ESCAPE); $command ->setCommand('top') ->addArgument(new Argument('-b')) ->addArgument(new Argument('-n', 1)); return $command; }
php
protected function buildCommand() { $command = new Command(\Tivie\Command\ESCAPE); $command ->setCommand('top') ->addArgument(new Argument('-b')) ->addArgument(new Argument('-n', 1)); return $command; }
[ "protected", "function", "buildCommand", "(", ")", "{", "$", "command", "=", "new", "Command", "(", "\\", "Tivie", "\\", "Command", "\\", "ESCAPE", ")", ";", "$", "command", "->", "setCommand", "(", "'top'", ")", "->", "addArgument", "(", "new", "Argumen...
Build commit command @return Command @throws \Tivie\Command\Exception\Exception @throws \Tivie\Command\Exception\InvalidArgumentException
[ "Build", "commit", "command" ]
train
https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Model/TopCommand.php#L83-L92
wenbinye/PhalconX
src/Helper/ClassResolver.php
ClassResolver.resolve
public function resolve($name, $declaringClass) { if (strpos($name, '\\') !== false) { return $name; } $imports = $this->cache->get('_PHX.imports.'.$declaringClass); if (!isset($imports)) { $imports = ClassHelper::getImports($declaringClass); $this...
php
public function resolve($name, $declaringClass) { if (strpos($name, '\\') !== false) { return $name; } $imports = $this->cache->get('_PHX.imports.'.$declaringClass); if (!isset($imports)) { $imports = ClassHelper::getImports($declaringClass); $this...
[ "public", "function", "resolve", "(", "$", "name", ",", "$", "declaringClass", ")", "{", "if", "(", "strpos", "(", "$", "name", ",", "'\\\\'", ")", "!==", "false", ")", "{", "return", "$", "name", ";", "}", "$", "imports", "=", "$", "this", "->", ...
Gets full class name @param string $name @param string $declaringClass @return string|null
[ "Gets", "full", "class", "name" ]
train
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ClassResolver.php#L28-L45
hnhdigital-os/laravel-html-builder
src/Tag.php
Tag.add
public function add($tag, ...$arguments) { $tag = strtolower($tag); $text = ''; $attributes = []; for ($i = 0; $i <= 1; $i++) { if (array_has($arguments, $i)) { if (is_array(array_get($arguments, $i))) { $attributes = array_get($argume...
php
public function add($tag, ...$arguments) { $tag = strtolower($tag); $text = ''; $attributes = []; for ($i = 0; $i <= 1; $i++) { if (array_has($arguments, $i)) { if (is_array(array_get($arguments, $i))) { $attributes = array_get($argume...
[ "public", "function", "add", "(", "$", "tag", ",", "...", "$", "arguments", ")", "{", "$", "tag", "=", "strtolower", "(", "$", "tag", ")", ";", "$", "text", "=", "''", ";", "$", "attributes", "=", "[", "]", ";", "for", "(", "$", "i", "=", "0"...
Add a child node to this tag. @param string $tag @param array $arguments @return Bluora\LaravelHtmlBuilder\Tag
[ "Add", "a", "child", "node", "to", "this", "tag", "." ]
train
https://github.com/hnhdigital-os/laravel-html-builder/blob/3c3c1f370e6ff77769b37130d12cbd041db3a841/src/Tag.php#L45-L95
hnhdigital-os/laravel-html-builder
src/Tag.php
Tag.setTag
public function setTag($tag) { if (in_array($tag, $this->getParent()->allowed_tags)) { throw new \Exception($tag.' can not be changed as it is not allowed under '.$this->getParent()->getTag().'.'); } $this->tag = $tag; return $this; }
php
public function setTag($tag) { if (in_array($tag, $this->getParent()->allowed_tags)) { throw new \Exception($tag.' can not be changed as it is not allowed under '.$this->getParent()->getTag().'.'); } $this->tag = $tag; return $this; }
[ "public", "function", "setTag", "(", "$", "tag", ")", "{", "if", "(", "in_array", "(", "$", "tag", ",", "$", "this", "->", "getParent", "(", ")", "->", "allowed_tags", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "$", "tag", ".", "' can n...
Set the tag name. @return Bluora\LaravelHtmlBuilder\Tag
[ "Set", "the", "tag", "name", "." ]
train
https://github.com/hnhdigital-os/laravel-html-builder/blob/3c3c1f370e6ff77769b37130d12cbd041db3a841/src/Tag.php#L126-L135
hnhdigital-os/laravel-html-builder
src/Tag.php
Tag.setText
public function setText($value) { $this->text = $value; // Auto-convert into html. if (is_object($value) && stripos(get_class($value), 'HtmlGenerator\\Html')) { $this->text = (string) $value; } return $this; }
php
public function setText($value) { $this->text = $value; // Auto-convert into html. if (is_object($value) && stripos(get_class($value), 'HtmlGenerator\\Html')) { $this->text = (string) $value; } return $this; }
[ "public", "function", "setText", "(", "$", "value", ")", "{", "$", "this", "->", "text", "=", "$", "value", ";", "// Auto-convert into html.", "if", "(", "is_object", "(", "$", "value", ")", "&&", "stripos", "(", "get_class", "(", "$", "value", ")", ",...
Set the text for this tag. @param string $value @return Bluora\LaravelHtmlBuilder\Tag
[ "Set", "the", "text", "for", "this", "tag", "." ]
train
https://github.com/hnhdigital-os/laravel-html-builder/blob/3c3c1f370e6ff77769b37130d12cbd041db3a841/src/Tag.php#L154-L164
hnhdigital-os/laravel-html-builder
src/Tag.php
Tag.setAttributes
public function setAttributes() { $attributes = func_get_args(); if (count($attributes)) { if (count($attributes) == 1 && is_array($attributes[0])) { $attributes = $attributes[0]; } $this->attributes = $attributes; } return $this; ...
php
public function setAttributes() { $attributes = func_get_args(); if (count($attributes)) { if (count($attributes) == 1 && is_array($attributes[0])) { $attributes = $attributes[0]; } $this->attributes = $attributes; } return $this; ...
[ "public", "function", "setAttributes", "(", ")", "{", "$", "attributes", "=", "func_get_args", "(", ")", ";", "if", "(", "count", "(", "$", "attributes", ")", ")", "{", "if", "(", "count", "(", "$", "attributes", ")", "==", "1", "&&", "is_array", "("...
Set one or many attributes. @param array ...$attributes @return Bluora\LaravelHtmlBuilder\Tag
[ "Set", "one", "or", "many", "attributes", "." ]
train
https://github.com/hnhdigital-os/laravel-html-builder/blob/3c3c1f370e6ff77769b37130d12cbd041db3a841/src/Tag.php#L183-L194
hnhdigital-os/laravel-html-builder
src/Tag.php
Tag.buildHtml
private static function buildHtml(&$html, $tag_object, $options, $tab = 0) { self::checkBuildOptions($options); $tag_is_special = in_array($tag_object->getTag(), self::$special_tags); $tag_is_ignored = in_array($tag_object->getTag(), array_get($options, 'ignore_tags', [])); $ignore...
php
private static function buildHtml(&$html, $tag_object, $options, $tab = 0) { self::checkBuildOptions($options); $tag_is_special = in_array($tag_object->getTag(), self::$special_tags); $tag_is_ignored = in_array($tag_object->getTag(), array_get($options, 'ignore_tags', [])); $ignore...
[ "private", "static", "function", "buildHtml", "(", "&", "$", "html", ",", "$", "tag_object", ",", "$", "options", ",", "$", "tab", "=", "0", ")", "{", "self", "::", "checkBuildOptions", "(", "$", "options", ")", ";", "$", "tag_is_special", "=", "in_arr...
Build html from this object. @param string &$html @param LaravelHtmlBuilder\Tag $tag_object @param array $options @param int $tab @return void
[ "Build", "html", "from", "this", "object", "." ]
train
https://github.com/hnhdigital-os/laravel-html-builder/blob/3c3c1f370e6ff77769b37130d12cbd041db3a841/src/Tag.php#L277-L326
hnhdigital-os/laravel-html-builder
src/Tag.php
Tag.buildHtmlAttribute
private static function buildHtmlAttribute($attributes) { $html = ''; foreach ($attributes as $name => $value) { $html .= ' '.$name.'="'.$value.'"'; $class_list = explode(' ', $value); foreach ($class_list as $class_name) { switch ($class_name) { ...
php
private static function buildHtmlAttribute($attributes) { $html = ''; foreach ($attributes as $name => $value) { $html .= ' '.$name.'="'.$value.'"'; $class_list = explode(' ', $value); foreach ($class_list as $class_name) { switch ($class_name) { ...
[ "private", "static", "function", "buildHtmlAttribute", "(", "$", "attributes", ")", "{", "$", "html", "=", "''", ";", "foreach", "(", "$", "attributes", "as", "$", "name", "=>", "$", "value", ")", "{", "$", "html", ".=", "' '", ".", "$", "name", ".",...
Build html attributes from array. @param array $attributes @return string
[ "Build", "html", "attributes", "from", "array", "." ]
train
https://github.com/hnhdigital-os/laravel-html-builder/blob/3c3c1f370e6ff77769b37130d12cbd041db3a841/src/Tag.php#L335-L352
hnhdigital-os/laravel-html-builder
src/Tag.php
Tag.buildArray
private static function buildArray(&$array, $tag_object, $options = []) { self::checkBuildOptions($options); if (in_array($tag_object->getTag(), self::$special_tags)) { $array[] = [trim((string) $tag_object)]; } elseif (!isset($options['ignore_tags']) || !in_array($tag_object->g...
php
private static function buildArray(&$array, $tag_object, $options = []) { self::checkBuildOptions($options); if (in_array($tag_object->getTag(), self::$special_tags)) { $array[] = [trim((string) $tag_object)]; } elseif (!isset($options['ignore_tags']) || !in_array($tag_object->g...
[ "private", "static", "function", "buildArray", "(", "&", "$", "array", ",", "$", "tag_object", ",", "$", "options", "=", "[", "]", ")", "{", "self", "::", "checkBuildOptions", "(", "$", "options", ")", ";", "if", "(", "in_array", "(", "$", "tag_object"...
Build an array from this object. @param array &$array @param LaravelHtmlBuilder\Tag $tag_object @param array $options @return void
[ "Build", "an", "array", "from", "this", "object", "." ]
train
https://github.com/hnhdigital-os/laravel-html-builder/blob/3c3c1f370e6ff77769b37130d12cbd041db3a841/src/Tag.php#L363-L394
hnhdigital-os/laravel-html-builder
src/Tag.php
Tag.buildFromArray
public static function buildFromArray(&$html, $array, $tab = 0) { $pad = ''; if ($tab > 0) { $pad = str_pad($pad, $tab * 2, ' ', STR_PAD_LEFT); } if (!isset($array[1])) { $html .= $array[0]."\n"; return; } if (!empty($array[0])) ...
php
public static function buildFromArray(&$html, $array, $tab = 0) { $pad = ''; if ($tab > 0) { $pad = str_pad($pad, $tab * 2, ' ', STR_PAD_LEFT); } if (!isset($array[1])) { $html .= $array[0]."\n"; return; } if (!empty($array[0])) ...
[ "public", "static", "function", "buildFromArray", "(", "&", "$", "html", ",", "$", "array", ",", "$", "tab", "=", "0", ")", "{", "$", "pad", "=", "''", ";", "if", "(", "$", "tab", ">", "0", ")", "{", "$", "pad", "=", "str_pad", "(", "$", "pad...
Build html from an array. @param string &$html @param array $array @param int $tab @return void
[ "Build", "html", "from", "an", "array", "." ]
train
https://github.com/hnhdigital-os/laravel-html-builder/blob/3c3c1f370e6ff77769b37130d12cbd041db3a841/src/Tag.php#L405-L441
hnhdigital-os/laravel-html-builder
src/Tag.php
Tag.prepare
public function prepare($options = []) { if (request()->ajax()) { return $this->getArray($options); } return $this->getHtml($options); }
php
public function prepare($options = []) { if (request()->ajax()) { return $this->getArray($options); } return $this->getHtml($options); }
[ "public", "function", "prepare", "(", "$", "options", "=", "[", "]", ")", "{", "if", "(", "request", "(", ")", "->", "ajax", "(", ")", ")", "{", "return", "$", "this", "->", "getArray", "(", "$", "options", ")", ";", "}", "return", "$", "this", ...
Automatically returns the object based on the http request. @return html|array
[ "Automatically", "returns", "the", "object", "based", "on", "the", "http", "request", "." ]
train
https://github.com/hnhdigital-os/laravel-html-builder/blob/3c3c1f370e6ff77769b37130d12cbd041db3a841/src/Tag.php#L448-L455
xiewulong/yii2-fileupload
oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php
ClassCollectionLoader.load
public static function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php') { // each $name can only be loaded once per PHP process if (isset(self::$loaded[$name])) { return; } self::$loaded[$name] = true; $declared = array_merge...
php
public static function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php') { // each $name can only be loaded once per PHP process if (isset(self::$loaded[$name])) { return; } self::$loaded[$name] = true; $declared = array_merge...
[ "public", "static", "function", "load", "(", "$", "classes", ",", "$", "cacheDir", ",", "$", "name", ",", "$", "autoReload", ",", "$", "adaptive", "=", "false", ",", "$", "extension", "=", "'.php'", ")", "{", "// each $name can only be loaded once per PHP proc...
Loads a list of classes and caches them in one big file. @param array $classes An array of classes to load @param string $cacheDir A cache directory @param string $name The cache name prefix @param Boolean $autoReload Whether to flush the cache when the cache is stale or not @param Boolean $adaptive W...
[ "Loads", "a", "list", "of", "classes", "and", "caches", "them", "in", "one", "big", "file", "." ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php#L37-L128
xiewulong/yii2-fileupload
oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php
ClassCollectionLoader.fixNamespaceDeclarations
public static function fixNamespaceDeclarations($source) { if (!function_exists('token_get_all') || !self::$useTokenizer) { if (preg_match('/namespace(.*?)\s*;/', $source)) { $source = preg_replace('/namespace(.*?)\s*;/', "namespace$1\n{", $source)."}\n"; } ...
php
public static function fixNamespaceDeclarations($source) { if (!function_exists('token_get_all') || !self::$useTokenizer) { if (preg_match('/namespace(.*?)\s*;/', $source)) { $source = preg_replace('/namespace(.*?)\s*;/', "namespace$1\n{", $source)."}\n"; } ...
[ "public", "static", "function", "fixNamespaceDeclarations", "(", "$", "source", ")", "{", "if", "(", "!", "function_exists", "(", "'token_get_all'", ")", "||", "!", "self", "::", "$", "useTokenizer", ")", "{", "if", "(", "preg_match", "(", "'/namespace(.*?)\\s...
Adds brackets around each namespace if it's not already the case. @param string $source Namespace string @return string Namespaces with brackets
[ "Adds", "brackets", "around", "each", "namespace", "if", "it", "s", "not", "already", "the", "case", "." ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php#L137-L196
xiewulong/yii2-fileupload
oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php
ClassCollectionLoader.resolveDependencies
private static function resolveDependencies(array $tree, $node, \ArrayObject $resolved = null, \ArrayObject $unresolved = null) { if (null === $resolved) { $resolved = new \ArrayObject(); } if (null === $unresolved) { $unresolved = new \ArrayObject(); } ...
php
private static function resolveDependencies(array $tree, $node, \ArrayObject $resolved = null, \ArrayObject $unresolved = null) { if (null === $resolved) { $resolved = new \ArrayObject(); } if (null === $unresolved) { $unresolved = new \ArrayObject(); } ...
[ "private", "static", "function", "resolveDependencies", "(", "array", "$", "tree", ",", "$", "node", ",", "\\", "ArrayObject", "$", "resolved", "=", "null", ",", "\\", "ArrayObject", "$", "unresolved", "=", "null", ")", "{", "if", "(", "null", "===", "$"...
Dependencies resolution. This function does not check for circular dependencies as it should never occur with PHP traits. @param array $tree The dependency tree @param \ReflectionClass $node The node @param \ArrayObject $resolved An array of already resolved dependencies @param \ArrayO...
[ "Dependencies", "resolution", "." ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php#L347-L366
surebert/surebert-framework
src/sb/SFTP/Client.php
Client.login
public function login($uname, $pass) { if(parent::login($uname, $pass)){ $this->connect(); } return true; }
php
public function login($uname, $pass) { if(parent::login($uname, $pass)){ $this->connect(); } return true; }
[ "public", "function", "login", "(", "$", "uname", ",", "$", "pass", ")", "{", "if", "(", "parent", "::", "login", "(", "$", "uname", ",", "$", "pass", ")", ")", "{", "$", "this", "->", "connect", "(", ")", ";", "}", "return", "true", ";", "}" ]
Login to a remote server with uname and pass based credentials @param string $uname The user name to log in with @param <type> $pass The password to login in with
[ "Login", "to", "a", "remote", "server", "with", "uname", "and", "pass", "based", "credentials" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SFTP/Client.php#L55-L63
surebert/surebert-framework
src/sb/SFTP/Client.php
Client.loginWithKey
public function loginWithKey($uname, $public_key_file, $private_key_file, $pass='') { if(parent::loginWithKey($uname, $public_key_file, $private_key_file, $pass)) { $this->connect(); } return true; }
php
public function loginWithKey($uname, $public_key_file, $private_key_file, $pass='') { if(parent::loginWithKey($uname, $public_key_file, $private_key_file, $pass)) { $this->connect(); } return true; }
[ "public", "function", "loginWithKey", "(", "$", "uname", ",", "$", "public_key_file", ",", "$", "private_key_file", ",", "$", "pass", "=", "''", ")", "{", "if", "(", "parent", "::", "loginWithKey", "(", "$", "uname", ",", "$", "public_key_file", ",", "$"...
Login with public key @param string $uname The username to login in as @param string $public_key_file The path to the public key file to use (id_rsa.pub), make sure it is readible by your script @param string $private_key_file The private key file to use id (id_rsa), make sure it is readible by your script @param strin...
[ "Login", "with", "public", "key" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SFTP/Client.php#L72-L80
surebert/surebert-framework
src/sb/SFTP/Client.php
Client.put
public function put($local_file, $remote_file, $mode=null) { if(!is_null($mode)){ return $this->scpSend($local_path, $remote_path, $mode); return true; } $stream = @fopen("ssh2.sftp://".$this->sftp.$remote_file, 'w'); if (! $stream){ throw new \E...
php
public function put($local_file, $remote_file, $mode=null) { if(!is_null($mode)){ return $this->scpSend($local_path, $remote_path, $mode); return true; } $stream = @fopen("ssh2.sftp://".$this->sftp.$remote_file, 'w'); if (! $stream){ throw new \E...
[ "public", "function", "put", "(", "$", "local_file", ",", "$", "remote_file", ",", "$", "mode", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "mode", ")", ")", "{", "return", "$", "this", "->", "scpSend", "(", "$", "local_path", ",", ...
Put a file on the remote machine @param string $local_file The path to the local file to read @param string $remote_file The path to the remote file to write @param integer $mode File permission mode, if is set, uses scp which is slower
[ "Put", "a", "file", "on", "the", "remote", "machine" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SFTP/Client.php#L88-L113
surebert/surebert-framework
src/sb/SFTP/Client.php
Client.get
public function get($remote_file, $local_file) { $stream = @fopen("ssh2.sftp://".$this->sftp.$remote_file, 'r'); if (! $stream){ throw new \Exception("Could not get remote file:". $remote_file); } $size = $this->size($remote_file); $contents = ''; $read ...
php
public function get($remote_file, $local_file) { $stream = @fopen("ssh2.sftp://".$this->sftp.$remote_file, 'r'); if (! $stream){ throw new \Exception("Could not get remote file:". $remote_file); } $size = $this->size($remote_file); $contents = ''; $read ...
[ "public", "function", "get", "(", "$", "remote_file", ",", "$", "local_file", ")", "{", "$", "stream", "=", "@", "fopen", "(", "\"ssh2.sftp://\"", ".", "$", "this", "->", "sftp", ".", "$", "remote_file", ",", "'r'", ")", ";", "if", "(", "!", "$", "...
Get a file from the remote machine @param string $remote_file The path to the remote file to read @param string $local_file The path to the local file to write
[ "Get", "a", "file", "from", "the", "remote", "machine" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SFTP/Client.php#L121-L142
surebert/surebert-framework
src/sb/SFTP/Client.php
Client.ls
public function ls($remote_dir) { $dir = "ssh2.sftp://".$this->sftp.$remote_dir; $handle = opendir($dir); $files = Array(); while (false !== ($file = readdir($handle))) { if (substr($file, 0, 1) != '.'){ $files[] = $file; } } c...
php
public function ls($remote_dir) { $dir = "ssh2.sftp://".$this->sftp.$remote_dir; $handle = opendir($dir); $files = Array(); while (false !== ($file = readdir($handle))) { if (substr($file, 0, 1) != '.'){ $files[] = $file; } } c...
[ "public", "function", "ls", "(", "$", "remote_dir", ")", "{", "$", "dir", "=", "\"ssh2.sftp://\"", ".", "$", "this", "->", "sftp", ".", "$", "remote_dir", ";", "$", "handle", "=", "opendir", "(", "$", "dir", ")", ";", "$", "files", "=", "Array", "(...
Lists the contents of a remote directory @param string $remote_dir @return Array The array of files
[ "Lists", "the", "contents", "of", "a", "remote", "directory" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SFTP/Client.php#L149-L164
surebert/surebert-framework
src/sb/SFTP/Client.php
Client.renameRemoteFile
public function renameRemoteFile($from, $to) { if(@ssh2_sftp_rename($this->sftp, $from, $to)){ throw new \Exception("Could not rename file from $from to $to"); } return true; }
php
public function renameRemoteFile($from, $to) { if(@ssh2_sftp_rename($this->sftp, $from, $to)){ throw new \Exception("Could not rename file from $from to $to"); } return true; }
[ "public", "function", "renameRemoteFile", "(", "$", "from", ",", "$", "to", ")", "{", "if", "(", "@", "ssh2_sftp_rename", "(", "$", "this", "->", "sftp", ",", "$", "from", ",", "$", "to", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "\"Co...
Renames remote files @param string $from The old path/file name @param string $to The new path/file name
[ "Renames", "remote", "files" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SFTP/Client.php#L181-L188
surebert/surebert-framework
src/sb/SFTP/Client.php
Client.getFileStats
public function getFileStats($path) { $stats = @ssh2_sftp_stat($this->sftp, $path); if(!$stats['size']){ throw new \Exception("Could get file stat: ".$path); } return $stats; }
php
public function getFileStats($path) { $stats = @ssh2_sftp_stat($this->sftp, $path); if(!$stats['size']){ throw new \Exception("Could get file stat: ".$path); } return $stats; }
[ "public", "function", "getFileStats", "(", "$", "path", ")", "{", "$", "stats", "=", "@", "ssh2_sftp_stat", "(", "$", "this", "->", "sftp", ",", "$", "path", ")", ";", "if", "(", "!", "$", "stats", "[", "'size'", "]", ")", "{", "throw", "new", "\...
Gets remote file stats @param string $path The path to the file to get stats for @return Array with size, gid, uid, atime, mtime, mode keys
[ "Gets", "remote", "file", "stats" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SFTP/Client.php#L230-L237
surebert/surebert-framework
src/sb/SFTP/Client.php
Client.readlink
public function readlink($path) { $result = @ssh2_sftp_readlink($this->sftp, $path); if(!$result){ throw new \Exception("Could get readlink: ".$path); } return $result; }
php
public function readlink($path) { $result = @ssh2_sftp_readlink($this->sftp, $path); if(!$result){ throw new \Exception("Could get readlink: ".$path); } return $result; }
[ "public", "function", "readlink", "(", "$", "path", ")", "{", "$", "result", "=", "@", "ssh2_sftp_readlink", "(", "$", "this", "->", "sftp", ",", "$", "path", ")", ";", "if", "(", "!", "$", "result", ")", "{", "throw", "new", "\\", "Exception", "("...
Return the target of a symbolic link @param string $path @return string the real path to the file
[ "Return", "the", "target", "of", "a", "symbolic", "link" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SFTP/Client.php#L244-L251
surebert/surebert-framework
src/sb/SFTP/Client.php
Client.ssh2SftpSymlink
public function ssh2SftpSymlink($orig_path, $symlink_path) { $result = @ssh2_sftp_symlink($this->sftp, $orig_path, $symlink_path); if(!$result){ throw new \Exception("Could create symlink: ".$path); } return $result; }
php
public function ssh2SftpSymlink($orig_path, $symlink_path) { $result = @ssh2_sftp_symlink($this->sftp, $orig_path, $symlink_path); if(!$result){ throw new \Exception("Could create symlink: ".$path); } return $result; }
[ "public", "function", "ssh2SftpSymlink", "(", "$", "orig_path", ",", "$", "symlink_path", ")", "{", "$", "result", "=", "@", "ssh2_sftp_symlink", "(", "$", "this", "->", "sftp", ",", "$", "orig_path", ",", "$", "symlink_path", ")", ";", "if", "(", "!", ...
Create a symlink on the remote system @param string $orig_path The path to the original remote file @param string $symlink_path The path to the symlink you want to create @return boolean success or failure
[ "Create", "a", "symlink", "on", "the", "remote", "system" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SFTP/Client.php#L259-L266
surebert/surebert-framework
src/sb/SFTP/Client.php
Client.scpSend
protected function scpSend($local_path, $remote_path, $mode=0644) { if(@ssh2_scpSend($connection, $remote_path, $remote_path, $mode)){ throw new \Exception("Could send file with scp: ".$local_path.' to '.$remote_path); } }
php
protected function scpSend($local_path, $remote_path, $mode=0644) { if(@ssh2_scpSend($connection, $remote_path, $remote_path, $mode)){ throw new \Exception("Could send file with scp: ".$local_path.' to '.$remote_path); } }
[ "protected", "function", "scpSend", "(", "$", "local_path", ",", "$", "remote_path", ",", "$", "mode", "=", "0644", ")", "{", "if", "(", "@", "ssh2_scpSend", "(", "$", "connection", ",", "$", "remote_path", ",", "$", "remote_path", ",", "$", "mode", ")...
Use scp to send, slower than $this->get which uses sftp but allows mode change @param string $local_path The local file path @param string $remote_path The remote file path @param int $mode The file mode to set for the remote file @return boolean
[ "Use", "scp", "to", "send", "slower", "than", "$this", "-", ">", "get", "which", "uses", "sftp", "but", "allows", "mode", "change" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SFTP/Client.php#L287-L292
php-lug/lug
src/Bundle/LocaleBundle/Validator/LocaleIntegrityValidator.php
LocaleIntegrityValidator.validate
public function validate($locale, Constraint $constraint) { if ($locale->isEnabled() && $locale->isRequired()) { return; } $this->validateDefaultLocale($locale, $constraint); $this->validateLastLocale($locale, $constraint); }
php
public function validate($locale, Constraint $constraint) { if ($locale->isEnabled() && $locale->isRequired()) { return; } $this->validateDefaultLocale($locale, $constraint); $this->validateLastLocale($locale, $constraint); }
[ "public", "function", "validate", "(", "$", "locale", ",", "Constraint", "$", "constraint", ")", "{", "if", "(", "$", "locale", "->", "isEnabled", "(", ")", "&&", "$", "locale", "->", "isRequired", "(", ")", ")", "{", "return", ";", "}", "$", "this",...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/LocaleBundle/Validator/LocaleIntegrityValidator.php#L40-L48
zhouyl/mellivora
Mellivora/Database/Query/Grammars/Grammar.php
Grammar.compileJoins
protected function compileJoins(Builder $query, $joins) { return collect($joins)->map(function ($join) use ($query) { $table = $this->wrapTable($join->table); return trim("{$join->type} join {$table} {$this->compileWheres($join)}"); })->implode(' '); }
php
protected function compileJoins(Builder $query, $joins) { return collect($joins)->map(function ($join) use ($query) { $table = $this->wrapTable($join->table); return trim("{$join->type} join {$table} {$this->compileWheres($join)}"); })->implode(' '); }
[ "protected", "function", "compileJoins", "(", "Builder", "$", "query", ",", "$", "joins", ")", "{", "return", "collect", "(", "$", "joins", ")", "->", "map", "(", "function", "(", "$", "join", ")", "use", "(", "$", "query", ")", "{", "$", "table", ...
Compile the "join" portions of the query. @param \Mellivora\Database\Query\Builder $query @param array $joins @return string
[ "Compile", "the", "join", "portions", "of", "the", "query", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Query/Grammars/Grammar.php#L161-L168
zhouyl/mellivora
Mellivora/Database/Query/Grammars/Grammar.php
Grammar.prepareBindingsForUpdate
public function prepareBindingsForUpdate(array $bindings, array $values) { $bindingsWithoutJoin = Arr::except($bindings, 'join'); return array_values( array_merge($bindings['join'], $values, Arr::flatten($bindingsWithoutJoin)) ); }
php
public function prepareBindingsForUpdate(array $bindings, array $values) { $bindingsWithoutJoin = Arr::except($bindings, 'join'); return array_values( array_merge($bindings['join'], $values, Arr::flatten($bindingsWithoutJoin)) ); }
[ "public", "function", "prepareBindingsForUpdate", "(", "array", "$", "bindings", ",", "array", "$", "values", ")", "{", "$", "bindingsWithoutJoin", "=", "Arr", "::", "except", "(", "$", "bindings", ",", "'join'", ")", ";", "return", "array_values", "(", "arr...
Prepare the bindings for an update statement. @param array $bindings @param array $values @return array
[ "Prepare", "the", "bindings", "for", "an", "update", "statement", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Query/Grammars/Grammar.php#L789-L796
ronaldborla/chikka
src/Borla/Chikka/Support/Loader.php
Loader.config
static function config($config) { // Cache static $cache; // If found if ($cache && array_key_exists($config, $cache)) { // Return return $cache[$config]; } // If there's config if (function_exists('config')) { // Use this return $cache[$config] = config('chikka.' . $...
php
static function config($config) { // Cache static $cache; // If found if ($cache && array_key_exists($config, $cache)) { // Return return $cache[$config]; } // If there's config if (function_exists('config')) { // Use this return $cache[$config] = config('chikka.' . $...
[ "static", "function", "config", "(", "$", "config", ")", "{", "// Cache", "static", "$", "cache", ";", "// If found", "if", "(", "$", "cache", "&&", "array_key_exists", "(", "$", "config", ",", "$", "cache", ")", ")", "{", "// Return", "return", "$", "...
Get config
[ "Get", "config" ]
train
https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Loader.php#L38-L70
ronaldborla/chikka
src/Borla/Chikka/Support/Loader.php
Loader.getClass
static function getClass($class) { // Cache static $cache; // If found if ($cache && array_key_exists($class, $cache)) { // Return return $cache[$class]; } // Get class name $className = static::config($class); // If not found if ( ! $className) { // Attempt models ...
php
static function getClass($class) { // Cache static $cache; // If found if ($cache && array_key_exists($class, $cache)) { // Return return $cache[$class]; } // Get class name $className = static::config($class); // If not found if ( ! $className) { // Attempt models ...
[ "static", "function", "getClass", "(", "$", "class", ")", "{", "// Cache", "static", "$", "cache", ";", "// If found", "if", "(", "$", "cache", "&&", "array_key_exists", "(", "$", "class", ",", "$", "cache", ")", ")", "{", "// Return", "return", "$", "...
Get class
[ "Get", "class" ]
train
https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Loader.php#L75-L104
ronaldborla/chikka
src/Borla/Chikka/Support/Loader.php
Loader.instance
static function instance($class, array $args = []) { // Get class name $class = static::getClass($class); // Count args switch (count($args)) { case 1: return new $class($args[0]); case 2: return new $class($args[0], $args[1]); case 3: return new $class($args[0], $args[1], $args[...
php
static function instance($class, array $args = []) { // Get class name $class = static::getClass($class); // Count args switch (count($args)) { case 1: return new $class($args[0]); case 2: return new $class($args[0], $args[1]); case 3: return new $class($args[0], $args[1], $args[...
[ "static", "function", "instance", "(", "$", "class", ",", "array", "$", "args", "=", "[", "]", ")", "{", "// Get class name", "$", "class", "=", "static", "::", "getClass", "(", "$", "class", ")", ";", "// Count args", "switch", "(", "count", "(", "$",...
Instantiate class
[ "Instantiate", "class" ]
train
https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Loader.php#L109-L127
Eresus/EresusCMS
src/core/client.php
TClientUI.replaceMacros
public function replaceMacros($text) { $section = $this->section; if (siteTitleReverse) { $section = array_reverse($section); } $section = strip_tags(implode($section, option('siteTitleDivider'))); $result = str_replace( array( ...
php
public function replaceMacros($text) { $section = $this->section; if (siteTitleReverse) { $section = array_reverse($section); } $section = strip_tags(implode($section, option('siteTitleDivider'))); $result = str_replace( array( ...
[ "public", "function", "replaceMacros", "(", "$", "text", ")", "{", "$", "section", "=", "$", "this", "->", "section", ";", "if", "(", "siteTitleReverse", ")", "{", "$", "section", "=", "array_reverse", "(", "$", "section", ")", ";", "}", "$", "section"...
Подставляет значения макросов @param string $text @return mixed
[ "Подставляет", "значения", "макросов" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/client.php#L129-L192
Eresus/EresusCMS
src/core/client.php
TClientUI.pageSelector
public function pageSelector($total, $current, $url = null, $templates = null) { if (is_null($url)) { $url = $this->url().'p%d/'; } $Templates = Templates::getInstance(); $defaults = explode('---', $Templates->get('PageSelector', 'std')); if (!is_array($te...
php
public function pageSelector($total, $current, $url = null, $templates = null) { if (is_null($url)) { $url = $this->url().'p%d/'; } $Templates = Templates::getInstance(); $defaults = explode('---', $Templates->get('PageSelector', 'std')); if (!is_array($te...
[ "public", "function", "pageSelector", "(", "$", "total", ",", "$", "current", ",", "$", "url", "=", "null", ",", "$", "templates", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "url", ")", ")", "{", "$", "url", "=", "$", "this", "->", ...
Отрисовка переключателя страниц @param int $total Общее количество страниц @param int $current Номер текущей страницы @param string $url Шаблон адреса для перехода к подстранице. @param array $templates Шаблоны оформления @return string
[ "Отрисовка", "переключателя", "страниц" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/client.php#L203-L224
Eresus/EresusCMS
src/core/client.php
TClientUI.loadPage
private function loadPage() { $result = false; $main_fake = false; if (!count(Eresus_CMS::getLegacyKernel()->request['params']) || Eresus_CMS::getLegacyKernel()->request['params'][0] != 'main') { array_unshift(Eresus_CMS::getLegacyKernel()->request['params'], ...
php
private function loadPage() { $result = false; $main_fake = false; if (!count(Eresus_CMS::getLegacyKernel()->request['params']) || Eresus_CMS::getLegacyKernel()->request['params'][0] != 'main') { array_unshift(Eresus_CMS::getLegacyKernel()->request['params'], ...
[ "private", "function", "loadPage", "(", ")", "{", "$", "result", "=", "false", ";", "$", "main_fake", "=", "false", ";", "if", "(", "!", "count", "(", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", "->", "request", "[", "'params'", "]", ")", "||", ...
Производит разбор URL и загрузку соответствующего раздела @return array|bool Описание загруженного раздела или false если он не найден
[ "Производит", "разбор", "URL", "и", "загрузку", "соответствующего", "раздела" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/client.php#L231-L281
Eresus/EresusCMS
src/core/client.php
TClientUI.init
private function init() { Eresus_Kernel::app()->getEventDispatcher()->dispatch('cms.client.start'); $item = $this->loadPage(); if ($item) { if (count(Eresus_CMS::getLegacyKernel()->request['params'])) { if (preg_match('/p[\d]+/i', Eresus_CMS::...
php
private function init() { Eresus_Kernel::app()->getEventDispatcher()->dispatch('cms.client.start'); $item = $this->loadPage(); if ($item) { if (count(Eresus_CMS::getLegacyKernel()->request['params'])) { if (preg_match('/p[\d]+/i', Eresus_CMS::...
[ "private", "function", "init", "(", ")", "{", "Eresus_Kernel", "::", "app", "(", ")", "->", "getEventDispatcher", "(", ")", "->", "dispatch", "(", "'cms.client.start'", ")", ";", "$", "item", "=", "$", "this", "->", "loadPage", "(", ")", ";", "if", "("...
Проводит инициализацию страницы @throws Eresus_CMS_Exception_NotFound
[ "Проводит", "инициализацию", "страницы" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/client.php#L288-L329
Eresus/EresusCMS
src/core/client.php
TClientUI.httpError
public function httpError($code) { switch ($code) { case 400: throw new Eresus_HTTP_Exception_BadRequest; case 401: throw new Eresus_HTTP_Exception_Unauthorized; case 402: throw new Eresus_HTTP_Exception_PaymentRequi...
php
public function httpError($code) { switch ($code) { case 400: throw new Eresus_HTTP_Exception_BadRequest; case 401: throw new Eresus_HTTP_Exception_Unauthorized; case 402: throw new Eresus_HTTP_Exception_PaymentRequi...
[ "public", "function", "httpError", "(", "$", "code", ")", "{", "switch", "(", "$", "code", ")", "{", "case", "400", ":", "throw", "new", "Eresus_HTTP_Exception_BadRequest", ";", "case", "401", ":", "throw", "new", "Eresus_HTTP_Exception_Unauthorized", ";", "ca...
Выводит сообщение об ошибке и прекращает выполнение программы @param int $code код ошибки HTTP @throws Eresus_HTTP_Exception @deprecated с 3.01 используйте исключения Eresus_HTTP_Exception_*
[ "Выводит", "сообщение", "об", "ошибке", "и", "прекращает", "выполнение", "программы" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/client.php#L352-L369
Eresus/EresusCMS
src/core/client.php
TClientUI.render
public function render(Eresus_CMS_Request $request) { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'starting...'); try { $this->init(); $plugins = Eresus_Plugin_Registry::getInstance(); $response = $plugins->clientRenderContent($request); if (!...
php
public function render(Eresus_CMS_Request $request) { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'starting...'); try { $this->init(); $plugins = Eresus_Plugin_Registry::getInstance(); $response = $plugins->clientRenderContent($request); if (!...
[ "public", "function", "render", "(", "Eresus_CMS_Request", "$", "request", ")", "{", "Eresus_Kernel", "::", "log", "(", "__METHOD__", ",", "LOG_DEBUG", ",", "'starting...'", ")", ";", "try", "{", "$", "this", "->", "init", "(", ")", ";", "$", "plugins", ...
Отправляет созданную страницу пользователю. @param Eresus_CMS_Request $request @return Eresus_HTTP_Response
[ "Отправляет", "созданную", "страницу", "пользователю", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/client.php#L378-L412
Eresus/EresusCMS
src/core/client.php
TClientUI.pages
public function pages($pagesCount, $itemsPerPage, $reverse = false) { $eresus = Eresus_CMS::getLegacyKernel(); if ($pagesCount>1) { $at_once = option('clientPagesAtOnce'); if (!$at_once) { $at_once = 10; } $side_le...
php
public function pages($pagesCount, $itemsPerPage, $reverse = false) { $eresus = Eresus_CMS::getLegacyKernel(); if ($pagesCount>1) { $at_once = option('clientPagesAtOnce'); if (!$at_once) { $at_once = 10; } $side_le...
[ "public", "function", "pages", "(", "$", "pagesCount", ",", "$", "itemsPerPage", ",", "$", "reverse", "=", "false", ")", "{", "$", "eresus", "=", "Eresus_CMS", "::", "getLegacyKernel", "(", ")", ";", "if", "(", "$", "pagesCount", ">", "1", ")", "{", ...
Выводит список подстраниц для навигации по ним @param int $pagesCount @param int $itemsPerPage @param bool $reverse @return string
[ "Выводит", "список", "подстраниц", "для", "навигации", "по", "ним" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/client.php#L423-L520
Eresus/EresusCMS
src/core/client.php
TClientUI.setTemplate
public function setTemplate($template, $type = '') { if (!is_string($template) && (!is_object($template) || !($template instanceof Eresus_Template))) { throw Eresus_Exception_InvalidArgumentType::factory(__METHOD__, 1, 'string or an instance of Eresus_Template...
php
public function setTemplate($template, $type = '') { if (!is_string($template) && (!is_object($template) || !($template instanceof Eresus_Template))) { throw Eresus_Exception_InvalidArgumentType::factory(__METHOD__, 1, 'string or an instance of Eresus_Template...
[ "public", "function", "setTemplate", "(", "$", "template", ",", "$", "type", "=", "''", ")", "{", "if", "(", "!", "is_string", "(", "$", "template", ")", "&&", "(", "!", "is_object", "(", "$", "template", ")", "||", "!", "(", "$", "template", "inst...
Задаёт шаблон страницы <b>Обратите внимание!</b> Этот метод не влияет на результат, возвращаемый {@link getTemplateName()}. @param string|Eresus_Template $template имя файла шаблона или уже созданный объект шаблона @param string $type тип шаблона, только если $template — строка @throws Eresus_E...
[ "Задаёт", "шаблон", "страницы" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/client.php#L550-L563
Eresus/EresusCMS
src/core/client.php
TClientUI.createPageForContent
private function createPageForContent(Eresus_CMS_Page_Content $content, $statusCode = 200) { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '(%s, %d)', $content, $statusCode); $legacyKernel = Eresus_Kernel::app()->getLegacyKernel(); $html = $content->render(); if ( isset($leg...
php
private function createPageForContent(Eresus_CMS_Page_Content $content, $statusCode = 200) { Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '(%s, %d)', $content, $statusCode); $legacyKernel = Eresus_Kernel::app()->getLegacyKernel(); $html = $content->render(); if ( isset($leg...
[ "private", "function", "createPageForContent", "(", "Eresus_CMS_Page_Content", "$", "content", ",", "$", "statusCode", "=", "200", ")", "{", "Eresus_Kernel", "::", "log", "(", "__METHOD__", ",", "LOG_DEBUG", ",", "'(%s, %d)'", ",", "$", "content", ",", "$", "s...
Создаёт страницу для переданного контента @param Eresus_CMS_Page_Content $content @param int $statusCode @return Eresus_HTTP_Response @since 3.01
[ "Создаёт", "страницу", "для", "переданного", "контента" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/client.php#L575-L633
trunda/SmfMenu
src/Smf/Menu/Matcher/Voter/PresenterVoter.php
PresenterVoter.matchItem
public function matchItem(ItemInterface $item) { if ($item->getExtra('link', false) && $this->parentControl) { $presenter = $this->parentControl->getPresenter(true); $item->setCurrent(call_user_func_array(array($presenter, 'isLinkCurrent'), $item->getExtra('link'))); retu...
php
public function matchItem(ItemInterface $item) { if ($item->getExtra('link', false) && $this->parentControl) { $presenter = $this->parentControl->getPresenter(true); $item->setCurrent(call_user_func_array(array($presenter, 'isLinkCurrent'), $item->getExtra('link'))); retu...
[ "public", "function", "matchItem", "(", "ItemInterface", "$", "item", ")", "{", "if", "(", "$", "item", "->", "getExtra", "(", "'link'", ",", "false", ")", "&&", "$", "this", "->", "parentControl", ")", "{", "$", "presenter", "=", "$", "this", "->", ...
Checks whether an item is current. If the voter is not able to determine a result, it should return null to let other voters do the job. @param ItemInterface $item @return boolean|null
[ "Checks", "whether", "an", "item", "is", "current", "." ]
train
https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Matcher/Voter/PresenterVoter.php#L41-L49
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/manager.php
ezcCacheManager.createCache
public static function createCache( $id, $location = null, $storageClass, $options = array() ) { // BC for missing location. The location should not be missing. if ( $location !== null ) { // Unifiy file system locations if ( substr( $location, 0, 1 ) === '/' ) ...
php
public static function createCache( $id, $location = null, $storageClass, $options = array() ) { // BC for missing location. The location should not be missing. if ( $location !== null ) { // Unifiy file system locations if ( substr( $location, 0, 1 ) === '/' ) ...
[ "public", "static", "function", "createCache", "(", "$", "id", ",", "$", "location", "=", "null", ",", "$", "storageClass", ",", "$", "options", "=", "array", "(", ")", ")", "{", "// BC for missing location. The location should not be missing.", "if", "(", "$", ...
Creates a new cache in the manager. This method is used to create a new cache inside the manager. Each cache has a unique ID to access it during the application runtime. Each location may only be used by 1 cache. The $storageClass parameter must be a subclass of {@link ezcCacheStorage} and tells the manager which obje...
[ "Creates", "a", "new", "cache", "in", "the", "manager", ".", "This", "method", "is", "used", "to", "create", "a", "new", "cache", "inside", "the", "manager", ".", "Each", "cache", "has", "a", "unique", "ID", "to", "access", "it", "during", "the", "appl...
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/manager.php#L196-L236
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/manager.php
ezcCacheManager.getCache
public static function getCache( $id ) { // Look for already existing cache object if ( !isset( self::$caches[$id] ) ) { // Failed, look for configuration, and if it does not exist, use // delayed initialization. if ( !isset( self::$configurations[$id] ) )...
php
public static function getCache( $id ) { // Look for already existing cache object if ( !isset( self::$caches[$id] ) ) { // Failed, look for configuration, and if it does not exist, use // delayed initialization. if ( !isset( self::$configurations[$id] ) )...
[ "public", "static", "function", "getCache", "(", "$", "id", ")", "{", "// Look for already existing cache object", "if", "(", "!", "isset", "(", "self", "::", "$", "caches", "[", "$", "id", "]", ")", ")", "{", "// Failed, look for configuration, and if it does not...
Returns the ezcCacheStorage object with the given ID. The cache ID has to be defined before using the {@link ezcCacheManager::createCache()} method. If no instance of this cache does exist yet, it's created on the fly. If one exists, it will be reused. @param string $id The ID of the cache to return. @return ezc...
[ "Returns", "the", "ezcCacheStorage", "object", "with", "the", "given", "ID", ".", "The", "cache", "ID", "has", "to", "be", "defined", "before", "using", "the", "{", "@link", "ezcCacheManager", "::", "createCache", "()", "}", "method", ".", "If", "no", "ins...
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/manager.php#L275-L296
WellCommerce/AppBundle
Form/Admin/UserGroupFormBuilder.php
UserGroupFormBuilder.getPermissionActions
private function getPermissionActions() { $actions = []; /** * @var $route \Symfony\Component\Routing\Route */ foreach ($this->get('router')->getRouteCollection()->all() as $name => $route) { if ($route->hasOption('require_admin_permission')) { ...
php
private function getPermissionActions() { $actions = []; /** * @var $route \Symfony\Component\Routing\Route */ foreach ($this->get('router')->getRouteCollection()->all() as $name => $route) { if ($route->hasOption('require_admin_permission')) { ...
[ "private", "function", "getPermissionActions", "(", ")", "{", "$", "actions", "=", "[", "]", ";", "/**\n * @var $route \\Symfony\\Component\\Routing\\Route\n */", "foreach", "(", "$", "this", "->", "get", "(", "'router'", ")", "->", "getRouteCollection",...
Returns all routes which have require_permission option enabled @return array
[ "Returns", "all", "routes", "which", "have", "require_permission", "option", "enabled" ]
train
https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Form/Admin/UserGroupFormBuilder.php#L62-L82
WellCommerce/AppBundle
Form/Admin/UserGroupFormBuilder.php
UserGroupFormBuilder.getPermissionTypes
private function getPermissionTypes() { $types = []; /** * @var $route \Symfony\Component\Routing\Route */ foreach ($this->get('router')->getRouteCollection()->all() as $name => $route) { if ($route->hasOption('require_admin_permission')) { list...
php
private function getPermissionTypes() { $types = []; /** * @var $route \Symfony\Component\Routing\Route */ foreach ($this->get('router')->getRouteCollection()->all() as $name => $route) { if ($route->hasOption('require_admin_permission')) { list...
[ "private", "function", "getPermissionTypes", "(", ")", "{", "$", "types", "=", "[", "]", ";", "/**\n * @var $route \\Symfony\\Component\\Routing\\Route\n */", "foreach", "(", "$", "this", "->", "get", "(", "'router'", ")", "->", "getRouteCollection", "...
Returns all routes which have require_permission option enabled @return array
[ "Returns", "all", "routes", "which", "have", "require_permission", "option", "enabled" ]
train
https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Form/Admin/UserGroupFormBuilder.php#L89-L109
ShaoZeMing/laravel-merchant
src/Form/Builder.php
Builder.option
public function option($option, $value = null) { if (func_num_args() == 1) { return array_get($this->options, $option); } $this->options[$option] = $value; return $this; }
php
public function option($option, $value = null) { if (func_num_args() == 1) { return array_get($this->options, $option); } $this->options[$option] = $value; return $this; }
[ "public", "function", "option", "(", "$", "option", ",", "$", "value", "=", "null", ")", "{", "if", "(", "func_num_args", "(", ")", "==", "1", ")", "{", "return", "array_get", "(", "$", "this", "->", "options", ",", "$", "option", ")", ";", "}", ...
Get or set option. @param string $option @param mixed $value @return $this
[ "Get", "or", "set", "option", "." ]
train
https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/Builder.php#L319-L328
ShaoZeMing/laravel-merchant
src/Form/Builder.php
Builder.addRedirectUrlField
protected function addRedirectUrlField() { $previous = URL::previous(); if (!$previous || $previous == URL::current()) { return; } if (Str::contains($previous, url($this->getResource()))) { $this->addHiddenField((new Form\Field\Hidden(static::PREVIOUS_URL_KE...
php
protected function addRedirectUrlField() { $previous = URL::previous(); if (!$previous || $previous == URL::current()) { return; } if (Str::contains($previous, url($this->getResource()))) { $this->addHiddenField((new Form\Field\Hidden(static::PREVIOUS_URL_KE...
[ "protected", "function", "addRedirectUrlField", "(", ")", "{", "$", "previous", "=", "URL", "::", "previous", "(", ")", ";", "if", "(", "!", "$", "previous", "||", "$", "previous", "==", "URL", "::", "current", "(", ")", ")", "{", "return", ";", "}",...
Add field for store redirect url after update or store. @return void
[ "Add", "field", "for", "store", "redirect", "url", "after", "update", "or", "store", "." ]
train
https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/Builder.php#L371-L382
zicht/z
src/Zicht/Tool/Configuration/FileLoader.php
FileLoader.parseAnnotations
public function parseAnnotations($fileContents) { $ret = array(); if (preg_match('/^#\s*@(\w+)[:=]?\s+([\'"])?(.*)\2\s*$/m', $fileContents, $m)) { $ret[$m[1]] = $m[3]; } return $ret; }
php
public function parseAnnotations($fileContents) { $ret = array(); if (preg_match('/^#\s*@(\w+)[:=]?\s+([\'"])?(.*)\2\s*$/m', $fileContents, $m)) { $ret[$m[1]] = $m[3]; } return $ret; }
[ "public", "function", "parseAnnotations", "(", "$", "fileContents", ")", "{", "$", "ret", "=", "array", "(", ")", ";", "if", "(", "preg_match", "(", "'/^#\\s*@(\\w+)[:=]?\\s+([\\'\"])?(.*)\\2\\s*$/m'", ",", "$", "fileContents", ",", "$", "m", ")", ")", "{", ...
Parse the annotations contained in commented lines, starting with # Annotation format is '@' followed by a word, followed by an optional ':' or '=', followed by a quoted value, e.g. <code>@foo="bar"</code> @param string $fileContents @return array
[ "Parse", "the", "annotations", "contained", "in", "commented", "lines", "starting", "with", "#" ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Configuration/FileLoader.php#L165-L172
zicht/z
src/Zicht/Tool/Configuration/FileLoader.php
FileLoader.processPlugins
protected function processPlugins($plugins, $dir) { foreach ($plugins as $plugin) { $this->addPlugin($plugin, $dir); } }
php
protected function processPlugins($plugins, $dir) { foreach ($plugins as $plugin) { $this->addPlugin($plugin, $dir); } }
[ "protected", "function", "processPlugins", "(", "$", "plugins", ",", "$", "dir", ")", "{", "foreach", "(", "$", "plugins", "as", "$", "plugin", ")", "{", "$", "this", "->", "addPlugin", "(", "$", "plugin", ",", "$", "dir", ")", ";", "}", "}" ]
Processes plugin definitions @param array $plugins @param string $dir @return void
[ "Processes", "plugin", "definitions" ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Configuration/FileLoader.php#L191-L196
zicht/z
src/Zicht/Tool/Configuration/FileLoader.php
FileLoader.addPlugin
public function addPlugin($name, $dir) { Debug::enterScope($name); $hasPlugin = $hasZfile = false; try { $this->plugins[$name] = $this->getLocator()->locate($name . '/Plugin.php', $dir, true); $this->pluginPaths[$name] = dirname($this->plugins[$name]); $...
php
public function addPlugin($name, $dir) { Debug::enterScope($name); $hasPlugin = $hasZfile = false; try { $this->plugins[$name] = $this->getLocator()->locate($name . '/Plugin.php', $dir, true); $this->pluginPaths[$name] = dirname($this->plugins[$name]); $...
[ "public", "function", "addPlugin", "(", "$", "name", ",", "$", "dir", ")", "{", "Debug", "::", "enterScope", "(", "$", "name", ")", ";", "$", "hasPlugin", "=", "$", "hasZfile", "=", "false", ";", "try", "{", "$", "this", "->", "plugins", "[", "$", ...
Add a plugin at the passed location @param string $name @param string $dir @return void @throws \InvalidArgumentException @throws \UnexpectedValueException
[ "Add", "a", "plugin", "at", "the", "passed", "location" ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Configuration/FileLoader.php#L208-L243
zicht/z
src/Zicht/Tool/Configuration/FileLoader.php
FileLoader.processImports
protected function processImports($imports, $dir) { foreach ($imports as $import) { $this->setCurrentDir($dir); $this->import($import); } }
php
protected function processImports($imports, $dir) { foreach ($imports as $import) { $this->setCurrentDir($dir); $this->import($import); } }
[ "protected", "function", "processImports", "(", "$", "imports", ",", "$", "dir", ")", "{", "foreach", "(", "$", "imports", "as", "$", "import", ")", "{", "$", "this", "->", "setCurrentDir", "(", "$", "dir", ")", ";", "$", "this", "->", "import", "(",...
Processes imports @param array $imports @param string $dir @return void
[ "Processes", "imports" ]
train
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Configuration/FileLoader.php#L253-L259
zhouyl/mellivora
Mellivora/Database/Eloquent/FactoryBuilder.php
FactoryBuilder.create
public function create(array $attributes = []) { $results = $this->make($attributes); if ($results instanceof Model) { $results->save(); } else { $results->each->save(); } return $results; }
php
public function create(array $attributes = []) { $results = $this->make($attributes); if ($results instanceof Model) { $results->save(); } else { $results->each->save(); } return $results; }
[ "public", "function", "create", "(", "array", "$", "attributes", "=", "[", "]", ")", "{", "$", "results", "=", "$", "this", "->", "make", "(", "$", "attributes", ")", ";", "if", "(", "$", "results", "instanceof", "Model", ")", "{", "$", "results", ...
Create a collection of models and persist them to the database. @param array $attributes @return mixed
[ "Create", "a", "collection", "of", "models", "and", "persist", "them", "to", "the", "database", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/FactoryBuilder.php#L115-L126
zhouyl/mellivora
Mellivora/Database/Eloquent/FactoryBuilder.php
FactoryBuilder.make
public function make(array $attributes = []) { if ($this->amount === null) { return $this->makeInstance($attributes); } if ($this->amount < 1) { return (new $this->class)->newCollection(); } return (new $this->class)->newCollection(array_map(function...
php
public function make(array $attributes = []) { if ($this->amount === null) { return $this->makeInstance($attributes); } if ($this->amount < 1) { return (new $this->class)->newCollection(); } return (new $this->class)->newCollection(array_map(function...
[ "public", "function", "make", "(", "array", "$", "attributes", "=", "[", "]", ")", "{", "if", "(", "$", "this", "->", "amount", "===", "null", ")", "{", "return", "$", "this", "->", "makeInstance", "(", "$", "attributes", ")", ";", "}", "if", "(", ...
Create a collection of models. @param array $attributes @return mixed
[ "Create", "a", "collection", "of", "models", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/FactoryBuilder.php#L135-L148
zhouyl/mellivora
Mellivora/Database/Eloquent/FactoryBuilder.php
FactoryBuilder.makeInstance
protected function makeInstance(array $attributes = []) { return Model::unguarded(function () use ($attributes) { if (!isset($this->definitions[$this->class][$this->name])) { throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}] [{$this->class}]."...
php
protected function makeInstance(array $attributes = []) { return Model::unguarded(function () use ($attributes) { if (!isset($this->definitions[$this->class][$this->name])) { throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}] [{$this->class}]."...
[ "protected", "function", "makeInstance", "(", "array", "$", "attributes", "=", "[", "]", ")", "{", "return", "Model", "::", "unguarded", "(", "function", "(", ")", "use", "(", "$", "attributes", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "-...
Make an instance of the model with the given attributes. @param array $attributes @throws \InvalidArgumentException @return \Mellivora\Database\Eloquent\Model
[ "Make", "an", "instance", "of", "the", "model", "with", "the", "given", "attributes", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/FactoryBuilder.php#L159-L176
zhouyl/mellivora
Mellivora/Database/Eloquent/FactoryBuilder.php
FactoryBuilder.applyStates
protected function applyStates(array $definition, array $attributes = []) { foreach ($this->activeStates as $state) { if (!isset($this->states[$this->class][$state])) { throw new InvalidArgumentException("Unable to locate [{$state}] state for [{$this->class}]."); } ...
php
protected function applyStates(array $definition, array $attributes = []) { foreach ($this->activeStates as $state) { if (!isset($this->states[$this->class][$state])) { throw new InvalidArgumentException("Unable to locate [{$state}] state for [{$this->class}]."); } ...
[ "protected", "function", "applyStates", "(", "array", "$", "definition", ",", "array", "$", "attributes", "=", "[", "]", ")", "{", "foreach", "(", "$", "this", "->", "activeStates", "as", "$", "state", ")", "{", "if", "(", "!", "isset", "(", "$", "th...
Apply the active states to the model definition array. @param array $definition @param array $attributes @return array
[ "Apply", "the", "active", "states", "to", "the", "model", "definition", "array", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/FactoryBuilder.php#L186-L201
zhouyl/mellivora
Mellivora/Database/Eloquent/FactoryBuilder.php
FactoryBuilder.callClosureAttributes
protected function callClosureAttributes(array $attributes) { foreach ($attributes as &$attribute) { $attribute = $attribute instanceof Closure ? $attribute($attributes) : $attribute; } return $attributes; }
php
protected function callClosureAttributes(array $attributes) { foreach ($attributes as &$attribute) { $attribute = $attribute instanceof Closure ? $attribute($attributes) : $attribute; } return $attributes; }
[ "protected", "function", "callClosureAttributes", "(", "array", "$", "attributes", ")", "{", "foreach", "(", "$", "attributes", "as", "&", "$", "attribute", ")", "{", "$", "attribute", "=", "$", "attribute", "instanceof", "Closure", "?", "$", "attribute", "(...
Evaluate any Closure attributes on the attribute array. @param array $attributes @return array
[ "Evaluate", "any", "Closure", "attributes", "on", "the", "attribute", "array", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/FactoryBuilder.php#L210-L218
Salamek/nette-tempnam
src/Salamek/Tempnam/Tempnam.php
Tempnam.remove
public function remove($key) { $keyGen = $this->generateKey($key); $this->cache->remove($keyGen); @unlink($this->getFilePath($keyGen)); }
php
public function remove($key) { $keyGen = $this->generateKey($key); $this->cache->remove($keyGen); @unlink($this->getFilePath($keyGen)); }
[ "public", "function", "remove", "(", "$", "key", ")", "{", "$", "keyGen", "=", "$", "this", "->", "generateKey", "(", "$", "key", ")", ";", "$", "this", "->", "cache", "->", "remove", "(", "$", "keyGen", ")", ";", "@", "unlink", "(", "$", "this",...
Removes tempnam file by its key @param $key string tempnam key
[ "Removes", "tempnam", "file", "by", "its", "key" ]
train
https://github.com/Salamek/nette-tempnam/blob/47af43ec9a3f9f812177c83f021ffafeeff0305e/src/Salamek/Tempnam/Tempnam.php#L116-L121
Salamek/nette-tempnam
src/Salamek/Tempnam/Tempnam.php
Tempnam.load
public function load($key, \DateTimeInterface $updatedAt = null) { $keyGen = $this->generateKey($key); $updateDate = $this->cache->load($keyGen); if ($updateDate === null || $updateDate != $updatedAt) { if ($updateDate) { $this->remove($key); } ...
php
public function load($key, \DateTimeInterface $updatedAt = null) { $keyGen = $this->generateKey($key); $updateDate = $this->cache->load($keyGen); if ($updateDate === null || $updateDate != $updatedAt) { if ($updateDate) { $this->remove($key); } ...
[ "public", "function", "load", "(", "$", "key", ",", "\\", "DateTimeInterface", "$", "updatedAt", "=", "null", ")", "{", "$", "keyGen", "=", "$", "this", "->", "generateKey", "(", "$", "key", ")", ";", "$", "updateDate", "=", "$", "this", "->", "cache...
Loads tempnam file path @param $key string tempnam key @param \DateTimeInterface|null $updatedAt When data was last updated @return null|string path to tempnam
[ "Loads", "tempnam", "file", "path" ]
train
https://github.com/Salamek/nette-tempnam/blob/47af43ec9a3f9f812177c83f021ffafeeff0305e/src/Salamek/Tempnam/Tempnam.php#L129-L142
Salamek/nette-tempnam
src/Salamek/Tempnam/Tempnam.php
Tempnam.save
public function save($key, $data, \DateTimeInterface $updatedAt = null) { $keyGen = $this->generateKey($key); $path = $this->putFile($keyGen, $data); $this->cache->save($keyGen, $updatedAt); return $path; }
php
public function save($key, $data, \DateTimeInterface $updatedAt = null) { $keyGen = $this->generateKey($key); $path = $this->putFile($keyGen, $data); $this->cache->save($keyGen, $updatedAt); return $path; }
[ "public", "function", "save", "(", "$", "key", ",", "$", "data", ",", "\\", "DateTimeInterface", "$", "updatedAt", "=", "null", ")", "{", "$", "keyGen", "=", "$", "this", "->", "generateKey", "(", "$", "key", ")", ";", "$", "path", "=", "$", "this"...
Saves tempnam file and returns its path @param $key string tempnam key @param $data string content of file @param \DateTimeInterface|null $updatedAt When data was last updated @return string path to tempnam
[ "Saves", "tempnam", "file", "and", "returns", "its", "path" ]
train
https://github.com/Salamek/nette-tempnam/blob/47af43ec9a3f9f812177c83f021ffafeeff0305e/src/Salamek/Tempnam/Tempnam.php#L151-L157
Salamek/nette-tempnam
src/Salamek/Tempnam/Tempnam.php
Tempnam.clean
private function clean() { foreach (Finder::find($this->namespace . '*')->from($this->tempDir)->childFirst() as $entry) { $path = (string)$entry; if ($entry->isDir()) { //We dont use dirs, ignore continue; } $updateDate = $this...
php
private function clean() { foreach (Finder::find($this->namespace . '*')->from($this->tempDir)->childFirst() as $entry) { $path = (string)$entry; if ($entry->isDir()) { //We dont use dirs, ignore continue; } $updateDate = $this...
[ "private", "function", "clean", "(", ")", "{", "foreach", "(", "Finder", "::", "find", "(", "$", "this", "->", "namespace", ".", "'*'", ")", "->", "from", "(", "$", "this", "->", "tempDir", ")", "->", "childFirst", "(", ")", "as", "$", "entry", ")"...
Cleans unused tempnam files @return void
[ "Cleans", "unused", "tempnam", "files" ]
train
https://github.com/Salamek/nette-tempnam/blob/47af43ec9a3f9f812177c83f021ffafeeff0305e/src/Salamek/Tempnam/Tempnam.php#L163-L179
php-lug/lug
src/Bundle/ResourceBundle/Form/Extension/Base64FileExtension.php
Base64FileExtension.configureOptions
public function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'base64' => $this->parameterResolver->resolveApi(), ]); }
php
public function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'base64' => $this->parameterResolver->resolveApi(), ]); }
[ "public", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'base64'", "=>", "$", "this", "->", "parameterReso...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Form/Extension/Base64FileExtension.php#L41-L48
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/Builder/Reflector/Tags/AuthorAssembler.php
AuthorAssembler.create
public function create($data) { $descriptor = new AuthorDescriptor($data->getName()); $descriptor->setDescription($data->getDescription()); return $descriptor; }
php
public function create($data) { $descriptor = new AuthorDescriptor($data->getName()); $descriptor->setDescription($data->getDescription()); return $descriptor; }
[ "public", "function", "create", "(", "$", "data", ")", "{", "$", "descriptor", "=", "new", "AuthorDescriptor", "(", "$", "data", "->", "getName", "(", ")", ")", ";", "$", "descriptor", "->", "setDescription", "(", "$", "data", "->", "getDescription", "("...
Creates a new Descriptor from the given Reflector. @param AuthorTag $data @return AuthorDescriptor
[ "Creates", "a", "new", "Descriptor", "from", "the", "given", "Reflector", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/Tags/AuthorAssembler.php#L33-L39
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php
ezcDbSchemaDiff.checkSchemaDiffReader
static private function checkSchemaDiffReader( $obj, $type ) { if ( !( ( $obj->getDiffReaderType() & $type ) == $type ) ) { throw new ezcDbSchemaInvalidReaderClassException( get_class( $obj ), $type ); } }
php
static private function checkSchemaDiffReader( $obj, $type ) { if ( !( ( $obj->getDiffReaderType() & $type ) == $type ) ) { throw new ezcDbSchemaInvalidReaderClassException( get_class( $obj ), $type ); } }
[ "static", "private", "function", "checkSchemaDiffReader", "(", "$", "obj", ",", "$", "type", ")", "{", "if", "(", "!", "(", "(", "$", "obj", "->", "getDiffReaderType", "(", ")", "&", "$", "type", ")", "==", "$", "type", ")", ")", "{", "throw", "new...
Checks whether the object in $obj implements the correct $type of reader handler. @throws ezcDbSchemaInvalidReaderClassException if the object in $obj is not a schema reader of the correct type. @param ezcDbSchemaReader $obj @param int $type
[ "Checks", "whether", "the", "object", "in", "$obj", "implements", "the", "correct", "$type", "of", "reader", "handler", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php#L69-L75
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php
ezcDbSchemaDiff.createFromFile
static public function createFromFile( $format, $file ) { $className = ezcDbSchemaHandlerManager::getDiffReaderByFormat( $format ); $reader = new $className(); self::checkSchemaDiffReader( $reader, ezcDbSchema::FILE ); return $reader->loadDiffFromFile( $file ); }
php
static public function createFromFile( $format, $file ) { $className = ezcDbSchemaHandlerManager::getDiffReaderByFormat( $format ); $reader = new $className(); self::checkSchemaDiffReader( $reader, ezcDbSchema::FILE ); return $reader->loadDiffFromFile( $file ); }
[ "static", "public", "function", "createFromFile", "(", "$", "format", ",", "$", "file", ")", "{", "$", "className", "=", "ezcDbSchemaHandlerManager", "::", "getDiffReaderByFormat", "(", "$", "format", ")", ";", "$", "reader", "=", "new", "$", "className", "(...
Factory method to create a ezcDbSchemaDiff object from the file $file with the format $format. @throws ezcDbSchemaInvalidReaderClassException if the handler associated with the $format is not a file schema reader. @param string $format @param string $file @return ezcDbSchemaDiff
[ "Factory", "method", "to", "create", "a", "ezcDbSchemaDiff", "object", "from", "the", "file", "$file", "with", "the", "format", "$format", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php#L87-L93
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php
ezcDbSchemaDiff.checkSchemaDiffWriter
static private function checkSchemaDiffWriter( $obj, $type ) { if ( !( ( $obj->getDiffWriterType() & $type ) == $type ) ) { throw new ezcDbSchemaInvalidWriterClassException( get_class( $obj ), $type ); } }
php
static private function checkSchemaDiffWriter( $obj, $type ) { if ( !( ( $obj->getDiffWriterType() & $type ) == $type ) ) { throw new ezcDbSchemaInvalidWriterClassException( get_class( $obj ), $type ); } }
[ "static", "private", "function", "checkSchemaDiffWriter", "(", "$", "obj", ",", "$", "type", ")", "{", "if", "(", "!", "(", "(", "$", "obj", "->", "getDiffWriterType", "(", ")", "&", "$", "type", ")", "==", "$", "type", ")", ")", "{", "throw", "new...
Checks whether the object in $obj implements the correct $type of writer handler. @throws ezcDbSchemaInvalidWriterClassException if the object in $obj is not a schema writer of the correct type. @param ezcDbSchemaWriter $obj @param int $type
[ "Checks", "whether", "the", "object", "in", "$obj", "implements", "the", "correct", "$type", "of", "writer", "handler", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php#L104-L110
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php
ezcDbSchemaDiff.writeToFile
public function writeToFile( $format, $file ) { $className = ezcDbSchemaHandlerManager::getDiffWriterByFormat( $format ); $reader = new $className(); self::checkSchemaDiffWriter( $reader, ezcDbSchema::FILE ); $reader->saveDiffToFile( $file, $this ); }
php
public function writeToFile( $format, $file ) { $className = ezcDbSchemaHandlerManager::getDiffWriterByFormat( $format ); $reader = new $className(); self::checkSchemaDiffWriter( $reader, ezcDbSchema::FILE ); $reader->saveDiffToFile( $file, $this ); }
[ "public", "function", "writeToFile", "(", "$", "format", ",", "$", "file", ")", "{", "$", "className", "=", "ezcDbSchemaHandlerManager", "::", "getDiffWriterByFormat", "(", "$", "format", ")", ";", "$", "reader", "=", "new", "$", "className", "(", ")", ";"...
Writes the schema differences to the file $file in format $format. @throws ezcDbSchemaInvalidWriterClassException if the handler associated with the $format is not a file schema writer. @param string $format @param string $file
[ "Writes", "the", "schema", "differences", "to", "the", "file", "$file", "in", "format", "$format", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php#L121-L127
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php
ezcDbSchemaDiff.applyToDb
public function applyToDb( ezcDbHandler $db ) { $className = ezcDbSchemaHandlerManager::getDiffWriterByFormat( $db->getName() ); $writer = new $className(); self::checkSchemaDiffWriter( $writer, ezcDbSchema::DATABASE ); $writer->applyDiffToDb( $db, $this ); }
php
public function applyToDb( ezcDbHandler $db ) { $className = ezcDbSchemaHandlerManager::getDiffWriterByFormat( $db->getName() ); $writer = new $className(); self::checkSchemaDiffWriter( $writer, ezcDbSchema::DATABASE ); $writer->applyDiffToDb( $db, $this ); }
[ "public", "function", "applyToDb", "(", "ezcDbHandler", "$", "db", ")", "{", "$", "className", "=", "ezcDbSchemaHandlerManager", "::", "getDiffWriterByFormat", "(", "$", "db", "->", "getName", "(", ")", ")", ";", "$", "writer", "=", "new", "$", "className", ...
Upgrades the database $db with the differences. @throws ezcDbSchemaInvalidWriterClassException if the handler associated with the $format is not a database schema writer. @param ezcDbHandler $db
[ "Upgrades", "the", "database", "$db", "with", "the", "differences", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php#L137-L143
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php
ezcDbSchemaDiff.convertToDDL
public function convertToDDL( $db ) { if ( $db instanceof ezcDbHandler ) { $db = $db->getName(); } $className = ezcDbSchemaHandlerManager::getDiffWriterByFormat( $db ); $writer = new $className(); self::checkSchemaDiffWriter( $writer, ezcDbSchema::DATABASE...
php
public function convertToDDL( $db ) { if ( $db instanceof ezcDbHandler ) { $db = $db->getName(); } $className = ezcDbSchemaHandlerManager::getDiffWriterByFormat( $db ); $writer = new $className(); self::checkSchemaDiffWriter( $writer, ezcDbSchema::DATABASE...
[ "public", "function", "convertToDDL", "(", "$", "db", ")", "{", "if", "(", "$", "db", "instanceof", "ezcDbHandler", ")", "{", "$", "db", "=", "$", "db", "->", "getName", "(", ")", ";", "}", "$", "className", "=", "ezcDbSchemaHandlerManager", "::", "get...
Returns the $db specific SQL queries that would update the database $db The database type can be given as both a database handler (instanceof ezcDbHandler) or the name of the database as string as retrieved through calling getName() on the database handler object. @see ezcDbHandler::getName() @throws ezcDbSchemaInva...
[ "Returns", "the", "$db", "specific", "SQL", "queries", "that", "would", "update", "the", "database", "$db" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/schema_diff.php#L160-L170
willhoffmann/domuserp-php
src/Resources/People/People.php
People.deliveryAddresses
public function deliveryAddresses($personId) { $deliveryAddresses = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/' . $personId . '/enderecosentrega' ); return $deliveryAddresses; }
php
public function deliveryAddresses($personId) { $deliveryAddresses = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/' . $personId . '/enderecosentrega' ); return $deliveryAddresses; }
[ "public", "function", "deliveryAddresses", "(", "$", "personId", ")", "{", "$", "deliveryAddresses", "=", "$", "this", "->", "execute", "(", "self", "::", "HTTP_GET", ",", "self", "::", "DOMUSERP_API_PEDIDOVENDA", ".", "'/pessoas/'", ".", "$", "personId", ".",...
Gets the delivery address of the person according to the id passed as parameter @param $personId @return string @throws \GuzzleHttp\Exception\GuzzleException
[ "Gets", "the", "delivery", "address", "of", "the", "person", "according", "to", "the", "id", "passed", "as", "parameter" ]
train
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/People.php#L47-L55
willhoffmann/domuserp-php
src/Resources/People/People.php
People.orderDefaultValues
public function orderDefaultValues($personId) { $orderDefaultValues = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/' . $personId . '/valoresPadraoPedido' ); return $orderDefaultValues; }
php
public function orderDefaultValues($personId) { $orderDefaultValues = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/' . $personId . '/valoresPadraoPedido' ); return $orderDefaultValues; }
[ "public", "function", "orderDefaultValues", "(", "$", "personId", ")", "{", "$", "orderDefaultValues", "=", "$", "this", "->", "execute", "(", "self", "::", "HTTP_GET", ",", "self", "::", "DOMUSERP_API_PEDIDOVENDA", ".", "'/pessoas/'", ".", "$", "personId", "....
Gets the order default values of a person according to the person id passed as parameter @param $personId @return string @throws \GuzzleHttp\Exception\GuzzleException
[ "Gets", "the", "order", "default", "values", "of", "a", "person", "according", "to", "the", "person", "id", "passed", "as", "parameter" ]
train
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/People.php#L64-L72
willhoffmann/domuserp-php
src/Resources/People/People.php
People.document
public function document($documentNumber) { $data = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/documento', ['query' => ['num' => $documentNumber]] ); return $data; }
php
public function document($documentNumber) { $data = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/documento', ['query' => ['num' => $documentNumber]] ); return $data; }
[ "public", "function", "document", "(", "$", "documentNumber", ")", "{", "$", "data", "=", "$", "this", "->", "execute", "(", "self", "::", "HTTP_GET", ",", "self", "::", "DOMUSERP_API_PEDIDOVENDA", ".", "'/pessoas/documento'", ",", "[", "'query'", "=>", "[",...
Make sure the person - document (CNPJ/CPF) already exists @param $documentNumber @return string @throws \GuzzleHttp\Exception\GuzzleException
[ "Make", "sure", "the", "person", "-", "document", "(", "CNPJ", "/", "CPF", ")", "already", "exists" ]
train
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/People.php#L81-L90
willhoffmann/domuserp-php
src/Resources/People/People.php
People.validateDocument
public function validateDocument($documentNumber) { $data = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/validarDocumento', ['query' => ['num' => $documentNumber]] ); return $data; }
php
public function validateDocument($documentNumber) { $data = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/validarDocumento', ['query' => ['num' => $documentNumber]] ); return $data; }
[ "public", "function", "validateDocument", "(", "$", "documentNumber", ")", "{", "$", "data", "=", "$", "this", "->", "execute", "(", "self", "::", "HTTP_GET", ",", "self", "::", "DOMUSERP_API_PEDIDOVENDA", ".", "'/pessoas/validarDocumento'", ",", "[", "'query'",...
Document Validation (CNPJ/CPF) @param $documentNumber @return string @throws \GuzzleHttp\Exception\GuzzleException
[ "Document", "Validation", "(", "CNPJ", "/", "CPF", ")" ]
train
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/People.php#L99-L108
willhoffmann/domuserp-php
src/Resources/People/People.php
People.save
public function save(PersonData $personData) { $id = (int) ($personData->getId() > 0 ? '/' . $personData->getId() : ''); return $this->execute( is_null($id) ? self::HTTP_POST : self::HTTP_PUT, self::DOMUSERP_API_PEDIDOVENDA . '/pessoas' . $id, ['json' => $personD...
php
public function save(PersonData $personData) { $id = (int) ($personData->getId() > 0 ? '/' . $personData->getId() : ''); return $this->execute( is_null($id) ? self::HTTP_POST : self::HTTP_PUT, self::DOMUSERP_API_PEDIDOVENDA . '/pessoas' . $id, ['json' => $personD...
[ "public", "function", "save", "(", "PersonData", "$", "personData", ")", "{", "$", "id", "=", "(", "int", ")", "(", "$", "personData", "->", "getId", "(", ")", ">", "0", "?", "'/'", ".", "$", "personData", "->", "getId", "(", ")", ":", "''", ")",...
Send the save request @param PersonData $personData @return string @throws \GuzzleHttp\Exception\GuzzleException
[ "Send", "the", "save", "request" ]
train
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/People.php#L138-L147
inhere/php-librarys
src/Traits/LiteEventStaticTrait.php
LiteEventStaticTrait.on
public static function on($name, callable $cb, $replace = false) { if ($replace || !isset(self::$_events[$name])) { self::$_events[$name] = $cb; } }
php
public static function on($name, callable $cb, $replace = false) { if ($replace || !isset(self::$_events[$name])) { self::$_events[$name] = $cb; } }
[ "public", "static", "function", "on", "(", "$", "name", ",", "callable", "$", "cb", ",", "$", "replace", "=", "false", ")", "{", "if", "(", "$", "replace", "||", "!", "isset", "(", "self", "::", "$", "_events", "[", "$", "name", "]", ")", ")", ...
register a event callback @param string $name event name @param callable $cb event callback @param bool $replace replace exists's event cb
[ "register", "a", "event", "callback" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/LiteEventStaticTrait.php#L34-L39
blast-project/BaseEntitiesBundle
src/Entity/Traits/Tree/Node.php
Node.setChildNodeOf
public function setChildNodeOf(NodeInterface $node) { $id = $this->getNodeId(); if (empty($id)) { throw new \LogicException('You must provide an id for this node if you want it to be part of a tree.'); } $path = rtrim($node->getRealMaterializedPath(), static::getMaterial...
php
public function setChildNodeOf(NodeInterface $node) { $id = $this->getNodeId(); if (empty($id)) { throw new \LogicException('You must provide an id for this node if you want it to be part of a tree.'); } $path = rtrim($node->getRealMaterializedPath(), static::getMaterial...
[ "public", "function", "setChildNodeOf", "(", "NodeInterface", "$", "node", ")", "{", "$", "id", "=", "$", "this", "->", "getNodeId", "(", ")", ";", "if", "(", "empty", "(", "$", "id", ")", ")", "{", "throw", "new", "\\", "LogicException", "(", "'You ...
{@inheritdoc}
[ "{" ]
train
https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/Entity/Traits/Tree/Node.php#L158-L180
surebert/surebert-framework
src/sb/Excel/Workbook.php
Workbook.addStyle
public function addStyle($name, $properties) { $style = $this->createElement('ss:Style'); $style->setAttribute('ss:ID', $name); $this->styles->appendChild($style); $font = $this->createElement('ss:Font'); $style->appendChild($font); foreach($properties as $prop=>$val)...
php
public function addStyle($name, $properties) { $style = $this->createElement('ss:Style'); $style->setAttribute('ss:ID', $name); $this->styles->appendChild($style); $font = $this->createElement('ss:Font'); $style->appendChild($font); foreach($properties as $prop=>$val)...
[ "public", "function", "addStyle", "(", "$", "name", ",", "$", "properties", ")", "{", "$", "style", "=", "$", "this", "->", "createElement", "(", "'ss:Style'", ")", ";", "$", "style", "->", "setAttribute", "(", "'ss:ID'", ",", "$", "name", ")", ";", ...
Creates a new style node and adds it to the styles section @param string $name The name of the style, used when assigning it @param array $properties http://msdn.microsoft.com/en-us/library/aa140066%28office.10%29.aspx#odc_xmlss_ss:font e.g. Array('Color' => '#FF0000', 'Bold' => 1); @return DOMElement The Style tag it...
[ "Creates", "a", "new", "style", "node", "and", "adds", "it", "to", "the", "styles", "section" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Workbook.php#L82-L93
surebert/surebert-framework
src/sb/Excel/Workbook.php
Workbook.assignStyle
public function assignStyle(DOMElement $item, $style) { if($style instanceOf \DOMElement){ $style_id = $style->getAttribute('ss:ID'); } else { $style_id = $style; } $item->setAttribute('ss:StyleID', $style_id); }
php
public function assignStyle(DOMElement $item, $style) { if($style instanceOf \DOMElement){ $style_id = $style->getAttribute('ss:ID'); } else { $style_id = $style; } $item->setAttribute('ss:StyleID', $style_id); }
[ "public", "function", "assignStyle", "(", "DOMElement", "$", "item", ",", "$", "style", ")", "{", "if", "(", "$", "style", "instanceOf", "\\", "DOMElement", ")", "{", "$", "style_id", "=", "$", "style", "->", "getAttribute", "(", "'ss:ID'", ")", ";", "...
Assigns the style for an element Row, Cell @param DOMElement $item The item to assign the style for @param mixed $style DOMElement style or the string based style id The style to assign to the item
[ "Assigns", "the", "style", "for", "an", "element", "Row", "Cell" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Workbook.php#L100-L108
surebert/surebert-framework
src/sb/Excel/Workbook.php
Workbook.addWorksheet
public function addWorksheet($title) { $worksheet = $this->workbook->appendChild($this->createElement('Worksheet')); $title = preg_replace("/[\\\|:|\/|\?|\*|\[|\]]/", "", $title); $title = substr($title, 0, 31); $worksheet->setAttribute('ss:Name', $title); $worksheet->table =...
php
public function addWorksheet($title) { $worksheet = $this->workbook->appendChild($this->createElement('Worksheet')); $title = preg_replace("/[\\\|:|\/|\?|\*|\[|\]]/", "", $title); $title = substr($title, 0, 31); $worksheet->setAttribute('ss:Name', $title); $worksheet->table =...
[ "public", "function", "addWorksheet", "(", "$", "title", ")", "{", "$", "worksheet", "=", "$", "this", "->", "workbook", "->", "appendChild", "(", "$", "this", "->", "createElement", "(", "'Worksheet'", ")", ")", ";", "$", "title", "=", "preg_replace", "...
Adds a new worksheet to the workbook @param string $title @return DOMElement The worksheet itself
[ "Adds", "a", "new", "worksheet", "to", "the", "workbook" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Workbook.php#L115-L124
surebert/surebert-framework
src/sb/Excel/Workbook.php
Workbook.setActiveWorksheet
public function setActiveWorksheet($worksheet) { if(is_string($worksheet)){ $worksheet = $this->worksheets[md5($worksheet)]; } $this->active_worksheet = $worksheet; return $worksheet; }
php
public function setActiveWorksheet($worksheet) { if(is_string($worksheet)){ $worksheet = $this->worksheets[md5($worksheet)]; } $this->active_worksheet = $worksheet; return $worksheet; }
[ "public", "function", "setActiveWorksheet", "(", "$", "worksheet", ")", "{", "if", "(", "is_string", "(", "$", "worksheet", ")", ")", "{", "$", "worksheet", "=", "$", "this", "->", "worksheets", "[", "md5", "(", "$", "worksheet", ")", "]", ";", "}", ...
Sets the active worksheet @param string $worksheet The name of the worksheet or a reference to the DOMElement itself @return DOMElement The active worksheet
[ "Sets", "the", "active", "worksheet" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Workbook.php#L131-L139
surebert/surebert-framework
src/sb/Excel/Workbook.php
Workbook.setRow
public function setRow($row_index, $values_arr, $type=null) { $cell = null; foreach($values_arr as $col_index=>$val){ $cell = $this->setCell($col_index+1, $row_index, $val, $type); } if($cell){ return $cell->parentNode; } return false; }
php
public function setRow($row_index, $values_arr, $type=null) { $cell = null; foreach($values_arr as $col_index=>$val){ $cell = $this->setCell($col_index+1, $row_index, $val, $type); } if($cell){ return $cell->parentNode; } return false; }
[ "public", "function", "setRow", "(", "$", "row_index", ",", "$", "values_arr", ",", "$", "type", "=", "null", ")", "{", "$", "cell", "=", "null", ";", "foreach", "(", "$", "values_arr", "as", "$", "col_index", "=>", "$", "val", ")", "{", "$", "cell...
Sets an entire row of data @param integer $row_index The 1 based row index to use @param array $values_arr An array of values @param string $type ss:Type attribute @return DOMElement The row
[ "Sets", "an", "entire", "row", "of", "data" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Workbook.php#L148-L159
surebert/surebert-framework
src/sb/Excel/Workbook.php
Workbook.setCell
public function setCell($col_index, $row_index, $val, $type=null) { $result = $this->xpath->query("//Row[@Index='".$row_index."']/Cell[@Index='".$col_index."']/Data", $this->active_worksheet); $data = $result->item(0); $type = $type ? $type : $this->getValueType($val); ...
php
public function setCell($col_index, $row_index, $val, $type=null) { $result = $this->xpath->query("//Row[@Index='".$row_index."']/Cell[@Index='".$col_index."']/Data", $this->active_worksheet); $data = $result->item(0); $type = $type ? $type : $this->getValueType($val); ...
[ "public", "function", "setCell", "(", "$", "col_index", ",", "$", "row_index", ",", "$", "val", ",", "$", "type", "=", "null", ")", "{", "$", "result", "=", "$", "this", "->", "xpath", "->", "query", "(", "\"//Row[@Index='\"", ".", "$", "row_index", ...
Sets a cell by 1 based column and row index @param integer $col_index 1based column index @param integer $row_index 1 based row index @param mixed $val The value to insert @param string $type The ss:Type attribute @return DOMElement the cell itself
[ "Sets", "a", "cell", "by", "1", "based", "column", "and", "row", "index" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Workbook.php#L169-L210
surebert/surebert-framework
src/sb/Excel/Workbook.php
Workbook.setcellByAlphaIndex
public function setcellByAlphaIndex($alpha_index, $val, $type=null) { $pos = $this->alphaIndexToNumeric($alpha_index); return $this->setCell($pos[0], $pos[1], $val, $type); }
php
public function setcellByAlphaIndex($alpha_index, $val, $type=null) { $pos = $this->alphaIndexToNumeric($alpha_index); return $this->setCell($pos[0], $pos[1], $val, $type); }
[ "public", "function", "setcellByAlphaIndex", "(", "$", "alpha_index", ",", "$", "val", ",", "$", "type", "=", "null", ")", "{", "$", "pos", "=", "$", "this", "->", "alphaIndexToNumeric", "(", "$", "alpha_index", ")", ";", "return", "$", "this", "->", "...
Sets a cells value by alpha index e.g. A4 @param string $alpha_index A4 @param mixed $val the value to set the cell to @param string $type The ss:Type attribute @return DomElement The cell itself
[ "Sets", "a", "cells", "value", "by", "alpha", "index", "e", ".", "g", ".", "A4" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Workbook.php#L231-L236
surebert/surebert-framework
src/sb/Excel/Workbook.php
Workbook.outputWithHeaders
public function outputWithHeaders($filename='worksheet') { $filename = preg_replace('/[^aA-zZ0-9\_\-]/', '', $filename); header("Content-Type: application/msexcel; charset=" . $this->encoding); header("Content-Disposition: inline; filename=\"" . $filename . ".xlsx\""); echo $this->_...
php
public function outputWithHeaders($filename='worksheet') { $filename = preg_replace('/[^aA-zZ0-9\_\-]/', '', $filename); header("Content-Type: application/msexcel; charset=" . $this->encoding); header("Content-Disposition: inline; filename=\"" . $filename . ".xlsx\""); echo $this->_...
[ "public", "function", "outputWithHeaders", "(", "$", "filename", "=", "'worksheet'", ")", "{", "$", "filename", "=", "preg_replace", "(", "'/[^aA-zZ0-9\\_\\-]/'", ",", "''", ",", "$", "filename", ")", ";", "header", "(", "\"Content-Type: application/msexcel; charset...
Used to generate the xml with output headers @param string $filename Name of excel file to generate (...xls) default worksheet.xls
[ "Used", "to", "generate", "the", "xml", "with", "output", "headers" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Workbook.php#L242-L249
surebert/surebert-framework
src/sb/Excel/Workbook.php
Workbook.getValueType
protected function getValueType($val) { $type = 'String'; if ($this->auto_convert_types === true && is_numeric($val)) { $type = 'Number'; } return $type; }
php
protected function getValueType($val) { $type = 'String'; if ($this->auto_convert_types === true && is_numeric($val)) { $type = 'Number'; } return $type; }
[ "protected", "function", "getValueType", "(", "$", "val", ")", "{", "$", "type", "=", "'String'", ";", "if", "(", "$", "this", "->", "auto_convert_types", "===", "true", "&&", "is_numeric", "(", "$", "val", ")", ")", "{", "$", "type", "=", "'Number'", ...
Determines value type @param string $val @return string
[ "Determines", "value", "type" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Workbook.php#L274-L282
surebert/surebert-framework
src/sb/Excel/Workbook.php
Workbook.alphaIndexToNumeric
protected function alphaIndexToNumeric($alpha_index) { preg_match("~([A-Z]+)(\d)+~", $alpha_index, $match); $letters = range('A', 'Z'); $letters = array_flip($letters); $col_index = 0; $strlen = strlen($match[1]); if($strlen== 1){ $col_index += ($letters[...
php
protected function alphaIndexToNumeric($alpha_index) { preg_match("~([A-Z]+)(\d)+~", $alpha_index, $match); $letters = range('A', 'Z'); $letters = array_flip($letters); $col_index = 0; $strlen = strlen($match[1]); if($strlen== 1){ $col_index += ($letters[...
[ "protected", "function", "alphaIndexToNumeric", "(", "$", "alpha_index", ")", "{", "preg_match", "(", "\"~([A-Z]+)(\\d)+~\"", ",", "$", "alpha_index", ",", "$", "match", ")", ";", "$", "letters", "=", "range", "(", "'A'", ",", "'Z'", ")", ";", "$", "letter...
Converts Alpha column data to numeric indexes @param string $alpha_index e.g. A1 or AA4 @return array (col, row)
[ "Converts", "Alpha", "column", "data", "to", "numeric", "indexes" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Workbook.php#L289-L310
ronaldborla/chikka
src/Borla/Chikka/Models/Message.php
Message.toSend
public function toSend() { // Set type $this->type = static::SEND; // Refresh $this->refresh(); // Return array return [ 'message_type' => $this->message_type, 'mobile_number' => $this->mobile_number, 'message_id' => $this->id, 'message' => $this->getMessage(), ...
php
public function toSend() { // Set type $this->type = static::SEND; // Refresh $this->refresh(); // Return array return [ 'message_type' => $this->message_type, 'mobile_number' => $this->mobile_number, 'message_id' => $this->id, 'message' => $this->getMessage(), ...
[ "public", "function", "toSend", "(", ")", "{", "// Set type", "$", "this", "->", "type", "=", "static", "::", "SEND", ";", "// Refresh", "$", "this", "->", "refresh", "(", ")", ";", "// Return array", "return", "[", "'message_type'", "=>", "$", "this", "...
To send
[ "To", "send" ]
train
https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Message.php#L94-L106
ronaldborla/chikka
src/Borla/Chikka/Models/Message.php
Message.toReply
public function toReply($adjustCost = true) { // Set type $this->type = static::REPLY; // If to adjust if ($adjustCost) { // Do adjust $this->cost->adjust($this->mobile->carrier); } // Refresh $this->refresh(); // Return array return [ 'message_type' => $this->mess...
php
public function toReply($adjustCost = true) { // Set type $this->type = static::REPLY; // If to adjust if ($adjustCost) { // Do adjust $this->cost->adjust($this->mobile->carrier); } // Refresh $this->refresh(); // Return array return [ 'message_type' => $this->mess...
[ "public", "function", "toReply", "(", "$", "adjustCost", "=", "true", ")", "{", "// Set type", "$", "this", "->", "type", "=", "static", "::", "REPLY", ";", "// If to adjust", "if", "(", "$", "adjustCost", ")", "{", "// Do adjust", "$", "this", "->", "co...
To reply
[ "To", "reply" ]
train
https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Message.php#L111-L130
ronaldborla/chikka
src/Borla/Chikka/Models/Message.php
Message.refresh
protected function refresh() { // Refresh other attributes $this->message_id = $this->id; $this->message_type = $this->getMessageType(); $this->mobile_number = $this->mobile->intl(); $this->request_cost = (string) $this->cost; }
php
protected function refresh() { // Refresh other attributes $this->message_id = $this->id; $this->message_type = $this->getMessageType(); $this->mobile_number = $this->mobile->intl(); $this->request_cost = (string) $this->cost; }
[ "protected", "function", "refresh", "(", ")", "{", "// Refresh other attributes", "$", "this", "->", "message_id", "=", "$", "this", "->", "id", ";", "$", "this", "->", "message_type", "=", "$", "this", "->", "getMessageType", "(", ")", ";", "$", "this", ...
Refresh
[ "Refresh" ]
train
https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Message.php#L135-L141
ronaldborla/chikka
src/Borla/Chikka/Models/Message.php
Message.setTypeAttribute
protected function setTypeAttribute($value) { // If null if ($value === null) { // Return null return null; } // If numeric if (is_int($value) || is_numeric($value)) { // If not valid if (isset(static::types()[$value])) { // Return int value return (int) $valu...
php
protected function setTypeAttribute($value) { // If null if ($value === null) { // Return null return null; } // If numeric if (is_int($value) || is_numeric($value)) { // If not valid if (isset(static::types()[$value])) { // Return int value return (int) $valu...
[ "protected", "function", "setTypeAttribute", "(", "$", "value", ")", "{", "// If null", "if", "(", "$", "value", "===", "null", ")", "{", "// Return null", "return", "null", ";", "}", "// If numeric", "if", "(", "is_int", "(", "$", "value", ")", "||", "i...
Set type
[ "Set", "type" ]
train
https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Message.php#L162-L186
ronaldborla/chikka
src/Borla/Chikka/Models/Message.php
Message.setMobileAttribute
protected function setMobileAttribute($value) { // If null if ($value === null) { // Return null return null; } // Return mobile return ($value instanceof Mobile) ? $value : Loader::mobile($value); }
php
protected function setMobileAttribute($value) { // If null if ($value === null) { // Return null return null; } // Return mobile return ($value instanceof Mobile) ? $value : Loader::mobile($value); }
[ "protected", "function", "setMobileAttribute", "(", "$", "value", ")", "{", "// If null", "if", "(", "$", "value", "===", "null", ")", "{", "// Return null", "return", "null", ";", "}", "// Return mobile", "return", "(", "$", "value", "instanceof", "Mobile", ...
Set mobile
[ "Set", "mobile" ]
train
https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Message.php#L191-L199
ronaldborla/chikka
src/Borla/Chikka/Models/Message.php
Message.getMessageType
public function getMessageType() { // Get message type $messageType = static::types()[$this->type]; // If not incoming if ($this->type != static::INCOMING) { // Change to uppercase $messageType = strtoupper($messageType); } // Return return $messageType; }
php
public function getMessageType() { // Get message type $messageType = static::types()[$this->type]; // If not incoming if ($this->type != static::INCOMING) { // Change to uppercase $messageType = strtoupper($messageType); } // Return return $messageType; }
[ "public", "function", "getMessageType", "(", ")", "{", "// Get message type", "$", "messageType", "=", "static", "::", "types", "(", ")", "[", "$", "this", "->", "type", "]", ";", "// If not incoming", "if", "(", "$", "this", "->", "type", "!=", "static", ...
Get message type
[ "Get", "message", "type" ]
train
https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Message.php#L249-L259