repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
yuncms/framework
src/admin/models/OAuth2ClientSearch.php
OAuth2ClientSearch.search
public function search($params) { $query = OAuth2Client::find()->orderBy(['client_id' => SORT_DESC]); // add conditions that should always apply here $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->vali...
php
public function search($params) { $query = OAuth2Client::find()->orderBy(['client_id' => SORT_DESC]); // add conditions that should always apply here $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->vali...
[ "public", "function", "search", "(", "$", "params", ")", "{", "$", "query", "=", "OAuth2Client", "::", "find", "(", ")", "->", "orderBy", "(", "[", "'client_id'", "=>", "SORT_DESC", "]", ")", ";", "// add conditions that should always apply here", "$", "dataPr...
Creates data provider instance with search query applied @param array $params @return ActiveDataProvider
[ "Creates", "data", "provider", "instance", "with", "search", "query", "applied" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/models/OAuth2ClientSearch.php#L41-L76
GrafiteInc/Mission-Control-Package
src/Analyzers/TrafficAnalyzer.php
TrafficAnalyzer.getLogCollection
public function getLogCollection($now, $then) { if (!file_exists($this->fileName)) { throw new Exception("Access log file is not present - no traffic to report.", 1); } $collection = []; $lines = file($this->fileName, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); ...
php
public function getLogCollection($now, $then) { if (!file_exists($this->fileName)) { throw new Exception("Access log file is not present - no traffic to report.", 1); } $collection = []; $lines = file($this->fileName, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); ...
[ "public", "function", "getLogCollection", "(", "$", "now", ",", "$", "then", ")", "{", "if", "(", "!", "file_exists", "(", "$", "this", "->", "fileName", ")", ")", "{", "throw", "new", "Exception", "(", "\"Access log file is not present - no traffic to report.\"...
Get the log collection based on time @param int $now @param int $then @return Illuminate\Support\Collection
[ "Get", "the", "log", "collection", "based", "on", "time" ]
train
https://github.com/GrafiteInc/Mission-Control-Package/blob/4e85f0b729329783b34e35d90abba2807899ff58/src/Analyzers/TrafficAnalyzer.php#L42-L59
GrafiteInc/Mission-Control-Package
src/Analyzers/TrafficAnalyzer.php
TrafficAnalyzer.processLogStats
public function processLogStats($collection) { $validLogs = $collection->filter(function ($line) { return $this->validateLine($line); }); $sentBytes = $validLogs->pluck('sentBytes'); $stats = [ 'hits' => $validLogs->count(), 'total_data_sent' => ...
php
public function processLogStats($collection) { $validLogs = $collection->filter(function ($line) { return $this->validateLine($line); }); $sentBytes = $validLogs->pluck('sentBytes'); $stats = [ 'hits' => $validLogs->count(), 'total_data_sent' => ...
[ "public", "function", "processLogStats", "(", "$", "collection", ")", "{", "$", "validLogs", "=", "$", "collection", "->", "filter", "(", "function", "(", "$", "line", ")", "{", "return", "$", "this", "->", "validateLine", "(", "$", "line", ")", ";", "...
Process the log stats @param Collection $collection @return array
[ "Process", "the", "log", "stats" ]
train
https://github.com/GrafiteInc/Mission-Control-Package/blob/4e85f0b729329783b34e35d90abba2807899ff58/src/Analyzers/TrafficAnalyzer.php#L68-L85
GrafiteInc/Mission-Control-Package
src/Analyzers/TrafficAnalyzer.php
TrafficAnalyzer.sortByField
public function sortByField($field, $collection) { if ($collection->isEmpty()) { return 'N/A'; } return $collection->groupBy($field)->sortByDesc(function ($logs) { return count($logs); })->first()->pluck($field)->first(); }
php
public function sortByField($field, $collection) { if ($collection->isEmpty()) { return 'N/A'; } return $collection->groupBy($field)->sortByDesc(function ($logs) { return count($logs); })->first()->pluck($field)->first(); }
[ "public", "function", "sortByField", "(", "$", "field", ",", "$", "collection", ")", "{", "if", "(", "$", "collection", "->", "isEmpty", "(", ")", ")", "{", "return", "'N/A'", ";", "}", "return", "$", "collection", "->", "groupBy", "(", "$", "field", ...
Sort data by field @param string $field @param Collection $collection @return Collection
[ "Sort", "data", "by", "field" ]
train
https://github.com/GrafiteInc/Mission-Control-Package/blob/4e85f0b729329783b34e35d90abba2807899ff58/src/Analyzers/TrafficAnalyzer.php#L95-L104
GrafiteInc/Mission-Control-Package
src/Analyzers/TrafficAnalyzer.php
TrafficAnalyzer.validateLine
public function validateLine($line) { $invalidExtensions = [ '.jpg', '.js', '.css', '.sass', '.scss', '.png', '.svg', '.ico', '.jpeg', '.gif', '.mp4', ]; forea...
php
public function validateLine($line) { $invalidExtensions = [ '.jpg', '.js', '.css', '.sass', '.scss', '.png', '.svg', '.ico', '.jpeg', '.gif', '.mp4', ]; forea...
[ "public", "function", "validateLine", "(", "$", "line", ")", "{", "$", "invalidExtensions", "=", "[", "'.jpg'", ",", "'.js'", ",", "'.css'", ",", "'.sass'", ",", "'.scss'", ",", "'.png'", ",", "'.svg'", ",", "'.ico'", ",", "'.jpeg'", ",", "'.gif'", ",", ...
Line object from logs @param object $line @return bool
[ "Line", "object", "from", "logs" ]
train
https://github.com/GrafiteInc/Mission-Control-Package/blob/4e85f0b729329783b34e35d90abba2807899ff58/src/Analyzers/TrafficAnalyzer.php#L113-L140
lode/fem
src/response.php
response.send_status
public static function send_status($code) { if (!isset(static::$status_messages[$code])) { $code = self::STATUS_INTERNAL_SERVER_ERROR; } http_response_code($code); }
php
public static function send_status($code) { if (!isset(static::$status_messages[$code])) { $code = self::STATUS_INTERNAL_SERVER_ERROR; } http_response_code($code); }
[ "public", "static", "function", "send_status", "(", "$", "code", ")", "{", "if", "(", "!", "isset", "(", "static", "::", "$", "status_messages", "[", "$", "code", "]", ")", ")", "{", "$", "code", "=", "self", "::", "STATUS_INTERNAL_SERVER_ERROR", ";", ...
send a status code to the browser @param int $code @return void
[ "send", "a", "status", "code", "to", "the", "browser" ]
train
https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/response.php#L48-L54
lode/fem
src/response.php
response.get_status_message
public static function get_status_message($code) { if (!isset(static::$status_messages[$code])) { $code = self::STATUS_INTERNAL_SERVER_ERROR; } $message = static::$status_messages[$code]; return $message; }
php
public static function get_status_message($code) { if (!isset(static::$status_messages[$code])) { $code = self::STATUS_INTERNAL_SERVER_ERROR; } $message = static::$status_messages[$code]; return $message; }
[ "public", "static", "function", "get_status_message", "(", "$", "code", ")", "{", "if", "(", "!", "isset", "(", "static", "::", "$", "status_messages", "[", "$", "code", "]", ")", ")", "{", "$", "code", "=", "self", "::", "STATUS_INTERNAL_SERVER_ERROR", ...
get the describing message of the status code @param int $code i.e. 404 @return string i.e. 'Not found'
[ "get", "the", "describing", "message", "of", "the", "status", "code" ]
train
https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/response.php#L62-L69
lode/fem
src/response.php
response.download
public static function download($output, $content_type='text/plain', $filename=null) { $filename_postfix = ($filename) ? '; filename="'.$filename.'"' : ''; // force download header('Content-Type: '.$content_type.'; charset=utf-8'); header('Content-Disposition: attachment'.$filename_postfix); // write to browse...
php
public static function download($output, $content_type='text/plain', $filename=null) { $filename_postfix = ($filename) ? '; filename="'.$filename.'"' : ''; // force download header('Content-Type: '.$content_type.'; charset=utf-8'); header('Content-Disposition: attachment'.$filename_postfix); // write to browse...
[ "public", "static", "function", "download", "(", "$", "output", ",", "$", "content_type", "=", "'text/plain'", ",", "$", "filename", "=", "null", ")", "{", "$", "filename_postfix", "=", "(", "$", "filename", ")", "?", "'; filename=\"'", ".", "$", "filename...
force the user to download certain output @param string $output @param string $content_type optional, defaults to 'text/plain' @param string $filename optional, suggested filename when saving downloaded content @return void
[ "force", "the", "user", "to", "download", "certain", "output" ]
train
https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/response.php#L79-L88
praxisnetau/silverware-spam-guard
src/Extensions/FormExtension.php
FormExtension.enableSpamProtection
public function enableSpamProtection($args = []) { // Obtain Spam Guard Instance: if ($guard = $this->getSpamGuardInstance($args)) { // Define Field Name and Title: $name = isset($args['name']) ? $args['name'] : $guard->getDefaultName(); ...
php
public function enableSpamProtection($args = []) { // Obtain Spam Guard Instance: if ($guard = $this->getSpamGuardInstance($args)) { // Define Field Name and Title: $name = isset($args['name']) ? $args['name'] : $guard->getDefaultName(); ...
[ "public", "function", "enableSpamProtection", "(", "$", "args", "=", "[", "]", ")", "{", "// Obtain Spam Guard Instance:", "if", "(", "$", "guard", "=", "$", "this", "->", "getSpamGuardInstance", "(", "$", "args", ")", ")", "{", "// Define Field Name and Title:"...
Enables spam guard protection for the extended form. @param array $args @return Form
[ "Enables", "spam", "guard", "protection", "for", "the", "extended", "form", "." ]
train
https://github.com/praxisnetau/silverware-spam-guard/blob/c5f8836a09141bd675173892a1e3d8c8cc8c1886/src/Extensions/FormExtension.php#L41-L89
ClanCats/Core
src/bundles/Database/Query/Select.php
Query_Select.fields
public function fields( $fields ) { if ( !is_array( $fields ) && !is_null( $fields ) ) { $fields = array( $fields ); } // do nothing if we get nothing if ( empty( $fields ) || $fields == array( '*' ) ) { $this->fields = array(); return $this; } $this->fields = $fields; // return self so ...
php
public function fields( $fields ) { if ( !is_array( $fields ) && !is_null( $fields ) ) { $fields = array( $fields ); } // do nothing if we get nothing if ( empty( $fields ) || $fields == array( '*' ) ) { $this->fields = array(); return $this; } $this->fields = $fields; // return self so ...
[ "public", "function", "fields", "(", "$", "fields", ")", "{", "if", "(", "!", "is_array", "(", "$", "fields", ")", "&&", "!", "is_null", "(", "$", "fields", ")", ")", "{", "$", "fields", "=", "array", "(", "$", "fields", ")", ";", "}", "// do not...
Set the select fields @param array $values @return self
[ "Set", "the", "select", "fields" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Select.php#L87-L104
ClanCats/Core
src/bundles/Database/Query/Select.php
Query_Select.add_fields
public function add_fields( $fields ) { if ( !is_array( $fields ) ) { $fields = array( $fields ); } // merge the new values with the existing ones. $this->fields = array_merge( $this->fields, $fields ); // return self so we can continue running the next function return $this; }
php
public function add_fields( $fields ) { if ( !is_array( $fields ) ) { $fields = array( $fields ); } // merge the new values with the existing ones. $this->fields = array_merge( $this->fields, $fields ); // return self so we can continue running the next function return $this; }
[ "public", "function", "add_fields", "(", "$", "fields", ")", "{", "if", "(", "!", "is_array", "(", "$", "fields", ")", ")", "{", "$", "fields", "=", "array", "(", "$", "fields", ")", ";", "}", "// merge the new values with the existing ones.", "$", "this",...
Add select fields @param array $values @return self
[ "Add", "select", "fields" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Select.php#L112-L124
ClanCats/Core
src/bundles/Database/Query/Select.php
Query_Select.order_by
public function order_by( $cols, $order = 'asc' ) { if ( !is_array( $cols ) ) { $this->orders[] = array( $cols, $order ); return $this; } else { foreach( $cols as $key => $col ) { if ( is_numeric( $key ) ) { $this->orders[] = array( $col, $order ); } else { $this...
php
public function order_by( $cols, $order = 'asc' ) { if ( !is_array( $cols ) ) { $this->orders[] = array( $cols, $order ); return $this; } else { foreach( $cols as $key => $col ) { if ( is_numeric( $key ) ) { $this->orders[] = array( $col, $order ); } else { $this...
[ "public", "function", "order_by", "(", "$", "cols", ",", "$", "order", "=", "'asc'", ")", "{", "if", "(", "!", "is_array", "(", "$", "cols", ")", ")", "{", "$", "this", "->", "orders", "[", "]", "=", "array", "(", "$", "cols", ",", "$", "order"...
Set the order parameters @param mixed $cols @param string $order @return self
[ "Set", "the", "order", "parameters" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Select.php#L133-L155
ClanCats/Core
src/bundles/Database/Query/Select.php
Query_Select.group_by
public function group_by( $key ) { if ( !is_array( $key ) ) { $key = array( $key ); } foreach( $key as $group_key ) { $this->groups[] = $group_key; } return $this; }
php
public function group_by( $key ) { if ( !is_array( $key ) ) { $key = array( $key ); } foreach( $key as $group_key ) { $this->groups[] = $group_key; } return $this; }
[ "public", "function", "group_by", "(", "$", "key", ")", "{", "if", "(", "!", "is_array", "(", "$", "key", ")", ")", "{", "$", "key", "=", "array", "(", "$", "key", ")", ";", "}", "foreach", "(", "$", "key", "as", "$", "group_key", ")", "{", "...
Add group by stuff @param mixed $key By passing an array you can add multiple groups @return self
[ "Add", "group", "by", "stuff" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Select.php#L163-L176
ClanCats/Core
src/bundles/Database/Query/Select.php
Query_Select.forward_key
public function forward_key( $key = true ) { if ( $key === false ) { $this->forward_key = false; } elseif ( $key === true ) { $this->forward_key = \ClanCats::$config->get( 'database.default_primary_key', 'id' ); } else { $this->forward_key = $key; } return $this; }
php
public function forward_key( $key = true ) { if ( $key === false ) { $this->forward_key = false; } elseif ( $key === true ) { $this->forward_key = \ClanCats::$config->get( 'database.default_primary_key', 'id' ); } else { $this->forward_key = $key; } return $this; }
[ "public", "function", "forward_key", "(", "$", "key", "=", "true", ")", "{", "if", "(", "$", "key", "===", "false", ")", "{", "$", "this", "->", "forward_key", "=", "false", ";", "}", "elseif", "(", "$", "key", "===", "true", ")", "{", "$", "this...
Forward a result value as array key @param string|bool $key @return self
[ "Forward", "a", "result", "value", "as", "array", "key" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Select.php#L184-L200
ClanCats/Core
src/bundles/Database/Query/Select.php
Query_Select.group_result
public function group_result( $key ) { if ( $key === false ) { $this->group_result = false; } else { $this->group_result = $key; } return $this; }
php
public function group_result( $key ) { if ( $key === false ) { $this->group_result = false; } else { $this->group_result = $key; } return $this; }
[ "public", "function", "group_result", "(", "$", "key", ")", "{", "if", "(", "$", "key", "===", "false", ")", "{", "$", "this", "->", "group_result", "=", "false", ";", "}", "else", "{", "$", "this", "->", "group_result", "=", "$", "key", ";", "}", ...
Group results by a column example: array( 'name' => 'John', 'age' => 18, ), array( 'name' => 'Jeff', 'age' => 32, ), array( 'name' => 'Jenny', 'age' => 18, ), To: '18' => array( array( 'name' => 'John', 'age' => 18 ), array( 'name' => 'Jenny', 'age' => 18 ), ), '32' => array( array( 'name' => 'Jeff', 'age' => 32 ), ),...
[ "Group", "results", "by", "a", "column" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Select.php#L227-L239
ClanCats/Core
src/bundles/Database/Query/Select.php
Query_Select.run
public function run( $handler = null ) { if ( !is_null( $handler ) ) { $this->handler( $handler ); } // if there is a special fetch handler defined pass him all the // needed parameters and retrive the results if ( !is_null( $this->fetch_handler ) ) { $results = call_user_func_array( $this->fet...
php
public function run( $handler = null ) { if ( !is_null( $handler ) ) { $this->handler( $handler ); } // if there is a special fetch handler defined pass him all the // needed parameters and retrive the results if ( !is_null( $this->fetch_handler ) ) { $results = call_user_func_array( $this->fet...
[ "public", "function", "run", "(", "$", "handler", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "handler", ")", ")", "{", "$", "this", "->", "handler", "(", "$", "handler", ")", ";", "}", "// if there is a special fetch handler defined pass h...
Build and execute the current query This wil run the local build function and pass the parameters from the builder object in the handler @param string $handler @return mixed
[ "Build", "and", "execute", "the", "current", "query", "This", "wil", "run", "the", "local", "build", "function", "and", "pass", "the", "parameters", "from", "the", "builder", "object", "in", "the", "handler" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Select.php#L275-L349
ClanCats/Core
src/bundles/Database/Query/Select.php
Query_Select.find
public function find( $id, $key = null, $name = null ) { if ( is_null( $key ) ) { $key = Query::$_default_key; } return $this->where( $key, $id )->one( $name ); }
php
public function find( $id, $key = null, $name = null ) { if ( is_null( $key ) ) { $key = Query::$_default_key; } return $this->where( $key, $id )->one( $name ); }
[ "public", "function", "find", "(", "$", "id", ",", "$", "key", "=", "null", ",", "$", "name", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "key", ")", ")", "{", "$", "key", "=", "Query", "::", "$", "_default_key", ";", "}", "return", ...
Find something, means select one record by key @param int $id @param string $key @param string $name @return mixed
[ "Find", "something", "means", "select", "one", "record", "by", "key" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Select.php#L370-L378
ClanCats/Core
src/bundles/Database/Query/Select.php
Query_Select.first
public function first( $key = null, $name = null ) { if ( is_null( $key ) ) { $key = Query::$_default_key; } return $this->order_by( $key, 'asc' )->one( $name ); }
php
public function first( $key = null, $name = null ) { if ( is_null( $key ) ) { $key = Query::$_default_key; } return $this->order_by( $key, 'asc' )->one( $name ); }
[ "public", "function", "first", "(", "$", "key", "=", "null", ",", "$", "name", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "key", ")", ")", "{", "$", "key", "=", "Query", "::", "$", "_default_key", ";", "}", "return", "$", "this", "-...
Get the first result by key @param string $key @param string $name @return mixed
[ "Get", "the", "first", "result", "by", "key" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Select.php#L387-L395
ClanCats/Core
src/bundles/Database/Query/Select.php
Query_Select.column
public function column( $column, $name = null ) { return $this->fields( $column )->one( $name )->$column; }
php
public function column( $column, $name = null ) { return $this->fields( $column )->one( $name )->$column; }
[ "public", "function", "column", "(", "$", "column", ",", "$", "name", "=", "null", ")", "{", "return", "$", "this", "->", "fields", "(", "$", "column", ")", "->", "one", "(", "$", "name", ")", "->", "$", "column", ";", "}" ]
Just get a single value from the db @param string $column @param string $name @return mixed
[ "Just", "get", "a", "single", "value", "from", "the", "db" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Query/Select.php#L421-L424
dreamfactorysoftware/df-file
src/Components/SupportsFiles.php
SupportsFiles.getConfig
public static function getConfig($id, $local_config = null, $protect = true) { $config = parent::getConfig($id, $local_config, $protect); /** @var FilePublicPath $pathConfig */ if (!empty($pathConfig = FilePublicPath::find($id))) { $config = array_merge($config, $pathConfig->toA...
php
public static function getConfig($id, $local_config = null, $protect = true) { $config = parent::getConfig($id, $local_config, $protect); /** @var FilePublicPath $pathConfig */ if (!empty($pathConfig = FilePublicPath::find($id))) { $config = array_merge($config, $pathConfig->toA...
[ "public", "static", "function", "getConfig", "(", "$", "id", ",", "$", "local_config", "=", "null", ",", "$", "protect", "=", "true", ")", "{", "$", "config", "=", "parent", "::", "getConfig", "(", "$", "id", ",", "$", "local_config", ",", "$", "prot...
{@inheritdoc}
[ "{" ]
train
https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/SupportsFiles.php#L11-L21
dreamfactorysoftware/df-file
src/Components/SupportsFiles.php
SupportsFiles.setConfig
public static function setConfig($id, $config, $local_config = null) { $result = parent::setConfig($id, $config, $local_config); $resultPath = FilePublicPath::setConfig($id, $config, $local_config); if ($resultPath) { $result = array_merge((array)$result, (array)$resultPath); ...
php
public static function setConfig($id, $config, $local_config = null) { $result = parent::setConfig($id, $config, $local_config); $resultPath = FilePublicPath::setConfig($id, $config, $local_config); if ($resultPath) { $result = array_merge((array)$result, (array)$resultPath); ...
[ "public", "static", "function", "setConfig", "(", "$", "id", ",", "$", "config", ",", "$", "local_config", "=", "null", ")", "{", "$", "result", "=", "parent", "::", "setConfig", "(", "$", "id", ",", "$", "config", ",", "$", "local_config", ")", ";",...
{@inheritdoc}
[ "{" ]
train
https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/SupportsFiles.php#L26-L36
dreamfactorysoftware/df-file
src/Components/SupportsFiles.php
SupportsFiles.storeConfig
public static function storeConfig($id, $config) { parent::storeConfig($id, $config); FilePublicPath::storeConfig($id, $config); }
php
public static function storeConfig($id, $config) { parent::storeConfig($id, $config); FilePublicPath::storeConfig($id, $config); }
[ "public", "static", "function", "storeConfig", "(", "$", "id", ",", "$", "config", ")", "{", "parent", "::", "storeConfig", "(", "$", "id", ",", "$", "config", ")", ";", "FilePublicPath", "::", "storeConfig", "(", "$", "id", ",", "$", "config", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/SupportsFiles.php#L41-L46
dreamfactorysoftware/df-file
src/Components/SupportsFiles.php
SupportsFiles.getConfigSchema
public static function getConfigSchema() { $out = (array)parent::getConfigSchema(); $pathSchema = (array)FilePublicPath::getConfigSchema(); return array_merge($out, $pathSchema); }
php
public static function getConfigSchema() { $out = (array)parent::getConfigSchema(); $pathSchema = (array)FilePublicPath::getConfigSchema(); return array_merge($out, $pathSchema); }
[ "public", "static", "function", "getConfigSchema", "(", ")", "{", "$", "out", "=", "(", "array", ")", "parent", "::", "getConfigSchema", "(", ")", ";", "$", "pathSchema", "=", "(", "array", ")", "FilePublicPath", "::", "getConfigSchema", "(", ")", ";", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/SupportsFiles.php#L51-L57
yuncms/framework
src/user/models/UserSearch.php
UserSearch.search
public function search($params) { $query = User::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['like', 'nickname', $th...
php
public function search($params) { $query = User::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['like', 'nickname', $th...
[ "public", "function", "search", "(", "$", "params", ")", "{", "$", "query", "=", "User", "::", "find", "(", ")", ";", "$", "dataProvider", "=", "new", "ActiveDataProvider", "(", "[", "'query'", "=>", "$", "query", ",", "]", ")", ";", "if", "(", "!"...
@param $params @return ActiveDataProvider
[ "@param", "$params" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/user/models/UserSearch.php#L37-L48
bosha/PTel
src/PTel.php
PTel.connect
public function connect($host, $port = null, $timeout = null) { $port = (empty($port)) ? 23 : $port; $timeout = (empty($timeout)) ? 1 : $timeout; if (!filter_var($host, FILTER_VALIDATE_IP)) { $ip = gethostbyname($host); if ($ip !== $host) { $host = $ip; ...
php
public function connect($host, $port = null, $timeout = null) { $port = (empty($port)) ? 23 : $port; $timeout = (empty($timeout)) ? 1 : $timeout; if (!filter_var($host, FILTER_VALIDATE_IP)) { $ip = gethostbyname($host); if ($ip !== $host) { $host = $ip; ...
[ "public", "function", "connect", "(", "$", "host", ",", "$", "port", "=", "null", ",", "$", "timeout", "=", "null", ")", "{", "$", "port", "=", "(", "empty", "(", "$", "port", ")", ")", "?", "23", ":", "$", "port", ";", "$", "timeout", "=", "...
Connect to given host/port @param $host string IP-Address or host to connect @param $port int Port @param $timeout int Connection timeout @throws SocketClientException On socket connection error @throws TelnetException On error while resolving IP-address @return $this ...
[ "Connect", "to", "given", "host", "/", "port" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L130-L168
bosha/PTel
src/PTel.php
PTel.login
public function login($user, $pass, $maxtimeout = 10) { try { $this->expect('((U|u)ser|(L|l)ogin)((N|n)ame|)(:|)', $user); $this->expect('(P|p)ass((W|w)ord|)(:|)', $pass); } catch (TelnetException $e) { throw new TelnetException('Could not find password request. Login...
php
public function login($user, $pass, $maxtimeout = 10) { try { $this->expect('((U|u)ser|(L|l)ogin)((N|n)ame|)(:|)', $user); $this->expect('(P|p)ass((W|w)ord|)(:|)', $pass); } catch (TelnetException $e) { throw new TelnetException('Could not find password request. Login...
[ "public", "function", "login", "(", "$", "user", ",", "$", "pass", ",", "$", "maxtimeout", "=", "10", ")", "{", "try", "{", "$", "this", "->", "expect", "(", "'((U|u)ser|(L|l)ogin)((N|n)ame|)(:|)'", ",", "$", "user", ")", ";", "$", "this", "->", "expec...
Login to device. @param string $user Username @param string $pass Password @throws TelnetException On wrong username/password @throws SocketClientException On socket communication error @return $this Current instance on success
[ "Login", "to", "device", "." ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L180-L212
bosha/PTel
src/PTel.php
PTel.send
public function send($data, $newline = true) { if (!$this->_sock) { throw new SocketClientException("Connection unexpectedly closed!"); } if ($newline) { $data = $data.$this->retcarriage; } if (! $wr = fwrite($this->_sock, $data)) { throw new SocketClientException('Error while sendin...
php
public function send($data, $newline = true) { if (!$this->_sock) { throw new SocketClientException("Connection unexpectedly closed!"); } if ($newline) { $data = $data.$this->retcarriage; } if (! $wr = fwrite($this->_sock, $data)) { throw new SocketClientException('Error while sendin...
[ "public", "function", "send", "(", "$", "data", ",", "$", "newline", "=", "true", ")", "{", "if", "(", "!", "$", "this", "->", "_sock", ")", "{", "throw", "new", "SocketClientException", "(", "\"Connection unexpectedly closed!\"", ")", ";", "}", "if", "(...
Send data to socket @param $data mixed Can be anything: string, int, hex, binary @param $newline bool Determines send or not carriage return @throws SocketClientException On socket communication error @return int Bytes written
[ "Send", "data", "to", "socket" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L224-L231
bosha/PTel
src/PTel.php
PTel.recvChr
public function recvChr() { if (!$this->_sock) { throw new SocketClientException("Connection gone!"); } $char = fgetc($this->_sock); if ($this->stream_eof()) { return false; } if ($char === TEL_IAC && $this->negotiation_enabled) { $this->_negotiate(fgetc($this->_sock)); ...
php
public function recvChr() { if (!$this->_sock) { throw new SocketClientException("Connection gone!"); } $char = fgetc($this->_sock); if ($this->stream_eof()) { return false; } if ($char === TEL_IAC && $this->negotiation_enabled) { $this->_negotiate(fgetc($this->_sock)); ...
[ "public", "function", "recvChr", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_sock", ")", "{", "throw", "new", "SocketClientException", "(", "\"Connection gone!\"", ")", ";", "}", "$", "char", "=", "fgetc", "(", "$", "this", "->", "_sock", ")", ...
Get char from socket or call negotiation method if found telnet negotiaton command. @throws SocketClientException On socket communication error @return char Char from socket connection
[ "Get", "char", "from", "socket", "or", "call", "negotiation", "method", "if", "found", "telnet", "negotiaton", "command", "." ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L240-L250
bosha/PTel
src/PTel.php
PTel.recvLine
public function recvLine($delimiter = "\n") { $str = ''; while (!$this->stream_eof()) { $char = $this->recvChr(); $str .= $char; if ($char === false) { return $str; } if (strpos($str, $delimiter) !== false) { return $str; } } return $str; ...
php
public function recvLine($delimiter = "\n") { $str = ''; while (!$this->stream_eof()) { $char = $this->recvChr(); $str .= $char; if ($char === false) { return $str; } if (strpos($str, $delimiter) !== false) { return $str; } } return $str; ...
[ "public", "function", "recvLine", "(", "$", "delimiter", "=", "\"\\n\"", ")", "{", "$", "str", "=", "''", ";", "while", "(", "!", "$", "this", "->", "stream_eof", "(", ")", ")", "{", "$", "char", "=", "$", "this", "->", "recvChr", "(", ")", ";", ...
Receive line from connection @param string $delimiter Line delimiter @throws SocketClientException On socket communication error @return string String from socket connection
[ "Receive", "line", "from", "connection" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L260-L269
bosha/PTel
src/PTel.php
PTel.find
public function find($str) { while ($line = $this->recvLine()) { if (preg_match("/{$str}/", $line, $matches)) { return $matches[0]; } } return false; }
php
public function find($str) { while ($line = $this->recvLine()) { if (preg_match("/{$str}/", $line, $matches)) { return $matches[0]; } } return false; }
[ "public", "function", "find", "(", "$", "str", ")", "{", "while", "(", "$", "line", "=", "$", "this", "->", "recvLine", "(", ")", ")", "{", "if", "(", "preg_match", "(", "\"/{$str}/\"", ",", "$", "line", ",", "$", "matches", ")", ")", "{", "retur...
Search for given string/regexp in stream output @param string $str String or regexp for search @throws SocketClientException On socket communication error @return string|bool Line with search match, or false if not found/timeout
[ "Search", "for", "given", "string", "/", "regexp", "in", "stream", "output" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L293-L300
bosha/PTel
src/PTel.php
PTel.findAll
public function findAll($str) { $this->recvAll(); $output_as_array = explode($this->retcarriage, $this->getBuffer()); foreach ($output_as_array as $line) { if (preg_match("/{$str}/", $line, $matches)) { return $matches[0]; } } return false;...
php
public function findAll($str) { $this->recvAll(); $output_as_array = explode($this->retcarriage, $this->getBuffer()); foreach ($output_as_array as $line) { if (preg_match("/{$str}/", $line, $matches)) { return $matches[0]; } } return false;...
[ "public", "function", "findAll", "(", "$", "str", ")", "{", "$", "this", "->", "recvAll", "(", ")", ";", "$", "output_as_array", "=", "explode", "(", "$", "this", "->", "retcarriage", ",", "$", "this", "->", "getBuffer", "(", ")", ")", ";", "foreach"...
Receive all data, and search through global buffer @param string $str String to search (regex supported) @return bool|string False if not found, string contains search
[ "Receive", "all", "data", "and", "search", "through", "global", "buffer" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L309-L318
bosha/PTel
src/PTel.php
PTel.expect
public function expect($str, $cmd, $newline = true, $maxtimeout = 10) { if ($this->waitFor($str, $maxtimeout)) { $this->send($cmd, $newline); return true; } }
php
public function expect($str, $cmd, $newline = true, $maxtimeout = 10) { if ($this->waitFor($str, $maxtimeout)) { $this->send($cmd, $newline); return true; } }
[ "public", "function", "expect", "(", "$", "str", ",", "$", "cmd", ",", "$", "newline", "=", "true", ",", "$", "maxtimeout", "=", "10", ")", "{", "if", "(", "$", "this", "->", "waitFor", "(", "$", "str", ",", "$", "maxtimeout", ")", ")", "{", "$...
Search for given occurance and send given command if found @param string $str String/regexp for search @param string $cmd Command to send @param bool $newline Send new line character @param int $maxtimeout Maximum timeout for waiting sought string @throws SocketClientException ...
[ "Search", "for", "given", "occurance", "and", "send", "given", "command", "if", "found" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L332-L337
bosha/PTel
src/PTel.php
PTel.getMetaData
public function getMetaData($param) { if (!$this->_sock) { throw new SocketClientException("Connection gone!"); } $info = stream_get_meta_data($this->_sock); return $info[$param]; }
php
public function getMetaData($param) { if (!$this->_sock) { throw new SocketClientException("Connection gone!"); } $info = stream_get_meta_data($this->_sock); return $info[$param]; }
[ "public", "function", "getMetaData", "(", "$", "param", ")", "{", "if", "(", "!", "$", "this", "->", "_sock", ")", "{", "throw", "new", "SocketClientException", "(", "\"Connection gone!\"", ")", ";", "}", "$", "info", "=", "stream_get_meta_data", "(", "$",...
Return stream meta data parameter @param $param string Parameter name @throws SocketClientException On socket communication error @return mixed Value of parameter
[ "Return", "stream", "meta", "data", "parameter" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L374-L378
bosha/PTel
src/PTel.php
PTel._negotiate
private function _negotiate($char) { switch ($char) { case TEL_DO: $this->_negotiateDo(fgetc($this->_sock)); break; case TEL_WILL: $this->_negotiateWill(fgetc($this->_sock)); break; } }
php
private function _negotiate($char) { switch ($char) { case TEL_DO: $this->_negotiateDo(fgetc($this->_sock)); break; case TEL_WILL: $this->_negotiateWill(fgetc($this->_sock)); break; } }
[ "private", "function", "_negotiate", "(", "$", "char", ")", "{", "switch", "(", "$", "char", ")", "{", "case", "TEL_DO", ":", "$", "this", "->", "_negotiateDo", "(", "fgetc", "(", "$", "this", "->", "_sock", ")", ")", ";", "break", ";", "case", "TE...
Telnet negotiation method. Run appropriate method based on type of received command (DO or WILL) @param $char binary Binary representation of command char
[ "Telnet", "negotiation", "method", ".", "Run", "appropriate", "method", "based", "on", "type", "of", "received", "command", "(", "DO", "or", "WILL", ")" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L403-L412
bosha/PTel
src/PTel.php
PTel._negotiateDo
private function _negotiateDo($cmd) { switch ($cmd) { case TEL_TTYPE: // Send terminal type $term = (binary) $this->terminal_type; return $this->send(TEL_IAC.TEL_SUB.TEL_TTYPE.TEL_BIN.$term. TEL_IAC.TEL_SUBEND,false); case TEL_X...
php
private function _negotiateDo($cmd) { switch ($cmd) { case TEL_TTYPE: // Send terminal type $term = (binary) $this->terminal_type; return $this->send(TEL_IAC.TEL_SUB.TEL_TTYPE.TEL_BIN.$term. TEL_IAC.TEL_SUBEND,false); case TEL_X...
[ "private", "function", "_negotiateDo", "(", "$", "cmd", ")", "{", "switch", "(", "$", "cmd", ")", "{", "case", "TEL_TTYPE", ":", "// Send terminal type", "$", "term", "=", "(", "binary", ")", "$", "this", "->", "terminal_type", ";", "return", "$", "this"...
Telnet DO negotiaion @param char $cmd Binary representation of command char @throws SocketClientException On socket communication error @return int Bytes written
[ "Telnet", "DO", "negotiaion" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L422-L454
bosha/PTel
src/PTel.php
PTel._negotiateWill
private function _negotiateWill($cmd) { switch ($cmd) { case TEL_GA: break; case TEL_ECHO: break; default: return $this->send(TEL_IAC.TEL_WONT.$cmd, false); } }
php
private function _negotiateWill($cmd) { switch ($cmd) { case TEL_GA: break; case TEL_ECHO: break; default: return $this->send(TEL_IAC.TEL_WONT.$cmd, false); } }
[ "private", "function", "_negotiateWill", "(", "$", "cmd", ")", "{", "switch", "(", "$", "cmd", ")", "{", "case", "TEL_GA", ":", "break", ";", "case", "TEL_ECHO", ":", "break", ";", "default", ":", "return", "$", "this", "->", "send", "(", "TEL_IAC", ...
Telnet WILL negotiaion @param char $cmd Binary representation of command char @throws SocketClientException On socket communication error @return int Bytes written
[ "Telnet", "WILL", "negotiaion" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L464-L473
bosha/PTel
src/PTel.php
PTel.waitReply
public function waitReply($timeout = 10) { $timestart = time(); while (true) { $char = $this->recvChr(); $timerun = time() - $timestart; if ($timerun >= $timeout) { return false; } if(!empty($char)) { return true...
php
public function waitReply($timeout = 10) { $timestart = time(); while (true) { $char = $this->recvChr(); $timerun = time() - $timestart; if ($timerun >= $timeout) { return false; } if(!empty($char)) { return true...
[ "public", "function", "waitReply", "(", "$", "timeout", "=", "10", ")", "{", "$", "timestart", "=", "time", "(", ")", ";", "while", "(", "true", ")", "{", "$", "char", "=", "$", "this", "->", "recvChr", "(", ")", ";", "$", "timerun", "=", "time",...
Wait for reply from socket @param int $timeout Max timeout to wait reply @throws SocketClientException On socket communication error @return bool True if found reply, false if timeout reached
[ "Wait", "for", "reply", "from", "socket" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L483-L496
bosha/PTel
src/PTel.php
PTel.waitFor
public function waitFor($str, $maxtimeout = 10) { $timestart = time(); $buff = ''; while (true) { $buff .= $this->recvChr(); $timerun = time() - $timestart; if (preg_match("/$str/", $buff, $matches)) { return true; } i...
php
public function waitFor($str, $maxtimeout = 10) { $timestart = time(); $buff = ''; while (true) { $buff .= $this->recvChr(); $timerun = time() - $timestart; if (preg_match("/$str/", $buff, $matches)) { return true; } i...
[ "public", "function", "waitFor", "(", "$", "str", ",", "$", "maxtimeout", "=", "10", ")", "{", "$", "timestart", "=", "time", "(", ")", ";", "$", "buff", "=", "''", ";", "while", "(", "true", ")", "{", "$", "buff", ".=", "$", "this", "->", "rec...
Wait for specified message from socket till timeout @param string $str String to wait @param int $maxtimeout Maximum timeout to wait @throws SocketClientException On socket communication error @throws TelnetException If maxtimeout reached @return bool True if found
[ "Wait", "for", "specified", "message", "from", "socket", "till", "timeout" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L508-L524
bosha/PTel
src/PTel.php
PTel.getOutputOf
public function getOutputOf($cmd, $newline = true, $maxtimeout = 10) { $return = array(); $this->recvAll(); $this->send($cmd, $newline); $timestart = time(); while (true) { $buff = $this->recvLine(); $timerun = time() - $timestart; if (strpos(...
php
public function getOutputOf($cmd, $newline = true, $maxtimeout = 10) { $return = array(); $this->recvAll(); $this->send($cmd, $newline); $timestart = time(); while (true) { $buff = $this->recvLine(); $timerun = time() - $timestart; if (strpos(...
[ "public", "function", "getOutputOf", "(", "$", "cmd", ",", "$", "newline", "=", "true", ",", "$", "maxtimeout", "=", "10", ")", "{", "$", "return", "=", "array", "(", ")", ";", "$", "this", "->", "recvAll", "(", ")", ";", "$", "this", "->", "send...
Get only output of running command @param string $cmd Command to execute @param bool $newline Add new line character, or not @param int $maxtimeout Maximum timeout to wait command execution @throws SocketClientException On socket communication error @throws TelnetException ...
[ "Get", "only", "output", "of", "running", "command" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L538-L565
bosha/PTel
src/PTel.php
PTel.setTermSpeed
public function setTermSpeed($in, $out) { $this->terminal_speed_in = $in; $this->terminal_speed_out = $out; return $this; }
php
public function setTermSpeed($in, $out) { $this->terminal_speed_in = $in; $this->terminal_speed_out = $out; return $this; }
[ "public", "function", "setTermSpeed", "(", "$", "in", ",", "$", "out", ")", "{", "$", "this", "->", "terminal_speed_in", "=", "$", "in", ";", "$", "this", "->", "terminal_speed_out", "=", "$", "out", ";", "return", "$", "this", ";", "}" ]
Setting terminal speed @param string $in String with inbound terminal speed @param string $out String with outbound terminal speed @return $this Instance of current class
[ "Setting", "terminal", "speed" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L587-L592
bosha/PTel
src/PTel.php
PTel.setWindowSize
public function setWindowSize($height, $width) { if (!is_int($height) || !is_int($width)) { throw new TelnetException("Wrong windows height or width used. Should valid integer."); } if ($height < 1 || $width < 1 || $height === 255 || $width === 255) { throw new TelnetExc...
php
public function setWindowSize($height, $width) { if (!is_int($height) || !is_int($width)) { throw new TelnetException("Wrong windows height or width used. Should valid integer."); } if ($height < 1 || $width < 1 || $height === 255 || $width === 255) { throw new TelnetExc...
[ "public", "function", "setWindowSize", "(", "$", "height", ",", "$", "width", ")", "{", "if", "(", "!", "is_int", "(", "$", "height", ")", "||", "!", "is_int", "(", "$", "width", ")", ")", "{", "throw", "new", "TelnetException", "(", "\"Wrong windows h...
Window size used while negotiating @param int $height Window height @param int $width Window width @throws TelnetException On wrong parameter specified @throws SocketClientException On socket communication error @return $this Instance of current class
[ "Window", "size", "used", "while", "negotiating" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L605-L618
bosha/PTel
src/PTel.php
PTel.disconnect
public function disconnect() { if ($this->_sock) { fclose($this->_sock); $this->_sock = null; } return $this; }
php
public function disconnect() { if ($this->_sock) { fclose($this->_sock); $this->_sock = null; } return $this; }
[ "public", "function", "disconnect", "(", ")", "{", "if", "(", "$", "this", "->", "_sock", ")", "{", "fclose", "(", "$", "this", "->", "_sock", ")", ";", "$", "this", "->", "_sock", "=", "null", ";", "}", "return", "$", "this", ";", "}" ]
Closing socket @return $this Current class instance
[ "Closing", "socket" ]
train
https://github.com/bosha/PTel/blob/049d72f8faaf6c2548353e715e06ad1f28c756b5/src/PTel.php#L654-L660
parsnick/steak
src/Console/StatusCommand.php
StatusCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $config = $this->container['config']; $table = new Table($output); $table ->setRows([ ['<b>Build status</b>'], [' Last build time', $this->formatLastBuildStatus()], ...
php
protected function execute(InputInterface $input, OutputInterface $output) { $config = $this->container['config']; $table = new Table($output); $table ->setRows([ ['<b>Build status</b>'], [' Last build time', $this->formatLastBuildStatus()], ...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "config", "=", "$", "this", "->", "container", "[", "'config'", "]", ";", "$", "table", "=", "new", "Table", "(", "$", "output"...
Execute the command. @param InputInterface $input @param OutputInterface $output @return void
[ "Execute", "the", "command", "." ]
train
https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/StatusCommand.php#L37-L72
dunkelfrosch/phpcoverfish
src/PHPCoverFish/Common/CoverFishMessageError.php
CoverFishMessageError.getErrorStreamTemplate
public function getErrorStreamTemplate(CoverFishMapping $coverMapping, $noAnsiColors = false) { $coverLine = null; switch ($this->getMessageCode()) { case self::PHPUNIT_REFLECTION_CLASS_NOT_FOUND: $coverLine = sprintf('@covers %s::%s', $coverMapping->getClassFQN(), $cover...
php
public function getErrorStreamTemplate(CoverFishMapping $coverMapping, $noAnsiColors = false) { $coverLine = null; switch ($this->getMessageCode()) { case self::PHPUNIT_REFLECTION_CLASS_NOT_FOUND: $coverLine = sprintf('@covers %s::%s', $coverMapping->getClassFQN(), $cover...
[ "public", "function", "getErrorStreamTemplate", "(", "CoverFishMapping", "$", "coverMapping", ",", "$", "noAnsiColors", "=", "false", ")", "{", "$", "coverLine", "=", "null", ";", "switch", "(", "$", "this", "->", "getMessageCode", "(", ")", ")", "{", "case"...
@param CoverFishMapping $coverMapping @param bool|false $noAnsiColors @return null|string
[ "@param", "CoverFishMapping", "$coverMapping", "@param", "bool|false", "$noAnsiColors" ]
train
https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishMessageError.php#L66-L136
afrittella/back-project
src/app/Http/Controllers/Auth/RegisterController.php
RegisterController.showRegistrationForm
public function showRegistrationForm() { //if registration is closed, deny access if (!config('back-project.registration_open')) { abort(403, trans('back-project::base.registration_closed')); } $this->data['title'] = trans('back-project::base.register'); // set the page t...
php
public function showRegistrationForm() { //if registration is closed, deny access if (!config('back-project.registration_open')) { abort(403, trans('back-project::base.registration_closed')); } $this->data['title'] = trans('back-project::base.register'); // set the page t...
[ "public", "function", "showRegistrationForm", "(", ")", "{", "//if registration is closed, deny access", "if", "(", "!", "config", "(", "'back-project.registration_open'", ")", ")", "{", "abort", "(", "403", ",", "trans", "(", "'back-project::base.registration_closed'", ...
Show the application registration form. @return \Illuminate\Http\Response
[ "Show", "the", "application", "registration", "form", "." ]
train
https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/app/Http/Controllers/Auth/RegisterController.php#L38-L46
afrittella/back-project
src/app/Http/Controllers/Auth/RegisterController.php
RegisterController.register
public function register(Request $request, Users $users) { // if registration is closed, deny access if (!config('back-project.registration_open')) { abort(403, trans('back-project::base.registration_closed')); } $this->validator($request->all())->validate(); //$t...
php
public function register(Request $request, Users $users) { // if registration is closed, deny access if (!config('back-project.registration_open')) { abort(403, trans('back-project::base.registration_closed')); } $this->validator($request->all())->validate(); //$t...
[ "public", "function", "register", "(", "Request", "$", "request", ",", "Users", "$", "users", ")", "{", "// if registration is closed, deny access", "if", "(", "!", "config", "(", "'back-project.registration_open'", ")", ")", "{", "abort", "(", "403", ",", "tran...
Handle a registration request for the application. @param \Illuminate\Http\Request $request @return \Illuminate\Http\RedirectResponse
[ "Handle", "a", "registration", "request", "for", "the", "application", "." ]
train
https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/app/Http/Controllers/Auth/RegisterController.php#L55-L76
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setLiveInfoPosition
public function setLiveInfoPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->liveInfoProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setLiveInfoPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->liveInfoProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setLiveInfoPosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "liveInfoProperties", ",", "$", "positionX", ",", "$", ...
Set the live info position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "live", "info", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L124-L128
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setSpectatorInfoPosition
public function setSpectatorInfoPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->spectatorInfoProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setSpectatorInfoPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->spectatorInfoProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setSpectatorInfoPosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "spectatorInfoProperties", ",", "$", "positionX", ",...
Set the spectator info position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "spectator", "info", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L174-L178
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setCheckpointListPosition
public function setCheckpointListPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->checkpointListProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setCheckpointListPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->checkpointListProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setCheckpointListPosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "checkpointListProperties", ",", "$", "positionX", ...
Set the checkpoint list position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "checkpoint", "list", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L248-L252
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setRoundScoresPosition
public function setRoundScoresPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->roundScoresProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setRoundScoresPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->roundScoresProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setRoundScoresPosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "roundScoresProperties", ",", "$", "positionX", ",", ...
Set the round scores position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "round", "scores", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L298-L302
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setChronoPosition
public function setChronoPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->chronoProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setChronoPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->chronoProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setChronoPosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "chronoProperties", ",", "$", "positionX", ",", "$", "p...
Set the chrono position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "chrono", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L348-L352
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setSpeedAndDistancePosition
public function setSpeedAndDistancePosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->speedAndDistanceProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setSpeedAndDistancePosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->speedAndDistanceProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setSpeedAndDistancePosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "speedAndDistanceProperties", ",", "$", "positionX"...
Set the speed and distance position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "speed", "and", "distance", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L398-L402
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setPersonalBestAndRankPosition
public function setPersonalBestAndRankPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->personalBestAndRankProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setPersonalBestAndRankPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->personalBestAndRankProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setPersonalBestAndRankPosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "personalBestAndRankProperties", ",", "$", "posi...
Set the personal best and rank position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "personal", "best", "and", "rank", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L448-L452
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setPositionPosition
public function setPositionPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->positionProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setPositionPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->positionProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setPositionPosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "positionProperties", ",", "$", "positionX", ",", "$", ...
Set the position position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "position", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L498-L502
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setCheckpointTimePosition
public function setCheckpointTimePosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->checkpointTimeProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setCheckpointTimePosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->checkpointTimeProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setCheckpointTimePosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "checkpointTimeProperties", ",", "$", "positionX", ...
Set the checkpoint time position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "checkpoint", "time", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L548-L552
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setWarmUpPosition
public function setWarmUpPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->warmUpProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setWarmUpPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->warmUpProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setWarmUpPosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "warmUpProperties", ",", "$", "positionX", ",", "$", "p...
Set the warm-up position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "warm", "-", "up", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L598-L602
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setMultiLapInfoPosition
public function setMultiLapInfoPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->multiLapInfoProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setMultiLapInfoPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->multiLapInfoProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setMultiLapInfoPosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "multiLapInfoProperties", ",", "$", "positionX", ",",...
Set the multi-lap info position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "multi", "-", "lap", "info", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L648-L652
steeffeen/FancyManiaLinks
FML/XmlRpc/TMUIProperties.php
TMUIProperties.setCheckpointRankingPosition
public function setCheckpointRankingPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->checkpointRankingProperties, $positionX, $positionY, $positionZ); return $this; }
php
public function setCheckpointRankingPosition($positionX, $positionY, $positionZ = null) { $this->setPositionProperty($this->checkpointRankingProperties, $positionX, $positionY, $positionZ); return $this; }
[ "public", "function", "setCheckpointRankingPosition", "(", "$", "positionX", ",", "$", "positionY", ",", "$", "positionZ", "=", "null", ")", "{", "$", "this", "->", "setPositionProperty", "(", "$", "this", "->", "checkpointRankingProperties", ",", "$", "position...
Set the checkpoint ranking position @api @param float $positionX X position @param float $positionY Y position @param float $positionZ (optional) Z position (Z-index) @return static
[ "Set", "the", "checkpoint", "ranking", "position" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/XmlRpc/TMUIProperties.php#L698-L702
scrutinizer-ci/rabbitmq
src/Scrutinizer/RabbitMQ/Rpc/RpcClient.php
RpcClient.invoke
public function invoke($queueName, $payload, $resultType, $timeout = 10) { $rs = $this->invokeAll(array(array($queueName, $payload, $resultType)), $timeout); if ($rs[0] instanceof RpcError) { throw new RpcErrorException($rs[0]); } return $rs[0]; }
php
public function invoke($queueName, $payload, $resultType, $timeout = 10) { $rs = $this->invokeAll(array(array($queueName, $payload, $resultType)), $timeout); if ($rs[0] instanceof RpcError) { throw new RpcErrorException($rs[0]); } return $rs[0]; }
[ "public", "function", "invoke", "(", "$", "queueName", ",", "$", "payload", ",", "$", "resultType", ",", "$", "timeout", "=", "10", ")", "{", "$", "rs", "=", "$", "this", "->", "invokeAll", "(", "array", "(", "array", "(", "$", "queueName", ",", "$...
Invokes a single remote command and returns the result of the invocation. The remote command is invoked synchronously. @param $queueName @param $payload @param $resultType @throws RpcErrorException when a remote error occurs @return mixed
[ "Invokes", "a", "single", "remote", "command", "and", "returns", "the", "result", "of", "the", "invocation", "." ]
train
https://github.com/scrutinizer-ci/rabbitmq/blob/5603f7901de2ad352086287f8d2c65bbae5170d5/src/Scrutinizer/RabbitMQ/Rpc/RpcClient.php#L93-L101
lemonphp/event
src/EventDispatcherTrait.php
EventDispatcherTrait.dispatch
public function dispatch($event) { if (!($event instanceof Event)) { $event = new Event($event); } if ($listeners = $this->getListeners($event->getEventType())) { $this->doDispatch($listeners, $event); } return $event; }
php
public function dispatch($event) { if (!($event instanceof Event)) { $event = new Event($event); } if ($listeners = $this->getListeners($event->getEventType())) { $this->doDispatch($listeners, $event); } return $event; }
[ "public", "function", "dispatch", "(", "$", "event", ")", "{", "if", "(", "!", "(", "$", "event", "instanceof", "Event", ")", ")", "{", "$", "event", "=", "new", "Event", "(", "$", "event", ")", ";", "}", "if", "(", "$", "listeners", "=", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/lemonphp/event/blob/57d9ffcc551febca967068668dd9f005d989d94b/src/EventDispatcherTrait.php#L31-L42
lemonphp/event
src/EventDispatcherTrait.php
EventDispatcherTrait.addListener
public function addListener($eventType, $listener, $priority = 0) { $this->listeners[$eventType][$priority][] = $listener; unset($this->sorted[$eventType]); }
php
public function addListener($eventType, $listener, $priority = 0) { $this->listeners[$eventType][$priority][] = $listener; unset($this->sorted[$eventType]); }
[ "public", "function", "addListener", "(", "$", "eventType", ",", "$", "listener", ",", "$", "priority", "=", "0", ")", "{", "$", "this", "->", "listeners", "[", "$", "eventType", "]", "[", "$", "priority", "]", "[", "]", "=", "$", "listener", ";", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/lemonphp/event/blob/57d9ffcc551febca967068668dd9f005d989d94b/src/EventDispatcherTrait.php#L47-L51
lemonphp/event
src/EventDispatcherTrait.php
EventDispatcherTrait.removeListener
public function removeListener($eventType, $listener) { if (!isset($this->listeners[$eventType])) { return; } foreach ($this->listeners[$eventType] as $priority => $listeners) { if (false !== ($key = array_search($listener, $listeners, true))) { unset...
php
public function removeListener($eventType, $listener) { if (!isset($this->listeners[$eventType])) { return; } foreach ($this->listeners[$eventType] as $priority => $listeners) { if (false !== ($key = array_search($listener, $listeners, true))) { unset...
[ "public", "function", "removeListener", "(", "$", "eventType", ",", "$", "listener", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "listeners", "[", "$", "eventType", "]", ")", ")", "{", "return", ";", "}", "foreach", "(", "$", "this", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/lemonphp/event/blob/57d9ffcc551febca967068668dd9f005d989d94b/src/EventDispatcherTrait.php#L56-L67
lemonphp/event
src/EventDispatcherTrait.php
EventDispatcherTrait.removeAllListeners
public function removeAllListeners($eventType = null) { if (null !== $eventType) { unset($this->listeners[$eventType], $this->sorted[$eventType]); } else { $this->listeners = []; $this->sorted = []; } }
php
public function removeAllListeners($eventType = null) { if (null !== $eventType) { unset($this->listeners[$eventType], $this->sorted[$eventType]); } else { $this->listeners = []; $this->sorted = []; } }
[ "public", "function", "removeAllListeners", "(", "$", "eventType", "=", "null", ")", "{", "if", "(", "null", "!==", "$", "eventType", ")", "{", "unset", "(", "$", "this", "->", "listeners", "[", "$", "eventType", "]", ",", "$", "this", "->", "sorted", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/lemonphp/event/blob/57d9ffcc551febca967068668dd9f005d989d94b/src/EventDispatcherTrait.php#L72-L80
lemonphp/event
src/EventDispatcherTrait.php
EventDispatcherTrait.getListeners
public function getListeners($eventType = null) { if (null !== $eventType) { if (!isset($this->listeners[$eventType])) { return []; } if (!isset($this->sorted[$eventType])) { $this->sortListeners($eventType); } ret...
php
public function getListeners($eventType = null) { if (null !== $eventType) { if (!isset($this->listeners[$eventType])) { return []; } if (!isset($this->sorted[$eventType])) { $this->sortListeners($eventType); } ret...
[ "public", "function", "getListeners", "(", "$", "eventType", "=", "null", ")", "{", "if", "(", "null", "!==", "$", "eventType", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "listeners", "[", "$", "eventType", "]", ")", ")", "{", "retu...
{@inheritdoc}
[ "{" ]
train
https://github.com/lemonphp/event/blob/57d9ffcc551febca967068668dd9f005d989d94b/src/EventDispatcherTrait.php#L85-L106
lemonphp/event
src/EventDispatcherTrait.php
EventDispatcherTrait.getListenerPriority
public function getListenerPriority($eventType, $listener) { if (isset($this->listeners[$eventType])) { foreach ($this->listeners[$eventType] as $priority => $listeners) { if (false !== ($key = array_search($listener, $listeners, true))) { return $priority; ...
php
public function getListenerPriority($eventType, $listener) { if (isset($this->listeners[$eventType])) { foreach ($this->listeners[$eventType] as $priority => $listeners) { if (false !== ($key = array_search($listener, $listeners, true))) { return $priority; ...
[ "public", "function", "getListenerPriority", "(", "$", "eventType", ",", "$", "listener", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "listeners", "[", "$", "eventType", "]", ")", ")", "{", "foreach", "(", "$", "this", "->", "listeners", "[",...
Gets the listener priority for a specific event. Returns null if the event or the listener does not exist. @param string $eventType The name of the event @param callable $listener The listener @return int|null The event listener priority
[ "Gets", "the", "listener", "priority", "for", "a", "specific", "event", "." ]
train
https://github.com/lemonphp/event/blob/57d9ffcc551febca967068668dd9f005d989d94b/src/EventDispatcherTrait.php#L126-L137
lemonphp/event
src/EventDispatcherTrait.php
EventDispatcherTrait.addSubscriber
public function addSubscriber(EventSubscriberInterface $subscriber) { foreach ($subscriber->getSubscribedEvents() as $eventType => $params) { if (is_string($params)) { $this->addListener($eventType, [$subscriber, $params]); } elseif (is_string($params[0])) { ...
php
public function addSubscriber(EventSubscriberInterface $subscriber) { foreach ($subscriber->getSubscribedEvents() as $eventType => $params) { if (is_string($params)) { $this->addListener($eventType, [$subscriber, $params]); } elseif (is_string($params[0])) { ...
[ "public", "function", "addSubscriber", "(", "EventSubscriberInterface", "$", "subscriber", ")", "{", "foreach", "(", "$", "subscriber", "->", "getSubscribedEvents", "(", ")", "as", "$", "eventType", "=>", "$", "params", ")", "{", "if", "(", "is_string", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/lemonphp/event/blob/57d9ffcc551febca967068668dd9f005d989d94b/src/EventDispatcherTrait.php#L142-L159
lemonphp/event
src/EventDispatcherTrait.php
EventDispatcherTrait.sortListeners
protected function sortListeners($eventType) { krsort($this->listeners[$eventType]); $this->sorted[$eventType] = call_user_func_array('array_merge', $this->listeners[$eventType]); }
php
protected function sortListeners($eventType) { krsort($this->listeners[$eventType]); $this->sorted[$eventType] = call_user_func_array('array_merge', $this->listeners[$eventType]); }
[ "protected", "function", "sortListeners", "(", "$", "eventType", ")", "{", "krsort", "(", "$", "this", "->", "listeners", "[", "$", "eventType", "]", ")", ";", "$", "this", "->", "sorted", "[", "$", "eventType", "]", "=", "call_user_func_array", "(", "'a...
Sorts the internal list of listeners for the given event by priority. @param string $eventType The name of the event.
[ "Sorts", "the", "internal", "list", "of", "listeners", "for", "the", "given", "event", "by", "priority", "." ]
train
https://github.com/lemonphp/event/blob/57d9ffcc551febca967068668dd9f005d989d94b/src/EventDispatcherTrait.php#L201-L205
webforge-labs/psc-cms
lib/Psc/Code/Generate/GProperty.php
GProperty.php
public function php($baseIndent = 0) { $php = $this->phpDocBlock($baseIndent); $php .= str_repeat(' ',$baseIndent); $ms = array( self::MODIFIER_PUBLIC => 'public', self::MODIFIER_PRIVATE => 'private', self::MODIFIER_PROTECTED => 'protected', ...
php
public function php($baseIndent = 0) { $php = $this->phpDocBlock($baseIndent); $php .= str_repeat(' ',$baseIndent); $ms = array( self::MODIFIER_PUBLIC => 'public', self::MODIFIER_PRIVATE => 'private', self::MODIFIER_PROTECTED => 'protected', ...
[ "public", "function", "php", "(", "$", "baseIndent", "=", "0", ")", "{", "$", "php", "=", "$", "this", "->", "phpDocBlock", "(", "$", "baseIndent", ")", ";", "$", "php", ".=", "str_repeat", "(", "' '", ",", "$", "baseIndent", ")", ";", "$", "ms", ...
Gibt den PHP Code für das Property zurück Nach dem ; ist kein LF
[ "Gibt", "den", "PHP", "Code", "für", "das", "Property", "zurück" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Generate/GProperty.php#L57-L81
webforge-labs/psc-cms
lib/Psc/Code/Generate/GProperty.php
GProperty.reflectorFactory
public static function reflectorFactory(Reflector $reflector) { $args = func_get_args(); $g = new static($args[1]); $g->elevate($args[0]); return $g; }
php
public static function reflectorFactory(Reflector $reflector) { $args = func_get_args(); $g = new static($args[1]); $g->elevate($args[0]); return $g; }
[ "public", "static", "function", "reflectorFactory", "(", "Reflector", "$", "reflector", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "g", "=", "new", "static", "(", "$", "args", "[", "1", "]", ")", ";", "$", "g", "->", "elevate", ...
Erstellt ein neues GProperty der zweite Parameter ist wichtig @param Reflector $reflector @param GClass $gClass
[ "Erstellt", "ein", "neues", "GProperty" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Generate/GProperty.php#L126-L131
mle86/php-wq
src/WQ/SignalSafeWorkProcessor.php
SignalSafeWorkProcessor.installSignalHandler
public static function installSignalHandler(array $signals = [\SIGTERM, \SIGINT]) { $lastSignal =& self::$lastSignal; $alive =& self::$alive; $fnHandler = function (int $signo) use (&$lastSignal, &$alive) { $lastSignal = $signo; $alive = false; }; ...
php
public static function installSignalHandler(array $signals = [\SIGTERM, \SIGINT]) { $lastSignal =& self::$lastSignal; $alive =& self::$alive; $fnHandler = function (int $signo) use (&$lastSignal, &$alive) { $lastSignal = $signo; $alive = false; }; ...
[ "public", "static", "function", "installSignalHandler", "(", "array", "$", "signals", "=", "[", "\\", "SIGTERM", ",", "\\", "SIGINT", "]", ")", "{", "$", "lastSignal", "=", "&", "self", "::", "$", "lastSignal", ";", "$", "alive", "=", "&", "self", "::"...
Installs a signal handler that will clear the {@see isAlive()} flag. The registered signals will not immediately terminate the program anymore, giving the job handler callback enough time to finish their execution. If {@see isAlive()} is false after {@see processNextJob()} returns, you should {@see exit} the program....
[ "Installs", "a", "signal", "handler", "that", "will", "clear", "the", "{", "@see", "isAlive", "()", "}", "flag", "." ]
train
https://github.com/mle86/php-wq/blob/e1ca1dcfd3d40edb0085f6dfa83d90db74253de4/src/WQ/SignalSafeWorkProcessor.php#L56-L69
askupasoftware/amarkal
Form/Updater.php
Updater.update
public function update( array $old_instance = array() ) { $this->old_instance = $old_instance; $this->update_components( $this->components ); return $this->final_instance; }
php
public function update( array $old_instance = array() ) { $this->old_instance = $old_instance; $this->update_components( $this->components ); return $this->final_instance; }
[ "public", "function", "update", "(", "array", "$", "old_instance", "=", "array", "(", ")", ")", "{", "$", "this", "->", "old_instance", "=", "$", "old_instance", ";", "$", "this", "->", "update_components", "(", "$", "this", "->", "components", ")", ";",...
Get the updated component values (validated, filtered or ignored). Loops through each component and acts according to its type: - Disableable components are ignored if they are disabled. - Validatable components are validated using their validation function. If the new value is invalid, the old value will be used. - F...
[ "Get", "the", "updated", "component", "values", "(", "validated", "filtered", "or", "ignored", ")", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Form/Updater.php#L84-L89
askupasoftware/amarkal
Form/Updater.php
Updater.reset
public function reset( array $names = array() ) { if( array() == $names ) { // Unset new instance to force reset $this->new_instance = array(); return $this->update(); } else { foreach( $this->components as $c ) { ...
php
public function reset( array $names = array() ) { if( array() == $names ) { // Unset new instance to force reset $this->new_instance = array(); return $this->update(); } else { foreach( $this->components as $c ) { ...
[ "public", "function", "reset", "(", "array", "$", "names", "=", "array", "(", ")", ")", "{", "if", "(", "array", "(", ")", "==", "$", "names", ")", "{", "// Unset new instance to force reset", "$", "this", "->", "new_instance", "=", "array", "(", ")", ...
Reset all fields to their default values. @param array $names List of component names to be set to their defaults. If no names are specified, all components will be reset @return array The updated values array.
[ "Reset", "all", "fields", "to", "their", "default", "values", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Form/Updater.php#L97-L116
askupasoftware/amarkal
Form/Updater.php
Updater.update_components
private function update_components( $components ) { foreach ( $components as $component ) { // Update each component in the composite collection if ( $component instanceof UI\Components\Composite ) { $this->update_components( $component->component...
php
private function update_components( $components ) { foreach ( $components as $component ) { // Update each component in the composite collection if ( $component instanceof UI\Components\Composite ) { $this->update_components( $component->component...
[ "private", "function", "update_components", "(", "$", "components", ")", "{", "foreach", "(", "$", "components", "as", "$", "component", ")", "{", "// Update each component in the composite collection", "if", "(", "$", "component", "instanceof", "UI", "\\", "Compone...
Update the given list of components. Recursively calls itself fpr composite components. @param UI\AbstractComponent $components
[ "Update", "the", "given", "list", "of", "components", ".", "Recursively", "calls", "itself", "fpr", "composite", "components", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Form/Updater.php#L124-L140
askupasoftware/amarkal
Form/Updater.php
Updater.update_component
private function update_component( UI\ValueComponentInterface $component ) { $comp_name = $component->get_name(); // Use default values if: // 1. There is no old value (this is the first initiation of the form) // and no new instance (this is not a form submission), or ...
php
private function update_component( UI\ValueComponentInterface $component ) { $comp_name = $component->get_name(); // Use default values if: // 1. There is no old value (this is the first initiation of the form) // and no new instance (this is not a form submission), or ...
[ "private", "function", "update_component", "(", "UI", "\\", "ValueComponentInterface", "$", "component", ")", "{", "$", "comp_name", "=", "$", "component", "->", "get_name", "(", ")", ";", "// Use default values if:", "// 1. There is no old value (this is the first initia...
Update the component's value with the new value. NOTE: this function also updates the $final_instance array. @param ValueComponentInterface $component The component to validate. @param type $new_instance The new component values array. @param type $old_instance The old component values array.
[ "Update", "the", "component", "s", "value", "with", "the", "new", "value", ".", "NOTE", ":", "this", "function", "also", "updates", "the", "$final_instance", "array", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Form/Updater.php#L151-L191
askupasoftware/amarkal
Form/Updater.php
Updater.update_value
private function update_value( $component, $value ) { $component->set_value( $value ); $this->final_instance[$component->get_name()] = $value; }
php
private function update_value( $component, $value ) { $component->set_value( $value ); $this->final_instance[$component->get_name()] = $value; }
[ "private", "function", "update_value", "(", "$", "component", ",", "$", "value", ")", "{", "$", "component", "->", "set_value", "(", "$", "value", ")", ";", "$", "this", "->", "final_instance", "[", "$", "component", "->", "get_name", "(", ")", "]", "=...
Update the component's value and the final instance with the given value. @param UI\AbstractComponent $component @param string $value
[ "Update", "the", "component", "s", "value", "and", "the", "final", "instance", "with", "the", "given", "value", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Form/Updater.php#L200-L204
askupasoftware/amarkal
Form/Updater.php
Updater.update_filterable
private function update_filterable( UI\FilterableComponentInterface $component ) { $this->update_value( $component, $component->apply_filter( $this->new_instance[$component->get_name()] ) ); }
php
private function update_filterable( UI\FilterableComponentInterface $component ) { $this->update_value( $component, $component->apply_filter( $this->new_instance[$component->get_name()] ) ); }
[ "private", "function", "update_filterable", "(", "UI", "\\", "FilterableComponentInterface", "$", "component", ")", "{", "$", "this", "->", "update_value", "(", "$", "component", ",", "$", "component", "->", "apply_filter", "(", "$", "this", "->", "new_instance"...
Filter the component's value using its filter function. @param UI\FilterableComponentInterface $component
[ "Filter", "the", "component", "s", "value", "using", "its", "filter", "function", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Form/Updater.php#L224-L230
askupasoftware/amarkal
Form/Updater.php
Updater.update_validatable
private function update_validatable( UI\ValidatableComponentInterface $component ) { $name = $component->get_name(); $error = ''; // Invalid input, use old instance or default value if ( !$component->validate( $this->new_instance[$name], $error ) ) { ...
php
private function update_validatable( UI\ValidatableComponentInterface $component ) { $name = $component->get_name(); $error = ''; // Invalid input, use old instance or default value if ( !$component->validate( $this->new_instance[$name], $error ) ) { ...
[ "private", "function", "update_validatable", "(", "UI", "\\", "ValidatableComponentInterface", "$", "component", ")", "{", "$", "name", "=", "$", "component", "->", "get_name", "(", ")", ";", "$", "error", "=", "''", ";", "// Invalid input, use old instance or def...
Validate the component's value using its validation function. If the value is invalid, the old value is used, and an error message is saved into the errors array as component_name => error_message. @param ValidatableComponentInterface $component The component to validate.
[ "Validate", "the", "component", "s", "value", "using", "its", "validation", "function", "." ]
train
https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Form/Updater.php#L240-L255
PortaText/php-sdk
src/PortaText/Command/Api/Trunks.php
Trunks.getEndpoint
protected function getEndpoint($method) { $endpoint = "trunks"; $trunkId = $this->getArgument("id"); if (!is_null($trunkId)) { $endpoint .= "/$trunkId"; $this->delArgument("id"); } return $endpoint; }
php
protected function getEndpoint($method) { $endpoint = "trunks"; $trunkId = $this->getArgument("id"); if (!is_null($trunkId)) { $endpoint .= "/$trunkId"; $this->delArgument("id"); } return $endpoint; }
[ "protected", "function", "getEndpoint", "(", "$", "method", ")", "{", "$", "endpoint", "=", "\"trunks\"", ";", "$", "trunkId", "=", "$", "this", "->", "getArgument", "(", "\"id\"", ")", ";", "if", "(", "!", "is_null", "(", "$", "trunkId", ")", ")", "...
Returns a string with the endpoint for the given command. @param string $method Method for this command. @return string
[ "Returns", "a", "string", "with", "the", "endpoint", "for", "the", "given", "command", "." ]
train
https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/Trunks.php#L64-L73
forxer/tao
src/Tao/Support/StopWords.php
StopWords.get
public function get($locale = 'en') { if (isset($this->stopwords[$locale])) { return $this->stopwords[$locale]; } $this->stopwords[$locale] = []; $filename = $this->path . '/' . $locale . '.php'; if (file_exists($filename)) { $this->stopwords[$locale] = require $filename; } return $this->stopwo...
php
public function get($locale = 'en') { if (isset($this->stopwords[$locale])) { return $this->stopwords[$locale]; } $this->stopwords[$locale] = []; $filename = $this->path . '/' . $locale . '.php'; if (file_exists($filename)) { $this->stopwords[$locale] = require $filename; } return $this->stopwo...
[ "public", "function", "get", "(", "$", "locale", "=", "'en'", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "stopwords", "[", "$", "locale", "]", ")", ")", "{", "return", "$", "this", "->", "stopwords", "[", "$", "locale", "]", ";", "}", ...
Return stop word list for given locale. @param string $locale @return array
[ "Return", "stop", "word", "list", "for", "given", "locale", "." ]
train
https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Support/StopWords.php#L25-L40
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php
BaseRolePeer.getFieldNames
public static function getFieldNames($type = BasePeer::TYPE_PHPNAME) { if (!array_key_exists($type, RolePeer::$fieldNames)) { throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BaseP...
php
public static function getFieldNames($type = BasePeer::TYPE_PHPNAME) { if (!array_key_exists($type, RolePeer::$fieldNames)) { throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BaseP...
[ "public", "static", "function", "getFieldNames", "(", "$", "type", "=", "BasePeer", "::", "TYPE_PHPNAME", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "type", ",", "RolePeer", "::", "$", "fieldNames", ")", ")", "{", "throw", "new", "PropelExcept...
Returns an array of field names. @param string $type The type of fieldnames to return: One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM @return array A list of field names @throws PropelException - i...
[ "Returns", "an", "array", "of", "field", "names", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php#L122-L129
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php
BaseRolePeer.addSelectColumns
public static function addSelectColumns(Criteria $criteria, $alias = null) { if (null === $alias) { $criteria->addSelectColumn(RolePeer::ID); $criteria->addSelectColumn(RolePeer::NAME); $criteria->addSelectColumn(RolePeer::ROLE); } else { $criteria->ad...
php
public static function addSelectColumns(Criteria $criteria, $alias = null) { if (null === $alias) { $criteria->addSelectColumn(RolePeer::ID); $criteria->addSelectColumn(RolePeer::NAME); $criteria->addSelectColumn(RolePeer::ROLE); } else { $criteria->ad...
[ "public", "static", "function", "addSelectColumns", "(", "Criteria", "$", "criteria", ",", "$", "alias", "=", "null", ")", "{", "if", "(", "null", "===", "$", "alias", ")", "{", "$", "criteria", "->", "addSelectColumn", "(", "RolePeer", "::", "ID", ")", ...
Add all the columns needed to create a new object. Note: any columns that were marked with lazyLoad="true" in the XML schema will not be added to the select list and only loaded on demand. @param Criteria $criteria object containing the columns to add. @param string $alias optional table alias @throws ...
[ "Add", "all", "the", "columns", "needed", "to", "create", "a", "new", "object", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php#L160-L171
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php
BaseRolePeer.getInstanceFromPool
public static function getInstanceFromPool($key) { if (Propel::isInstancePoolingEnabled()) { if (isset(RolePeer::$instances[$key])) { return RolePeer::$instances[$key]; } } return null; // just to be explicit }
php
public static function getInstanceFromPool($key) { if (Propel::isInstancePoolingEnabled()) { if (isset(RolePeer::$instances[$key])) { return RolePeer::$instances[$key]; } } return null; // just to be explicit }
[ "public", "static", "function", "getInstanceFromPool", "(", "$", "key", ")", "{", "if", "(", "Propel", "::", "isInstancePoolingEnabled", "(", ")", ")", "{", "if", "(", "isset", "(", "RolePeer", "::", "$", "instances", "[", "$", "key", "]", ")", ")", "{...
Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table. For tables with a single-column primary key, that simple pkey value will be returned. For tables with a multi-column primary key, a serialize()d version of the primary key will be returne...
[ "Retrieves", "a", "string", "version", "of", "the", "primary", "key", "from", "the", "DB", "resultset", "row", "that", "can", "be", "used", "to", "uniquely", "identify", "a", "row", "in", "this", "table", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php#L342-L351
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php
BaseRolePeer.buildTableMap
public static function buildTableMap() { $dbMap = Propel::getDatabaseMap(BaseRolePeer::DATABASE_NAME); if (!$dbMap->hasTable(BaseRolePeer::TABLE_NAME)) { $dbMap->addTableObject(new \Slashworks\BackendBundle\Model\map\RoleTableMap()); } }
php
public static function buildTableMap() { $dbMap = Propel::getDatabaseMap(BaseRolePeer::DATABASE_NAME); if (!$dbMap->hasTable(BaseRolePeer::TABLE_NAME)) { $dbMap->addTableObject(new \Slashworks\BackendBundle\Model\map\RoleTableMap()); } }
[ "public", "static", "function", "buildTableMap", "(", ")", "{", "$", "dbMap", "=", "Propel", "::", "getDatabaseMap", "(", "BaseRolePeer", "::", "DATABASE_NAME", ")", ";", "if", "(", "!", "$", "dbMap", "->", "hasTable", "(", "BaseRolePeer", "::", "TABLE_NAME"...
Add a TableMap instance to the database for this peer class.
[ "Add", "a", "TableMap", "instance", "to", "the", "database", "for", "this", "peer", "class", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php#L488-L494
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php
BaseRolePeer.doInsert
public static function doInsert($values, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(RolePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); } if ($values instanceof Criteria) { $criteria = clone $values; // rename for clarity } els...
php
public static function doInsert($values, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(RolePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); } if ($values instanceof Criteria) { $criteria = clone $values; // rename for clarity } els...
[ "public", "static", "function", "doInsert", "(", "$", "values", ",", "PropelPDO", "$", "con", "=", "null", ")", "{", "if", "(", "$", "con", "===", "null", ")", "{", "$", "con", "=", "Propel", "::", "getConnection", "(", "RolePeer", "::", "DATABASE_NAME...
Performs an INSERT on the database, given a Role or Criteria object. @param mixed $values Criteria or Role object containing data that is used to create the INSERT statement. @param PropelPDO $con the PropelPDO connection to use @return mixed The new primary key. @throws PropelException Any excepti...
[ "Performs", "an", "INSERT", "on", "the", "database", "given", "a", "Role", "or", "Criteria", "object", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php#L516-L548
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php
BaseRolePeer.doOnDeleteCascade
protected static function doOnDeleteCascade(Criteria $criteria, PropelPDO $con) { // initialize var to track total num of affected rows $affectedRows = 0; // first find the objects that are implicated by the $criteria $objects = RolePeer::doSelect($criteria, $con); foreach (...
php
protected static function doOnDeleteCascade(Criteria $criteria, PropelPDO $con) { // initialize var to track total num of affected rows $affectedRows = 0; // first find the objects that are implicated by the $criteria $objects = RolePeer::doSelect($criteria, $con); foreach (...
[ "protected", "static", "function", "doOnDeleteCascade", "(", "Criteria", "$", "criteria", ",", "PropelPDO", "$", "con", ")", "{", "// initialize var to track total num of affected rows", "$", "affectedRows", "=", "0", ";", "// first find the objects that are implicated by the...
This is a method for emulating ON DELETE CASCADE for DBs that don't support this feature (like MySQL or SQLite). This method is not very speedy because it must perform a query first to get the implicated records and then perform the deletes by calling those Peer classes. This method should be used within a transactio...
[ "This", "is", "a", "method", "for", "emulating", "ON", "DELETE", "CASCADE", "for", "DBs", "that", "don", "t", "support", "this", "feature", "(", "like", "MySQL", "or", "SQLite", ")", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRolePeer.php#L701-L719
flipboxstudio/orm-manager
src/Flipbox/OrmManager/Consoles/ModelDetail.php
ModelDetail.handle
public function handle() { $model = $this->argument('model'); if ($this->manager->isModelExists($model)) { return $this->showDetail($this->manager->getModel($model)); } $this->error("Model {$model} is not found"); }
php
public function handle() { $model = $this->argument('model'); if ($this->manager->isModelExists($model)) { return $this->showDetail($this->manager->getModel($model)); } $this->error("Model {$model} is not found"); }
[ "public", "function", "handle", "(", ")", "{", "$", "model", "=", "$", "this", "->", "argument", "(", "'model'", ")", ";", "if", "(", "$", "this", "->", "manager", "->", "isModelExists", "(", "$", "model", ")", ")", "{", "return", "$", "this", "->"...
Execute the console command. @return mixed
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/Consoles/ModelDetail.php#L60-L69
flipboxstudio/orm-manager
src/Flipbox/OrmManager/Consoles/ModelDetail.php
ModelDetail.showDetail
protected function showDetail(Model $model) { $name = $this->manager->getClassName($model); $this->title("Summary of Model {$name} :"); $summary = $this->manager->getModelSummary($name); $rows = []; foreach ($summary as $key => $value) { if (is_bool($value)) { ...
php
protected function showDetail(Model $model) { $name = $this->manager->getClassName($model); $this->title("Summary of Model {$name} :"); $summary = $this->manager->getModelSummary($name); $rows = []; foreach ($summary as $key => $value) { if (is_bool($value)) { ...
[ "protected", "function", "showDetail", "(", "Model", "$", "model", ")", "{", "$", "name", "=", "$", "this", "->", "manager", "->", "getClassName", "(", "$", "model", ")", ";", "$", "this", "->", "title", "(", "\"Summary of Model {$name} :\"", ")", ";", "...
show detail of model @param Model $model @return void
[ "show", "detail", "of", "model" ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/Consoles/ModelDetail.php#L77-L101
flipboxstudio/orm-manager
src/Flipbox/OrmManager/Consoles/ModelDetail.php
ModelDetail.showDatabaseFields
protected function showDatabaseFields(Model $model) { $this->title("Table {$model->getTable()} :"); if ( ! $this->db->isConnected()) { $this->warn("Not Connected to databse, please check your connection config\r"); } else { $fields = $this->db->getFields($model->getT...
php
protected function showDatabaseFields(Model $model) { $this->title("Table {$model->getTable()} :"); if ( ! $this->db->isConnected()) { $this->warn("Not Connected to databse, please check your connection config\r"); } else { $fields = $this->db->getFields($model->getT...
[ "protected", "function", "showDatabaseFields", "(", "Model", "$", "model", ")", "{", "$", "this", "->", "title", "(", "\"Table {$model->getTable()} :\"", ")", ";", "if", "(", "!", "$", "this", "->", "db", "->", "isConnected", "(", ")", ")", "{", "$", "th...
show database fileds @param Model $model @return void
[ "show", "database", "fileds" ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/Consoles/ModelDetail.php#L109-L121
flipboxstudio/orm-manager
src/Flipbox/OrmManager/Consoles/ModelDetail.php
ModelDetail.showRelatoins
protected function showRelatoins(Model $model) { $name = $this->manager->getClassName($model); $this->title("Relations of Model {$name}: "); $relations = $this->manager->getRelations($model); $tbody = []; foreach ($relations as $relation) { $relationName = $thi...
php
protected function showRelatoins(Model $model) { $name = $this->manager->getClassName($model); $this->title("Relations of Model {$name}: "); $relations = $this->manager->getRelations($model); $tbody = []; foreach ($relations as $relation) { $relationName = $thi...
[ "protected", "function", "showRelatoins", "(", "Model", "$", "model", ")", "{", "$", "name", "=", "$", "this", "->", "manager", "->", "getClassName", "(", "$", "model", ")", ";", "$", "this", "->", "title", "(", "\"Relations of Model {$name}: \"", ")", ";"...
show relations of model @param Model $model @return void
[ "show", "relations", "of", "model" ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/Consoles/ModelDetail.php#L129-L149
flipboxstudio/orm-manager
src/Flipbox/OrmManager/Consoles/ModelDetail.php
ModelDetail.showModifier
protected function showModifier(Model $model) { $name = $this->manager->getClassName($model); $this->title("Modifier of Model {$name}: "); $modifiers = [ 'mutators' => $this->manager->getMutators($model), 'accessors' => $this->manager->getAccessors($model), ...
php
protected function showModifier(Model $model) { $name = $this->manager->getClassName($model); $this->title("Modifier of Model {$name}: "); $modifiers = [ 'mutators' => $this->manager->getMutators($model), 'accessors' => $this->manager->getAccessors($model), ...
[ "protected", "function", "showModifier", "(", "Model", "$", "model", ")", "{", "$", "name", "=", "$", "this", "->", "manager", "->", "getClassName", "(", "$", "model", ")", ";", "$", "this", "->", "title", "(", "\"Modifier of Model {$name}: \"", ")", ";", ...
show model modifier @param Model $model @return void
[ "show", "model", "modifier" ]
train
https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/Consoles/ModelDetail.php#L157-L189
koriym/Koriym.Psr4List
src/Psr4List.php
Psr4List.invoke
private function invoke($prefix, $path) { foreach ($this->files($path) as $item) { /** @var $item \SplFileInfo */ $file = $item->getPathname(); $namePath = str_replace('/', '\\' , substr(substr($file, strlen($path) + 1), 0, -4)); $class = $prefix . '\\' . $nam...
php
private function invoke($prefix, $path) { foreach ($this->files($path) as $item) { /** @var $item \SplFileInfo */ $file = $item->getPathname(); $namePath = str_replace('/', '\\' , substr(substr($file, strlen($path) + 1), 0, -4)); $class = $prefix . '\\' . $nam...
[ "private", "function", "invoke", "(", "$", "prefix", ",", "$", "path", ")", "{", "foreach", "(", "$", "this", "->", "files", "(", "$", "path", ")", "as", "$", "item", ")", "{", "/** @var $item \\SplFileInfo */", "$", "file", "=", "$", "item", "->", "...
@param string $prefix @param string $path @return \Generator
[ "@param", "string", "$prefix", "@param", "string", "$path" ]
train
https://github.com/koriym/Koriym.Psr4List/blob/4f267aa6de4e37cfa84f4d9447f2936e8c79870a/src/Psr4List.php#L28-L41
nicklaw5/larapi
src/Larapi.php
Larapi.badRequest
public function badRequest($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_BAD_REQUEST, $headers); }
php
public function badRequest($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_BAD_REQUEST, $headers); }
[ "public", "function", "badRequest", "(", "$", "msg", "=", "''", ",", "$", "errorCode", "=", "null", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getErrorResponse", "(", "$", "msg", ",", "$", "errorCode", ",", "self", ...
Returns 400 Bad Request Response @param string $msg @param int $errorCode @param array $headers @return json
[ "Returns", "400", "Bad", "Request", "Response" ]
train
https://github.com/nicklaw5/larapi/blob/fb3493118bb9c6ce01567230c09e8402ac148d0e/src/Larapi.php#L110-L113
nicklaw5/larapi
src/Larapi.php
Larapi.unauthorized
public function unauthorized($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_UNAUTHORIZED, $headers); }
php
public function unauthorized($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_UNAUTHORIZED, $headers); }
[ "public", "function", "unauthorized", "(", "$", "msg", "=", "''", ",", "$", "errorCode", "=", "null", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getErrorResponse", "(", "$", "msg", ",", "$", "errorCode", ",", "self", ...
Returns 401 Unauthorized Response @param string $msg @param int $errorCode @param array $headers @return json
[ "Returns", "401", "Unauthorized", "Response" ]
train
https://github.com/nicklaw5/larapi/blob/fb3493118bb9c6ce01567230c09e8402ac148d0e/src/Larapi.php#L123-L126
nicklaw5/larapi
src/Larapi.php
Larapi.forbidden
public function forbidden($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_FORBIDDEN, $headers); }
php
public function forbidden($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_FORBIDDEN, $headers); }
[ "public", "function", "forbidden", "(", "$", "msg", "=", "''", ",", "$", "errorCode", "=", "null", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getErrorResponse", "(", "$", "msg", ",", "$", "errorCode", ",", "self", "...
Returns 403 Forbidden Response @param string $msg @param int $errorCode @param array $headers @return json
[ "Returns", "403", "Forbidden", "Response" ]
train
https://github.com/nicklaw5/larapi/blob/fb3493118bb9c6ce01567230c09e8402ac148d0e/src/Larapi.php#L136-L139
nicklaw5/larapi
src/Larapi.php
Larapi.notFound
public function notFound($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_NOT_FOUND, $headers); }
php
public function notFound($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_NOT_FOUND, $headers); }
[ "public", "function", "notFound", "(", "$", "msg", "=", "''", ",", "$", "errorCode", "=", "null", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getErrorResponse", "(", "$", "msg", ",", "$", "errorCode", ",", "self", ":...
Returns 404 Not Found HTTP Response @param string $msg @param int $errorCode @param array $headers @return json
[ "Returns", "404", "Not", "Found", "HTTP", "Response" ]
train
https://github.com/nicklaw5/larapi/blob/fb3493118bb9c6ce01567230c09e8402ac148d0e/src/Larapi.php#L149-L152
nicklaw5/larapi
src/Larapi.php
Larapi.methodNotAllowed
public function methodNotAllowed($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_METHOD_NOT_ALLOWED, $headers); }
php
public function methodNotAllowed($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_METHOD_NOT_ALLOWED, $headers); }
[ "public", "function", "methodNotAllowed", "(", "$", "msg", "=", "''", ",", "$", "errorCode", "=", "null", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getErrorResponse", "(", "$", "msg", ",", "$", "errorCode", ",", "sel...
Returns 405 Method Not Allowed Response @param string $msg @param int $errorCode @param array $headers @return json
[ "Returns", "405", "Method", "Not", "Allowed", "Response" ]
train
https://github.com/nicklaw5/larapi/blob/fb3493118bb9c6ce01567230c09e8402ac148d0e/src/Larapi.php#L162-L165
nicklaw5/larapi
src/Larapi.php
Larapi.conflict
public function conflict($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_CONFLICT, $headers); }
php
public function conflict($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_CONFLICT, $headers); }
[ "public", "function", "conflict", "(", "$", "msg", "=", "''", ",", "$", "errorCode", "=", "null", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getErrorResponse", "(", "$", "msg", ",", "$", "errorCode", ",", "self", ":...
Returns 409 Conflict Response @param string $msg @param int $errorCode @param array $headers @return json
[ "Returns", "409", "Conflict", "Response" ]
train
https://github.com/nicklaw5/larapi/blob/fb3493118bb9c6ce01567230c09e8402ac148d0e/src/Larapi.php#L175-L178
nicklaw5/larapi
src/Larapi.php
Larapi.unprocessableEntity
public function unprocessableEntity($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_UNPROCESSABLE_ENTITY, $headers); }
php
public function unprocessableEntity($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_UNPROCESSABLE_ENTITY, $headers); }
[ "public", "function", "unprocessableEntity", "(", "$", "msg", "=", "''", ",", "$", "errorCode", "=", "null", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getErrorResponse", "(", "$", "msg", ",", "$", "errorCode", ",", "...
Returns 422 Unprocessable Entity @param string $msg @param int $errorCode @param array $headers @return json
[ "Returns", "422", "Unprocessable", "Entity" ]
train
https://github.com/nicklaw5/larapi/blob/fb3493118bb9c6ce01567230c09e8402ac148d0e/src/Larapi.php#L188-L191
nicklaw5/larapi
src/Larapi.php
Larapi.internalError
public function internalError($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_INTERNAL_SERVER_ERROR, $headers); }
php
public function internalError($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_INTERNAL_SERVER_ERROR, $headers); }
[ "public", "function", "internalError", "(", "$", "msg", "=", "''", ",", "$", "errorCode", "=", "null", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getErrorResponse", "(", "$", "msg", ",", "$", "errorCode", ",", "self",...
Returns 500 Internal Server HTTP Response @param string $msg @param int $errorCode @param array $headers @return json
[ "Returns", "500", "Internal", "Server", "HTTP", "Response" ]
train
https://github.com/nicklaw5/larapi/blob/fb3493118bb9c6ce01567230c09e8402ac148d0e/src/Larapi.php#L201-L204
nicklaw5/larapi
src/Larapi.php
Larapi.notImplemented
public function notImplemented($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_NOT_IMPLEMENTED, $headers); }
php
public function notImplemented($msg = '', $errorCode = null, $headers = []) { return $this->getErrorResponse($msg, $errorCode, self::HTTP_NOT_IMPLEMENTED, $headers); }
[ "public", "function", "notImplemented", "(", "$", "msg", "=", "''", ",", "$", "errorCode", "=", "null", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getErrorResponse", "(", "$", "msg", ",", "$", "errorCode", ",", "self"...
Returns 501 Not Implemented HTTP Response @param string $msg @param int $errorCode @param array $headers @return json
[ "Returns", "501", "Not", "Implemented", "HTTP", "Response" ]
train
https://github.com/nicklaw5/larapi/blob/fb3493118bb9c6ce01567230c09e8402ac148d0e/src/Larapi.php#L214-L217