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
PenoaksDev/Milky-Framework
src/Milky/Annotations/DocParser.php
DocParser.classExists
private function classExists( $fqcn ) { if ( isset( $this->classExists[$fqcn] ) ) return $this->classExists[$fqcn]; // first check if the class already exists, maybe loaded through another AnnotationReader if ( class_exists( $fqcn ) ) return $this->classExists[$fqcn] = true; return false; }
php
private function classExists( $fqcn ) { if ( isset( $this->classExists[$fqcn] ) ) return $this->classExists[$fqcn]; // first check if the class already exists, maybe loaded through another AnnotationReader if ( class_exists( $fqcn ) ) return $this->classExists[$fqcn] = true; return false; }
[ "private", "function", "classExists", "(", "$", "fqcn", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "classExists", "[", "$", "fqcn", "]", ")", ")", "return", "$", "this", "->", "classExists", "[", "$", "fqcn", "]", ";", "// first check if the...
Attempts to check if a class exists or not. @param string $fqcn @return boolean
[ "Attempts", "to", "check", "if", "a", "class", "exists", "or", "not", "." ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Annotations/DocParser.php#L321-L331
PenoaksDev/Milky-Framework
src/Milky/Annotations/DocParser.php
DocParser.Annotation
private function Annotation() { $this->match( DocLexer::T_AT ); // check if we have an annotation $name = $this->Identifier(); // only process names which are not fully qualified, yet // fully qualified names must start with a \ $originalName = $name; if ( '\\' !== $name[0] ) { $alias = ( false =...
php
private function Annotation() { $this->match( DocLexer::T_AT ); // check if we have an annotation $name = $this->Identifier(); // only process names which are not fully qualified, yet // fully qualified names must start with a \ $originalName = $name; if ( '\\' !== $name[0] ) { $alias = ( false =...
[ "private", "function", "Annotation", "(", ")", "{", "$", "this", "->", "match", "(", "DocLexer", "::", "T_AT", ")", ";", "// check if we have an annotation", "$", "name", "=", "$", "this", "->", "Identifier", "(", ")", ";", "// only process names which are not f...
Annotation ::= "@" AnnotationName MethodCall AnnotationName ::= QualifiedName | SimpleName QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName NameSpacePart ::= identifier | null | false | true SimpleName ::= identifier | null | false | true @return mixed False if it is not a valid annotation...
[ "Annotation", "::", "=", "@", "AnnotationName", "MethodCall", "AnnotationName", "::", "=", "QualifiedName", "|", "SimpleName", "QualifiedName", "::", "=", "NameSpacePart", "\\", "{", "NameSpacePart", "\\", "}", "*", "SimpleName", "NameSpacePart", "::", "=", "ident...
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Annotations/DocParser.php#L522-L655
PenoaksDev/Milky-Framework
src/Milky/Annotations/DocParser.php
DocParser.MethodCall
private function MethodCall() { $values = []; if ( !$this->lexer->isNextToken( DocLexer::T_OPEN_PARENTHESIS ) ) return $values; $this->match( DocLexer::T_OPEN_PARENTHESIS ); if ( !$this->lexer->isNextToken( DocLexer::T_CLOSE_PARENTHESIS ) ) $values = $this->Values(); $this->match( DocLexer::T_CLOSE...
php
private function MethodCall() { $values = []; if ( !$this->lexer->isNextToken( DocLexer::T_OPEN_PARENTHESIS ) ) return $values; $this->match( DocLexer::T_OPEN_PARENTHESIS ); if ( !$this->lexer->isNextToken( DocLexer::T_CLOSE_PARENTHESIS ) ) $values = $this->Values(); $this->match( DocLexer::T_CLOSE...
[ "private", "function", "MethodCall", "(", ")", "{", "$", "values", "=", "[", "]", ";", "if", "(", "!", "$", "this", "->", "lexer", "->", "isNextToken", "(", "DocLexer", "::", "T_OPEN_PARENTHESIS", ")", ")", "return", "$", "values", ";", "$", "this", ...
MethodCall ::= ["(" [Values] ")"] @return array
[ "MethodCall", "::", "=", "[", "(", "[", "Values", "]", ")", "]" ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Annotations/DocParser.php#L680-L695
PenoaksDev/Milky-Framework
src/Milky/Annotations/DocParser.php
DocParser.Values
private function Values() { $values = [$this->Value()]; while ( $this->lexer->isNextToken( DocLexer::T_COMMA ) ) { $this->match( DocLexer::T_COMMA ); if ( $this->lexer->isNextToken( DocLexer::T_CLOSE_PARENTHESIS ) ) break; $token = $this->lexer->lookahead; $value = $this->Value(); if ( !is...
php
private function Values() { $values = [$this->Value()]; while ( $this->lexer->isNextToken( DocLexer::T_COMMA ) ) { $this->match( DocLexer::T_COMMA ); if ( $this->lexer->isNextToken( DocLexer::T_CLOSE_PARENTHESIS ) ) break; $token = $this->lexer->lookahead; $value = $this->Value(); if ( !is...
[ "private", "function", "Values", "(", ")", "{", "$", "values", "=", "[", "$", "this", "->", "Value", "(", ")", "]", ";", "while", "(", "$", "this", "->", "lexer", "->", "isNextToken", "(", "DocLexer", "::", "T_COMMA", ")", ")", "{", "$", "this", ...
Values ::= Array | Value {"," Value}* [","] @return array
[ "Values", "::", "=", "Array", "|", "Value", "{", "Value", "}", "*", "[", "]" ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Annotations/DocParser.php#L702-L740
PenoaksDev/Milky-Framework
src/Milky/Annotations/DocParser.php
DocParser.ArrayEntry
private function ArrayEntry() { $peek = $this->lexer->glimpse(); if ( DocLexer::T_EQUALS === $peek['type'] || DocLexer::T_COLON === $peek['type'] ) { if ( $this->lexer->isNextToken( DocLexer::T_IDENTIFIER ) ) $key = $this->Constant(); else { $this->matchAny( [DocLexer::T_INTEGER, DocLexer::T_ST...
php
private function ArrayEntry() { $peek = $this->lexer->glimpse(); if ( DocLexer::T_EQUALS === $peek['type'] || DocLexer::T_COLON === $peek['type'] ) { if ( $this->lexer->isNextToken( DocLexer::T_IDENTIFIER ) ) $key = $this->Constant(); else { $this->matchAny( [DocLexer::T_INTEGER, DocLexer::T_ST...
[ "private", "function", "ArrayEntry", "(", ")", "{", "$", "peek", "=", "$", "this", "->", "lexer", "->", "glimpse", "(", ")", ";", "if", "(", "DocLexer", "::", "T_EQUALS", "===", "$", "peek", "[", "'type'", "]", "||", "DocLexer", "::", "T_COLON", "===...
ArrayEntry ::= Value | KeyValuePair KeyValuePair ::= Key ("=" | ":") PlainValue | Constant Key ::= string | integer | Constant @return array
[ "ArrayEntry", "::", "=", "Value", "|", "KeyValuePair", "KeyValuePair", "::", "=", "Key", "(", "=", "|", ":", ")", "PlainValue", "|", "Constant", "Key", "::", "=", "string", "|", "integer", "|", "Constant" ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Annotations/DocParser.php#L965-L985
nguyenanhung/my-debug
src/Debug.php
Debug.setGlobalLoggerLevel
public function setGlobalLoggerLevel($globalLoggerLevel = NULL) { if (!empty($globalLoggerLevel) && is_string($globalLoggerLevel)) { $this->globalLoggerLevel = strtolower($globalLoggerLevel); } return $this; }
php
public function setGlobalLoggerLevel($globalLoggerLevel = NULL) { if (!empty($globalLoggerLevel) && is_string($globalLoggerLevel)) { $this->globalLoggerLevel = strtolower($globalLoggerLevel); } return $this; }
[ "public", "function", "setGlobalLoggerLevel", "(", "$", "globalLoggerLevel", "=", "NULL", ")", "{", "if", "(", "!", "empty", "(", "$", "globalLoggerLevel", ")", "&&", "is_string", "(", "$", "globalLoggerLevel", ")", ")", "{", "$", "this", "->", "globalLogger...
Hàm cấu hình level Debug @author: 713uk13m <dev@nguyenanhung.com> @time : 10/17/18 09:53 @param null|string $globalLoggerLevel Level Debug được cấu hình theo chuẩn RFC 5424 @see https://github.com/Seldaek/monolog/blob/master/doc/01-usage.md#log-levels @see https://tools.ietf.org/html/rfc5424 @return $this
[ "Hàm", "cấu", "hình", "level", "Debug" ]
train
https://github.com/nguyenanhung/my-debug/blob/9dde293d6c04098ee68858035bd04076874f43d6/src/Debug.php#L108-L115
nguyenanhung/my-debug
src/Debug.php
Debug.setLoggerFilename
public function setLoggerFilename($loggerFilename = '') { if (!empty($loggerFilename)) { $this->loggerFilename = trim($loggerFilename); } else { $this->loggerFilename = 'Log-' . date('Y-m-d') . '.log'; } return $this; }
php
public function setLoggerFilename($loggerFilename = '') { if (!empty($loggerFilename)) { $this->loggerFilename = trim($loggerFilename); } else { $this->loggerFilename = 'Log-' . date('Y-m-d') . '.log'; } return $this; }
[ "public", "function", "setLoggerFilename", "(", "$", "loggerFilename", "=", "''", ")", "{", "if", "(", "!", "empty", "(", "$", "loggerFilename", ")", ")", "{", "$", "this", "->", "loggerFilename", "=", "trim", "(", "$", "loggerFilename", ")", ";", "}", ...
Hàm cấu hình file lưu trữ Log @author: 713uk13m <dev@nguyenanhung.com> @time : 10/17/18 09:57 @param string $loggerFilename Filename cần lưu log, VD: app.log, Log-2018-10-17.log @return $this
[ "Hàm", "cấu", "hình", "file", "lưu", "trữ", "Log" ]
train
https://github.com/nguyenanhung/my-debug/blob/9dde293d6c04098ee68858035bd04076874f43d6/src/Debug.php#L204-L213
nguyenanhung/my-debug
src/Debug.php
Debug.setLoggerDateFormat
public function setLoggerDateFormat($loggerDateFormat = NULL) { if (!empty($loggerDateFormat) && is_string($loggerDateFormat)) { $this->loggerDateFormat = $loggerDateFormat; } else { $this->loggerDateFormat = "Y-m-d H:i:s u"; } return $this; }
php
public function setLoggerDateFormat($loggerDateFormat = NULL) { if (!empty($loggerDateFormat) && is_string($loggerDateFormat)) { $this->loggerDateFormat = $loggerDateFormat; } else { $this->loggerDateFormat = "Y-m-d H:i:s u"; } return $this; }
[ "public", "function", "setLoggerDateFormat", "(", "$", "loggerDateFormat", "=", "NULL", ")", "{", "if", "(", "!", "empty", "(", "$", "loggerDateFormat", ")", "&&", "is_string", "(", "$", "loggerDateFormat", ")", ")", "{", "$", "this", "->", "loggerDateFormat...
Hàm quy định Date Format cho file Log @author: 713uk13m <dev@nguyenanhung.com> @time : 10/17/18 09:59 @param null $loggerDateFormat Logger Date Format, VD: Y-m-d H:i:s u @see https://github.com/Seldaek/monolog/blob/master/doc/01-usage.md#customizing-the-log-format @see https://github.com/Seldaek/monolog/blob/ma...
[ "Hàm", "quy", "định", "Date", "Format", "cho", "file", "Log" ]
train
https://github.com/nguyenanhung/my-debug/blob/9dde293d6c04098ee68858035bd04076874f43d6/src/Debug.php#L240-L249
nguyenanhung/my-debug
src/Debug.php
Debug.setLoggerLineFormat
public function setLoggerLineFormat($loggerLineFormat = NULL) { if (!empty($loggerLineFormat) && is_string($loggerLineFormat)) { $this->loggerLineFormat = $loggerLineFormat; } else { $this->loggerLineFormat = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n...
php
public function setLoggerLineFormat($loggerLineFormat = NULL) { if (!empty($loggerLineFormat) && is_string($loggerLineFormat)) { $this->loggerLineFormat = $loggerLineFormat; } else { $this->loggerLineFormat = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n...
[ "public", "function", "setLoggerLineFormat", "(", "$", "loggerLineFormat", "=", "NULL", ")", "{", "if", "(", "!", "empty", "(", "$", "loggerLineFormat", ")", "&&", "is_string", "(", "$", "loggerLineFormat", ")", ")", "{", "$", "this", "->", "loggerLineFormat...
Hàm cấu hình thông tin về format dòng ghi log @author: 713uk13m <dev@nguyenanhung.com> @time : 10/17/18 10:00 @param null $loggerLineFormat Line Format Input, example: [%datetime%] %channel%.%level_name%: %message% %context% %extra%\n @see https://github.com/Seldaek/monolog/blob/master/doc/01-usage.md#customizing...
[ "Hàm", "cấu", "hình", "thông", "tin", "về", "format", "dòng", "ghi", "log" ]
train
https://github.com/nguyenanhung/my-debug/blob/9dde293d6c04098ee68858035bd04076874f43d6/src/Debug.php#L277-L286
nguyenanhung/my-debug
src/Debug.php
Debug.log
public function log($level = '', $name = 'log', $msg = 'My Message', $context = []) { $level = strtolower(trim($level)); if ($this->DEBUG == TRUE) { if (!class_exists('\Monolog\Logger')) { if (function_exists('log_message')) { $errorMsg = 'Không tồn tạ...
php
public function log($level = '', $name = 'log', $msg = 'My Message', $context = []) { $level = strtolower(trim($level)); if ($this->DEBUG == TRUE) { if (!class_exists('\Monolog\Logger')) { if (function_exists('log_message')) { $errorMsg = 'Không tồn tạ...
[ "public", "function", "log", "(", "$", "level", "=", "''", ",", "$", "name", "=", "'log'", ",", "$", "msg", "=", "'My Message'", ",", "$", "context", "=", "[", "]", ")", "{", "$", "level", "=", "strtolower", "(", "trim", "(", "$", "level", ")", ...
Hàm ghi log cho hệ thống @author : 713uk13m <dev@nguyenanhung.com> @time : 10/6/18 23:35 @param string $level Level Debug: DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY @param string $name Log Name: log, etc... @param string $msg Log Message write to Log @param array $context Log Conte...
[ "Hàm", "ghi", "log", "cho", "hệ", "thống" ]
train
https://github.com/nguyenanhung/my-debug/blob/9dde293d6c04098ee68858035bd04076874f43d6/src/Debug.php#L304-L392
ddvphp/ddv-exception
src/DdvException/Handler.php
Handler.errorHandler
public static function errorHandler($errorCode, $message, $errfile, $errline, $errcontext){ $isError = (((E_ERROR | E_PARSE | E_COMPILE_ERROR | E_CORE_ERROR | E_USER_ERROR) & $errorCode) === $errorCode); $r = array(); $r['errorCode'] =$errorCode; $r['statusCode'] =500; $r['errorId'] ='UNKNOWN_ERROR'...
php
public static function errorHandler($errorCode, $message, $errfile, $errline, $errcontext){ $isError = (((E_ERROR | E_PARSE | E_COMPILE_ERROR | E_CORE_ERROR | E_USER_ERROR) & $errorCode) === $errorCode); $r = array(); $r['errorCode'] =$errorCode; $r['statusCode'] =500; $r['errorId'] ='UNKNOWN_ERROR'...
[ "public", "static", "function", "errorHandler", "(", "$", "errorCode", ",", "$", "message", ",", "$", "errfile", ",", "$", "errline", ",", "$", "errcontext", ")", "{", "$", "isError", "=", "(", "(", "(", "E_ERROR", "|", "E_PARSE", "|", "E_COMPILE_ERROR",...
用户定义的错误处理函数
[ "用户定义的错误处理函数" ]
train
https://github.com/ddvphp/ddv-exception/blob/4f1830dca40ea8ef99e721f043ade30c680ec2c5/src/DdvException/Handler.php#L122-L148
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.wherePivotIn
public function wherePivotIn($column, $values, $boolean = 'and', $not = false) { $this->pivotWheres[] = func_get_args(); return $this->whereIn($this->table.'.'.$column, $values, $boolean, $not); }
php
public function wherePivotIn($column, $values, $boolean = 'and', $not = false) { $this->pivotWheres[] = func_get_args(); return $this->whereIn($this->table.'.'.$column, $values, $boolean, $not); }
[ "public", "function", "wherePivotIn", "(", "$", "column", ",", "$", "values", ",", "$", "boolean", "=", "'and'", ",", "$", "not", "=", "false", ")", "{", "$", "this", "->", "pivotWheres", "[", "]", "=", "func_get_args", "(", ")", ";", "return", "$", ...
Set a "where in" clause for a pivot table column. @param string $column @param mixed $values @param string $boolean @param bool $not @return BelongsToMany
[ "Set", "a", "where", "in", "clause", "for", "a", "pivot", "table", "column", "." ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Relations/BelongsToMany.php#L131-L136
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.chunk
public function chunk($count, callable $callback) { $this->query->addSelect($this->getSelectColumns()); return $this->query->chunk($count, function ($results) use ($callback) { $this->hydratePivotRelation($results->all()); return $callback($results); }); }
php
public function chunk($count, callable $callback) { $this->query->addSelect($this->getSelectColumns()); return $this->query->chunk($count, function ($results) use ($callback) { $this->hydratePivotRelation($results->all()); return $callback($results); }); }
[ "public", "function", "chunk", "(", "$", "count", ",", "callable", "$", "callback", ")", "{", "$", "this", "->", "query", "->", "addSelect", "(", "$", "this", "->", "getSelectColumns", "(", ")", ")", ";", "return", "$", "this", "->", "query", "->", "...
Chunk the results of the query. @param int $count @param callable $callback @return bool
[ "Chunk", "the", "results", "of", "the", "query", "." ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Relations/BelongsToMany.php#L270-L279
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.getRelationQuery
public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*']) { if ($parent->getQuery()->from == $query->getQuery()->from) { return $this->getRelationQueryForSelfJoin($query, $parent, $columns); } $this->setJoin($query); return parent::getRelationQuery($query, $parent, $columns); }
php
public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*']) { if ($parent->getQuery()->from == $query->getQuery()->from) { return $this->getRelationQueryForSelfJoin($query, $parent, $columns); } $this->setJoin($query); return parent::getRelationQuery($query, $parent, $columns); }
[ "public", "function", "getRelationQuery", "(", "Builder", "$", "query", ",", "Builder", "$", "parent", ",", "$", "columns", "=", "[", "'*'", "]", ")", "{", "if", "(", "$", "parent", "->", "getQuery", "(", ")", "->", "from", "==", "$", "query", "->", ...
Add the constraints for a relationship query. @param Builder $query @param Builder $parent @param array|mixed $columns @return Builder
[ "Add", "the", "constraints", "for", "a", "relationship", "query", "." ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Relations/BelongsToMany.php#L345-L354
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.getRelationQueryForSelfJoin
public function getRelationQueryForSelfJoin(Builder $query, Builder $parent, $columns = ['*']) { $query->select($columns); $query->from($this->related->getTable().' as '.$hash = $this->getRelationCountHash()); $this->related->setTable($hash); $this->setJoin($query); return parent::getRelationQuery($query...
php
public function getRelationQueryForSelfJoin(Builder $query, Builder $parent, $columns = ['*']) { $query->select($columns); $query->from($this->related->getTable().' as '.$hash = $this->getRelationCountHash()); $this->related->setTable($hash); $this->setJoin($query); return parent::getRelationQuery($query...
[ "public", "function", "getRelationQueryForSelfJoin", "(", "Builder", "$", "query", ",", "Builder", "$", "parent", ",", "$", "columns", "=", "[", "'*'", "]", ")", "{", "$", "query", "->", "select", "(", "$", "columns", ")", ";", "$", "query", "->", "fro...
Add the constraints for a relationship query on the same table. @param Builder $query @param Builder $parent @param array|mixed $columns @return Builder
[ "Add", "the", "constraints", "for", "a", "relationship", "query", "on", "the", "same", "table", "." ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Relations/BelongsToMany.php#L364-L375
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.getSelectColumns
protected function getSelectColumns(array $columns = ['*']) { if ($columns == ['*']) { $columns = [$this->related->getTable().'.*']; } return array_merge($columns, $this->getAliasedPivotColumns()); }
php
protected function getSelectColumns(array $columns = ['*']) { if ($columns == ['*']) { $columns = [$this->related->getTable().'.*']; } return array_merge($columns, $this->getAliasedPivotColumns()); }
[ "protected", "function", "getSelectColumns", "(", "array", "$", "columns", "=", "[", "'*'", "]", ")", "{", "if", "(", "$", "columns", "==", "[", "'*'", "]", ")", "{", "$", "columns", "=", "[", "$", "this", "->", "related", "->", "getTable", "(", ")...
Set the select clause for the relation query. @param array $columns @return BelongsToMany
[ "Set", "the", "select", "clause", "for", "the", "relation", "query", "." ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Relations/BelongsToMany.php#L393-L400
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.findOrNew
public function findOrNew($id, $columns = ['*']) { if (is_null($instance = $this->find($id, $columns))) { $instance = $this->getRelated()->newInstance(); } return $instance; }
php
public function findOrNew($id, $columns = ['*']) { if (is_null($instance = $this->find($id, $columns))) { $instance = $this->getRelated()->newInstance(); } return $instance; }
[ "public", "function", "findOrNew", "(", "$", "id", ",", "$", "columns", "=", "[", "'*'", "]", ")", "{", "if", "(", "is_null", "(", "$", "instance", "=", "$", "this", "->", "find", "(", "$", "id", ",", "$", "columns", ")", ")", ")", "{", "$", ...
Find a related model by its primary key or return new instance of the related model. @param mixed $id @param array $columns @return Model
[ "Find", "a", "related", "model", "by", "its", "primary", "key", "or", "return", "new", "instance", "of", "the", "related", "model", "." ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Relations/BelongsToMany.php#L684-L691
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.attachNew
protected function attachNew(array $records, array $current, $touch = true) { $changes = ['attached' => [], 'updated' => []]; foreach ($records as $id => $attributes) { // If the ID is not in the list of existing pivot IDs, we will insert a new pivot // record, otherwise, we will just update this existing r...
php
protected function attachNew(array $records, array $current, $touch = true) { $changes = ['attached' => [], 'updated' => []]; foreach ($records as $id => $attributes) { // If the ID is not in the list of existing pivot IDs, we will insert a new pivot // record, otherwise, we will just update this existing r...
[ "protected", "function", "attachNew", "(", "array", "$", "records", ",", "array", "$", "current", ",", "$", "touch", "=", "true", ")", "{", "$", "changes", "=", "[", "'attached'", "=>", "[", "]", ",", "'updated'", "=>", "[", "]", "]", ";", "foreach",...
Attach all of the IDs that aren't in the current array. @param array $records @param array $current @param bool $touch @return array
[ "Attach", "all", "of", "the", "IDs", "that", "aren", "t", "in", "the", "current", "array", "." ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Relations/BelongsToMany.php#L869-L893
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.updateExistingPivot
public function updateExistingPivot($id, array $attributes, $touch = true) { if (in_array($this->updatedAt(), $this->pivotColumns)) { $attributes = $this->setTimestampsOnAttach($attributes, true); } $updated = $this->newPivotStatementForId($id)->update($attributes); if ($touch) { $this->touchIfTouching...
php
public function updateExistingPivot($id, array $attributes, $touch = true) { if (in_array($this->updatedAt(), $this->pivotColumns)) { $attributes = $this->setTimestampsOnAttach($attributes, true); } $updated = $this->newPivotStatementForId($id)->update($attributes); if ($touch) { $this->touchIfTouching...
[ "public", "function", "updateExistingPivot", "(", "$", "id", ",", "array", "$", "attributes", ",", "$", "touch", "=", "true", ")", "{", "if", "(", "in_array", "(", "$", "this", "->", "updatedAt", "(", ")", ",", "$", "this", "->", "pivotColumns", ")", ...
Update an existing pivot record on the table. @param mixed $id @param array $attributes @param bool $touch @return int
[ "Update", "an", "existing", "pivot", "record", "on", "the", "table", "." ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Relations/BelongsToMany.php#L903-L916
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.newPivot
public function newPivot(array $attributes = [], $exists = false) { $pivot = $this->related->newPivot($this->parent, $attributes, $this->table, $exists); return $pivot->setPivotKeys($this->foreignKey, $this->otherKey); }
php
public function newPivot(array $attributes = [], $exists = false) { $pivot = $this->related->newPivot($this->parent, $attributes, $this->table, $exists); return $pivot->setPivotKeys($this->foreignKey, $this->otherKey); }
[ "public", "function", "newPivot", "(", "array", "$", "attributes", "=", "[", "]", ",", "$", "exists", "=", "false", ")", "{", "$", "pivot", "=", "$", "this", "->", "related", "->", "newPivot", "(", "$", "this", "->", "parent", ",", "$", "attributes",...
Create a new pivot model instance. @param array $attributes @param bool $exists @return Pivot
[ "Create", "a", "new", "pivot", "model", "instance", "." ]
train
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Relations/BelongsToMany.php#L1168-L1173
Eden-PHP/Block
Field/Textarea.php
Textarea.setAttributes
public function setAttributes($name, $value = null) { Argument::i() ->test(1, 'string', 'array') ->test(2, 'scalar', 'null'); if(is_array($name)) { $this->attributes = $name; return $this; } $this->attributes[$name] = $value; return $this; }
php
public function setAttributes($name, $value = null) { Argument::i() ->test(1, 'string', 'array') ->test(2, 'scalar', 'null'); if(is_array($name)) { $this->attributes = $name; return $this; } $this->attributes[$name] = $value; return $this; }
[ "public", "function", "setAttributes", "(", "$", "name", ",", "$", "value", "=", "null", ")", "{", "Argument", "::", "i", "(", ")", "->", "test", "(", "1", ",", "'string'", ",", "'array'", ")", "->", "test", "(", "2", ",", "'scalar'", ",", "'null'"...
Returns the template variables in key value format @param string|array @param scalar|null @return Eden\Block\Field\Textarea
[ "Returns", "the", "template", "variables", "in", "key", "value", "format" ]
train
https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field/Textarea.php#L65-L78
ScaraMVC/Framework
src/Scara/Console/Database/Rollback.php
Rollback.configure
protected function configure() { $this->setName('db:rollback') ->setDescription('Rollback migrations') ->addArgument('migration', InputArgument::OPTIONAL, 'The migriation to rollback. Done by class name'); $this->_db = new Database(); $this->_cap = $this->_db->getCapsule(); ...
php
protected function configure() { $this->setName('db:rollback') ->setDescription('Rollback migrations') ->addArgument('migration', InputArgument::OPTIONAL, 'The migriation to rollback. Done by class name'); $this->_db = new Database(); $this->_cap = $this->_db->getCapsule(); ...
[ "protected", "function", "configure", "(", ")", "{", "$", "this", "->", "setName", "(", "'db:rollback'", ")", "->", "setDescription", "(", "'Rollback migrations'", ")", "->", "addArgument", "(", "'migration'", ",", "InputArgument", "::", "OPTIONAL", ",", "'The m...
Configure Symfony Command. @return void
[ "Configure", "Symfony", "Command", "." ]
train
https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Console/Database/Rollback.php#L35-L43
phuria/under-query
src/QueryCompiler/TableCompiler.php
TableCompiler.compileTableDeclaration
public function compileTableDeclaration(AbstractTable $table) { $declaration = ''; if ($table->isJoin()) { $declaration .= $this->compileJoinName($table->getJoinMetadata()) . ' '; } $declaration .= $table->getTableName(); if ($alias = $table->getAlias()) { ...
php
public function compileTableDeclaration(AbstractTable $table) { $declaration = ''; if ($table->isJoin()) { $declaration .= $this->compileJoinName($table->getJoinMetadata()) . ' '; } $declaration .= $table->getTableName(); if ($alias = $table->getAlias()) { ...
[ "public", "function", "compileTableDeclaration", "(", "AbstractTable", "$", "table", ")", "{", "$", "declaration", "=", "''", ";", "if", "(", "$", "table", "->", "isJoin", "(", ")", ")", "{", "$", "declaration", ".=", "$", "this", "->", "compileJoinName", ...
@param AbstractTable $table @return string
[ "@param", "AbstractTable", "$table" ]
train
https://github.com/phuria/under-query/blob/f5e733808c1f109fa73fd95a1fbc5c78fb4b8793/src/QueryCompiler/TableCompiler.php#L51-L70
phuria/under-query
src/QueryCompiler/TableCompiler.php
TableCompiler.compileJoinName
private function compileJoinName(JoinMetadata $metadata) { return implode(' ', array_filter([ $metadata->isNaturalJoin() ? 'NATURAL' : '', $this->compileJoinPrefix($metadata->getJoinType()), $metadata->isOuterJoin() ? 'OUTER' : '', $this->compileJoinSuffix($me...
php
private function compileJoinName(JoinMetadata $metadata) { return implode(' ', array_filter([ $metadata->isNaturalJoin() ? 'NATURAL' : '', $this->compileJoinPrefix($metadata->getJoinType()), $metadata->isOuterJoin() ? 'OUTER' : '', $this->compileJoinSuffix($me...
[ "private", "function", "compileJoinName", "(", "JoinMetadata", "$", "metadata", ")", "{", "return", "implode", "(", "' '", ",", "array_filter", "(", "[", "$", "metadata", "->", "isNaturalJoin", "(", ")", "?", "'NATURAL'", ":", "''", ",", "$", "this", "->",...
@param JoinMetadata $metadata @return string
[ "@param", "JoinMetadata", "$metadata" ]
train
https://github.com/phuria/under-query/blob/f5e733808c1f109fa73fd95a1fbc5c78fb4b8793/src/QueryCompiler/TableCompiler.php#L77-L85
phuria/under-query
src/QueryCompiler/TableCompiler.php
TableCompiler.compileJoinPrefix
private function compileJoinPrefix($joinType) { if (array_key_exists($joinType, $this->joinPrefixes)) { return $this->joinPrefixes[$joinType]; } return null; }
php
private function compileJoinPrefix($joinType) { if (array_key_exists($joinType, $this->joinPrefixes)) { return $this->joinPrefixes[$joinType]; } return null; }
[ "private", "function", "compileJoinPrefix", "(", "$", "joinType", ")", "{", "if", "(", "array_key_exists", "(", "$", "joinType", ",", "$", "this", "->", "joinPrefixes", ")", ")", "{", "return", "$", "this", "->", "joinPrefixes", "[", "$", "joinType", "]", ...
@param int $joinType @return string
[ "@param", "int", "$joinType" ]
train
https://github.com/phuria/under-query/blob/f5e733808c1f109fa73fd95a1fbc5c78fb4b8793/src/QueryCompiler/TableCompiler.php#L92-L99
phuria/under-query
src/QueryCompiler/TableCompiler.php
TableCompiler.compileRootTables
public function compileRootTables(CompilerPayload $payload) { $builder = $payload->getBuilder(); $newSQL = ''; if ($builder instanceof AbstractBuilder && $builder->getRootTables()) { $newSQL = implode(', ', array_map([$this, 'compileTableDeclaration'], $builder->getRootTables())...
php
public function compileRootTables(CompilerPayload $payload) { $builder = $payload->getBuilder(); $newSQL = ''; if ($builder instanceof AbstractBuilder && $builder->getRootTables()) { $newSQL = implode(', ', array_map([$this, 'compileTableDeclaration'], $builder->getRootTables())...
[ "public", "function", "compileRootTables", "(", "CompilerPayload", "$", "payload", ")", "{", "$", "builder", "=", "$", "payload", "->", "getBuilder", "(", ")", ";", "$", "newSQL", "=", "''", ";", "if", "(", "$", "builder", "instanceof", "AbstractBuilder", ...
@param CompilerPayload $payload @return CompilerPayload
[ "@param", "CompilerPayload", "$payload" ]
train
https://github.com/phuria/under-query/blob/f5e733808c1f109fa73fd95a1fbc5c78fb4b8793/src/QueryCompiler/TableCompiler.php#L116-L130
phuria/under-query
src/QueryCompiler/TableCompiler.php
TableCompiler.compileJoinTables
public function compileJoinTables(CompilerPayload $payload) { $builder = $payload->getBuilder(); if ($builder instanceof Clause\JoinInterface) { $newSQL = implode(' ', array_map([$this, 'compileTableDeclaration'], $builder->getJoinTables())); return $payload->appendSQL($newS...
php
public function compileJoinTables(CompilerPayload $payload) { $builder = $payload->getBuilder(); if ($builder instanceof Clause\JoinInterface) { $newSQL = implode(' ', array_map([$this, 'compileTableDeclaration'], $builder->getJoinTables())); return $payload->appendSQL($newS...
[ "public", "function", "compileJoinTables", "(", "CompilerPayload", "$", "payload", ")", "{", "$", "builder", "=", "$", "payload", "->", "getBuilder", "(", ")", ";", "if", "(", "$", "builder", "instanceof", "Clause", "\\", "JoinInterface", ")", "{", "$", "n...
@param CompilerPayload $payload @return CompilerPayload
[ "@param", "CompilerPayload", "$payload" ]
train
https://github.com/phuria/under-query/blob/f5e733808c1f109fa73fd95a1fbc5c78fb4b8793/src/QueryCompiler/TableCompiler.php#L137-L147
koolkode/stream
src/Stream.php
Stream.fillBuffer
public static function fillBuffer(StreamInterface $stream, $bufferSize = 8192) { if(!$stream->isReadable()) { throw new \InvalidArgumentException(sprintf('Stream is not readable: %s', get_class($stream))); } $buffer = ''; while(!$stream->eof() && strlen($buffer) < $bufferSize) { $buffer .= $str...
php
public static function fillBuffer(StreamInterface $stream, $bufferSize = 8192) { if(!$stream->isReadable()) { throw new \InvalidArgumentException(sprintf('Stream is not readable: %s', get_class($stream))); } $buffer = ''; while(!$stream->eof() && strlen($buffer) < $bufferSize) { $buffer .= $str...
[ "public", "static", "function", "fillBuffer", "(", "StreamInterface", "$", "stream", ",", "$", "bufferSize", "=", "8192", ")", "{", "if", "(", "!", "$", "stream", "->", "isReadable", "(", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "("...
Read contents from the given input stream until EOF or the specified buffer is full. @param StreamInterface $stream @param int $bufferSize @return string @throws \InvalidArgumentException When the stream is not readable.
[ "Read", "contents", "from", "the", "given", "input", "stream", "until", "EOF", "or", "the", "specified", "buffer", "is", "full", "." ]
train
https://github.com/koolkode/stream/blob/05e83efd76e1cb9e40a972711986b4a7e38bc141/src/Stream.php#L32-L47
koolkode/stream
src/Stream.php
Stream.reader
public static function reader(StreamInterface $stream, $bufferSize = 8192) { if(!$stream->isReadable()) { throw new \InvalidArgumentException(sprintf('Stream is not readable: %s', get_class($stream))); } while(!$stream->eof()) { yield $stream->read($bufferSize); } }
php
public static function reader(StreamInterface $stream, $bufferSize = 8192) { if(!$stream->isReadable()) { throw new \InvalidArgumentException(sprintf('Stream is not readable: %s', get_class($stream))); } while(!$stream->eof()) { yield $stream->read($bufferSize); } }
[ "public", "static", "function", "reader", "(", "StreamInterface", "$", "stream", ",", "$", "bufferSize", "=", "8192", ")", "{", "if", "(", "!", "$", "stream", "->", "isReadable", "(", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", ...
Turn a stream into an iterator. @param StreamInterface $stream @param int $bufferSize @return \Iterator @throws \InvalidArgumentException When the stream is not readable.
[ "Turn", "a", "stream", "into", "an", "iterator", "." ]
train
https://github.com/koolkode/stream/blob/05e83efd76e1cb9e40a972711986b4a7e38bc141/src/Stream.php#L58-L69
koolkode/stream
src/Stream.php
Stream.bufferedReader
public static function bufferedReader(StreamInterface $stream, $bufferSize = 8192) { if(!$stream->isReadable()) { throw new \InvalidArgumentException(sprintf('Stream is not readable: %s', get_class($stream))); } $buffer = ''; while(!$stream->eof()) { $buffer .= $stream->read($bufferSize); ...
php
public static function bufferedReader(StreamInterface $stream, $bufferSize = 8192) { if(!$stream->isReadable()) { throw new \InvalidArgumentException(sprintf('Stream is not readable: %s', get_class($stream))); } $buffer = ''; while(!$stream->eof()) { $buffer .= $stream->read($bufferSize); ...
[ "public", "static", "function", "bufferedReader", "(", "StreamInterface", "$", "stream", ",", "$", "bufferSize", "=", "8192", ")", "{", "if", "(", "!", "$", "stream", "->", "isReadable", "(", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", ...
Turn a stream into an iterator returning even-sized results. @param StreamInterface $stream @param int $bufferSize @return \Iterator @throws \InvalidArgumentException When the stream is not readable.
[ "Turn", "a", "stream", "into", "an", "iterator", "returning", "even", "-", "sized", "results", "." ]
train
https://github.com/koolkode/stream/blob/05e83efd76e1cb9e40a972711986b4a7e38bc141/src/Stream.php#L80-L105
koolkode/stream
src/Stream.php
Stream.pipe
public static function pipe(StreamInterface $in, StreamInterface $out, $chunkSize = 8192) { if(!$in->isReadable()) { throw new \InvalidArgumentException(sprintf('Input stream is not readable: %s', get_class($in))); } if(!$out->isWritable()) { throw new \InvalidArgumentException(sprintf('Output strea...
php
public static function pipe(StreamInterface $in, StreamInterface $out, $chunkSize = 8192) { if(!$in->isReadable()) { throw new \InvalidArgumentException(sprintf('Input stream is not readable: %s', get_class($in))); } if(!$out->isWritable()) { throw new \InvalidArgumentException(sprintf('Output strea...
[ "public", "static", "function", "pipe", "(", "StreamInterface", "$", "in", ",", "StreamInterface", "$", "out", ",", "$", "chunkSize", "=", "8192", ")", "{", "if", "(", "!", "$", "in", "->", "isReadable", "(", ")", ")", "{", "throw", "new", "\\", "Inv...
Pipe data from an input stream into an output stream. @param StreamInterface $in @param StreamInterface $out @param int $chunkSize Maximum chunk size being used during copy. @return int Number of bytes being copied. @throws \InvalidArgumentException When input stream is not readable or output stream is not writable.
[ "Pipe", "data", "from", "an", "input", "stream", "into", "an", "output", "stream", "." ]
train
https://github.com/koolkode/stream/blob/05e83efd76e1cb9e40a972711986b4a7e38bc141/src/Stream.php#L117-L137
Danack/Jig
src/Jig/Jig.php
Jig.deleteCompiledFile
public function deleteCompiledFile($templateName) { $className = $this->jigConverter->getClassNameFromFilename($templateName); $compileFilename = $this->jigConfig->getCompiledFilenameFromClassname($className); $deleted = @unlink($compileFilename); return $deleted; }
php
public function deleteCompiledFile($templateName) { $className = $this->jigConverter->getClassNameFromFilename($templateName); $compileFilename = $this->jigConfig->getCompiledFilenameFromClassname($className); $deleted = @unlink($compileFilename); return $deleted; }
[ "public", "function", "deleteCompiledFile", "(", "$", "templateName", ")", "{", "$", "className", "=", "$", "this", "->", "jigConverter", "->", "getClassNameFromFilename", "(", "$", "templateName", ")", ";", "$", "compileFilename", "=", "$", "this", "->", "jig...
Delete the compiled version of a template. @param $templateName @return bool
[ "Delete", "the", "compiled", "version", "of", "a", "template", "." ]
train
https://github.com/Danack/Jig/blob/b11106bc7d634add9873bf246eda1dadb059ed7a/src/Jig/Jig.php#L78-L85
ekyna/Table
Bridge/Doctrine/ORM/Source/EntitySource.php
EntitySource.setQueryBuilderInitializer
public function setQueryBuilderInitializer(\Closure $initializer = null) { if (!is_null($initializer)) { $this->validateQueryBuilderInitializer($initializer); } $this->queryBuilderInitializer = $initializer; return $this; }
php
public function setQueryBuilderInitializer(\Closure $initializer = null) { if (!is_null($initializer)) { $this->validateQueryBuilderInitializer($initializer); } $this->queryBuilderInitializer = $initializer; return $this; }
[ "public", "function", "setQueryBuilderInitializer", "(", "\\", "Closure", "$", "initializer", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "initializer", ")", ")", "{", "$", "this", "->", "validateQueryBuilderInitializer", "(", "$", "initializer...
Sets the query builder initializer. A closure with the query builder as first argument and the root alias as the second argument: function (QueryBuilder $qb, $alias) { } @param \Closure|null $initializer @return EntitySource
[ "Sets", "the", "query", "builder", "initializer", "." ]
train
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Doctrine/ORM/Source/EntitySource.php#L73-L82
ekyna/Table
Bridge/Doctrine/ORM/Source/EntitySource.php
EntitySource.validateQueryBuilderInitializer
private function validateQueryBuilderInitializer(\Closure $initializer) { $reflection = new \ReflectionFunction($initializer); $parameters = $reflection->getParameters(); if (2 !== count($parameters)) { throw new InvalidArgumentException("The query builder initializer must have ...
php
private function validateQueryBuilderInitializer(\Closure $initializer) { $reflection = new \ReflectionFunction($initializer); $parameters = $reflection->getParameters(); if (2 !== count($parameters)) { throw new InvalidArgumentException("The query builder initializer must have ...
[ "private", "function", "validateQueryBuilderInitializer", "(", "\\", "Closure", "$", "initializer", ")", "{", "$", "reflection", "=", "new", "\\", "ReflectionFunction", "(", "$", "initializer", ")", ";", "$", "parameters", "=", "$", "reflection", "->", "getParam...
Validates the query builder initializer. @param \Closure $initializer @throws InvalidArgumentException
[ "Validates", "the", "query", "builder", "initializer", "." ]
train
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Doctrine/ORM/Source/EntitySource.php#L91-L114
dms-org/common.structure
src/DateTime/Persistence/TimezonedDateTimeMapper.php
TimezonedDateTimeMapper.define
protected function define(MapperDefinition $map) { $map->type(TimezonedDateTime::class); $map->property(TimezonedDateTime::DATE_TIME) ->mappedVia(function (\DateTimeImmutable $phpDateTime) { // Remove timezone information as this is lost when persisted anyway ...
php
protected function define(MapperDefinition $map) { $map->type(TimezonedDateTime::class); $map->property(TimezonedDateTime::DATE_TIME) ->mappedVia(function (\DateTimeImmutable $phpDateTime) { // Remove timezone information as this is lost when persisted anyway ...
[ "protected", "function", "define", "(", "MapperDefinition", "$", "map", ")", "{", "$", "map", "->", "type", "(", "TimezonedDateTime", "::", "class", ")", ";", "$", "map", "->", "property", "(", "TimezonedDateTime", "::", "DATE_TIME", ")", "->", "mappedVia", ...
Defines the value object mapper @param MapperDefinition $map @return void
[ "Defines", "the", "value", "object", "mapper" ]
train
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/Persistence/TimezonedDateTimeMapper.php#L40-L74
lasallecms/lasallecms-l5-lasallecmsadmin-pkg
src/FormProcessing/Postupdates/DeletePostupdateFormProcessing.php
DeletePostupdateFormProcessing.quarterback
public function quarterback($id) { // SPECIAL FOR POST UPDATES: WHAT IS THE POST_ID OF THIS POST UPDATE? BETTER FIND OUT BEFORE DELETING THE POST! $post_id = $this->repository->postIdOfPostupdate($id); // DELETE record if (!$this->persist($id, $this->type)) { // Pr...
php
public function quarterback($id) { // SPECIAL FOR POST UPDATES: WHAT IS THE POST_ID OF THIS POST UPDATE? BETTER FIND OUT BEFORE DELETING THE POST! $post_id = $this->repository->postIdOfPostupdate($id); // DELETE record if (!$this->persist($id, $this->type)) { // Pr...
[ "public", "function", "quarterback", "(", "$", "id", ")", "{", "// SPECIAL FOR POST UPDATES: WHAT IS THE POST_ID OF THIS POST UPDATE? BETTER FIND OUT BEFORE DELETING THE POST!", "$", "post_id", "=", "$", "this", "->", "repository", "->", "postIdOfPostupdate", "(", "$", "id", ...
The processing steps. @param The command bus object $deletePostCommand @return The custom response array
[ "The", "processing", "steps", "." ]
train
https://github.com/lasallecms/lasallecms-l5-lasallecmsadmin-pkg/blob/5a4b3375e449273a98e84a566bcf60fd2172cb2d/src/FormProcessing/Postupdates/DeletePostupdateFormProcessing.php#L115-L139
lightwerk/SurfTasks
Classes/Lightwerk/SurfTasks/Task/Database/DumpTask.php
DumpTask.execute
public function execute(Node $node, Application $application, Deployment $deployment, array $options = []) { $options = array_replace_recursive($this->options, $options); if (empty($options['sourceNode']) === false) { $node = $this->nodeFactory->getNodeByArray($options['sourceNode']); ...
php
public function execute(Node $node, Application $application, Deployment $deployment, array $options = []) { $options = array_replace_recursive($this->options, $options); if (empty($options['sourceNode']) === false) { $node = $this->nodeFactory->getNodeByArray($options['sourceNode']); ...
[ "public", "function", "execute", "(", "Node", "$", "node", ",", "Application", "$", "application", ",", "Deployment", "$", "deployment", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "options", "=", "array_replace_recursive", "(", "$", "this"...
@param Node $node @param Application $application @param Deployment $deployment @param array $options @throws TaskExecutionException @throws InvalidConfigurationException
[ "@param", "Node", "$node", "@param", "Application", "$application", "@param", "Deployment", "$deployment", "@param", "array", "$options" ]
train
https://github.com/lightwerk/SurfTasks/blob/8a6e4c85e42c762ad6515778c3fc7e19052cd9d1/Classes/Lightwerk/SurfTasks/Task/Database/DumpTask.php#L68-L87
lightwerk/SurfTasks
Classes/Lightwerk/SurfTasks/Task/Database/DumpTask.php
DumpTask.getTableLikes
protected function getTableLikes($options, $credentials) { if ($options['fullDump'] === true || empty($options['ignoreTables']) === true) { return []; } $tablesLike = []; foreach ($options['ignoreTables'] as $table => $enabled) { if (!$enabled) { ...
php
protected function getTableLikes($options, $credentials) { if ($options['fullDump'] === true || empty($options['ignoreTables']) === true) { return []; } $tablesLike = []; foreach ($options['ignoreTables'] as $table => $enabled) { if (!$enabled) { ...
[ "protected", "function", "getTableLikes", "(", "$", "options", ",", "$", "credentials", ")", "{", "if", "(", "$", "options", "[", "'fullDump'", "]", "===", "true", "||", "empty", "(", "$", "options", "[", "'ignoreTables'", "]", ")", "===", "true", ")", ...
@param array $options @return array
[ "@param", "array", "$options" ]
train
https://github.com/lightwerk/SurfTasks/blob/8a6e4c85e42c762ad6515778c3fc7e19052cd9d1/Classes/Lightwerk/SurfTasks/Task/Database/DumpTask.php#L94-L108
lightwerk/SurfTasks
Classes/Lightwerk/SurfTasks/Task/Database/DumpTask.php
DumpTask.getDataTablesCommand
protected function getDataTablesCommand($mysqlArguments, $tableLikes, $targetFile) { if (empty($tableLikes) === false) { $dataTables = ' `mysql -N ' . $mysqlArguments . ' -e "SHOW TABLES WHERE NOT (' . implode(' OR ', $tableLikes) . ')" | awk \'{printf $1" "}\'`'; } else { $d...
php
protected function getDataTablesCommand($mysqlArguments, $tableLikes, $targetFile) { if (empty($tableLikes) === false) { $dataTables = ' `mysql -N ' . $mysqlArguments . ' -e "SHOW TABLES WHERE NOT (' . implode(' OR ', $tableLikes) . ')" | awk \'{printf $1" "}\'`'; } else { $d...
[ "protected", "function", "getDataTablesCommand", "(", "$", "mysqlArguments", ",", "$", "tableLikes", ",", "$", "targetFile", ")", "{", "if", "(", "empty", "(", "$", "tableLikes", ")", "===", "false", ")", "{", "$", "dataTables", "=", "' `mysql -N '", ".", ...
@param string $mysqlArguments @param array $tableLikes @param string $targetFile @return string
[ "@param", "string", "$mysqlArguments", "@param", "array", "$tableLikes", "@param", "string", "$targetFile" ]
train
https://github.com/lightwerk/SurfTasks/blob/8a6e4c85e42c762ad6515778c3fc7e19052cd9d1/Classes/Lightwerk/SurfTasks/Task/Database/DumpTask.php#L117-L127
lightwerk/SurfTasks
Classes/Lightwerk/SurfTasks/Task/Database/DumpTask.php
DumpTask.getStructureCommand
protected function getStructureCommand($mysqlArguments, $tableLikes, $targetFile) { $dataTables = ' `mysql -N ' . $mysqlArguments . ' -e "SHOW TABLES WHERE (' . implode(' OR ', $tableLikes) . ')" | awk \'{printf $1" "}\'`'; return 'mysqldump --no-data --single-transaction ' . $mysqlArguments . ' --...
php
protected function getStructureCommand($mysqlArguments, $tableLikes, $targetFile) { $dataTables = ' `mysql -N ' . $mysqlArguments . ' -e "SHOW TABLES WHERE (' . implode(' OR ', $tableLikes) . ')" | awk \'{printf $1" "}\'`'; return 'mysqldump --no-data --single-transaction ' . $mysqlArguments . ' --...
[ "protected", "function", "getStructureCommand", "(", "$", "mysqlArguments", ",", "$", "tableLikes", ",", "$", "targetFile", ")", "{", "$", "dataTables", "=", "' `mysql -N '", ".", "$", "mysqlArguments", ".", "' -e \"SHOW TABLES WHERE ('", ".", "implode", "(", "' O...
@param string $mysqlArguments @param array $tableLikes @param string $targetFile @return string
[ "@param", "string", "$mysqlArguments", "@param", "array", "$tableLikes", "@param", "string", "$targetFile" ]
train
https://github.com/lightwerk/SurfTasks/blob/8a6e4c85e42c762ad6515778c3fc7e19052cd9d1/Classes/Lightwerk/SurfTasks/Task/Database/DumpTask.php#L136-L143
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Type/BinaryType.php
BinaryType.databaseValue
protected function databaseValue($value) { if (is_string($value)) { return $value; } if (!$value instanceof BinaryValue) { if (!is_resource($value) && !$value instanceof StreamInterface) { throw ODMException::invalidValueForType('Binary', ['string', '...
php
protected function databaseValue($value) { if (is_string($value)) { return $value; } if (!$value instanceof BinaryValue) { if (!is_resource($value) && !$value instanceof StreamInterface) { throw ODMException::invalidValueForType('Binary', ['string', '...
[ "protected", "function", "databaseValue", "(", "$", "value", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", ")", "{", "return", "$", "value", ";", "}", "if", "(", "!", "$", "value", "instanceof", "BinaryValue", ")", "{", "if", "(", "!", ...
@param string|resource|StreamInterface|BinaryValue $value @return string @throws ODMException
[ "@param", "string|resource|StreamInterface|BinaryValue", "$value" ]
train
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Type/BinaryType.php#L28-L43
ValkSystems/bootbuilder
src/bootbuilder/Form.php
Form.render
public function render($return = false) { $html = "<form"; if($this->id) $html .= " id='$this->id'"; if($this->class) $html .= " class='$this->class'"; if($this->action || $this->action == "") $html .= " action='$this->action'"; if($this->method) $html .= " method='$this->method'...
php
public function render($return = false) { $html = "<form"; if($this->id) $html .= " id='$this->id'"; if($this->class) $html .= " class='$this->class'"; if($this->action || $this->action == "") $html .= " action='$this->action'"; if($this->method) $html .= " method='$this->method'...
[ "public", "function", "render", "(", "$", "return", "=", "false", ")", "{", "$", "html", "=", "\"<form\"", ";", "if", "(", "$", "this", "->", "id", ")", "$", "html", ".=", "\" id='$this->id'\"", ";", "if", "(", "$", "this", "->", "class", ")", "$",...
Render form @param boolean $return Do you want to return the HTML?
[ "Render", "form" ]
train
https://github.com/ValkSystems/bootbuilder/blob/7601a403f42eba47ce4cf02a3c852d5196b1d860/src/bootbuilder/Form.php#L24-L49
ValkSystems/bootbuilder
src/bootbuilder/Form.php
Form.addAll
public function addAll() { if(func_num_args() > 0) { for($i = 0; $i < func_num_args(); $i++) { if(func_get_arg($i) instanceof \bootbuilder\Controls\Control){ array_push($this->controls, func_get_arg($i)); } } } }
php
public function addAll() { if(func_num_args() > 0) { for($i = 0; $i < func_num_args(); $i++) { if(func_get_arg($i) instanceof \bootbuilder\Controls\Control){ array_push($this->controls, func_get_arg($i)); } } } }
[ "public", "function", "addAll", "(", ")", "{", "if", "(", "func_num_args", "(", ")", ">", "0", ")", "{", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "func_num_args", "(", ")", ";", "$", "i", "++", ")", "{", "if", "(", "func_get_arg", ...
Add multiple controls to form @param \BootBuilder\Controls\Control $control,... Multiple controls
[ "Add", "multiple", "controls", "to", "form" ]
train
https://github.com/ValkSystems/bootbuilder/blob/7601a403f42eba47ce4cf02a3c852d5196b1d860/src/bootbuilder/Form.php#L72-L80
ValkSystems/bootbuilder
src/bootbuilder/Form.php
Form.replaceControl
public function replaceControl($nr, $control) { if(isset($this->controls[$nr])) { $this->controls[$nr] = $control; } }
php
public function replaceControl($nr, $control) { if(isset($this->controls[$nr])) { $this->controls[$nr] = $control; } }
[ "public", "function", "replaceControl", "(", "$", "nr", ",", "$", "control", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "controls", "[", "$", "nr", "]", ")", ")", "{", "$", "this", "->", "controls", "[", "$", "nr", "]", "=", "$", "co...
Replace current control in array with new one @param int $nr @param mixed $control
[ "Replace", "current", "control", "in", "array", "with", "new", "one" ]
train
https://github.com/ValkSystems/bootbuilder/blob/7601a403f42eba47ce4cf02a3c852d5196b1d860/src/bootbuilder/Form.php#L143-L147
ValkSystems/bootbuilder
src/bootbuilder/Form.php
Form.parseParameters
public function parseParameters($parameters) { for($i = 0; $i < count($this->controls); $i++) { $this->controls[$i] = $this->parseParameterControl($this->controls[$i], $parameters); } }
php
public function parseParameters($parameters) { for($i = 0; $i < count($this->controls); $i++) { $this->controls[$i] = $this->parseParameterControl($this->controls[$i], $parameters); } }
[ "public", "function", "parseParameters", "(", "$", "parameters", ")", "{", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "count", "(", "$", "this", "->", "controls", ")", ";", "$", "i", "++", ")", "{", "$", "this", "->", "controls", "[", ...
Parse Posted Parameters into controls @param mixed $parameters
[ "Parse", "Posted", "Parameters", "into", "controls" ]
train
https://github.com/ValkSystems/bootbuilder/blob/7601a403f42eba47ce4cf02a3c852d5196b1d860/src/bootbuilder/Form.php#L185-L189
ValkSystems/bootbuilder
src/bootbuilder/Form.php
Form.parseParameterControl
private function parseParameterControl($control, $parameters) { if($control instanceof \bootbuilder\Pane\Pane) { $control->parseParameters($parameters); }elseif($control instanceof \bootbuilder\Controls\Control) { if(isset($parameters[$control->getName()])) { if($...
php
private function parseParameterControl($control, $parameters) { if($control instanceof \bootbuilder\Pane\Pane) { $control->parseParameters($parameters); }elseif($control instanceof \bootbuilder\Controls\Control) { if(isset($parameters[$control->getName()])) { if($...
[ "private", "function", "parseParameterControl", "(", "$", "control", ",", "$", "parameters", ")", "{", "if", "(", "$", "control", "instanceof", "\\", "bootbuilder", "\\", "Pane", "\\", "Pane", ")", "{", "$", "control", "->", "parseParameters", "(", "$", "p...
Parse control @param mixed $control @param array $parameters @return mixed
[ "Parse", "control" ]
train
https://github.com/ValkSystems/bootbuilder/blob/7601a403f42eba47ce4cf02a3c852d5196b1d860/src/bootbuilder/Form.php#L197-L219
ValkSystems/bootbuilder
src/bootbuilder/Form.php
Form.save
public function save($replace = true, $prepare = true) { $this->add(new \bootbuilder\Controls\Hidden("bootbuilder-form", $this->id)); if($replace) { \bootbuilder\Validation\Validator::clean(); } \bootbuilder\Validation\Validator::save($this, $this->id, $prep...
php
public function save($replace = true, $prepare = true) { $this->add(new \bootbuilder\Controls\Hidden("bootbuilder-form", $this->id)); if($replace) { \bootbuilder\Validation\Validator::clean(); } \bootbuilder\Validation\Validator::save($this, $this->id, $prep...
[ "public", "function", "save", "(", "$", "replace", "=", "true", ",", "$", "prepare", "=", "true", ")", "{", "$", "this", "->", "add", "(", "new", "\\", "bootbuilder", "\\", "Controls", "\\", "Hidden", "(", "\"bootbuilder-form\"", ",", "$", "this", "->"...
Save form for validation @param boolean $replace set false if you have multiple forms on one page @param boolean $prepare prepare session, false on unittesting
[ "Save", "form", "for", "validation" ]
train
https://github.com/ValkSystems/bootbuilder/blob/7601a403f42eba47ce4cf02a3c852d5196b1d860/src/bootbuilder/Form.php#L226-L234
cocur/pli
src/Pli.php
Pli.loadConfiguration
public function loadConfiguration(ConfigurationInterface $configuration, array $configFiles = []) { $rawConfig = []; foreach ($configFiles as $configFile) { if (!file_exists($configFile)) { $configFile = $this->getConfigFilename($configFile); } if ...
php
public function loadConfiguration(ConfigurationInterface $configuration, array $configFiles = []) { $rawConfig = []; foreach ($configFiles as $configFile) { if (!file_exists($configFile)) { $configFile = $this->getConfigFilename($configFile); } if ...
[ "public", "function", "loadConfiguration", "(", "ConfigurationInterface", "$", "configuration", ",", "array", "$", "configFiles", "=", "[", "]", ")", "{", "$", "rawConfig", "=", "[", "]", ";", "foreach", "(", "$", "configFiles", "as", "$", "configFile", ")",...
@param ConfigurationInterface $configuration @param string[] $configFiles @return array
[ "@param", "ConfigurationInterface", "$configuration", "@param", "string", "[]", "$configFiles" ]
train
https://github.com/cocur/pli/blob/9f036160065b11998b07a5fd79a3be670f9ffa7b/src/Pli.php#L54-L67
cocur/pli
src/Pli.php
Pli.buildContainer
public function buildContainer( ExtensionInterface $extension = null, array $config = [], array $parameters = [], array $compilerPasses = [] ) { $container = new ContainerBuilder(); if ($extension !== null) { $extension->setConfigDirectories($this->configD...
php
public function buildContainer( ExtensionInterface $extension = null, array $config = [], array $parameters = [], array $compilerPasses = [] ) { $container = new ContainerBuilder(); if ($extension !== null) { $extension->setConfigDirectories($this->configD...
[ "public", "function", "buildContainer", "(", "ExtensionInterface", "$", "extension", "=", "null", ",", "array", "$", "config", "=", "[", "]", ",", "array", "$", "parameters", "=", "[", "]", ",", "array", "$", "compilerPasses", "=", "[", "]", ")", "{", ...
@param ExtensionInterface|null $extension @param array $config @param array $parameters @param CompilerPassInterface[] $compilerPasses @return ContainerBuilder
[ "@param", "ExtensionInterface|null", "$extension", "@param", "array", "$config", "@param", "array", "$parameters", "@param", "CompilerPassInterface", "[]", "$compilerPasses" ]
train
https://github.com/cocur/pli/blob/9f036160065b11998b07a5fd79a3be670f9ffa7b/src/Pli.php#L77-L97
cocur/pli
src/Pli.php
Pli.addCommands
protected function addCommands(Application $application, ContainerBuilder $container) { $commands = array_keys($container->findTaggedServiceIds('command')); foreach ($commands as $id) { /** @var \Symfony\Component\Console\Command\Command|ContainerAwareInterface $command */ $c...
php
protected function addCommands(Application $application, ContainerBuilder $container) { $commands = array_keys($container->findTaggedServiceIds('command')); foreach ($commands as $id) { /** @var \Symfony\Component\Console\Command\Command|ContainerAwareInterface $command */ $c...
[ "protected", "function", "addCommands", "(", "Application", "$", "application", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "commands", "=", "array_keys", "(", "$", "container", "->", "findTaggedServiceIds", "(", "'command'", ")", ")", ";", "foreac...
@param Application $application @param ContainerBuilder $container @return Application
[ "@param", "Application", "$application", "@param", "ContainerBuilder", "$container" ]
train
https://github.com/cocur/pli/blob/9f036160065b11998b07a5fd79a3be670f9ffa7b/src/Pli.php#L115-L128
cocur/pli
src/Pli.php
Pli.getConfigFilename
protected function getConfigFilename($configFile) { foreach ($this->configDirectories as $configDirectory) { $configPathname = sprintf('%s/%s', $configDirectory, $configFile); if (file_exists($configPathname)) { return $configPathname; } } ...
php
protected function getConfigFilename($configFile) { foreach ($this->configDirectories as $configDirectory) { $configPathname = sprintf('%s/%s', $configDirectory, $configFile); if (file_exists($configPathname)) { return $configPathname; } } ...
[ "protected", "function", "getConfigFilename", "(", "$", "configFile", ")", "{", "foreach", "(", "$", "this", "->", "configDirectories", "as", "$", "configDirectory", ")", "{", "$", "configPathname", "=", "sprintf", "(", "'%s/%s'", ",", "$", "configDirectory", ...
@param string $configFile @return null|string
[ "@param", "string", "$configFile" ]
train
https://github.com/cocur/pli/blob/9f036160065b11998b07a5fd79a3be670f9ffa7b/src/Pli.php#L135-L145
Saritasa/php-eloquent-custom
src/Utils/Query.php
Query.captureQueries
public static function captureQueries(\Closure $closure) { DB::enableQueryLog(); $closure(); $logs = DB::getQueryLog(); return array_map(function ($log) { return static::inlineBindings($log['query'], $log['bindings']); }, $logs); }
php
public static function captureQueries(\Closure $closure) { DB::enableQueryLog(); $closure(); $logs = DB::getQueryLog(); return array_map(function ($log) { return static::inlineBindings($log['query'], $log['bindings']); }, $logs); }
[ "public", "static", "function", "captureQueries", "(", "\\", "Closure", "$", "closure", ")", "{", "DB", "::", "enableQueryLog", "(", ")", ";", "$", "closure", "(", ")", ";", "$", "logs", "=", "DB", "::", "getQueryLog", "(", ")", ";", "return", "array_m...
Capture SQL queries, called via Eloquent inside argument closure @param \Closure $closure function, that contains DB invocations @return array
[ "Capture", "SQL", "queries", "called", "via", "Eloquent", "inside", "argument", "closure" ]
train
https://github.com/Saritasa/php-eloquent-custom/blob/54a2479f1d6e9cddac14dd8e473ab6a99dc6a82a/src/Utils/Query.php#L17-L25
Saritasa/php-eloquent-custom
src/Utils/Query.php
Query.plainSql
public static function plainSql($query) { $query = static::getBaseQuery($query); return self::inlineBindings($query->toSql(), $query->getBindings()); }
php
public static function plainSql($query) { $query = static::getBaseQuery($query); return self::inlineBindings($query->toSql(), $query->getBindings()); }
[ "public", "static", "function", "plainSql", "(", "$", "query", ")", "{", "$", "query", "=", "static", "::", "getBaseQuery", "(", "$", "query", ")", ";", "return", "self", "::", "inlineBindings", "(", "$", "query", "->", "toSql", "(", ")", ",", "$", "...
Present query builder as plain SQL, including inline parameter values @param QueryBuilder|EloquentBuilder $query Query buiilder @return string
[ "Present", "query", "builder", "as", "plain", "SQL", "including", "inline", "parameter", "values" ]
train
https://github.com/Saritasa/php-eloquent-custom/blob/54a2479f1d6e9cddac14dd8e473ab6a99dc6a82a/src/Utils/Query.php#L55-L59
cravler/CravlerRemoteBundle
DependencyInjection/Compiler/GlobalVariablesCompilerPass.php
GlobalVariablesCompilerPass.process
public function process(ContainerBuilder $container) { $def = $container->getDefinition('twig'); $parameters = array( CravlerRemoteExtension::CONFIG_KEY . '.app_port', ); foreach ($parameters as $key) { list($listen, $connect) = explode(':', $container->getPar...
php
public function process(ContainerBuilder $container) { $def = $container->getDefinition('twig'); $parameters = array( CravlerRemoteExtension::CONFIG_KEY . '.app_port', ); foreach ($parameters as $key) { list($listen, $connect) = explode(':', $container->getPar...
[ "public", "function", "process", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "def", "=", "$", "container", "->", "getDefinition", "(", "'twig'", ")", ";", "$", "parameters", "=", "array", "(", "CravlerRemoteExtension", "::", "CONFIG_KEY", ".", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/cravler/CravlerRemoteBundle/blob/b13e182007850063781d277ab5b0e4e69d415e2b/DependencyInjection/Compiler/GlobalVariablesCompilerPass.php#L17-L30
Xsaven/laravel-intelect-admin
src/Addons/Modules/Generators/FromModuleGenerator.php
FromModuleGenerator.generateFiles
public function generateFiles() { foreach ($this->getFiles() as $stub => $file) { $path = $this->module->getModulePath($this->getName()) . $file; if (!$this->filesystem->isDirectory($dir = dirname($path))) { $this->filesystem->makeDirectory($dir, 0775, true); ...
php
public function generateFiles() { foreach ($this->getFiles() as $stub => $file) { $path = $this->module->getModulePath($this->getName()) . $file; if (!$this->filesystem->isDirectory($dir = dirname($path))) { $this->filesystem->makeDirectory($dir, 0775, true); ...
[ "public", "function", "generateFiles", "(", ")", "{", "foreach", "(", "$", "this", "->", "getFiles", "(", ")", "as", "$", "stub", "=>", "$", "file", ")", "{", "$", "path", "=", "$", "this", "->", "module", "->", "getModulePath", "(", "$", "this", "...
Generate the files.
[ "Generate", "the", "files", "." ]
train
https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/Modules/Generators/FromModuleGenerator.php#L282-L293
Xsaven/laravel-intelect-admin
src/Addons/Modules/Generators/FromModuleGenerator.php
FromModuleGenerator.generateResources
public function generateResources() { Artisan::call('module:make-seed', [ 'name' => $this->getName(), 'module' => $this->getName(), '--master' => true, ]); Artisan::call('module:make-provider', [ 'name' => $this->getName() . 'ServiceProvider'...
php
public function generateResources() { Artisan::call('module:make-seed', [ 'name' => $this->getName(), 'module' => $this->getName(), '--master' => true, ]); Artisan::call('module:make-provider', [ 'name' => $this->getName() . 'ServiceProvider'...
[ "public", "function", "generateResources", "(", ")", "{", "Artisan", "::", "call", "(", "'module:make-seed'", ",", "[", "'name'", "=>", "$", "this", "->", "getName", "(", ")", ",", "'module'", "=>", "$", "this", "->", "getName", "(", ")", ",", "'--master...
Generate some resources.
[ "Generate", "some", "resources", "." ]
train
https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/Modules/Generators/FromModuleGenerator.php#L298-L317
Xsaven/laravel-intelect-admin
src/Addons/Modules/Generators/FromModuleGenerator.php
FromModuleGenerator.generateModuleJsonFile
private function generateModuleJsonFile() { $path = $this->module->getModulePath($this->getName()) . 'module.json'; if (!$this->filesystem->isDirectory($dir = dirname($path))) { $this->filesystem->makeDirectory($dir, 0775, true); } $this->filesystem->put($path, $this->g...
php
private function generateModuleJsonFile() { $path = $this->module->getModulePath($this->getName()) . 'module.json'; if (!$this->filesystem->isDirectory($dir = dirname($path))) { $this->filesystem->makeDirectory($dir, 0775, true); } $this->filesystem->put($path, $this->g...
[ "private", "function", "generateModuleJsonFile", "(", ")", "{", "$", "path", "=", "$", "this", "->", "module", "->", "getModulePath", "(", "$", "this", "->", "getName", "(", ")", ")", ".", "'module.json'", ";", "if", "(", "!", "$", "this", "->", "files...
Generate the module.json file
[ "Generate", "the", "module", ".", "json", "file" ]
train
https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/Modules/Generators/FromModuleGenerator.php#L376-L385
Erebot/Timer
src/Timer.php
Timer.cleanup
protected function cleanup() { if ($this->resource) { proc_terminate($this->resource); } if (is_resource($this->handle)) { fclose($this->handle); } $this->handle = null; $this->resource = null; }
php
protected function cleanup() { if ($this->resource) { proc_terminate($this->resource); } if (is_resource($this->handle)) { fclose($this->handle); } $this->handle = null; $this->resource = null; }
[ "protected", "function", "cleanup", "(", ")", "{", "if", "(", "$", "this", "->", "resource", ")", "{", "proc_terminate", "(", "$", "this", "->", "resource", ")", ";", "}", "if", "(", "is_resource", "(", "$", "this", "->", "handle", ")", ")", "{", "...
Performs cleanup duties so that no traces of this timer having ever been used remain.
[ "Performs", "cleanup", "duties", "so", "that", "no", "traces", "of", "this", "timer", "having", "ever", "been", "used", "remain", "." ]
train
https://github.com/Erebot/Timer/blob/cd04905d859221f9e216deba25693bc8906441f5/src/Timer.php#L123-L135
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.setAttribute
public function setAttribute($name, $value) { if(strlen($name) < 1) { throw new HTMLTagException("Attribute name is empty"); } $this->tag_attributes[strtolower($name)] = $value; return $this; }
php
public function setAttribute($name, $value) { if(strlen($name) < 1) { throw new HTMLTagException("Attribute name is empty"); } $this->tag_attributes[strtolower($name)] = $value; return $this; }
[ "public", "function", "setAttribute", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "strlen", "(", "$", "name", ")", "<", "1", ")", "{", "throw", "new", "HTMLTagException", "(", "\"Attribute name is empty\"", ")", ";", "}", "$", "this", "->...
Sets the attribute of this tag to the value given, a value of NULL will list the attribute with no ="value" after @param string $name @param string|null $value @return HTMLTag @throws HTMLTagException
[ "Sets", "the", "attribute", "of", "this", "tag", "to", "the", "value", "given", "a", "value", "of", "NULL", "will", "list", "the", "attribute", "with", "no", "=", "value", "after" ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L77-L87
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.getAttribute
public function getAttribute($name) { if(strlen($name) < 1) { throw new HTMLTagException("Attribute name is empty"); } if(!isset($this->tag_attributes[strtolower($name)])) { return null; } return $this->tag_attributes[strtolower($name...
php
public function getAttribute($name) { if(strlen($name) < 1) { throw new HTMLTagException("Attribute name is empty"); } if(!isset($this->tag_attributes[strtolower($name)])) { return null; } return $this->tag_attributes[strtolower($name...
[ "public", "function", "getAttribute", "(", "$", "name", ")", "{", "if", "(", "strlen", "(", "$", "name", ")", "<", "1", ")", "{", "throw", "new", "HTMLTagException", "(", "\"Attribute name is empty\"", ")", ";", "}", "if", "(", "!", "isset", "(", "$", ...
Returns the value of the given attribute @param string $name @return null|string @throws HTMLTagException
[ "Returns", "the", "value", "of", "the", "given", "attribute" ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L95-L108
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.removeAttribute
public function removeAttribute($name) { if(strlen($name) < 1) { throw new HTMLTagException("Attribute name is empty"); } unset($this->tag_attributes[strtolower($name)]); return $this; }
php
public function removeAttribute($name) { if(strlen($name) < 1) { throw new HTMLTagException("Attribute name is empty"); } unset($this->tag_attributes[strtolower($name)]); return $this; }
[ "public", "function", "removeAttribute", "(", "$", "name", ")", "{", "if", "(", "strlen", "(", "$", "name", ")", "<", "1", ")", "{", "throw", "new", "HTMLTagException", "(", "\"Attribute name is empty\"", ")", ";", "}", "unset", "(", "$", "this", "->", ...
Removes the attribute from the tag, along with its value. @param string $name @return HTMLTag @throws HTMLTagException
[ "Removes", "the", "attribute", "from", "the", "tag", "along", "with", "its", "value", "." ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L117-L127
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.hasAttribute
public function hasAttribute($name) { if(strlen($name) < 1) { throw new HTMLTagException("Attribute name is empty"); } return (isset($this->tag_attributes[strtolower($name)])) ? true : false; }
php
public function hasAttribute($name) { if(strlen($name) < 1) { throw new HTMLTagException("Attribute name is empty"); } return (isset($this->tag_attributes[strtolower($name)])) ? true : false; }
[ "public", "function", "hasAttribute", "(", "$", "name", ")", "{", "if", "(", "strlen", "(", "$", "name", ")", "<", "1", ")", "{", "throw", "new", "HTMLTagException", "(", "\"Attribute name is empty\"", ")", ";", "}", "return", "(", "isset", "(", "$", "...
Returns true/false depending on if the attribute name exists. @param string $name @return bool @throws HTMLTagException
[ "Returns", "true", "/", "false", "depending", "on", "if", "the", "attribute", "name", "exists", "." ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L135-L143
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.addClass
public function addClass($className) { if(strlen($className) < 1) { throw new HTMLTagException("Class name is empty"); } if(!$this->hasClass($className)) { $classes = $this->getClasses() . " " . $this->removeMultipleSpaces(trim($className)); ...
php
public function addClass($className) { if(strlen($className) < 1) { throw new HTMLTagException("Class name is empty"); } if(!$this->hasClass($className)) { $classes = $this->getClasses() . " " . $this->removeMultipleSpaces(trim($className)); ...
[ "public", "function", "addClass", "(", "$", "className", ")", "{", "if", "(", "strlen", "(", "$", "className", ")", "<", "1", ")", "{", "throw", "new", "HTMLTagException", "(", "\"Class name is empty\"", ")", ";", "}", "if", "(", "!", "$", "this", "->"...
Add a class name to the class attribute, this won't add duplicates. @param string $className @return HTMLTag @throws HTMLTagException
[ "Add", "a", "class", "name", "to", "the", "class", "attribute", "this", "won", "t", "add", "duplicates", "." ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L163-L177
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.removeClass
public function removeClass($className) { if(strlen($className) < 1) { throw new HTMLTagException("Class name is empty"); } $classes = explode(" ", $this->getClasses()); $this->clearClasses(); foreach($classes as $class) { if(strtolower($clas...
php
public function removeClass($className) { if(strlen($className) < 1) { throw new HTMLTagException("Class name is empty"); } $classes = explode(" ", $this->getClasses()); $this->clearClasses(); foreach($classes as $class) { if(strtolower($clas...
[ "public", "function", "removeClass", "(", "$", "className", ")", "{", "if", "(", "strlen", "(", "$", "className", ")", "<", "1", ")", "{", "throw", "new", "HTMLTagException", "(", "\"Class name is empty\"", ")", ";", "}", "$", "classes", "=", "explode", ...
Removes the specified class name. @param string $className @return HTMLTag @throws HTMLTagException
[ "Removes", "the", "specified", "class", "name", "." ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L196-L214
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.hasClass
public function hasClass($className) { if(strlen($className) < 1) { throw new HTMLTagException("Class name is empty"); } if($this->hasAttribute("class")) { $classes = $this->getClasses(); foreach(explode(" ",$classes) as $class) { ...
php
public function hasClass($className) { if(strlen($className) < 1) { throw new HTMLTagException("Class name is empty"); } if($this->hasAttribute("class")) { $classes = $this->getClasses(); foreach(explode(" ",$classes) as $class) { ...
[ "public", "function", "hasClass", "(", "$", "className", ")", "{", "if", "(", "strlen", "(", "$", "className", ")", "<", "1", ")", "{", "throw", "new", "HTMLTagException", "(", "\"Class name is empty\"", ")", ";", "}", "if", "(", "$", "this", "->", "ha...
Checks to see if the given class name is inside of the class attribute @param string $className @return bool @throws HTMLTagException
[ "Checks", "to", "see", "if", "the", "given", "class", "name", "is", "inside", "of", "the", "class", "attribute" ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L222-L242
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.getClasses
public function getClasses() { $classes = $this->getAttribute("class"); return (strlen($classes) > 0) ? trim($this->removeMultipleSpaces($classes)) : ""; }
php
public function getClasses() { $classes = $this->getAttribute("class"); return (strlen($classes) > 0) ? trim($this->removeMultipleSpaces($classes)) : ""; }
[ "public", "function", "getClasses", "(", ")", "{", "$", "classes", "=", "$", "this", "->", "getAttribute", "(", "\"class\"", ")", ";", "return", "(", "strlen", "(", "$", "classes", ")", ">", "0", ")", "?", "trim", "(", "$", "this", "->", "removeMulti...
Returns a space separated string of classes belonging to the tag. @return string @throws HTMLTagException
[ "Returns", "a", "space", "separated", "string", "of", "classes", "belonging", "to", "the", "tag", "." ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L249-L253
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.appendContent
public function appendContent($content) { if(!is_string($content) && !($content instanceof self)) { throw new HTMLTagException("Only HTMLTags and strings are allowed as content."); } $this->tag_content[] = $content; $this->setClosingTag(true); return $t...
php
public function appendContent($content) { if(!is_string($content) && !($content instanceof self)) { throw new HTMLTagException("Only HTMLTags and strings are allowed as content."); } $this->tag_content[] = $content; $this->setClosingTag(true); return $t...
[ "public", "function", "appendContent", "(", "$", "content", ")", "{", "if", "(", "!", "is_string", "(", "$", "content", ")", "&&", "!", "(", "$", "content", "instanceof", "self", ")", ")", "{", "throw", "new", "HTMLTagException", "(", "\"Only HTMLTags and ...
Adds content inside of a tag and places it in the last slot, NOTE: performing this will automatically add a closing tag. @param self|string $content @return HTMLTag @throws HTMLTagException
[ "Adds", "content", "inside", "of", "a", "tag", "and", "places", "it", "in", "the", "last", "slot", "NOTE", ":", "performing", "this", "will", "automatically", "add", "a", "closing", "tag", "." ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L262-L274
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.prependContent
public function prependContent($content) { if(!is_string($content) && !($content instanceof self)) { throw new HTMLTagException("Only HTMLTags and strings are allowed as content."); } array_unshift($this->tag_content,$content); $this->setClosingTag(true); ...
php
public function prependContent($content) { if(!is_string($content) && !($content instanceof self)) { throw new HTMLTagException("Only HTMLTags and strings are allowed as content."); } array_unshift($this->tag_content,$content); $this->setClosingTag(true); ...
[ "public", "function", "prependContent", "(", "$", "content", ")", "{", "if", "(", "!", "is_string", "(", "$", "content", ")", "&&", "!", "(", "$", "content", "instanceof", "self", ")", ")", "{", "throw", "new", "HTMLTagException", "(", "\"Only HTMLTags and...
Adds content inside of a tag and places it in the first slot, NOTE: performing this will automatically add a closing tag. @param self|string $content @return HTMLTag @throws HTMLTagException
[ "Adds", "content", "inside", "of", "a", "tag", "and", "places", "it", "in", "the", "first", "slot", "NOTE", ":", "performing", "this", "will", "automatically", "add", "a", "closing", "tag", "." ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L283-L295
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.getFormattedAttributes
public function getFormattedAttributes() { $rtn = ""; foreach($this->listAttributes() as $name => $value) { $rtn .= sprintf(" %s=\"%s\"",htmlentities($name),htmlentities($value)); } return $rtn; }
php
public function getFormattedAttributes() { $rtn = ""; foreach($this->listAttributes() as $name => $value) { $rtn .= sprintf(" %s=\"%s\"",htmlentities($name),htmlentities($value)); } return $rtn; }
[ "public", "function", "getFormattedAttributes", "(", ")", "{", "$", "rtn", "=", "\"\"", ";", "foreach", "(", "$", "this", "->", "listAttributes", "(", ")", "as", "$", "name", "=>", "$", "value", ")", "{", "$", "rtn", ".=", "sprintf", "(", "\" %s=\\\"%s...
Format and return attributes in a name="value" format as it should appear in an HTML tag. @return string
[ "Format", "and", "return", "attributes", "in", "a", "name", "=", "value", "format", "as", "it", "should", "appear", "in", "an", "HTML", "tag", "." ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L380-L388
Gercoli/HTMLTags
src/HTMLTag.php
HTMLTag.setTagPrefix
public function setTagPrefix($prefix) { if(!is_string($prefix) && $prefix !== null) { throw new HTMLTagException("The tag prefix must be a string or null."); } $this->tag_prefix_previous = $this->getTagPrefix(); $this->tag_prefix = $prefix; return $this;...
php
public function setTagPrefix($prefix) { if(!is_string($prefix) && $prefix !== null) { throw new HTMLTagException("The tag prefix must be a string or null."); } $this->tag_prefix_previous = $this->getTagPrefix(); $this->tag_prefix = $prefix; return $this;...
[ "public", "function", "setTagPrefix", "(", "$", "prefix", ")", "{", "if", "(", "!", "is_string", "(", "$", "prefix", ")", "&&", "$", "prefix", "!==", "null", ")", "{", "throw", "new", "HTMLTagException", "(", "\"The tag prefix must be a string or null.\"", ")"...
Sets the string that should precede a tag @param string|null $prefix @return HTMLTag @throws HTMLTagException
[ "Sets", "the", "string", "that", "should", "precede", "a", "tag" ]
train
https://github.com/Gercoli/HTMLTags/blob/795c4c1bab405d1387406a4da0e2884f4314b2ce/src/HTMLTag.php#L396-L408
benjamindulau/AnoDataGrid
src/Ano/DataGrid/DataGrid.php
DataGrid.addColumn
public function addColumn(ColumnInterface $column) { $column->setGrid($this); $this->columns[$column->getName()] = $column; return $this; }
php
public function addColumn(ColumnInterface $column) { $column->setGrid($this); $this->columns[$column->getName()] = $column; return $this; }
[ "public", "function", "addColumn", "(", "ColumnInterface", "$", "column", ")", "{", "$", "column", "->", "setGrid", "(", "$", "this", ")", ";", "$", "this", "->", "columns", "[", "$", "column", "->", "getName", "(", ")", "]", "=", "$", "column", ";",...
{@inheritDoc}
[ "{" ]
train
https://github.com/benjamindulau/AnoDataGrid/blob/69b31803929b04e9d6e807bb2213b9b3477d0367/src/Ano/DataGrid/DataGrid.php#L30-L36
benjamindulau/AnoDataGrid
src/Ano/DataGrid/DataGrid.php
DataGrid.getColumn
public function getColumn($name) { if (!$this->hasColumn($name)) { throw new DataGridException(sprintf('The column "%s" does not exist', $name)); } return $this->columns[$name]; }
php
public function getColumn($name) { if (!$this->hasColumn($name)) { throw new DataGridException(sprintf('The column "%s" does not exist', $name)); } return $this->columns[$name]; }
[ "public", "function", "getColumn", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "hasColumn", "(", "$", "name", ")", ")", "{", "throw", "new", "DataGridException", "(", "sprintf", "(", "'The column \"%s\" does not exist'", ",", "$", "name"...
{@inheritDoc}
[ "{" ]
train
https://github.com/benjamindulau/AnoDataGrid/blob/69b31803929b04e9d6e807bb2213b9b3477d0367/src/Ano/DataGrid/DataGrid.php#L41-L48
benjamindulau/AnoDataGrid
src/Ano/DataGrid/DataGrid.php
DataGrid.setData
public function setData($data) { if (!is_object($data) && !is_array($data)) { throw new UnexpectedTypeException($data, 'array or object'); } $this->data = $data; // $this->prepareRows(); }
php
public function setData($data) { if (!is_object($data) && !is_array($data)) { throw new UnexpectedTypeException($data, 'array or object'); } $this->data = $data; // $this->prepareRows(); }
[ "public", "function", "setData", "(", "$", "data", ")", "{", "if", "(", "!", "is_object", "(", "$", "data", ")", "&&", "!", "is_array", "(", "$", "data", ")", ")", "{", "throw", "new", "UnexpectedTypeException", "(", "$", "data", ",", "'array or object...
{@inheritDoc}
[ "{" ]
train
https://github.com/benjamindulau/AnoDataGrid/blob/69b31803929b04e9d6e807bb2213b9b3477d0367/src/Ano/DataGrid/DataGrid.php#L72-L80
benjamindulau/AnoDataGrid
src/Ano/DataGrid/DataGrid.php
DataGrid.createView
public function createView() { $view = new DataGridView(); foreach($this->columns as $column) { $columnView = $column->createView($view); $view->addColumn($column->getName(), $columnView); } $view ->set('dataGrid', $view) -...
php
public function createView() { $view = new DataGridView(); foreach($this->columns as $column) { $columnView = $column->createView($view); $view->addColumn($column->getName(), $columnView); } $view ->set('dataGrid', $view) -...
[ "public", "function", "createView", "(", ")", "{", "$", "view", "=", "new", "DataGridView", "(", ")", ";", "foreach", "(", "$", "this", "->", "columns", "as", "$", "column", ")", "{", "$", "columnView", "=", "$", "column", "->", "createView", "(", "$...
{@inheritDoc}
[ "{" ]
train
https://github.com/benjamindulau/AnoDataGrid/blob/69b31803929b04e9d6e807bb2213b9b3477d0367/src/Ano/DataGrid/DataGrid.php#L93-L108
wasinger/adaptimage
src/ImageResizer.php
ImageResizer.resize
public function resize(ImageResizeDefinition $image_resize_definition, ImageFileInfo $image, $really_do_it = false, $pre_transformation = null) { if ($image->getOrientation() != 1) { if ($pre_transformation == null) { $pre_transformation = new FilterChain($this->imagine); ...
php
public function resize(ImageResizeDefinition $image_resize_definition, ImageFileInfo $image, $really_do_it = false, $pre_transformation = null) { if ($image->getOrientation() != 1) { if ($pre_transformation == null) { $pre_transformation = new FilterChain($this->imagine); ...
[ "public", "function", "resize", "(", "ImageResizeDefinition", "$", "image_resize_definition", ",", "ImageFileInfo", "$", "image", ",", "$", "really_do_it", "=", "false", ",", "$", "pre_transformation", "=", "null", ")", "{", "if", "(", "$", "image", "->", "get...
Apply transformation to image. Return an ImageFileInfo object with information about the resulting file. If a cached version of this image/transformation combination already exists, the cached version will be returned. @param ImageResizeDefinition $image_resize_definition @param ImageFileInfo $image @param bool $reall...
[ "Apply", "transformation", "to", "image", ".", "Return", "an", "ImageFileInfo", "object", "with", "information", "about", "the", "resulting", "file", ".", "If", "a", "cached", "version", "of", "this", "image", "/", "transformation", "combination", "already", "ex...
train
https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ImageResizer.php#L53-L106
chalasr/RCHCapistranoBundle
Generator/DeployGenerator.php
DeployGenerator.write
public function write() { foreach ($this->parameters as $prop => $value) { $placeHolders[] = sprintf('<%s>', $prop); $replacements[] = $value; } $config = str_replace($placeHolders, $replacements, self::$configTemplate); $config = sprintf('%s%s%s', self::$def...
php
public function write() { foreach ($this->parameters as $prop => $value) { $placeHolders[] = sprintf('<%s>', $prop); $replacements[] = $value; } $config = str_replace($placeHolders, $replacements, self::$configTemplate); $config = sprintf('%s%s%s', self::$def...
[ "public", "function", "write", "(", ")", "{", "foreach", "(", "$", "this", "->", "parameters", "as", "$", "prop", "=>", "$", "value", ")", "{", "$", "placeHolders", "[", "]", "=", "sprintf", "(", "'<%s>'", ",", "$", "prop", ")", ";", "$", "replacem...
Writes deployment file.
[ "Writes", "deployment", "file", "." ]
train
https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Generator/DeployGenerator.php#L111-L130
Innmind/Socket
src/Server/Unix.php
Unix.recoverable
public static function recoverable(Address $path): self { try { return new self($path); } catch (FailedToOpenSocket $e) { @unlink((string) $path); return new self($path); } }
php
public static function recoverable(Address $path): self { try { return new self($path); } catch (FailedToOpenSocket $e) { @unlink((string) $path); return new self($path); } }
[ "public", "static", "function", "recoverable", "(", "Address", "$", "path", ")", ":", "self", "{", "try", "{", "return", "new", "self", "(", "$", "path", ")", ";", "}", "catch", "(", "FailedToOpenSocket", "$", "e", ")", "{", "@", "unlink", "(", "(", ...
On open failure it will try to delete existing socket file the ntry to reopen the socket connection
[ "On", "open", "failure", "it", "will", "try", "to", "delete", "existing", "socket", "file", "the", "ntry", "to", "reopen", "the", "socket", "connection" ]
train
https://github.com/Innmind/Socket/blob/4d05c841d85ccbde7bfdaeafc6930970923bab84/src/Server/Unix.php#L49-L58
romm/configuration_object
Classes/Validation/Validator/ClassExistsValidator.php
ClassExistsValidator.isValid
public function isValid($value) { if (false === Core::get()->classExists($value)) { $errorMessage = $this->translateErrorMessage('validator.class_exists.not_valid', 'configuration_object', [$value]); $this->addError($errorMessage, 1457610460); } }
php
public function isValid($value) { if (false === Core::get()->classExists($value)) { $errorMessage = $this->translateErrorMessage('validator.class_exists.not_valid', 'configuration_object', [$value]); $this->addError($errorMessage, 1457610460); } }
[ "public", "function", "isValid", "(", "$", "value", ")", "{", "if", "(", "false", "===", "Core", "::", "get", "(", ")", "->", "classExists", "(", "$", "value", ")", ")", "{", "$", "errorMessage", "=", "$", "this", "->", "translateErrorMessage", "(", ...
Checks if the value is an existing class. @param mixed $value The value that should be validated.
[ "Checks", "if", "the", "value", "is", "an", "existing", "class", "." ]
train
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Validation/Validator/ClassExistsValidator.php#L27-L33
phossa/phossa-di
src/Phossa/Di/Container.php
Container.get
public function get($id) { if ($this->has($id)) { // prepare constructor arguments and scope list($args, $scope, $sid) = $this->prepareArguments( $id, func_get_args() ); // try get from pool first if (empty($args) ...
php
public function get($id) { if ($this->has($id)) { // prepare constructor arguments and scope list($args, $scope, $sid) = $this->prepareArguments( $id, func_get_args() ); // try get from pool first if (empty($args) ...
[ "public", "function", "get", "(", "$", "id", ")", "{", "if", "(", "$", "this", "->", "has", "(", "$", "id", ")", ")", "{", "// prepare constructor arguments and scope", "list", "(", "$", "args", ",", "$", "scope", ",", "$", "sid", ")", "=", "$", "t...
Accept second parameter $constructorArguments (array) Accept third parameter $inThisScope (string) {@inheritDoc}
[ "Accept", "second", "parameter", "$constructorArguments", "(", "array", ")", "Accept", "third", "parameter", "$inThisScope", "(", "string", ")" ]
train
https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Container.php#L93-L132
phossa/phossa-di
src/Phossa/Di/Container.php
Container.has
public function has($id) { // second argument $withAutowiring = func_num_args() > 1 ? (bool) func_get_arg(1) : $this->autowiring; // return FALSE if $id not a string return is_string($id) && ( // found in definitions ? isset($this->services[$id]) ...
php
public function has($id) { // second argument $withAutowiring = func_num_args() > 1 ? (bool) func_get_arg(1) : $this->autowiring; // return FALSE if $id not a string return is_string($id) && ( // found in definitions ? isset($this->services[$id]) ...
[ "public", "function", "has", "(", "$", "id", ")", "{", "// second argument", "$", "withAutowiring", "=", "func_num_args", "(", ")", ">", "1", "?", "(", "bool", ")", "func_get_arg", "(", "1", ")", ":", "$", "this", "->", "autowiring", ";", "// return FALS...
Accept second parameter $withAutowiring (bool) Non-string $id will return FALSE @inheritDoc
[ "Accept", "second", "parameter", "$withAutowiring", "(", "bool", ")" ]
train
https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Container.php#L141-L158
phossa/phossa-di
src/Phossa/Di/Container.php
Container.prepareArguments
protected function prepareArguments(/*# string */ $id, array $arguments) { $args = isset($arguments[1]) ? (array) $arguments[1] : []; $scope = isset($arguments[2]) ? (string) $arguments[2] : $this->getScope($id); // scope === '@serviceId@' ? if (isset($this->circular[$s...
php
protected function prepareArguments(/*# string */ $id, array $arguments) { $args = isset($arguments[1]) ? (array) $arguments[1] : []; $scope = isset($arguments[2]) ? (string) $arguments[2] : $this->getScope($id); // scope === '@serviceId@' ? if (isset($this->circular[$s...
[ "protected", "function", "prepareArguments", "(", "/*# string */", "$", "id", ",", "array", "$", "arguments", ")", "{", "$", "args", "=", "isset", "(", "$", "arguments", "[", "1", "]", ")", "?", "(", "array", ")", "$", "arguments", "[", "1", "]", ":"...
Process arguments for get() @param string $id service id @param array $arguments of get() @return array @access protected
[ "Process", "arguments", "for", "get", "()" ]
train
https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Container.php#L186-L198
phossa/phossa-di
src/Phossa/Di/Container.php
Container.serviceFromDefinition
protected function serviceFromDefinition($id, $args) { // create the service object $service = $this->createServiceObject($id, $args); // run predefined methods if any $this->runDefinedMethods($id, $service); // decorate the service if DecorateExtension loaded $this...
php
protected function serviceFromDefinition($id, $args) { // create the service object $service = $this->createServiceObject($id, $args); // run predefined methods if any $this->runDefinedMethods($id, $service); // decorate the service if DecorateExtension loaded $this...
[ "protected", "function", "serviceFromDefinition", "(", "$", "id", ",", "$", "args", ")", "{", "// create the service object", "$", "service", "=", "$", "this", "->", "createServiceObject", "(", "$", "id", ",", "$", "args", ")", ";", "// run predefined methods if...
Check circular, create service and decorate service @param string $id service id @param array $args constructor arguments @return object @access protected
[ "Check", "circular", "create", "service", "and", "decorate", "service" ]
train
https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Container.php#L208-L220
phossa/phossa-di
src/Phossa/Di/Container.php
Container.checkCircularMark
protected function checkCircularMark(/*# string */ $id) { // reference id "@$id@" of current service object $refId = $this->getServiceReferenceId($id); // circular detected if (isset($this->circular[$refId])) { throw new LogicException( Message::get(Messa...
php
protected function checkCircularMark(/*# string */ $id) { // reference id "@$id@" of current service object $refId = $this->getServiceReferenceId($id); // circular detected if (isset($this->circular[$refId])) { throw new LogicException( Message::get(Messa...
[ "protected", "function", "checkCircularMark", "(", "/*# string */", "$", "id", ")", "{", "// reference id \"@$id@\" of current service object", "$", "refId", "=", "$", "this", "->", "getServiceReferenceId", "(", "$", "id", ")", ";", "// circular detected", "if", "(", ...
Check circular for get() @param string $id service id @return void @throws LogicException if circular found @access protected
[ "Check", "circular", "for", "get", "()" ]
train
https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Container.php#L230-L246
sndsgd/http
src/http/request/Client.php
Client.getIp
public function getIp(): string { if ($this->ip === null) { foreach (["HTTP_X_FORWARDED_FOR", "X_FORWARDED_FOR"] as $key) { $proxyIpList = $this->environment[$key] ?? ""; if ($proxyIpList) { $commaPosition = strpos($proxyIpList, ","); ...
php
public function getIp(): string { if ($this->ip === null) { foreach (["HTTP_X_FORWARDED_FOR", "X_FORWARDED_FOR"] as $key) { $proxyIpList = $this->environment[$key] ?? ""; if ($proxyIpList) { $commaPosition = strpos($proxyIpList, ","); ...
[ "public", "function", "getIp", "(", ")", ":", "string", "{", "if", "(", "$", "this", "->", "ip", "===", "null", ")", "{", "foreach", "(", "[", "\"HTTP_X_FORWARDED_FOR\"", ",", "\"X_FORWARDED_FOR\"", "]", "as", "$", "key", ")", "{", "$", "proxyIpList", ...
Retrieve the client ip address @return string
[ "Retrieve", "the", "client", "ip", "address" ]
train
https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/request/Client.php#L42-L60
CalderaWP/caldera-interop
src/IteratableCollection.php
IteratableCollection.count
public function count(): int { $key = $this->storeKey(); if (! $this->isCountable($this->$key)) { return 0; } return count($this->$key); }
php
public function count(): int { $key = $this->storeKey(); if (! $this->isCountable($this->$key)) { return 0; } return count($this->$key); }
[ "public", "function", "count", "(", ")", ":", "int", "{", "$", "key", "=", "$", "this", "->", "storeKey", "(", ")", ";", "if", "(", "!", "$", "this", "->", "isCountable", "(", "$", "this", "->", "$", "key", ")", ")", "{", "return", "0", ";", ...
Get size of collection @return int
[ "Get", "size", "of", "collection" ]
train
https://github.com/CalderaWP/caldera-interop/blob/d25c4bc930200b314fbd42d084080b5d85261c94/src/IteratableCollection.php#L38-L45
CalderaWP/caldera-interop
src/IteratableCollection.php
IteratableCollection.increase
public function increase(int $size) { $count = $this->count(); if ($size > $this->count()) { $add = $size - $this->count(); $key = $this->storeKey(); for ($i = 0; $i < $add; $i++) { $this->addEmpty(); } } return $this; }
php
public function increase(int $size) { $count = $this->count(); if ($size > $this->count()) { $add = $size - $this->count(); $key = $this->storeKey(); for ($i = 0; $i < $add; $i++) { $this->addEmpty(); } } return $this; }
[ "public", "function", "increase", "(", "int", "$", "size", ")", "{", "$", "count", "=", "$", "this", "->", "count", "(", ")", ";", "if", "(", "$", "size", ">", "$", "this", "->", "count", "(", ")", ")", "{", "$", "add", "=", "$", "size", "-",...
Increase size of collection @param int $size @return $this
[ "Increase", "size", "of", "collection" ]
train
https://github.com/CalderaWP/caldera-interop/blob/d25c4bc930200b314fbd42d084080b5d85261c94/src/IteratableCollection.php#L76-L88
artscorestudio/user-bundle
Repository/UserRepository.php
UserRepository.findByUsernameContains
public function findByUsernameContains($searched_term) { $qb = $this->createQueryBuilder('u'); $qb instanceof QueryBuilder; $qb->add('where', $qb->expr()->like('u.username', $qb->expr()->lower(':searched_term'))) ->setParameter('searched_term', $searched_term . '%'); re...
php
public function findByUsernameContains($searched_term) { $qb = $this->createQueryBuilder('u'); $qb instanceof QueryBuilder; $qb->add('where', $qb->expr()->like('u.username', $qb->expr()->lower(':searched_term'))) ->setParameter('searched_term', $searched_term . '%'); re...
[ "public", "function", "findByUsernameContains", "(", "$", "searched_term", ")", "{", "$", "qb", "=", "$", "this", "->", "createQueryBuilder", "(", "'u'", ")", ";", "$", "qb", "instanceof", "QueryBuilder", ";", "$", "qb", "->", "add", "(", "'where'", ",", ...
Find user by username @param string $searched_term
[ "Find", "user", "by", "username" ]
train
https://github.com/artscorestudio/user-bundle/blob/83e660d1073e1cbfde6eed0b528b8c99e78a2e53/Repository/UserRepository.php#L28-L37
zhaoxianfang/tools
src/Symfony/Component/DependencyInjection/Container.php
Container.set
public function set($id, $service) { // Runs the internal initializer; used by the dumped container to include always-needed files if (isset($this->privates['service_container']) && $this->privates['service_container'] instanceof \Closure) { $initialize = $this->privates['service_contain...
php
public function set($id, $service) { // Runs the internal initializer; used by the dumped container to include always-needed files if (isset($this->privates['service_container']) && $this->privates['service_container'] instanceof \Closure) { $initialize = $this->privates['service_contain...
[ "public", "function", "set", "(", "$", "id", ",", "$", "service", ")", "{", "// Runs the internal initializer; used by the dumped container to include always-needed files", "if", "(", "isset", "(", "$", "this", "->", "privates", "[", "'service_container'", "]", ")", "...
Sets a service. Setting a service to null resets the service: has() returns false and get() behaves in the same way as if the service was never created. @param string $id The service identifier @param object $service The service instance
[ "Sets", "a", "service", "." ]
train
https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Container.php#L168-L211
zhaoxianfang/tools
src/Symfony/Component/DependencyInjection/Container.php
Container.has
public function has($id) { for ($i = 2;;) { if (isset($this->privates[$id])) { @trigger_error(sprintf('The "%s" service is private, checking for its existence is deprecated since Symfony 3.2 and will fail in 4.0.', $id), E_USER_DEPRECATED); } if (isset($th...
php
public function has($id) { for ($i = 2;;) { if (isset($this->privates[$id])) { @trigger_error(sprintf('The "%s" service is private, checking for its existence is deprecated since Symfony 3.2 and will fail in 4.0.', $id), E_USER_DEPRECATED); } if (isset($th...
[ "public", "function", "has", "(", "$", "id", ")", "{", "for", "(", "$", "i", "=", "2", ";", ";", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "privates", "[", "$", "id", "]", ")", ")", "{", "@", "trigger_error", "(", "sprintf", "(", ...
Returns true if the given service is defined. @param string $id The service identifier @return bool true if the service is defined, false otherwise
[ "Returns", "true", "if", "the", "given", "service", "is", "defined", "." ]
train
https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Container.php#L220-L255
zhaoxianfang/tools
src/Symfony/Component/DependencyInjection/Container.php
Container.get
public function get($id, $invalidBehavior = /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1) { // Attempt to retrieve the service by checking first aliases then // available services. Service IDs are case insensitive, however since // this method can be called thousands of times during a reques...
php
public function get($id, $invalidBehavior = /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1) { // Attempt to retrieve the service by checking first aliases then // available services. Service IDs are case insensitive, however since // this method can be called thousands of times during a reques...
[ "public", "function", "get", "(", "$", "id", ",", "$", "invalidBehavior", "=", "/* self::EXCEPTION_ON_INVALID_REFERENCE */", "1", ")", "{", "// Attempt to retrieve the service by checking first aliases then", "// available services. Service IDs are case insensitive, however since", "...
Gets a service. If a service is defined both through a set() method and with a get{$id}Service() method, the former has always precedence. @param string $id The service identifier @param int $invalidBehavior The behavior when the service does not exist @return object The associated service @throws S...
[ "Gets", "a", "service", "." ]
train
https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Container.php#L274-L350
zhaoxianfang/tools
src/Symfony/Component/DependencyInjection/Container.php
Container.initialized
public function initialized($id) { $id = $this->normalizeId($id); if (isset($this->privates[$id])) { @trigger_error(sprintf('Checking for the initialization of the "%s" private service is deprecated since Symfony 3.4 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECA...
php
public function initialized($id) { $id = $this->normalizeId($id); if (isset($this->privates[$id])) { @trigger_error(sprintf('Checking for the initialization of the "%s" private service is deprecated since Symfony 3.4 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECA...
[ "public", "function", "initialized", "(", "$", "id", ")", "{", "$", "id", "=", "$", "this", "->", "normalizeId", "(", "$", "id", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "privates", "[", "$", "id", "]", ")", ")", "{", "@", "trigger...
Returns true if the given service has actually been initialized. @param string $id The service identifier @return bool true if service has already been initialized, false otherwise
[ "Returns", "true", "if", "the", "given", "service", "has", "actually", "been", "initialized", "." ]
train
https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Container.php#L359-L376
zhaoxianfang/tools
src/Symfony/Component/DependencyInjection/Container.php
Container.getServiceIds
public function getServiceIds() { $ids = array(); if (!$this->methodMap && !$this instanceof ContainerBuilder && __CLASS__ !== static::class) { // We only check the convention-based factory in a compiled container (i.e. a child class other than a ContainerBuilder, // and onl...
php
public function getServiceIds() { $ids = array(); if (!$this->methodMap && !$this instanceof ContainerBuilder && __CLASS__ !== static::class) { // We only check the convention-based factory in a compiled container (i.e. a child class other than a ContainerBuilder, // and onl...
[ "public", "function", "getServiceIds", "(", ")", "{", "$", "ids", "=", "array", "(", ")", ";", "if", "(", "!", "$", "this", "->", "methodMap", "&&", "!", "$", "this", "instanceof", "ContainerBuilder", "&&", "__CLASS__", "!==", "static", "::", "class", ...
Gets all service ids. @return array An array of all defined service ids
[ "Gets", "all", "service", "ids", "." ]
train
https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Container.php#L391-L409
zhaoxianfang/tools
src/Symfony/Component/DependencyInjection/Container.php
Container.getEnv
protected function getEnv($name) { if (isset($this->resolving[$envName = "env($name)"])) { throw new ParameterCircularReferenceException(array_keys($this->resolving)); } if (isset($this->envCache[$name]) || array_key_exists($name, $this->envCache)) { return $this->env...
php
protected function getEnv($name) { if (isset($this->resolving[$envName = "env($name)"])) { throw new ParameterCircularReferenceException(array_keys($this->resolving)); } if (isset($this->envCache[$name]) || array_key_exists($name, $this->envCache)) { return $this->env...
[ "protected", "function", "getEnv", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "resolving", "[", "$", "envName", "=", "\"env($name)\"", "]", ")", ")", "{", "throw", "new", "ParameterCircularReferenceException", "(", "array_keys", ...
Fetches a variable from the environment. @param string $name The name of the environment variable @return mixed The value to use for the provided environment variable name @throws EnvNotFoundException When the environment variable is not found and has no default value
[ "Fetches", "a", "variable", "from", "the", "environment", "." ]
train
https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Container.php#L464-L497
zhaoxianfang/tools
src/Symfony/Component/DependencyInjection/Container.php
Container.normalizeId
public function normalizeId($id) { if (!\is_string($id)) { $id = (string) $id; } if (isset($this->normalizedIds[$normalizedId = strtolower($id)])) { $normalizedId = $this->normalizedIds[$normalizedId]; if ($id !== $normalizedId) { @trigger_...
php
public function normalizeId($id) { if (!\is_string($id)) { $id = (string) $id; } if (isset($this->normalizedIds[$normalizedId = strtolower($id)])) { $normalizedId = $this->normalizedIds[$normalizedId]; if ($id !== $normalizedId) { @trigger_...
[ "public", "function", "normalizeId", "(", "$", "id", ")", "{", "if", "(", "!", "\\", "is_string", "(", "$", "id", ")", ")", "{", "$", "id", "=", "(", "string", ")", "$", "id", ";", "}", "if", "(", "isset", "(", "$", "this", "->", "normalizedIds...
Returns the case sensitive id used at registration time. @param string $id @return string @internal
[ "Returns", "the", "case", "sensitive", "id", "used", "at", "registration", "time", "." ]
train
https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Container.php#L508-L523
danielgp/common-lib
source/CommonCode.php
CommonCode.getContentFromUrlThroughCurl
public function getContentFromUrlThroughCurl($fullURL, $features = null) { if (!function_exists('curl_init')) { $aReturn = ['info' => $this->lclMsgCmn('i18n_Error_ExtensionNotLoaded'), 'response' => '']; return $this->setArrayToJson($aReturn); } if (!filter_var($fullU...
php
public function getContentFromUrlThroughCurl($fullURL, $features = null) { if (!function_exists('curl_init')) { $aReturn = ['info' => $this->lclMsgCmn('i18n_Error_ExtensionNotLoaded'), 'response' => '']; return $this->setArrayToJson($aReturn); } if (!filter_var($fullU...
[ "public", "function", "getContentFromUrlThroughCurl", "(", "$", "fullURL", ",", "$", "features", "=", "null", ")", "{", "if", "(", "!", "function_exists", "(", "'curl_init'", ")", ")", "{", "$", "aReturn", "=", "[", "'info'", "=>", "$", "this", "->", "lc...
Reads the content of a remote file through CURL extension @param string $fullURL @param array $features @return string
[ "Reads", "the", "content", "of", "a", "remote", "file", "through", "CURL", "extension" ]
train
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonCode.php#L49-L61
danielgp/common-lib
source/CommonCode.php
CommonCode.getContentFromUrlThroughCurlAsArrayIfJson
public function getContentFromUrlThroughCurlAsArrayIfJson($fullURL, $features = null) { $result = $this->setJsonToArray($this->getContentFromUrlThroughCurl($fullURL, $features)); if (is_array($result['info'])) { ksort($result['info']); } if (is_array($result['response']))...
php
public function getContentFromUrlThroughCurlAsArrayIfJson($fullURL, $features = null) { $result = $this->setJsonToArray($this->getContentFromUrlThroughCurl($fullURL, $features)); if (is_array($result['info'])) { ksort($result['info']); } if (is_array($result['response']))...
[ "public", "function", "getContentFromUrlThroughCurlAsArrayIfJson", "(", "$", "fullURL", ",", "$", "features", "=", "null", ")", "{", "$", "result", "=", "$", "this", "->", "setJsonToArray", "(", "$", "this", "->", "getContentFromUrlThroughCurl", "(", "$", "fullU...
Reads the content of a remote file through CURL extension @param string $fullURL @param array $features @return array
[ "Reads", "the", "content", "of", "a", "remote", "file", "through", "CURL", "extension" ]
train
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonCode.php#L70-L80
danielgp/common-lib
source/CommonCode.php
CommonCode.getFileDetails
public function getFileDetails($fileGiven) { if (!file_exists($fileGiven)) { return ['error' => sprintf($this->lclMsgCmn('i18n_Error_GivenFileDoesNotExist'), $fileGiven)]; } return $this->getFileDetailsRaw($fileGiven); }
php
public function getFileDetails($fileGiven) { if (!file_exists($fileGiven)) { return ['error' => sprintf($this->lclMsgCmn('i18n_Error_GivenFileDoesNotExist'), $fileGiven)]; } return $this->getFileDetailsRaw($fileGiven); }
[ "public", "function", "getFileDetails", "(", "$", "fileGiven", ")", "{", "if", "(", "!", "file_exists", "(", "$", "fileGiven", ")", ")", "{", "return", "[", "'error'", "=>", "sprintf", "(", "$", "this", "->", "lclMsgCmn", "(", "'i18n_Error_GivenFileDoesNotEx...
returns the details about Communicator (current) file @param string $fileGiven @return array
[ "returns", "the", "details", "about", "Communicator", "(", "current", ")", "file" ]
train
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonCode.php#L129-L135
danielgp/common-lib
source/CommonCode.php
CommonCode.getListOfFiles
public function getListOfFiles($pathAnalised) { if (realpath($pathAnalised) === false) { return ['error' => sprintf($this->lclMsgCmn('i18n_Error_GivenPathIsNotValid'), $pathAnalised)]; } elseif (!is_dir($pathAnalised)) { return ['error' => $this->lclMsgCmn('i18n_Error_GivenPa...
php
public function getListOfFiles($pathAnalised) { if (realpath($pathAnalised) === false) { return ['error' => sprintf($this->lclMsgCmn('i18n_Error_GivenPathIsNotValid'), $pathAnalised)]; } elseif (!is_dir($pathAnalised)) { return ['error' => $this->lclMsgCmn('i18n_Error_GivenPa...
[ "public", "function", "getListOfFiles", "(", "$", "pathAnalised", ")", "{", "if", "(", "realpath", "(", "$", "pathAnalised", ")", "===", "false", ")", "{", "return", "[", "'error'", "=>", "sprintf", "(", "$", "this", "->", "lclMsgCmn", "(", "'i18n_Error_Gi...
returns a multi-dimensional array with list of file details within a given path (by using Symfony/Finder package) @param string $pathAnalised @return array
[ "returns", "a", "multi", "-", "dimensional", "array", "with", "list", "of", "file", "details", "within", "a", "given", "path", "(", "by", "using", "Symfony", "/", "Finder", "package", ")" ]
train
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonCode.php#L144-L158
danielgp/common-lib
source/CommonCode.php
CommonCode.getTimestamp
public function getTimestamp($returnType = 'string') { if (in_array($returnType, ['array', 'float', 'string'])) { return $this->getTimestampRaw($returnType); } return sprintf($this->lclMsgCmn('i18n_Error_UnknownReturnType'), $returnType); }
php
public function getTimestamp($returnType = 'string') { if (in_array($returnType, ['array', 'float', 'string'])) { return $this->getTimestampRaw($returnType); } return sprintf($this->lclMsgCmn('i18n_Error_UnknownReturnType'), $returnType); }
[ "public", "function", "getTimestamp", "(", "$", "returnType", "=", "'string'", ")", "{", "if", "(", "in_array", "(", "$", "returnType", ",", "[", "'array'", ",", "'float'", ",", "'string'", "]", ")", ")", "{", "return", "$", "this", "->", "getTimestampRa...
Returns server Timestamp into various formats @param string $returnType @return string
[ "Returns", "server", "Timestamp", "into", "various", "formats" ]
train
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonCode.php#L166-L172
danielgp/common-lib
source/CommonCode.php
CommonCode.isJsonByDanielGP
public function isJsonByDanielGP($inputJson) { if (is_string($inputJson)) { json_decode($inputJson); return (json_last_error() == JSON_ERROR_NONE); } return $this->lclMsgCmn('i18n_Error_GivenInputIsNotJson'); }
php
public function isJsonByDanielGP($inputJson) { if (is_string($inputJson)) { json_decode($inputJson); return (json_last_error() == JSON_ERROR_NONE); } return $this->lclMsgCmn('i18n_Error_GivenInputIsNotJson'); }
[ "public", "function", "isJsonByDanielGP", "(", "$", "inputJson", ")", "{", "if", "(", "is_string", "(", "$", "inputJson", ")", ")", "{", "json_decode", "(", "$", "inputJson", ")", ";", "return", "(", "json_last_error", "(", ")", "==", "JSON_ERROR_NONE", ")...
Tests if given string has a valid Json format @param string|null|array $inputJson @return boolean|string
[ "Tests", "if", "given", "string", "has", "a", "valid", "Json", "format" ]
train
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonCode.php#L180-L187