id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
4,400
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/database/connection.php
Database_Connection.instance
public static function instance($name = null, array $config = null, $writable = true) { \Config::load('db', true); if ($name === null) { // Use the default instance name $name = \Config::get('db.active'); } if ( ! $writable and ($readonly = \Config::get('db.'.$name.'.readonly', false))) { ! isset...
php
public static function instance($name = null, array $config = null, $writable = true) { \Config::load('db', true); if ($name === null) { // Use the default instance name $name = \Config::get('db.active'); } if ( ! $writable and ($readonly = \Config::get('db.'.$name.'.readonly', false))) { ! isset...
[ "public", "static", "function", "instance", "(", "$", "name", "=", "null", ",", "array", "$", "config", "=", "null", ",", "$", "writable", "=", "true", ")", "{", "\\", "Config", "::", "load", "(", "'db'", ",", "true", ")", ";", "if", "(", "$", "n...
Get a singleton Database instance. If configuration is not specified, it will be loaded from the database configuration file using the same group as the name. // Load the default database $db = static::instance(); // Create a custom configured instance $db = static::instance('custom', $config); @param string $name...
[ "Get", "a", "singleton", "Database", "instance", ".", "If", "configuration", "is", "not", "specified", "it", "will", "be", "loaded", "from", "the", "database", "configuration", "file", "using", "the", "same", "group", "as", "the", "name", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/connection.php#L50-L86
4,401
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/database/connection.php
Database_Connection.count_last_query
public function count_last_query() { if ($sql = $this->last_query) { $sql = trim($sql); if (stripos($sql, 'SELECT') !== 0) { return false; } if (stripos($sql, 'LIMIT') !== false) { // Remove LIMIT from the SQL $sql = preg_replace('/\sLIMIT\s+[^a-z]+/i', ' ', $sql); } if (strip...
php
public function count_last_query() { if ($sql = $this->last_query) { $sql = trim($sql); if (stripos($sql, 'SELECT') !== 0) { return false; } if (stripos($sql, 'LIMIT') !== false) { // Remove LIMIT from the SQL $sql = preg_replace('/\sLIMIT\s+[^a-z]+/i', ' ', $sql); } if (strip...
[ "public", "function", "count_last_query", "(", ")", "{", "if", "(", "$", "sql", "=", "$", "this", "->", "last_query", ")", "{", "$", "sql", "=", "trim", "(", "$", "sql", ")", ";", "if", "(", "stripos", "(", "$", "sql", ",", "'SELECT'", ")", "!=="...
Count the number of records in the last query, without LIMIT or OFFSET applied. // Get the total number of records that match the last query $count = $db->count_last_query(); @return integer
[ "Count", "the", "number", "of", "records", "in", "the", "last", "query", "without", "LIMIT", "or", "OFFSET", "applied", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/connection.php#L232-L268
4,402
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/database/connection.php
Database_Connection.count_records
public function count_records($table) { // Quote the table name $table = $this->quote_table($table); return $this->query(\DB::SELECT, 'SELECT COUNT(*) AS total_row_count FROM '.$table, false) ->get('total_row_count'); }
php
public function count_records($table) { // Quote the table name $table = $this->quote_table($table); return $this->query(\DB::SELECT, 'SELECT COUNT(*) AS total_row_count FROM '.$table, false) ->get('total_row_count'); }
[ "public", "function", "count_records", "(", "$", "table", ")", "{", "// Quote the table name", "$", "table", "=", "$", "this", "->", "quote_table", "(", "$", "table", ")", ";", "return", "$", "this", "->", "query", "(", "\\", "DB", "::", "SELECT", ",", ...
Count the number of records in a table. // Get the total number of records in the "users" table $count = $db->count_records('users'); @param mixed $table table name string or array(query, alias) @return integer
[ "Count", "the", "number", "of", "records", "in", "a", "table", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/connection.php#L297-L304
4,403
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/database/connection.php
Database_Connection._parse_type
protected function _parse_type($type) { if (($open = strpos($type, '(')) === false) { // No length specified return array($type, null); } // Closing parenthesis $close = strpos($type, ')', $open); // Length without parentheses $length = substr($type, $open + 1, $close - 1 - $open); // Type wit...
php
protected function _parse_type($type) { if (($open = strpos($type, '(')) === false) { // No length specified return array($type, null); } // Closing parenthesis $close = strpos($type, ')', $open); // Length without parentheses $length = substr($type, $open + 1, $close - 1 - $open); // Type wit...
[ "protected", "function", "_parse_type", "(", "$", "type", ")", "{", "if", "(", "(", "$", "open", "=", "strpos", "(", "$", "type", ",", "'('", ")", ")", "===", "false", ")", "{", "// No length specified", "return", "array", "(", "$", "type", ",", "nul...
Extracts the text between parentheses, if any. // Returns: array('CHAR', '6') list($type, $length) = $db->_parse_type('CHAR(6)'); @param string $type @return array list containing the type and length, if any
[ "Extracts", "the", "text", "between", "parentheses", "if", "any", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/connection.php#L420-L438
4,404
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/database/connection.php
Database_Connection.table_prefix
public function table_prefix($table = null) { if ($table !== null) { return $this->_config['table_prefix'] .$table; } return $this->_config['table_prefix']; }
php
public function table_prefix($table = null) { if ($table !== null) { return $this->_config['table_prefix'] .$table; } return $this->_config['table_prefix']; }
[ "public", "function", "table_prefix", "(", "$", "table", "=", "null", ")", "{", "if", "(", "$", "table", "!==", "null", ")", "{", "return", "$", "this", "->", "_config", "[", "'table_prefix'", "]", ".", "$", "table", ";", "}", "return", "$", "this", ...
Return the table prefix defined in the current configuration. $prefix = $db->table_prefix(); @param string $table @return string
[ "Return", "the", "table", "prefix", "defined", "in", "the", "current", "configuration", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/connection.php#L449-L457
4,405
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/database/connection.php
Database_Connection.quote
public function quote($value) { if ($value === null) { return 'null'; } elseif ($value === true) { return "'1'"; } elseif ($value === false) { return "'0'"; } elseif (is_object($value)) { if ($value instanceof Database_Query) { // Create a sub-query return '('.$value->compi...
php
public function quote($value) { if ($value === null) { return 'null'; } elseif ($value === true) { return "'1'"; } elseif ($value === false) { return "'0'"; } elseif (is_object($value)) { if ($value instanceof Database_Query) { // Create a sub-query return '('.$value->compi...
[ "public", "function", "quote", "(", "$", "value", ")", "{", "if", "(", "$", "value", "===", "null", ")", "{", "return", "'null'", ";", "}", "elseif", "(", "$", "value", "===", "true", ")", "{", "return", "\"'1'\"", ";", "}", "elseif", "(", "$", "...
Quote a value for an SQL query. $db->quote(null); // 'null' $db->quote(10); // 10 $db->quote('fred'); // 'fred' Objects passed to this function will be converted to strings. [Database_Expression] objects will use the value of the expression. [Database_Query] objects will be compiled and converted to a sub-query...
[ "Quote", "a", "value", "for", "an", "SQL", "query", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/connection.php#L477-L524
4,406
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/database/connection.php
Database_Connection.quote_identifier
public function quote_identifier($value) { if ($value === '*') { return $value; } elseif (is_object($value)) { if ($value instanceof Database_Query) { // Create a sub-query return '('.$value->compile($this).')'; } elseif ($value instanceof Database_Expression) { // Use a raw exp...
php
public function quote_identifier($value) { if ($value === '*') { return $value; } elseif (is_object($value)) { if ($value instanceof Database_Query) { // Create a sub-query return '('.$value->compile($this).')'; } elseif ($value instanceof Database_Expression) { // Use a raw exp...
[ "public", "function", "quote_identifier", "(", "$", "value", ")", "{", "if", "(", "$", "value", "===", "'*'", ")", "{", "return", "$", "value", ";", "}", "elseif", "(", "is_object", "(", "$", "value", ")", ")", "{", "if", "(", "$", "value", "instan...
Quote a database identifier, such as a column name. Adds the table prefix to the identifier if a table name is present. $column = $db->quote_identifier($column); You can also use SQL methods within identifiers. // The value of "column" will be quoted $column = $db->quote_identifier('COUNT("column")'); Objects passe...
[ "Quote", "a", "database", "identifier", "such", "as", "a", "column", "name", ".", "Adds", "the", "table", "prefix", "to", "the", "identifier", "if", "a", "table", "name", "is", "present", "." ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/connection.php#L630-L693
4,407
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/database/connection.php
Database_Connection.start_transaction
public function start_transaction() { $result = true; if ($this->_transaction_depth == 0) { if ($this->driver_start_transaction()) { $this->_in_transaction = true; } else { $result = false; } } else { $result = $this->set_savepoint($this->_transaction_depth); // If savepoin...
php
public function start_transaction() { $result = true; if ($this->_transaction_depth == 0) { if ($this->driver_start_transaction()) { $this->_in_transaction = true; } else { $result = false; } } else { $result = $this->set_savepoint($this->_transaction_depth); // If savepoin...
[ "public", "function", "start_transaction", "(", ")", "{", "$", "result", "=", "true", ";", "if", "(", "$", "this", "->", "_transaction_depth", "==", "0", ")", "{", "if", "(", "$", "this", "->", "driver_start_transaction", "(", ")", ")", "{", "$", "this...
Begins a nested transaction on instance $db->start_transaction(); @return bool
[ "Begins", "a", "nested", "transaction", "on", "instance" ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/connection.php#L726-L751
4,408
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/database/connection.php
Database_Connection.commit_transaction
public function commit_transaction() { // Fake call of the commit if ($this->_transaction_depth <= 0) { return false; } if ($this->_transaction_depth - 1) { $result = $this->release_savepoint($this->_transaction_depth - 1); // If savepoint is not supported it is not an error ! isset($result) a...
php
public function commit_transaction() { // Fake call of the commit if ($this->_transaction_depth <= 0) { return false; } if ($this->_transaction_depth - 1) { $result = $this->release_savepoint($this->_transaction_depth - 1); // If savepoint is not supported it is not an error ! isset($result) a...
[ "public", "function", "commit_transaction", "(", ")", "{", "// Fake call of the commit", "if", "(", "$", "this", "->", "_transaction_depth", "<=", "0", ")", "{", "return", "false", ";", "}", "if", "(", "$", "this", "->", "_transaction_depth", "-", "1", ")", ...
Commits nested transaction $db->commit_transaction(); @return bool
[ "Commits", "nested", "transaction" ]
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/connection.php#L760-L783
4,409
indigophp-archive/codeception-fuel-module
fuel/fuel/core/classes/database/connection.php
Database_Connection.rollback_transaction
public function rollback_transaction($rollback_all = true) { if ($this->_transaction_depth > 0) { if($rollback_all or $this->_transaction_depth == 1) { if($result = $this->driver_rollback()) { $this->_transaction_depth = 0; $this->_in_transaction = false; } } else { $result...
php
public function rollback_transaction($rollback_all = true) { if ($this->_transaction_depth > 0) { if($rollback_all or $this->_transaction_depth == 1) { if($result = $this->driver_rollback()) { $this->_transaction_depth = 0; $this->_in_transaction = false; } } else { $result...
[ "public", "function", "rollback_transaction", "(", "$", "rollback_all", "=", "true", ")", "{", "if", "(", "$", "this", "->", "_transaction_depth", ">", "0", ")", "{", "if", "(", "$", "rollback_all", "or", "$", "this", "->", "_transaction_depth", "==", "1",...
Rollsback nested pending transaction queries. Rollback to the current level uses SAVEPOINT, it does not work if current RDBMS does not support them. In this case system rollbacks all queries and closes the transaction $db->rollback_transaction(); @param bool $rollback_all: true - rollback everything and close transa...
[ "Rollsback", "nested", "pending", "transaction", "queries", ".", "Rollback", "to", "the", "current", "level", "uses", "SAVEPOINT", "it", "does", "not", "work", "if", "current", "RDBMS", "does", "not", "support", "them", ".", "In", "this", "case", "system", "...
0973b7cbd540a0e89cc5bb7af94627f77f09bf49
https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/connection.php#L799-L826
4,410
humweb/widgets
src/WidgetFactory.php
WidgetFactory.render
public function render($name, array $args = array()) { if ($this->has($name)) { $callback = $this->widgets[$name]; return $this->executeCallback($callback, $args); } return ''; }
php
public function render($name, array $args = array()) { if ($this->has($name)) { $callback = $this->widgets[$name]; return $this->executeCallback($callback, $args); } return ''; }
[ "public", "function", "render", "(", "$", "name", ",", "array", "$", "args", "=", "array", "(", ")", ")", "{", "if", "(", "$", "this", "->", "has", "(", "$", "name", ")", ")", "{", "$", "callback", "=", "$", "this", "->", "widgets", "[", "$", ...
Render widget instance @param string $name @param array $args @return string
[ "Render", "widget", "instance" ]
c68f19b3a46d08f8e4d6ef6f722204532e5608e5
https://github.com/humweb/widgets/blob/c68f19b3a46d08f8e4d6ef6f722204532e5608e5/src/WidgetFactory.php#L38-L47
4,411
humweb/widgets
src/WidgetFactory.php
WidgetFactory.callStringCallback
protected function callStringCallback($callback, $args = []) { if (strpos($callback, '@')) { list($klass, $method) = explode('@', $callback); } else { $klass = $callback; $method = 'render'; } $klass = isset($this->instantiatedWidgets[$klass]) ? ...
php
protected function callStringCallback($callback, $args = []) { if (strpos($callback, '@')) { list($klass, $method) = explode('@', $callback); } else { $klass = $callback; $method = 'render'; } $klass = isset($this->instantiatedWidgets[$klass]) ? ...
[ "protected", "function", "callStringCallback", "(", "$", "callback", ",", "$", "args", "=", "[", "]", ")", "{", "if", "(", "strpos", "(", "$", "callback", ",", "'@'", ")", ")", "{", "list", "(", "$", "klass", ",", "$", "method", ")", "=", "explode"...
Execute string callback @param string $callback @param array $args @return string
[ "Execute", "string", "callback" ]
c68f19b3a46d08f8e4d6ef6f722204532e5608e5
https://github.com/humweb/widgets/blob/c68f19b3a46d08f8e4d6ef6f722204532e5608e5/src/WidgetFactory.php#L91-L103
4,412
edunola13/core-modules
src/Authorization/AuthDbMiddleware.php
AuthDbMiddleware.getModules
public function getModules(){ if($this->loadModules != 'ALL'){ $this->connection->select('name'); $this->connection->from($this->tableModule); $modules= $this->connection->get()->fetchAll(\PDO::FETCH_ASSOC); foreach ($modules as $module) { $this->g...
php
public function getModules(){ if($this->loadModules != 'ALL'){ $this->connection->select('name'); $this->connection->from($this->tableModule); $modules= $this->connection->get()->fetchAll(\PDO::FETCH_ASSOC); foreach ($modules as $module) { $this->g...
[ "public", "function", "getModules", "(", ")", "{", "if", "(", "$", "this", "->", "loadModules", "!=", "'ALL'", ")", "{", "$", "this", "->", "connection", "->", "select", "(", "'name'", ")", ";", "$", "this", "->", "connection", "->", "from", "(", "$"...
Retorna todos los modulos de la aplicacion @return array
[ "Retorna", "todos", "los", "modulos", "de", "la", "aplicacion" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/Authorization/AuthDbMiddleware.php#L77-L88
4,413
edunola13/core-modules
src/Authorization/AuthDbMiddleware.php
AuthDbMiddleware.getProfiles
public function getProfiles(){ if($this->loadProfiles != 'ALL'){ $this->connection->select('name'); $this->connection->from($this->tableProfile); $profiles= $this->connection->get()->fetchAll(\PDO::FETCH_ASSOC); foreach ($profiles as $profile) { $t...
php
public function getProfiles(){ if($this->loadProfiles != 'ALL'){ $this->connection->select('name'); $this->connection->from($this->tableProfile); $profiles= $this->connection->get()->fetchAll(\PDO::FETCH_ASSOC); foreach ($profiles as $profile) { $t...
[ "public", "function", "getProfiles", "(", ")", "{", "if", "(", "$", "this", "->", "loadProfiles", "!=", "'ALL'", ")", "{", "$", "this", "->", "connection", "->", "select", "(", "'name'", ")", ";", "$", "this", "->", "connection", "->", "from", "(", "...
Retorna todos los profiles de la aplicacion @return array
[ "Retorna", "todos", "los", "profiles", "de", "la", "aplicacion" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/Authorization/AuthDbMiddleware.php#L110-L121
4,414
vinala/kernel
src/Database/Schemas/MysqlSchema.php
MysqlSchema.string
public function string($name, $length = 255, $default = null) { $cmnd = $name.' varchar('.$length.')'; // if (!empty($default)) { $cmnd .= " DEFAULT '$default' "; } // self::$colmuns[] = $cmnd; return $this; }
php
public function string($name, $length = 255, $default = null) { $cmnd = $name.' varchar('.$length.')'; // if (!empty($default)) { $cmnd .= " DEFAULT '$default' "; } // self::$colmuns[] = $cmnd; return $this; }
[ "public", "function", "string", "(", "$", "name", ",", "$", "length", "=", "255", ",", "$", "default", "=", "null", ")", "{", "$", "cmnd", "=", "$", "name", ".", "' varchar('", ".", "$", "length", ".", "')'", ";", "//", "if", "(", "!", "empty", ...
function to add varchar column. @param string name @param int length @param string $default @return schema
[ "function", "to", "add", "varchar", "column", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Schemas/MysqlSchema.php#L40-L51
4,415
vinala/kernel
src/Database/Schemas/MysqlSchema.php
MysqlSchema.bool
public function bool($name, $default = null) { $cmnd = $name.' tinyint(1)'; // if (!empty($default)) { $default = $default ? '1' : '0'; $cmnd .= " DEFAULT $default "; } // self::$colmuns[] = $cmnd; // return $this; }
php
public function bool($name, $default = null) { $cmnd = $name.' tinyint(1)'; // if (!empty($default)) { $default = $default ? '1' : '0'; $cmnd .= " DEFAULT $default "; } // self::$colmuns[] = $cmnd; // return $this; }
[ "public", "function", "bool", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "$", "cmnd", "=", "$", "name", ".", "' tinyint(1)'", ";", "//", "if", "(", "!", "empty", "(", "$", "default", ")", ")", "{", "$", "default", "=", "$", "...
function to add bool column. @param string name @param bool default @return schema
[ "function", "to", "add", "bool", "column", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Schemas/MysqlSchema.php#L141-L153
4,416
vinala/kernel
src/Database/Schemas/MysqlSchema.php
MysqlSchema.timestamp
public function timestamp($name, $default = '') { $cmnd = $name.' int(15)'; // if (!empty($default)) { $cmnd .= " DEFAULT $default "; } // self::$colmuns[] = $cmnd; // return $this; }
php
public function timestamp($name, $default = '') { $cmnd = $name.' int(15)'; // if (!empty($default)) { $cmnd .= " DEFAULT $default "; } // self::$colmuns[] = $cmnd; // return $this; }
[ "public", "function", "timestamp", "(", "$", "name", ",", "$", "default", "=", "''", ")", "{", "$", "cmnd", "=", "$", "name", ".", "' int(15)'", ";", "//", "if", "(", "!", "empty", "(", "$", "default", ")", ")", "{", "$", "cmnd", ".=", "\" DEFAUL...
function to add timestamp column. @param string name @param string default @return schema
[ "function", "to", "add", "timestamp", "column", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Schemas/MysqlSchema.php#L205-L216
4,417
vinala/kernel
src/Database/Schemas/MysqlSchema.php
MysqlSchema.affect
public function affect($value) { $i = Collection::count(self::$colmuns) - 1; self::$colmuns[$i] .= " default '".$value."'"; // return $this; }
php
public function affect($value) { $i = Collection::count(self::$colmuns) - 1; self::$colmuns[$i] .= " default '".$value."'"; // return $this; }
[ "public", "function", "affect", "(", "$", "value", ")", "{", "$", "i", "=", "Collection", "::", "count", "(", "self", "::", "$", "colmuns", ")", "-", "1", ";", "self", "::", "$", "colmuns", "[", "$", "i", "]", ".=", "\" default '\"", ".", "$", "v...
function to add default constraint. @param string $value @return schema
[ "function", "to", "add", "default", "constraint", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Schemas/MysqlSchema.php#L282-L288
4,418
vinala/kernel
src/Database/Schemas/MysqlSchema.php
MysqlSchema.notnull
public function notnull() { $i = Collection::count(self::$colmuns) - 1; self::$colmuns[$i] .= ' not null'; // return $this; }
php
public function notnull() { $i = Collection::count(self::$colmuns) - 1; self::$colmuns[$i] .= ' not null'; // return $this; }
[ "public", "function", "notnull", "(", ")", "{", "$", "i", "=", "Collection", "::", "count", "(", "self", "::", "$", "colmuns", ")", "-", "1", ";", "self", "::", "$", "colmuns", "[", "$", "i", "]", ".=", "' not null'", ";", "//", "return", "$", "t...
function to add not null constraint. @return schema
[ "function", "to", "add", "not", "null", "constraint", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Schemas/MysqlSchema.php#L295-L301
4,419
vinala/kernel
src/Database/Schemas/MysqlSchema.php
MysqlSchema.foreignkey
public function foreignkey($table, $colmun = null) { $i = Collection::count(self::$colmuns) - 1; // self::$colmuns[$i] .= ' references '.$table; if (!empty($colmun)) { self::$colmuns[$i] .= '('.$colmun.')'; } // return $this; }
php
public function foreignkey($table, $colmun = null) { $i = Collection::count(self::$colmuns) - 1; // self::$colmuns[$i] .= ' references '.$table; if (!empty($colmun)) { self::$colmuns[$i] .= '('.$colmun.')'; } // return $this; }
[ "public", "function", "foreignkey", "(", "$", "table", ",", "$", "colmun", "=", "null", ")", "{", "$", "i", "=", "Collection", "::", "count", "(", "self", "::", "$", "colmuns", ")", "-", "1", ";", "//", "self", "::", "$", "colmuns", "[", "$", "i"...
function to add foreign key constraint. @param string $table @param string $colmun @return schema
[ "function", "to", "add", "foreign", "key", "constraint", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Schemas/MysqlSchema.php#L311-L321
4,420
vinala/kernel
src/Database/Schemas/MysqlSchema.php
MysqlSchema.unique
public function unique($name, array $colmuns) { if (is_array($colmuns)) { $query = "CONSTRAINT $name UNIQUE ("; // for ($i = 0; $i < Collection::count($colmuns); $i++) { if ($i == Collection::count($colmuns) - 1) { $query .= $colmuns[$i...
php
public function unique($name, array $colmuns) { if (is_array($colmuns)) { $query = "CONSTRAINT $name UNIQUE ("; // for ($i = 0; $i < Collection::count($colmuns); $i++) { if ($i == Collection::count($colmuns) - 1) { $query .= $colmuns[$i...
[ "public", "function", "unique", "(", "$", "name", ",", "array", "$", "colmuns", ")", "{", "if", "(", "is_array", "(", "$", "colmuns", ")", ")", "{", "$", "query", "=", "\"CONSTRAINT $name UNIQUE (\"", ";", "//", "for", "(", "$", "i", "=", "0", ";", ...
function to add unique constraint. @param string $table @param array $colmuns @return schema
[ "function", "to", "add", "unique", "constraint", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Schemas/MysqlSchema.php#L331-L349
4,421
vinala/kernel
src/Database/Schemas/MysqlSchema.php
MysqlSchema.drop
public static function drop($name) { if (self::existe($name)) { $name = self::table($name); // return Database::exec('DROP TABLE '.$name); } else { throw new SchemaTableNotExistException($name); } }
php
public static function drop($name) { if (self::existe($name)) { $name = self::table($name); // return Database::exec('DROP TABLE '.$name); } else { throw new SchemaTableNotExistException($name); } }
[ "public", "static", "function", "drop", "(", "$", "name", ")", "{", "if", "(", "self", "::", "existe", "(", "$", "name", ")", ")", "{", "$", "name", "=", "self", "::", "table", "(", "$", "name", ")", ";", "//", "return", "Database", "::", "exec",...
function to build query of table erasing. @param string $name @return bool
[ "function", "to", "build", "query", "of", "table", "erasing", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Schemas/MysqlSchema.php#L410-L419
4,422
vinala/kernel
src/Database/Schemas/MysqlSchema.php
MysqlSchema.add
public static function add($name, $script) { if (self::existe($name)) { $name = self::table($name); // self::$query = 'alter table '.$name.' '; // $object = new self(); $script($object); // $query = ''; ...
php
public static function add($name, $script) { if (self::existe($name)) { $name = self::table($name); // self::$query = 'alter table '.$name.' '; // $object = new self(); $script($object); // $query = ''; ...
[ "public", "static", "function", "add", "(", "$", "name", ",", "$", "script", ")", "{", "if", "(", "self", "::", "existe", "(", "$", "name", ")", ")", "{", "$", "name", "=", "self", "::", "table", "(", "$", "name", ")", ";", "//", "self", "::", ...
function to build query for adding column to table. @param string $name @param callable $script @return bool
[ "function", "to", "build", "query", "for", "adding", "column", "to", "table", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Schemas/MysqlSchema.php#L477-L498
4,423
vinala/kernel
src/Database/Schemas/MysqlSchema.php
MysqlSchema.remove
public static function remove($name, $colmuns) { if (self::existe($name)) { $name = self::table($name); // self::$query = 'alter table '.$name.' '; // if (is_array($colmuns)) { for ($i = 0; $i < Collection::count($colmuns); $i++) { ...
php
public static function remove($name, $colmuns) { if (self::existe($name)) { $name = self::table($name); // self::$query = 'alter table '.$name.' '; // if (is_array($colmuns)) { for ($i = 0; $i < Collection::count($colmuns); $i++) { ...
[ "public", "static", "function", "remove", "(", "$", "name", ",", "$", "colmuns", ")", "{", "if", "(", "self", "::", "existe", "(", "$", "name", ")", ")", "{", "$", "name", "=", "self", "::", "table", "(", "$", "name", ")", ";", "//", "self", ":...
function to build query for removing column to table. @param string $name @param callable $script @return bool
[ "function", "to", "build", "query", "for", "removing", "column", "to", "table", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Schemas/MysqlSchema.php#L508-L527
4,424
InfiniteDevelopers/Base64Bundle
Twig/ImageExtension.php
ImageExtension.image64
public function image64($path) { $file = new File($path, false); if (!$file->isFile() || 0 !== strpos($file->getMimeType(), 'image/')) { return; } $binary = file_get_contents($path); return sprintf('data:image/%s;base64,%s', $file->guess...
php
public function image64($path) { $file = new File($path, false); if (!$file->isFile() || 0 !== strpos($file->getMimeType(), 'image/')) { return; } $binary = file_get_contents($path); return sprintf('data:image/%s;base64,%s', $file->guess...
[ "public", "function", "image64", "(", "$", "path", ")", "{", "$", "file", "=", "new", "File", "(", "$", "path", ",", "false", ")", ";", "if", "(", "!", "$", "file", "->", "isFile", "(", ")", "||", "0", "!==", "strpos", "(", "$", "file", "->", ...
Transform image to base 64 @param string $path relative path to image from bundle directory @return string base64 encoded image
[ "Transform", "image", "to", "base", "64" ]
4279aefbd937adbed7ee97818fd893e72b8de216
https://github.com/InfiniteDevelopers/Base64Bundle/blob/4279aefbd937adbed7ee97818fd893e72b8de216/Twig/ImageExtension.php#L21-L32
4,425
dmeikle/pesedget
src/Gossamer/Pesedget/Commands/DeleteCommand.php
DeleteCommand.execute
public function execute($params = array(), $requestParams = array()){ $deleteParams = $params; if(count($requestParams) > 0) { $deleteParams = $requestParams; } $this->beginTransaction(); $firstResult = null; try{ //first delete the child ta...
php
public function execute($params = array(), $requestParams = array()){ $deleteParams = $params; if(count($requestParams) > 0) { $deleteParams = $requestParams; } $this->beginTransaction(); $firstResult = null; try{ //first delete the child ta...
[ "public", "function", "execute", "(", "$", "params", "=", "array", "(", ")", ",", "$", "requestParams", "=", "array", "(", ")", ")", "{", "$", "deleteParams", "=", "$", "params", ";", "if", "(", "count", "(", "$", "requestParams", ")", ">", "0", ")...
Deletes an entity row from the database @param array URI params @param array POST params
[ "Deletes", "an", "entity", "row", "from", "the", "database" ]
bcfca25569d1f47c073f08906a710ed895f77b4d
https://github.com/dmeikle/pesedget/blob/bcfca25569d1f47c073f08906a710ed895f77b4d/src/Gossamer/Pesedget/Commands/DeleteCommand.php#L25-L51
4,426
dmeikle/pesedget
src/Gossamer/Pesedget/Commands/DeleteCommand.php
DeleteCommand.deleteI18nLocales
private function deleteI18nLocales($params) { if(!$this->entity instanceof AbstractI18nEntity) { return; } $filter = array($this->entity->getI18nIdentifier() => $params['id']); $this->getQueryBuilder()->where($filter); $this->query($this->getQueryBui...
php
private function deleteI18nLocales($params) { if(!$this->entity instanceof AbstractI18nEntity) { return; } $filter = array($this->entity->getI18nIdentifier() => $params['id']); $this->getQueryBuilder()->where($filter); $this->query($this->getQueryBui...
[ "private", "function", "deleteI18nLocales", "(", "$", "params", ")", "{", "if", "(", "!", "$", "this", "->", "entity", "instanceof", "AbstractI18nEntity", ")", "{", "return", ";", "}", "$", "filter", "=", "array", "(", "$", "this", "->", "entity", "->", ...
deletes a row from the I18n table @param array URI params
[ "deletes", "a", "row", "from", "the", "I18n", "table" ]
bcfca25569d1f47c073f08906a710ed895f77b4d
https://github.com/dmeikle/pesedget/blob/bcfca25569d1f47c073f08906a710ed895f77b4d/src/Gossamer/Pesedget/Commands/DeleteCommand.php#L58-L67
4,427
polary/polary
src/polary/extension/devkit/ide/Controller.php
Controller.actionGenerate
public function actionGenerate() { $this->stdout("Polary Devkit Tool (based on Yii)\n\n"); try { $component = $this->getComponent(); $configList = $this->getConfig($component); $config = new Config([ 'files' => $configList, ]); ...
php
public function actionGenerate() { $this->stdout("Polary Devkit Tool (based on Yii)\n\n"); try { $component = $this->getComponent(); $configList = $this->getConfig($component); $config = new Config([ 'files' => $configList, ]); ...
[ "public", "function", "actionGenerate", "(", ")", "{", "$", "this", "->", "stdout", "(", "\"Polary Devkit Tool (based on Yii)\\n\\n\"", ")", ";", "try", "{", "$", "component", "=", "$", "this", "->", "getComponent", "(", ")", ";", "$", "configList", "=", "$"...
Generate IDE auto-completion code.
[ "Generate", "IDE", "auto", "-", "completion", "code", "." ]
683212e631e59faedce488f0d2cea82c94a83aae
https://github.com/polary/polary/blob/683212e631e59faedce488f0d2cea82c94a83aae/src/polary/extension/devkit/ide/Controller.php#L64-L94
4,428
docit/core
src/Menus/MenuFactory.php
MenuFactory.add
public function add($id) { if ($this->has($id)) { return $this->get($id); } $menu = $this->container->make(Menu::class, [ 'menuFactory' => $this ]); $this->runHook('menu-factory:add', [$this, $menu]); $this->menus->put($id, $menu); ret...
php
public function add($id) { if ($this->has($id)) { return $this->get($id); } $menu = $this->container->make(Menu::class, [ 'menuFactory' => $this ]); $this->runHook('menu-factory:add', [$this, $menu]); $this->menus->put($id, $menu); ret...
[ "public", "function", "add", "(", "$", "id", ")", "{", "if", "(", "$", "this", "->", "has", "(", "$", "id", ")", ")", "{", "return", "$", "this", "->", "get", "(", "$", "id", ")", ";", "}", "$", "menu", "=", "$", "this", "->", "container", ...
Creates a new menu or returns an existing @param string $id @return \Docit\Core\Menus\Menu
[ "Creates", "a", "new", "menu", "or", "returns", "an", "existing" ]
448e1cdca18a8ffb6c08430cad8d22162171ac35
https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Menus/MenuFactory.php#L94-L106
4,429
docit/core
src/Menus/MenuFactory.php
MenuFactory.forget
public function forget($id) { $this->runHook('menu-factory:forget', [$this, $id]); $this->menus->forget($id); return $this; }
php
public function forget($id) { $this->runHook('menu-factory:forget', [$this, $id]); $this->menus->forget($id); return $this; }
[ "public", "function", "forget", "(", "$", "id", ")", "{", "$", "this", "->", "runHook", "(", "'menu-factory:forget'", ",", "[", "$", "this", ",", "$", "id", "]", ")", ";", "$", "this", "->", "menus", "->", "forget", "(", "$", "id", ")", ";", "ret...
Removes a menu @param $id @return MenuFactory
[ "Removes", "a", "menu" ]
448e1cdca18a8ffb6c08430cad8d22162171ac35
https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Menus/MenuFactory.php#L138-L143
4,430
SlabPHP/concatenator
src/Manager.php
Manager.setCache
public function setCache(\Psr\SimpleCache\CacheInterface $cache, $key, $ttl = 86400) { $this->cache = $cache; $this->cacheKey = $key; $this->cacheTime = $ttl; if (empty($this->cacheKey)) { $this->cacheKey = 'concatenate-'.md5(serialize($this)); } ...
php
public function setCache(\Psr\SimpleCache\CacheInterface $cache, $key, $ttl = 86400) { $this->cache = $cache; $this->cacheKey = $key; $this->cacheTime = $ttl; if (empty($this->cacheKey)) { $this->cacheKey = 'concatenate-'.md5(serialize($this)); } ...
[ "public", "function", "setCache", "(", "\\", "Psr", "\\", "SimpleCache", "\\", "CacheInterface", "$", "cache", ",", "$", "key", ",", "$", "ttl", "=", "86400", ")", "{", "$", "this", "->", "cache", "=", "$", "cache", ";", "$", "this", "->", "cacheKey"...
Set cache manager @param \Psr\SimpleCache\CacheInterface $cache @param $key @param $ttl @return $this
[ "Set", "cache", "manager" ]
7ea1f29822a766ecb423845c549a9f9eec6594dd
https://github.com/SlabPHP/concatenator/blob/7ea1f29822a766ecb423845c549a9f9eec6594dd/src/Manager.php#L72-L84
4,431
SlabPHP/concatenator
src/Manager.php
Manager.addObject
public function addObject($objectValue, $filters) { if (empty($objectValue)) { throw new \Exception("Failed to add empty object value!"); } $object = null; if (strpos($objectValue, 'http') !== false) { /** * @var \Slab\Concatenator\Items\Base $ob...
php
public function addObject($objectValue, $filters) { if (empty($objectValue)) { throw new \Exception("Failed to add empty object value!"); } $object = null; if (strpos($objectValue, 'http') !== false) { /** * @var \Slab\Concatenator\Items\Base $ob...
[ "public", "function", "addObject", "(", "$", "objectValue", ",", "$", "filters", ")", "{", "if", "(", "empty", "(", "$", "objectValue", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "\"Failed to add empty object value!\"", ")", ";", "}", "$", "obj...
Add an object to the list @param $objectValue @param $filters @return $this
[ "Add", "an", "object", "to", "the", "list" ]
7ea1f29822a766ecb423845c549a9f9eec6594dd
https://github.com/SlabPHP/concatenator/blob/7ea1f29822a766ecb423845c549a9f9eec6594dd/src/Manager.php#L138-L162
4,432
SlabPHP/concatenator
src/Manager.php
Manager.concatenateObjectList
public function concatenateObjectList() { //Short circuit if cache is disabled if (empty($this->cache) || empty($this->cacheKey) || empty($this->cacheTime)) { $this->source = 'raw'; $this->output = $this->concatenateObjects(); return; } //See if y...
php
public function concatenateObjectList() { //Short circuit if cache is disabled if (empty($this->cache) || empty($this->cacheKey) || empty($this->cacheTime)) { $this->source = 'raw'; $this->output = $this->concatenateObjects(); return; } //See if y...
[ "public", "function", "concatenateObjectList", "(", ")", "{", "//Short circuit if cache is disabled", "if", "(", "empty", "(", "$", "this", "->", "cache", ")", "||", "empty", "(", "$", "this", "->", "cacheKey", ")", "||", "empty", "(", "$", "this", "->", "...
Concatenate the object list @param $objects
[ "Concatenate", "the", "object", "list" ]
7ea1f29822a766ecb423845c549a9f9eec6594dd
https://github.com/SlabPHP/concatenator/blob/7ea1f29822a766ecb423845c549a9f9eec6594dd/src/Manager.php#L179-L211
4,433
SlabPHP/concatenator
src/Manager.php
Manager.getActualLastModifiedTime
private function getActualLastModifiedTime() { if (empty($this->objectList)) return; foreach ($this->objectList as $object) { $modifiedTime = $object->getLastModifiedTimestamp(); if (!empty($modifiedTime) && $modifiedTime > $this->lastModifiedTime) { $this->...
php
private function getActualLastModifiedTime() { if (empty($this->objectList)) return; foreach ($this->objectList as $object) { $modifiedTime = $object->getLastModifiedTimestamp(); if (!empty($modifiedTime) && $modifiedTime > $this->lastModifiedTime) { $this->...
[ "private", "function", "getActualLastModifiedTime", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "objectList", ")", ")", "return", ";", "foreach", "(", "$", "this", "->", "objectList", "as", "$", "object", ")", "{", "$", "modifiedTime", "="...
Gets actual last modified time of files to see if we need to bust cache
[ "Gets", "actual", "last", "modified", "time", "of", "files", "to", "see", "if", "we", "need", "to", "bust", "cache" ]
7ea1f29822a766ecb423845c549a9f9eec6594dd
https://github.com/SlabPHP/concatenator/blob/7ea1f29822a766ecb423845c549a9f9eec6594dd/src/Manager.php#L216-L227
4,434
SlabPHP/concatenator
src/Manager.php
Manager.concatenateObjects
private function concatenateObjects() { $output = ""; if (empty($this->objectList)) return $output; foreach ($this->objectList as $object) { if ($object->isValid()) { $output .= $object->getData(); $modifiedTime = $object->getLastModifiedTimesta...
php
private function concatenateObjects() { $output = ""; if (empty($this->objectList)) return $output; foreach ($this->objectList as $object) { if ($object->isValid()) { $output .= $object->getData(); $modifiedTime = $object->getLastModifiedTimesta...
[ "private", "function", "concatenateObjects", "(", ")", "{", "$", "output", "=", "\"\"", ";", "if", "(", "empty", "(", "$", "this", "->", "objectList", ")", ")", "return", "$", "output", ";", "foreach", "(", "$", "this", "->", "objectList", "as", "$", ...
Concatenate the actual files and set output
[ "Concatenate", "the", "actual", "files", "and", "set", "output" ]
7ea1f29822a766ecb423845c549a9f9eec6594dd
https://github.com/SlabPHP/concatenator/blob/7ea1f29822a766ecb423845c549a9f9eec6594dd/src/Manager.php#L232-L257
4,435
SlabPHP/concatenator
src/Manager.php
Manager.extractLastModifiedTime
private function extractLastModifiedTime($cacheData) { $matches = array(); preg_match('#modified:([a-z0-9:-]*)#i', $cacheData, $matches); if (!empty($matches[1])) { return strtotime($matches[1]); } return 0; }
php
private function extractLastModifiedTime($cacheData) { $matches = array(); preg_match('#modified:([a-z0-9:-]*)#i', $cacheData, $matches); if (!empty($matches[1])) { return strtotime($matches[1]); } return 0; }
[ "private", "function", "extractLastModifiedTime", "(", "$", "cacheData", ")", "{", "$", "matches", "=", "array", "(", ")", ";", "preg_match", "(", "'#modified:([a-z0-9:-]*)#i'", ",", "$", "cacheData", ",", "$", "matches", ")", ";", "if", "(", "!", "empty", ...
Retrieve the last modified date from cached data @param $cacheData @return int
[ "Retrieve", "the", "last", "modified", "date", "from", "cached", "data" ]
7ea1f29822a766ecb423845c549a9f9eec6594dd
https://github.com/SlabPHP/concatenator/blob/7ea1f29822a766ecb423845c549a9f9eec6594dd/src/Manager.php#L275-L285
4,436
liftkit/core
src/Application/Hook/Action.php
Action.trigger
public function trigger ($value, $precedence = null) { if (is_null($precedence)) { $functions = array(); ksort($this->hooks); foreach ($this->hooks as $function_set) { foreach ($function_set as $function) { $functions[] = $function; } } foreach ($functions as $function) { ...
php
public function trigger ($value, $precedence = null) { if (is_null($precedence)) { $functions = array(); ksort($this->hooks); foreach ($this->hooks as $function_set) { foreach ($function_set as $function) { $functions[] = $function; } } foreach ($functions as $function) { ...
[ "public", "function", "trigger", "(", "$", "value", ",", "$", "precedence", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "precedence", ")", ")", "{", "$", "functions", "=", "array", "(", ")", ";", "ksort", "(", "$", "this", "->", "hooks",...
Invokes all hooks of a given precedence for a given event. If null precedence is provided, invokes all hooks for a given event, regardless of precedence. @api @param mixed $value The value to be transformed. @param mixed $precedence (default: null) If provided, only callbacks of this precedence ...
[ "Invokes", "all", "hooks", "of", "a", "given", "precedence", "for", "a", "given", "event", "." ]
c98dcffa65450bd11332dbffe2064650c3a72aae
https://github.com/liftkit/core/blob/c98dcffa65450bd11332dbffe2064650c3a72aae/src/Application/Hook/Action.php#L37-L65
4,437
kingcoyote/domi
src/Domi/Domi.php
Domi.attachToXml
public function attachToXml($data, $prefix, &$parentNode = false) { if (!$parentNode) { $parentNode = &$this->mainNode; } // i don't like how this is done, but i can't see an easy alternative // that is clean. if the prefix is attributes, instead of creating // a ...
php
public function attachToXml($data, $prefix, &$parentNode = false) { if (!$parentNode) { $parentNode = &$this->mainNode; } // i don't like how this is done, but i can't see an easy alternative // that is clean. if the prefix is attributes, instead of creating // a ...
[ "public", "function", "attachToXml", "(", "$", "data", ",", "$", "prefix", ",", "&", "$", "parentNode", "=", "false", ")", "{", "if", "(", "!", "$", "parentNode", ")", "{", "$", "parentNode", "=", "&", "$", "this", "->", "mainNode", ";", "}", "// i...
the heart of DOMi - take a complex data tree and build it into an XML tree with the specified prefix and attach it to either the specified node or the root node @param mixed any PHP data type that is being converted to XML @param string the name of the node that the data will be built onto @param DOMNode node to attac...
[ "the", "heart", "of", "DOMi", "-", "take", "a", "complex", "data", "tree", "and", "build", "it", "into", "an", "XML", "tree", "with", "the", "specified", "prefix", "and", "attach", "it", "to", "either", "the", "specified", "node", "or", "the", "root", ...
79f7f95c81536f704650aaf8584cf7eb4bfff410
https://github.com/kingcoyote/domi/blob/79f7f95c81536f704650aaf8584cf7eb4bfff410/src/Domi/Domi.php#L77-L97
4,438
kingcoyote/domi
src/Domi/Domi.php
Domi.convertToXml
public function convertToXml($data, $prefix) { $nodeName = $prefix; // figure out the prefix if (!self::isValidPrefix($prefix)) { throw new DomiException("invalid prefix '$prefix'"); } // if the data needs a list node, change the name to use the list-suff...
php
public function convertToXml($data, $prefix) { $nodeName = $prefix; // figure out the prefix if (!self::isValidPrefix($prefix)) { throw new DomiException("invalid prefix '$prefix'"); } // if the data needs a list node, change the name to use the list-suff...
[ "public", "function", "convertToXml", "(", "$", "data", ",", "$", "prefix", ")", "{", "$", "nodeName", "=", "$", "prefix", ";", "// figure out the prefix", "if", "(", "!", "self", "::", "isValidPrefix", "(", "$", "prefix", ")", ")", "{", "throw", "new", ...
convert a data tree to an XML tree with the name specified as the prefix @param mixed any PHP data type that is being converted to XML @param string the name of the node that the data will be built onto @retval DOMNode the newly created node
[ "convert", "a", "data", "tree", "to", "an", "XML", "tree", "with", "the", "name", "specified", "as", "the", "prefix" ]
79f7f95c81536f704650aaf8584cf7eb4bfff410
https://github.com/kingcoyote/domi/blob/79f7f95c81536f704650aaf8584cf7eb4bfff410/src/Domi/Domi.php#L107-L195
4,439
kingcoyote/domi
src/Domi/Domi.php
Domi.render
public function render($stylesheets=false, $mode=self::RENDER_HTML) { $this->xslt->importStylesheet($this->generateXsl($stylesheets)); return $this->generateOutput($mode); }
php
public function render($stylesheets=false, $mode=self::RENDER_HTML) { $this->xslt->importStylesheet($this->generateXsl($stylesheets)); return $this->generateOutput($mode); }
[ "public", "function", "render", "(", "$", "stylesheets", "=", "false", ",", "$", "mode", "=", "self", "::", "RENDER_HTML", ")", "{", "$", "this", "->", "xslt", "->", "importStylesheet", "(", "$", "this", "->", "generateXsl", "(", "$", "stylesheets", ")",...
process and return the output that will be sent to screen during the display process @param mixed a string or array listing the XSL stylesheets to be used for the rendering process @param int a flag indicating the rendering type. acceptable values are DOMi::RENDER_HTML and DOMi::RENDER_XML @retval string the result o...
[ "process", "and", "return", "the", "output", "that", "will", "be", "sent", "to", "screen", "during", "the", "display", "process" ]
79f7f95c81536f704650aaf8584cf7eb4bfff410
https://github.com/kingcoyote/domi/blob/79f7f95c81536f704650aaf8584cf7eb4bfff410/src/Domi/Domi.php#L209-L213
4,440
PowerOnSystem/WebFramework
src/Network/Response.php
Response.render
public function render($response_sent, $status = NULL) { $response = $this->_parse($response_sent); if (is_null($status)) { $status = $this->getStatus($this->_default_header); } elseif ( !is_null($status) ) { $status = $this->getStatus($status); } elseif ( !is_nu...
php
public function render($response_sent, $status = NULL) { $response = $this->_parse($response_sent); if (is_null($status)) { $status = $this->getStatus($this->_default_header); } elseif ( !is_null($status) ) { $status = $this->getStatus($status); } elseif ( !is_nu...
[ "public", "function", "render", "(", "$", "response_sent", ",", "$", "status", "=", "NULL", ")", "{", "$", "response", "=", "$", "this", "->", "_parse", "(", "$", "response_sent", ")", ";", "if", "(", "is_null", "(", "$", "status", ")", ")", "{", "...
Renderiza la respuesta completa @param mix $response_sent La respuesta puede ser un string con el body o un array ['body' => BODY_CONTENT, 'headers' => [HEADER_TO_SEND], 'status' => STATUS_CODE ] @param integer $status [Opcional] El codigo de estado HTTP, por defecto es 200
[ "Renderiza", "la", "respuesta", "completa" ]
3b885a390adc42d6ad93d7900d33d97c66a6c2a9
https://github.com/PowerOnSystem/WebFramework/blob/3b885a390adc42d6ad93d7900d33d97c66a6c2a9/src/Network/Response.php#L139-L164
4,441
consigliere/components
src/Process/Updater.php
Updater.update
public function update($component) { $component = $this->component->findOrFail($component); $packages = $component->getComposerAttr('require', []); chdir(base_path()); foreach ($packages as $name => $version) { $package = "\"{$name}:{$version}\""; $this->r...
php
public function update($component) { $component = $this->component->findOrFail($component); $packages = $component->getComposerAttr('require', []); chdir(base_path()); foreach ($packages as $name => $version) { $package = "\"{$name}:{$version}\""; $this->r...
[ "public", "function", "update", "(", "$", "component", ")", "{", "$", "component", "=", "$", "this", "->", "component", "->", "findOrFail", "(", "$", "component", ")", ";", "$", "packages", "=", "$", "component", "->", "getComposerAttr", "(", "'require'", ...
Update the dependencies for the specified component by given the component name. @param string $component
[ "Update", "the", "dependencies", "for", "the", "specified", "component", "by", "given", "the", "component", "name", "." ]
9b08bb111f0b55b0a860ed9c3407eda0d9cc1252
https://github.com/consigliere/components/blob/9b08bb111f0b55b0a860ed9c3407eda0d9cc1252/src/Process/Updater.php#L12-L25
4,442
CatLabInteractive/Neuron
src/Neuron/Net/Entity.php
Entity.setFromData
public function setFromData ($data) { // Check signature $model = $this; $chk = self::CHECK_SIGNATURE; if ($chk && !isset ($data['signature'])) { throw new InvalidParameter ("All decoded requests must have a signature."); } if ($chk && $data['signature'] != self::calculateSignature ($data)) { ...
php
public function setFromData ($data) { // Check signature $model = $this; $chk = self::CHECK_SIGNATURE; if ($chk && !isset ($data['signature'])) { throw new InvalidParameter ("All decoded requests must have a signature."); } if ($chk && $data['signature'] != self::calculateSignature ($data)) { ...
[ "public", "function", "setFromData", "(", "$", "data", ")", "{", "// Check signature", "$", "model", "=", "$", "this", ";", "$", "chk", "=", "self", "::", "CHECK_SIGNATURE", ";", "if", "(", "$", "chk", "&&", "!", "isset", "(", "$", "data", "[", "'sig...
Serialize & deserialize requests @param $data @return \Neuron\Net\Request @throws \Neuron\Exceptions\InvalidParameter
[ "Serialize", "&", "deserialize", "requests" ]
67dca5349891e23b31a96dcdead893b9491a1b8b
https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Net/Entity.php#L50-L99
4,443
CatLabInteractive/Neuron
src/Neuron/Net/Entity.php
Entity.hasData
public function hasData () { if (!isset ($this->data)) { if (!isset ($this->error)) $this->setError ('No input data set'); return false; } else { return true; } }
php
public function hasData () { if (!isset ($this->data)) { if (!isset ($this->error)) $this->setError ('No input data set'); return false; } else { return true; } }
[ "public", "function", "hasData", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "data", ")", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "error", ")", ")", "$", "this", "->", "setError", "(", "'No input data set'", ...
Check if request has data
[ "Check", "if", "request", "has", "data" ]
67dca5349891e23b31a96dcdead893b9491a1b8b
https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Net/Entity.php#L316-L328
4,444
easy-system/es-container
src/ParametricTree/RecursiveTree.php
RecursiveTree.buildLeaf
public function buildLeaf($uniqueKey = null, $parentKey = null) { if (isset($this->crown[$uniqueKey])) { throw new InvalidArgumentException(sprintf( 'The leaf with key "%s" is already exists.', $uniqueKey )); } if ($parentKey && ! isset...
php
public function buildLeaf($uniqueKey = null, $parentKey = null) { if (isset($this->crown[$uniqueKey])) { throw new InvalidArgumentException(sprintf( 'The leaf with key "%s" is already exists.', $uniqueKey )); } if ($parentKey && ! isset...
[ "public", "function", "buildLeaf", "(", "$", "uniqueKey", "=", "null", ",", "$", "parentKey", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "crown", "[", "$", "uniqueKey", "]", ")", ")", "{", "throw", "new", "InvalidArgumentExcepti...
Builds the leaf. @param null|int|string $uniqueKey Optional; null by default. The key, which is unique within the tree @param null|int|string $parentKey Optional; null by default. The key of parent leaf @throws \InvalidArgumentException
[ "Builds", "the", "leaf", "." ]
0e917d8ff2c3622f53b82d34436295539858be7d
https://github.com/easy-system/es-container/blob/0e917d8ff2c3622f53b82d34436295539858be7d/src/ParametricTree/RecursiveTree.php#L82-L108
4,445
easy-system/es-container
src/ParametricTree/RecursiveTree.php
RecursiveTree.getLeaf
public function getLeaf($uniqueKey) { if (! isset($this->crown[$uniqueKey])) { throw new InvalidArgumentException(sprintf( 'The leaf with unique key "%s" not exists.', $uniqueKey )); } return $this->crown[$uniqueKey]; }
php
public function getLeaf($uniqueKey) { if (! isset($this->crown[$uniqueKey])) { throw new InvalidArgumentException(sprintf( 'The leaf with unique key "%s" not exists.', $uniqueKey )); } return $this->crown[$uniqueKey]; }
[ "public", "function", "getLeaf", "(", "$", "uniqueKey", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "crown", "[", "$", "uniqueKey", "]", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'The leaf with unique k...
Gets the specified leaf. @param int|string $uniqueKey The unique key of leaf @throws \InvalidArgumentException If the specified leaf not exists @return RecursiveLeafInterface The specified leaf
[ "Gets", "the", "specified", "leaf", "." ]
0e917d8ff2c3622f53b82d34436295539858be7d
https://github.com/easy-system/es-container/blob/0e917d8ff2c3622f53b82d34436295539858be7d/src/ParametricTree/RecursiveTree.php#L131-L141
4,446
easy-system/es-container
src/ParametricTree/RecursiveTree.php
RecursiveTree.current
public function current() { if (is_null($this->current)) { $this->current = current($this->branch); } if ($this->current instanceof RecursiveLeafInterface) { return $this->current->current(); } return false; }
php
public function current() { if (is_null($this->current)) { $this->current = current($this->branch); } if ($this->current instanceof RecursiveLeafInterface) { return $this->current->current(); } return false; }
[ "public", "function", "current", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "current", ")", ")", "{", "$", "this", "->", "current", "=", "current", "(", "$", "this", "->", "branch", ")", ";", "}", "if", "(", "$", "this", "->", ...
Returns the current leaf. @return false|RecursiveLeafInterface Returns the current leaf on success, false otherwise
[ "Returns", "the", "current", "leaf", "." ]
0e917d8ff2c3622f53b82d34436295539858be7d
https://github.com/easy-system/es-container/blob/0e917d8ff2c3622f53b82d34436295539858be7d/src/ParametricTree/RecursiveTree.php#L169-L179
4,447
easy-system/es-container
src/ParametricTree/RecursiveTree.php
RecursiveTree.injectInCrown
protected function injectInCrown(RecursiveLeafInterface $leaf, $uniqueKey = null) { if (is_null($uniqueKey)) { $this->crown[] = null; $uniqueKey = key(array_slice($this->crown, -1, 1, true)); } $leaf->setUniqueKey($uniqueKey); $this->crown[$uniqueKey] = $leaf...
php
protected function injectInCrown(RecursiveLeafInterface $leaf, $uniqueKey = null) { if (is_null($uniqueKey)) { $this->crown[] = null; $uniqueKey = key(array_slice($this->crown, -1, 1, true)); } $leaf->setUniqueKey($uniqueKey); $this->crown[$uniqueKey] = $leaf...
[ "protected", "function", "injectInCrown", "(", "RecursiveLeafInterface", "$", "leaf", ",", "$", "uniqueKey", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "uniqueKey", ")", ")", "{", "$", "this", "->", "crown", "[", "]", "=", "null", ";", "$",...
Injects leaf in crown of the tree. @param RecursiveLeafInterface $leaf The leaf @param int|string $uniqueKey The unique key of leaf
[ "Injects", "leaf", "in", "crown", "of", "the", "tree", "." ]
0e917d8ff2c3622f53b82d34436295539858be7d
https://github.com/easy-system/es-container/blob/0e917d8ff2c3622f53b82d34436295539858be7d/src/ParametricTree/RecursiveTree.php#L253-L262
4,448
mszewcz/php-light-framework
src/Text/WordCount.php
WordCount.count
public static function count(string $text = '', int $minWorldLength = 0): int { if (\trim($text) === '') { return 0; } $text = StripTags::strip($text); $text = \htmlspecialchars_decode((string)$text, ENT_COMPAT | ENT_HTML5); $text = \preg_replace('/[^\w[:space:]]/...
php
public static function count(string $text = '', int $minWorldLength = 0): int { if (\trim($text) === '') { return 0; } $text = StripTags::strip($text); $text = \htmlspecialchars_decode((string)$text, ENT_COMPAT | ENT_HTML5); $text = \preg_replace('/[^\w[:space:]]/...
[ "public", "static", "function", "count", "(", "string", "$", "text", "=", "''", ",", "int", "$", "minWorldLength", "=", "0", ")", ":", "int", "{", "if", "(", "\\", "trim", "(", "$", "text", ")", "===", "''", ")", "{", "return", "0", ";", "}", "...
Counts words with provided min length @param string $text @param int $minWorldLength @return int
[ "Counts", "words", "with", "provided", "min", "length" ]
4d3b46781c387202c2dfbdb8760151b3ae8ef49c
https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Text/WordCount.php#L28-L46
4,449
strident/Trident
src/Trident/Module/DebugModule/Toolbar/Event/ToolbarSubscriptionManager.php
ToolbarSubscriptionManager.registerSubscriptions
public function registerSubscriptions(EventDispatcher $dispatcher) { if ($this->registered) { throw new \RuntimeException('Cannot register debug toolbar subscriptions when already registered.'); } foreach ($this->toolbar->getExtensions() as $extension) { if ( ! $exte...
php
public function registerSubscriptions(EventDispatcher $dispatcher) { if ($this->registered) { throw new \RuntimeException('Cannot register debug toolbar subscriptions when already registered.'); } foreach ($this->toolbar->getExtensions() as $extension) { if ( ! $exte...
[ "public", "function", "registerSubscriptions", "(", "EventDispatcher", "$", "dispatcher", ")", "{", "if", "(", "$", "this", "->", "registered", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'Cannot register debug toolbar subscriptions when already registered.'...
Register the subscriptions for extensions that have them.
[ "Register", "the", "subscriptions", "for", "extensions", "that", "have", "them", "." ]
a112f0b75601b897c470a49d85791dc386c29952
https://github.com/strident/Trident/blob/a112f0b75601b897c470a49d85791dc386c29952/src/Trident/Module/DebugModule/Toolbar/Event/ToolbarSubscriptionManager.php#L41-L56
4,450
JamesRezo/webhelper-parser
src/Compiler.php
Compiler.doCompile
public function doCompile($activeConfig, $context = 'main', $value = '') { $tempConfig = []; while (!empty($activeConfig)) { $lineConfig = array_shift($activeConfig); $tempConfig[] = $this->subCompile($activeConfig, $lineConfig); } return $this->buildBlockDi...
php
public function doCompile($activeConfig, $context = 'main', $value = '') { $tempConfig = []; while (!empty($activeConfig)) { $lineConfig = array_shift($activeConfig); $tempConfig[] = $this->subCompile($activeConfig, $lineConfig); } return $this->buildBlockDi...
[ "public", "function", "doCompile", "(", "$", "activeConfig", ",", "$", "context", "=", "'main'", ",", "$", "value", "=", "''", ")", "{", "$", "tempConfig", "=", "[", "]", ";", "while", "(", "!", "empty", "(", "$", "activeConfig", ")", ")", "{", "$"...
Does a nested array of lines depending on container Directives. @param array $activeConfig a clean config array of lines @param string $context the context name @param string $value an optional context value @return Directive\BlockDirective a full context of directives
[ "Does", "a", "nested", "array", "of", "lines", "depending", "on", "container", "Directives", "." ]
0b39e7abe8f35afbeacdd6681fa9d0767888c646
https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Compiler.php#L86-L96
4,451
JamesRezo/webhelper-parser
src/Compiler.php
Compiler.subCompile
private function subCompile(&$activeConfig, $lineConfig) { if (preg_match($this->startMultiLine, $lineConfig, $container)) { return $this->findEndingKey(trim($container['key']), trim($container['value']), $activeConfig); } if (!preg_match($this->simpleDirective, $lineConfig, $co...
php
private function subCompile(&$activeConfig, $lineConfig) { if (preg_match($this->startMultiLine, $lineConfig, $container)) { return $this->findEndingKey(trim($container['key']), trim($container['value']), $activeConfig); } if (!preg_match($this->simpleDirective, $lineConfig, $co...
[ "private", "function", "subCompile", "(", "&", "$", "activeConfig", ",", "$", "lineConfig", ")", "{", "if", "(", "preg_match", "(", "$", "this", "->", "startMultiLine", ",", "$", "lineConfig", ",", "$", "container", ")", ")", "{", "return", "$", "this", ...
Looks for a container directive. @param array $activeConfig a clean config array of directives @param string $lineConfig a line @throws Exception\InvalidConfigException if a simple directive has invalid syntax @return Directive\DirectiveInterface a directive or a container of directives
[ "Looks", "for", "a", "container", "directive", "." ]
0b39e7abe8f35afbeacdd6681fa9d0767888c646
https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Compiler.php#L108-L119
4,452
JamesRezo/webhelper-parser
src/Compiler.php
Compiler.findEndingKey
private function findEndingKey($context, $contextValue, &$activeConfig) { $lines = []; $endMultiLine = sprintf($this->endMultiLine, $context); while (!empty($activeConfig)) { $lineConfig = array_shift($activeConfig); if (preg_match($endMultiLine, $lineConfig)) { ...
php
private function findEndingKey($context, $contextValue, &$activeConfig) { $lines = []; $endMultiLine = sprintf($this->endMultiLine, $context); while (!empty($activeConfig)) { $lineConfig = array_shift($activeConfig); if (preg_match($endMultiLine, $lineConfig)) { ...
[ "private", "function", "findEndingKey", "(", "$", "context", ",", "$", "contextValue", ",", "&", "$", "activeConfig", ")", "{", "$", "lines", "=", "[", "]", ";", "$", "endMultiLine", "=", "sprintf", "(", "$", "this", "->", "endMultiLine", ",", "$", "co...
Finds the end of a container directive. @param string $context a container's name @param string $contextValue a container's value @param array $activeConfig a clean config array of lines @throws Exception\InvalidConfigException if a container does not end correctly @return Directive\BlockDirective a container ...
[ "Finds", "the", "end", "of", "a", "container", "directive", "." ]
0b39e7abe8f35afbeacdd6681fa9d0767888c646
https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Compiler.php#L132-L148
4,453
JamesRezo/webhelper-parser
src/Compiler.php
Compiler.buildBlockDirective
private function buildBlockDirective($context, $contextValue, $lines) { $class = 'WebHelper\Parser\Directive\BlockDirective'; $known = $this->parser->getServer()->getKnownDirectives(); if (in_array($context, array_keys($known))) { if (isset($known[$context]['class'])) { ...
php
private function buildBlockDirective($context, $contextValue, $lines) { $class = 'WebHelper\Parser\Directive\BlockDirective'; $known = $this->parser->getServer()->getKnownDirectives(); if (in_array($context, array_keys($known))) { if (isset($known[$context]['class'])) { ...
[ "private", "function", "buildBlockDirective", "(", "$", "context", ",", "$", "contextValue", ",", "$", "lines", ")", "{", "$", "class", "=", "'WebHelper\\Parser\\Directive\\BlockDirective'", ";", "$", "known", "=", "$", "this", "->", "parser", "->", "getServer",...
Builds a BlockDirective. @param string $context a container's name @param string $contextValue a container's value @param array $lines an array of directives @return Directive\BlockDirective the BlockDirective
[ "Builds", "a", "BlockDirective", "." ]
0b39e7abe8f35afbeacdd6681fa9d0767888c646
https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Compiler.php#L159-L174
4,454
JamesRezo/webhelper-parser
src/Compiler.php
Compiler.buildSimpleDirective
private function buildSimpleDirective($key, $value) { $known = $this->parser->getServer()->getKnownDirectives(); if (in_array($key, array_keys($known))) { if (isset($known[$key]['class'])) { $class = 'WebHelper\Parser\Directive\\'.$known[$key]['class']; re...
php
private function buildSimpleDirective($key, $value) { $known = $this->parser->getServer()->getKnownDirectives(); if (in_array($key, array_keys($known))) { if (isset($known[$key]['class'])) { $class = 'WebHelper\Parser\Directive\\'.$known[$key]['class']; re...
[ "private", "function", "buildSimpleDirective", "(", "$", "key", ",", "$", "value", ")", "{", "$", "known", "=", "$", "this", "->", "parser", "->", "getServer", "(", ")", "->", "getKnownDirectives", "(", ")", ";", "if", "(", "in_array", "(", "$", "key",...
Build a SimpleDirective or an InclusionDirective. Remember that inclusion are parsed as simple directives but are block directives @see Directive\InclusionDirective Inclusion Doc @param string $key a directive's name @param string $value a directive's value @return Directive\SimpleDirective|Directive\InclusionDir...
[ "Build", "a", "SimpleDirective", "or", "an", "InclusionDirective", "." ]
0b39e7abe8f35afbeacdd6681fa9d0767888c646
https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Compiler.php#L188-L199
4,455
gap-db/orm
GapOrm/Mapper/Model.php
Model.instance
public static function instance($className = __CLASS__) { if (!isset(self::$instances[$className])) { self::$instances[$className] = new $className; } return self::$instances[$className]; }
php
public static function instance($className = __CLASS__) { if (!isset(self::$instances[$className])) { self::$instances[$className] = new $className; } return self::$instances[$className]; }
[ "public", "static", "function", "instance", "(", "$", "className", "=", "__CLASS__", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "instances", "[", "$", "className", "]", ")", ")", "{", "self", "::", "$", "instances", "[", "$", "classNa...
Get Model instance @param string $className @return mixed
[ "Get", "Model", "instance" ]
bcd8e3d27b19b14814d3207489071c4a250a6ac5
https://github.com/gap-db/orm/blob/bcd8e3d27b19b14814d3207489071c4a250a6ac5/GapOrm/Mapper/Model.php#L27-L34
4,456
thecsea/twofactor-dir
src/twofactorDir.php
twofactorDir.redirectCheck
public function redirectCheck() { if(isset($_COOKIE['twofactorDir-'.$this->dir]) && $_COOKIE['twofactorDir-'.$this->dir] == $this->cookieCode) { self::redirect(); return true; }else { return false; } }
php
public function redirectCheck() { if(isset($_COOKIE['twofactorDir-'.$this->dir]) && $_COOKIE['twofactorDir-'.$this->dir] == $this->cookieCode) { self::redirect(); return true; }else { return false; } }
[ "public", "function", "redirectCheck", "(", ")", "{", "if", "(", "isset", "(", "$", "_COOKIE", "[", "'twofactorDir-'", ".", "$", "this", "->", "dir", "]", ")", "&&", "$", "_COOKIE", "[", "'twofactorDir-'", ".", "$", "this", "->", "dir", "]", "==", "$...
CAUTION this method uses cookie, it must be called before any print this method check if the cookie exists and if it is correct, if it is correct the method perform redirect @return bool true if the redirect is done
[ "CAUTION", "this", "method", "uses", "cookie", "it", "must", "be", "called", "before", "any", "print", "this", "method", "check", "if", "the", "cookie", "exists", "and", "if", "it", "is", "correct", "if", "it", "is", "correct", "the", "method", "perform", ...
4fe91b7d178fa705b560eb906e79a91d8d5d3de8
https://github.com/thecsea/twofactor-dir/blob/4fe91b7d178fa705b560eb906e79a91d8d5d3de8/src/twofactorDir.php#L91-L101
4,457
thecsea/twofactor-dir
src/twofactorDir.php
twofactorDir.checkCode
public function checkCode($code) { $res = $this->twofactorAdapter->check($code); if($res) { setcookie('twofactorDir-' . $this->dir, $this->cookieCode, 0, "/"); self::redirect(); } return $res; }
php
public function checkCode($code) { $res = $this->twofactorAdapter->check($code); if($res) { setcookie('twofactorDir-' . $this->dir, $this->cookieCode, 0, "/"); self::redirect(); } return $res; }
[ "public", "function", "checkCode", "(", "$", "code", ")", "{", "$", "res", "=", "$", "this", "->", "twofactorAdapter", "->", "check", "(", "$", "code", ")", ";", "if", "(", "$", "res", ")", "{", "setcookie", "(", "'twofactorDir-'", ".", "$", "this", ...
CAUTION this method uses cookie, it must be called before any print this method checks code and performs login this method perform redirect if the code is correct, after setting the cookie @param string $code @return bool true if the code is corret
[ "CAUTION", "this", "method", "uses", "cookie", "it", "must", "be", "called", "before", "any", "print", "this", "method", "checks", "code", "and", "performs", "login", "this", "method", "perform", "redirect", "if", "the", "code", "is", "correct", "after", "se...
4fe91b7d178fa705b560eb906e79a91d8d5d3de8
https://github.com/thecsea/twofactor-dir/blob/4fe91b7d178fa705b560eb906e79a91d8d5d3de8/src/twofactorDir.php#L120-L131
4,458
thecsea/twofactor-dir
src/twofactorDir.php
twofactorDir.install
static public function install($dir = ".") { $cookieCode = md5(rand()); $strReplaceS = array("{SRC_DIR}", "{CUR_DIR}", "{COOKIE_CODE}"); $strReplaceR = array(__DIR__."/..", $dir, $cookieCode); $f = fopen($dir . "/.htaccess", "a"); if(strpos(file_get_contents($dir."/.htaccess"...
php
static public function install($dir = ".") { $cookieCode = md5(rand()); $strReplaceS = array("{SRC_DIR}", "{CUR_DIR}", "{COOKIE_CODE}"); $strReplaceR = array(__DIR__."/..", $dir, $cookieCode); $f = fopen($dir . "/.htaccess", "a"); if(strpos(file_get_contents($dir."/.htaccess"...
[ "static", "public", "function", "install", "(", "$", "dir", "=", "\".\"", ")", "{", "$", "cookieCode", "=", "md5", "(", "rand", "(", ")", ")", ";", "$", "strReplaceS", "=", "array", "(", "\"{SRC_DIR}\"", ",", "\"{CUR_DIR}\"", ",", "\"{COOKIE_CODE}\"", ")...
Install library into a dir @param string $dir dir must be absolute link
[ "Install", "library", "into", "a", "dir" ]
4fe91b7d178fa705b560eb906e79a91d8d5d3de8
https://github.com/thecsea/twofactor-dir/blob/4fe91b7d178fa705b560eb906e79a91d8d5d3de8/src/twofactorDir.php#L168-L197
4,459
garkavenkov/db-connector
src/DBConnect.php
DBConnect.closeCursor
private function closeCursor() { try { if ($this->stmt) { $this->stmt->closeCursor(); } } catch (\PDOException $e) { die("Error: " . $e->getMessage()); } }
php
private function closeCursor() { try { if ($this->stmt) { $this->stmt->closeCursor(); } } catch (\PDOException $e) { die("Error: " . $e->getMessage()); } }
[ "private", "function", "closeCursor", "(", ")", "{", "try", "{", "if", "(", "$", "this", "->", "stmt", ")", "{", "$", "this", "->", "stmt", "->", "closeCursor", "(", ")", ";", "}", "}", "catch", "(", "\\", "PDOException", "$", "e", ")", "{", "die...
Closes cursor for next execution
[ "Closes", "cursor", "for", "next", "execution" ]
afe80d80b3377ef1fbeecd370bbf46568ae699ba
https://github.com/garkavenkov/db-connector/blob/afe80d80b3377ef1fbeecd370bbf46568ae699ba/src/DBConnect.php#L116-L125
4,460
garkavenkov/db-connector
src/DBConnect.php
DBConnect.getRow
public function getRow($fetch_style = null) { if (is_null($fetch_style)) { $fetch_style = \PDO::FETCH_ASSOC; } try { return $this->stmt->fetch($fetch_style); } catch (\PDOException $e) { die("Error: " . $e->getMessage()); } }
php
public function getRow($fetch_style = null) { if (is_null($fetch_style)) { $fetch_style = \PDO::FETCH_ASSOC; } try { return $this->stmt->fetch($fetch_style); } catch (\PDOException $e) { die("Error: " . $e->getMessage()); } }
[ "public", "function", "getRow", "(", "$", "fetch_style", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "fetch_style", ")", ")", "{", "$", "fetch_style", "=", "\\", "PDO", "::", "FETCH_ASSOC", ";", "}", "try", "{", "return", "$", "this", "->"...
Returns a next row from a result set @param int $fetch_style PDO fetch style @return mixed Record from result set depending on PDO fetch style
[ "Returns", "a", "next", "row", "from", "a", "result", "set" ]
afe80d80b3377ef1fbeecd370bbf46568ae699ba
https://github.com/garkavenkov/db-connector/blob/afe80d80b3377ef1fbeecd370bbf46568ae699ba/src/DBConnect.php#L149-L159
4,461
garkavenkov/db-connector
src/DBConnect.php
DBConnect.prepare
public function prepare(string $sql, $standalone = false) { try { $stmt = $this->dbh->prepare($sql); if ($standalone) { return $stmt; } else { $this->stmt = $stmt; } return $this; } catch (\PDOException $e) {...
php
public function prepare(string $sql, $standalone = false) { try { $stmt = $this->dbh->prepare($sql); if ($standalone) { return $stmt; } else { $this->stmt = $stmt; } return $this; } catch (\PDOException $e) {...
[ "public", "function", "prepare", "(", "string", "$", "sql", ",", "$", "standalone", "=", "false", ")", "{", "try", "{", "$", "stmt", "=", "$", "this", "->", "dbh", "->", "prepare", "(", "$", "sql", ")", ";", "if", "(", "$", "standalone", ")", "{"...
Prepares an SQL statement @param string $sql SQL statement @param boolean $standalone @return self
[ "Prepares", "an", "SQL", "statement" ]
afe80d80b3377ef1fbeecd370bbf46568ae699ba
https://github.com/garkavenkov/db-connector/blob/afe80d80b3377ef1fbeecd370bbf46568ae699ba/src/DBConnect.php#L186-L199
4,462
garkavenkov/db-connector
src/DBConnect.php
DBConnect.getFieldValue
public function getFieldValue(string $field_name) { try { $value = null; $fields = $this->stmt->fetch(\PDO::FETCH_ASSOC); if (array_key_exists($field_name, $fields)) { $value = $fields[$field_name]; } else { throw new \Exception...
php
public function getFieldValue(string $field_name) { try { $value = null; $fields = $this->stmt->fetch(\PDO::FETCH_ASSOC); if (array_key_exists($field_name, $fields)) { $value = $fields[$field_name]; } else { throw new \Exception...
[ "public", "function", "getFieldValue", "(", "string", "$", "field_name", ")", "{", "try", "{", "$", "value", "=", "null", ";", "$", "fields", "=", "$", "this", "->", "stmt", "->", "fetch", "(", "\\", "PDO", "::", "FETCH_ASSOC", ")", ";", "if", "(", ...
Returns field's value @param string $field_name Field's name @return mixed Field's value
[ "Returns", "field", "s", "value" ]
afe80d80b3377ef1fbeecd370bbf46568ae699ba
https://github.com/garkavenkov/db-connector/blob/afe80d80b3377ef1fbeecd370bbf46568ae699ba/src/DBConnect.php#L248-L264
4,463
garkavenkov/db-connector
src/DBConnect.php
DBConnect.getFieldValues
public function getFieldValues(string $field_name) { try { $field = []; $result = $this->stmt->fetchAll(\PDO::FETCH_ASSOC); if (array_key_exists($field_name, $result[0])) { foreach ($result as $row) { $field[] = $row[$field_name]; ...
php
public function getFieldValues(string $field_name) { try { $field = []; $result = $this->stmt->fetchAll(\PDO::FETCH_ASSOC); if (array_key_exists($field_name, $result[0])) { foreach ($result as $row) { $field[] = $row[$field_name]; ...
[ "public", "function", "getFieldValues", "(", "string", "$", "field_name", ")", "{", "try", "{", "$", "field", "=", "[", "]", ";", "$", "result", "=", "$", "this", "->", "stmt", "->", "fetchAll", "(", "\\", "PDO", "::", "FETCH_ASSOC", ")", ";", "if", ...
Returns field's values @param string $field_name Field's name @return array Array with field's values
[ "Returns", "field", "s", "values" ]
afe80d80b3377ef1fbeecd370bbf46568ae699ba
https://github.com/garkavenkov/db-connector/blob/afe80d80b3377ef1fbeecd370bbf46568ae699ba/src/DBConnect.php#L272-L290
4,464
FiveLab/Transactional
src/Proxy/Generator/ProxyFileGenerator.php
ProxyFileGenerator.generate
public function generate(): string { $namespace = $this->reflectionClass->getNamespaceName(); $fileDirectory = \rtrim($this->directory, '/') . '/Proxy/' . \str_replace('\\', '/', $namespace); $fileName = $this->reflectionClass->getShortName() . 'Proxy.php'; $filePath = $fileDirectory...
php
public function generate(): string { $namespace = $this->reflectionClass->getNamespaceName(); $fileDirectory = \rtrim($this->directory, '/') . '/Proxy/' . \str_replace('\\', '/', $namespace); $fileName = $this->reflectionClass->getShortName() . 'Proxy.php'; $filePath = $fileDirectory...
[ "public", "function", "generate", "(", ")", ":", "string", "{", "$", "namespace", "=", "$", "this", "->", "reflectionClass", "->", "getNamespaceName", "(", ")", ";", "$", "fileDirectory", "=", "\\", "rtrim", "(", "$", "this", "->", "directory", ",", "'/'...
Generate proxy file @return string
[ "Generate", "proxy", "file" ]
d2a406543f9eab35ad618d7f4436090487508fc9
https://github.com/FiveLab/Transactional/blob/d2a406543f9eab35ad618d7f4436090487508fc9/src/Proxy/Generator/ProxyFileGenerator.php#L66-L99
4,465
WellCommerce/DataSet
Context/TreeContext.php
TreeContext.buildTree
private function buildTree(array $rows, $parent = null) { $tree = []; foreach ($rows as &$row) { if ($row['parent'] == $parent) { $hasChildren = $this->propertyAccessor->getValue($row, "[{$this->options['children_column']}]"); $row['hasChildren'] =...
php
private function buildTree(array $rows, $parent = null) { $tree = []; foreach ($rows as &$row) { if ($row['parent'] == $parent) { $hasChildren = $this->propertyAccessor->getValue($row, "[{$this->options['children_column']}]"); $row['hasChildren'] =...
[ "private", "function", "buildTree", "(", "array", "$", "rows", ",", "$", "parent", "=", "null", ")", "{", "$", "tree", "=", "[", "]", ";", "foreach", "(", "$", "rows", "as", "&", "$", "row", ")", "{", "if", "(", "$", "row", "[", "'parent'", "]"...
Creates nested tree structure from result rows @param array $rows @param null $parent @return array
[ "Creates", "nested", "tree", "structure", "from", "result", "rows" ]
18720dc5416f245d22c502ceafce1a1b2db2b905
https://github.com/WellCommerce/DataSet/blob/18720dc5416f245d22c502ceafce1a1b2db2b905/Context/TreeContext.php#L46-L60
4,466
nirix/radium
src/Application.php
Application.loadDatabaseConfig
protected function loadDatabaseConfig() { if (!$this->databaseConfigFile) { return null; } $configPath = "{$this->path}/{$this->databaseConfigFile}"; if (file_exists($configPath)) { $this->databaseConfig = require $configPath; } else { thr...
php
protected function loadDatabaseConfig() { if (!$this->databaseConfigFile) { return null; } $configPath = "{$this->path}/{$this->databaseConfigFile}"; if (file_exists($configPath)) { $this->databaseConfig = require $configPath; } else { thr...
[ "protected", "function", "loadDatabaseConfig", "(", ")", "{", "if", "(", "!", "$", "this", "->", "databaseConfigFile", ")", "{", "return", "null", ";", "}", "$", "configPath", "=", "\"{$this->path}/{$this->databaseConfigFile}\"", ";", "if", "(", "file_exists", "...
Loads the database configuration file.
[ "Loads", "the", "database", "configuration", "file", "." ]
cc6907bfee296b64a7630b0b188e233d7cdb86fd
https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Application.php#L98-L110
4,467
CupOfTea696/WordPress-Lib
src/View/Blade.php
Blade.compileWhile
public function compileWhile($expression) { $expression = $this->normalizeExpression($expression); preg_match('/ *(.*?) *(?:, *(.*))? *$/is', $expression, $matches); $iteration = isset($matches[2]) ? trim($matches[1]) : $expression; $length = isset($matches[2]) ? tr...
php
public function compileWhile($expression) { $expression = $this->normalizeExpression($expression); preg_match('/ *(.*?) *(?:, *(.*))? *$/is', $expression, $matches); $iteration = isset($matches[2]) ? trim($matches[1]) : $expression; $length = isset($matches[2]) ? tr...
[ "public", "function", "compileWhile", "(", "$", "expression", ")", "{", "$", "expression", "=", "$", "this", "->", "normalizeExpression", "(", "$", "expression", ")", ";", "preg_match", "(", "'/ *(.*?) *(?:, *(.*))? *$/is'", ",", "$", "expression", ",", "$", "...
Compile the while statements into valid PHP. @param string $expression @return string
[ "Compile", "the", "while", "statements", "into", "valid", "PHP", "." ]
7b31413dff6f4f70b3e2a2fc8172d0721152891d
https://github.com/CupOfTea696/WordPress-Lib/blob/7b31413dff6f4f70b3e2a2fc8172d0721152891d/src/View/Blade.php#L200-L212
4,468
sulazix/SeanceBundle
Controller/ExportController.php
ExportController.exportToPDFAction
public function exportToPDFAction(Meeting $meeting) { $html = $this->render("InterneSeanceBundle:Export:pdf_export.html.twig", ["meeting" => $meeting])->getContent(); //return new Response($html); //* $html2pdf = $this->get('html2pdf_factory')->create(); $html2pdf->WriteHTML($html...
php
public function exportToPDFAction(Meeting $meeting) { $html = $this->render("InterneSeanceBundle:Export:pdf_export.html.twig", ["meeting" => $meeting])->getContent(); //return new Response($html); //* $html2pdf = $this->get('html2pdf_factory')->create(); $html2pdf->WriteHTML($html...
[ "public", "function", "exportToPDFAction", "(", "Meeting", "$", "meeting", ")", "{", "$", "html", "=", "$", "this", "->", "render", "(", "\"InterneSeanceBundle:Export:pdf_export.html.twig\"", ",", "[", "\"meeting\"", "=>", "$", "meeting", "]", ")", "->", "getCon...
Generate a PDF for a given Meeting entity
[ "Generate", "a", "PDF", "for", "a", "given", "Meeting", "entity" ]
6818f261dc5ca13a8f9664a46fad9bba273559c1
https://github.com/sulazix/SeanceBundle/blob/6818f261dc5ca13a8f9664a46fad9bba273559c1/Controller/ExportController.php#L27-L39
4,469
mszewcz/php-light-framework
src/Db/MySQL.php
MySQL.getInstance
public static function getInstance($driverName = null): AbstractMySQL { if (!static::$initialized) { static::$baseClass = Base::getInstance(); } $driverName = $driverName!==null ? '\\MS\\LightFramework\\Db\\MySQL\\Drivers\\'.$driverName : '\\MS\\LightFrame...
php
public static function getInstance($driverName = null): AbstractMySQL { if (!static::$initialized) { static::$baseClass = Base::getInstance(); } $driverName = $driverName!==null ? '\\MS\\LightFramework\\Db\\MySQL\\Drivers\\'.$driverName : '\\MS\\LightFrame...
[ "public", "static", "function", "getInstance", "(", "$", "driverName", "=", "null", ")", ":", "AbstractMySQL", "{", "if", "(", "!", "static", "::", "$", "initialized", ")", "{", "static", "::", "$", "baseClass", "=", "Base", "::", "getInstance", "(", ")"...
Returns MySQL driver according to configuration. @param string|null $driverName @return AbstractMySQL
[ "Returns", "MySQL", "driver", "according", "to", "configuration", "." ]
4d3b46781c387202c2dfbdb8760151b3ae8ef49c
https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Db/MySQL.php#L34-L52
4,470
mtoolkit/mtoolkit-core
src/MCoreApplication.php
MCoreApplication.setIsDebug
public static function setIsDebug(bool $bool): void { if (self::isCliApp()) { self::$IS_DEBUG = $bool; } else { MSession::set(MCoreApplication::DEBUG, $bool); } }
php
public static function setIsDebug(bool $bool): void { if (self::isCliApp()) { self::$IS_DEBUG = $bool; } else { MSession::set(MCoreApplication::DEBUG, $bool); } }
[ "public", "static", "function", "setIsDebug", "(", "bool", "$", "bool", ")", ":", "void", "{", "if", "(", "self", "::", "isCliApp", "(", ")", ")", "{", "self", "::", "$", "IS_DEBUG", "=", "$", "bool", ";", "}", "else", "{", "MSession", "::", "set",...
Set the debug mode. @param bool $bool
[ "Set", "the", "debug", "mode", "." ]
66c53273288a8652ff38240e063bdcffdf7c30aa
https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MCoreApplication.php#L86-L93
4,471
mtoolkit/mtoolkit-core
src/MCoreApplication.php
MCoreApplication.getApplicationDirPath
public static function getApplicationDirPath():?MApplicationDir { if (self::isCliApp()) { return self::$APPLICATION_DIR_PATH; } return MSession::get(MCoreApplication::APPLICATION_DIR_PATH); }
php
public static function getApplicationDirPath():?MApplicationDir { if (self::isCliApp()) { return self::$APPLICATION_DIR_PATH; } return MSession::get(MCoreApplication::APPLICATION_DIR_PATH); }
[ "public", "static", "function", "getApplicationDirPath", "(", ")", ":", "?", "MApplicationDir", "{", "if", "(", "self", "::", "isCliApp", "(", ")", ")", "{", "return", "self", "::", "$", "APPLICATION_DIR_PATH", ";", "}", "return", "MSession", "::", "get", ...
Return the root path of the project. @return MApplicationDir|null
[ "Return", "the", "root", "path", "of", "the", "project", "." ]
66c53273288a8652ff38240e063bdcffdf7c30aa
https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MCoreApplication.php#L150-L157
4,472
veonik/VeonikBlogBundle
src/Controller/Admin/AuthorController.php
AuthorController.newAction
public function newAction() { $entity = new Author(); $form = $this->createForm(new AuthorType(), $entity); return array( 'entity' => $entity, 'form' => $form->createView(), ); }
php
public function newAction() { $entity = new Author(); $form = $this->createForm(new AuthorType(), $entity); return array( 'entity' => $entity, 'form' => $form->createView(), ); }
[ "public", "function", "newAction", "(", ")", "{", "$", "entity", "=", "new", "Author", "(", ")", ";", "$", "form", "=", "$", "this", "->", "createForm", "(", "new", "AuthorType", "(", ")", ",", "$", "entity", ")", ";", "return", "array", "(", "'ent...
Displays a form to create a new Author entity. @Route("/new", name="manage_author_new") @Template()
[ "Displays", "a", "form", "to", "create", "a", "new", "Author", "entity", "." ]
52cca6b37feadd77fa564600b4db0e8e196099dd
https://github.com/veonik/VeonikBlogBundle/blob/52cca6b37feadd77fa564600b4db0e8e196099dd/src/Controller/Admin/AuthorController.php#L71-L80
4,473
easy-system/es-view-helpers
src/ViewHelpers.php
ViewHelpers.getHelper
public function getHelper($name, array $options = []) { $helper = $this->get($name); if (! empty($options) && is_callable([$helper, 'setOptions'])) { $helper->setOptions($options); } return $helper; }
php
public function getHelper($name, array $options = []) { $helper = $this->get($name); if (! empty($options) && is_callable([$helper, 'setOptions'])) { $helper->setOptions($options); } return $helper; }
[ "public", "function", "getHelper", "(", "$", "name", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "helper", "=", "$", "this", "->", "get", "(", "$", "name", ")", ";", "if", "(", "!", "empty", "(", "$", "options", ")", "&&", "is_c...
Gets the helper and sets its options. @param string $name The helper name @param array $options Optional; the helper options @return mixed The requested helper
[ "Gets", "the", "helper", "and", "sets", "its", "options", "." ]
39755d07dea63d525fb85d989bb095c89d805e9a
https://github.com/easy-system/es-view-helpers/blob/39755d07dea63d525fb85d989bb095c89d805e9a/src/ViewHelpers.php#L58-L66
4,474
easy-system/es-view-helpers
src/ViewHelpers.php
ViewHelpers.merge
public function merge(ViewHelpersInterface $source) { $this->registry = array_merge($this->registry, $source->getRegistry()); $this->instances = array_merge($this->instances, $source->getInstances()); return $this; }
php
public function merge(ViewHelpersInterface $source) { $this->registry = array_merge($this->registry, $source->getRegistry()); $this->instances = array_merge($this->instances, $source->getInstances()); return $this; }
[ "public", "function", "merge", "(", "ViewHelpersInterface", "$", "source", ")", "{", "$", "this", "->", "registry", "=", "array_merge", "(", "$", "this", "->", "registry", ",", "$", "source", "->", "getRegistry", "(", ")", ")", ";", "$", "this", "->", ...
Merges with other view helpers. @param \Es\Mvc\ViewHelpersInterface $source The data source @return self
[ "Merges", "with", "other", "view", "helpers", "." ]
39755d07dea63d525fb85d989bb095c89d805e9a
https://github.com/easy-system/es-view-helpers/blob/39755d07dea63d525fb85d989bb095c89d805e9a/src/ViewHelpers.php#L75-L81
4,475
phossa2/libs
src/Phossa2/Route/Parser/ParserStd.php
ParserStd.removeNumericAndEmpty
protected function removeNumericAndEmpty(array &$matches) { foreach ($matches as $idx => $val) { if (is_int($idx) || '' === $val) { unset($matches[$idx]); } } }
php
protected function removeNumericAndEmpty(array &$matches) { foreach ($matches as $idx => $val) { if (is_int($idx) || '' === $val) { unset($matches[$idx]); } } }
[ "protected", "function", "removeNumericAndEmpty", "(", "array", "&", "$", "matches", ")", "{", "foreach", "(", "$", "matches", "as", "$", "idx", "=>", "$", "val", ")", "{", "if", "(", "is_int", "(", "$", "idx", ")", "||", "''", "===", "$", "val", "...
remove numeric keys and empty group match @param array $matches @access protected
[ "remove", "numeric", "keys", "and", "empty", "group", "match" ]
921e485c8cc29067f279da2cdd06f47a9bddd115
https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Route/Parser/ParserStd.php#L159-L166
4,476
OpenResourceManager/client-php
src/Client/MobilePhone.php
MobilePhone.store
public function store( $account_id = null, $identifier = null, $username = null, $number, $country_code = null, $mobile_carrier_id = null, $mobile_carrier_code = null, $verified = null, $upstream_app_name = null, $verification_callback = nu...
php
public function store( $account_id = null, $identifier = null, $username = null, $number, $country_code = null, $mobile_carrier_id = null, $mobile_carrier_code = null, $verified = null, $upstream_app_name = null, $verification_callback = nu...
[ "public", "function", "store", "(", "$", "account_id", "=", "null", ",", "$", "identifier", "=", "null", ",", "$", "username", "=", "null", ",", "$", "number", ",", "$", "country_code", "=", "null", ",", "$", "mobile_carrier_id", "=", "null", ",", "$",...
Create Or Update Mobile Phone Create or update a mobile phone, based the phone number. An account ID, identifier, or username can be provided to associate the mobile phone with an account. @param int $account_id @param string $identifier @param string $username @param string $number @param string $country_code @param...
[ "Create", "Or", "Update", "Mobile", "Phone" ]
fa468e3425d32f97294fefed77a7f096f3f8cc86
https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/MobilePhone.php#L198-L225
4,477
aaronsaray/wordpress-plugin-on-github
src/UpdateWatcher.php
UpdateWatcher.filterPreSetSiteTransientUpdatePlugins
public function filterPreSetSiteTransientUpdatePlugins($transient) { $this->updatePluginData(); $this->updateGithubData(); if (version_compare($this->githubLatestRelease['tag_name'], $this->pluginData['Version']) === 1) { $update = new \stdClass(); $update->slug = $t...
php
public function filterPreSetSiteTransientUpdatePlugins($transient) { $this->updatePluginData(); $this->updateGithubData(); if (version_compare($this->githubLatestRelease['tag_name'], $this->pluginData['Version']) === 1) { $update = new \stdClass(); $update->slug = $t...
[ "public", "function", "filterPreSetSiteTransientUpdatePlugins", "(", "$", "transient", ")", "{", "$", "this", "->", "updatePluginData", "(", ")", ";", "$", "this", "->", "updateGithubData", "(", ")", ";", "if", "(", "version_compare", "(", "$", "this", "->", ...
Add in plugin information in order to get updates @param $transient object @return object
[ "Add", "in", "plugin", "information", "in", "order", "to", "get", "updates" ]
b79a81a5316f26cad6f0a5e992ccc9252187f9b5
https://github.com/aaronsaray/wordpress-plugin-on-github/blob/b79a81a5316f26cad6f0a5e992ccc9252187f9b5/src/UpdateWatcher.php#L73-L89
4,478
aaronsaray/wordpress-plugin-on-github
src/UpdateWatcher.php
UpdateWatcher.filterPluginsApi
public function filterPluginsApi($false, $action, $response) { // basically, verify we're working with our plugin if (empty($response->slug)) return false; $this->updatePluginData(); if ($response->slug != $this->pluginSlug) return false; // it's ours, so up...
php
public function filterPluginsApi($false, $action, $response) { // basically, verify we're working with our plugin if (empty($response->slug)) return false; $this->updatePluginData(); if ($response->slug != $this->pluginSlug) return false; // it's ours, so up...
[ "public", "function", "filterPluginsApi", "(", "$", "false", ",", "$", "action", ",", "$", "response", ")", "{", "// basically, verify we're working with our plugin", "if", "(", "empty", "(", "$", "response", "->", "slug", ")", ")", "return", "false", ";", "$"...
This updates the details for showing information in the modal @param $false @param $action @param $response @return mixed
[ "This", "updates", "the", "details", "for", "showing", "information", "in", "the", "modal" ]
b79a81a5316f26cad6f0a5e992ccc9252187f9b5
https://github.com/aaronsaray/wordpress-plugin-on-github/blob/b79a81a5316f26cad6f0a5e992ccc9252187f9b5/src/UpdateWatcher.php#L99-L125
4,479
aaronsaray/wordpress-plugin-on-github
src/UpdateWatcher.php
UpdateWatcher.filterUpgraderPostInstall
public function filterUpgraderPostInstall($true, $hookExtra, $result) { $this->updatePluginData(); $wasPluginActive = is_plugin_active($this->pluginBaseName); global $wp_filesystem; $pluginFolder = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . dirname($this->pluginBaseName); $wp_filesys...
php
public function filterUpgraderPostInstall($true, $hookExtra, $result) { $this->updatePluginData(); $wasPluginActive = is_plugin_active($this->pluginBaseName); global $wp_filesystem; $pluginFolder = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . dirname($this->pluginBaseName); $wp_filesys...
[ "public", "function", "filterUpgraderPostInstall", "(", "$", "true", ",", "$", "hookExtra", ",", "$", "result", ")", "{", "$", "this", "->", "updatePluginData", "(", ")", ";", "$", "wasPluginActive", "=", "is_plugin_active", "(", "$", "this", "->", "pluginBa...
Handles the post upgrade moving of files and what not @param $true @param $hookExtra @param $result @return mixed @throws \Exception
[ "Handles", "the", "post", "upgrade", "moving", "of", "files", "and", "what", "not" ]
b79a81a5316f26cad6f0a5e992ccc9252187f9b5
https://github.com/aaronsaray/wordpress-plugin-on-github/blob/b79a81a5316f26cad6f0a5e992ccc9252187f9b5/src/UpdateWatcher.php#L136-L153
4,480
aaronsaray/wordpress-plugin-on-github
src/UpdateWatcher.php
UpdateWatcher.updatePluginData
protected function updatePluginData() { $this->pluginBaseName = \plugin_basename($this->pluginFile); $this->pluginSlug = dirname($this->pluginBaseName); $this->pluginData = \get_plugin_data($this->pluginFile); }
php
protected function updatePluginData() { $this->pluginBaseName = \plugin_basename($this->pluginFile); $this->pluginSlug = dirname($this->pluginBaseName); $this->pluginData = \get_plugin_data($this->pluginFile); }
[ "protected", "function", "updatePluginData", "(", ")", "{", "$", "this", "->", "pluginBaseName", "=", "\\", "plugin_basename", "(", "$", "this", "->", "pluginFile", ")", ";", "$", "this", "->", "pluginSlug", "=", "dirname", "(", "$", "this", "->", "pluginB...
Gather plugin data from the file @note This is in a separate method because it doesn't need to be ran each time the constructor is initialized, only when callbacks are used
[ "Gather", "plugin", "data", "from", "the", "file" ]
b79a81a5316f26cad6f0a5e992ccc9252187f9b5
https://github.com/aaronsaray/wordpress-plugin-on-github/blob/b79a81a5316f26cad6f0a5e992ccc9252187f9b5/src/UpdateWatcher.php#L160-L165
4,481
aaronsaray/wordpress-plugin-on-github
src/UpdateWatcher.php
UpdateWatcher.updateGithubData
protected function updateGithubData() { if (!empty($this->githubLatestRelease)) return false; // this filter gets called twice, so the second time bail. $url = \esc_url_raw("https://api.github.com/repos/{$this->githubNamespace}/{$this->githubProject}/releases"); $response = \wp_remote_retr...
php
protected function updateGithubData() { if (!empty($this->githubLatestRelease)) return false; // this filter gets called twice, so the second time bail. $url = \esc_url_raw("https://api.github.com/repos/{$this->githubNamespace}/{$this->githubProject}/releases"); $response = \wp_remote_retr...
[ "protected", "function", "updateGithubData", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "githubLatestRelease", ")", ")", "return", "false", ";", "// this filter gets called twice, so the second time bail.", "$", "url", "=", "\\", "esc_url_raw", ...
Update the data from GitHub @return bool
[ "Update", "the", "data", "from", "GitHub" ]
b79a81a5316f26cad6f0a5e992ccc9252187f9b5
https://github.com/aaronsaray/wordpress-plugin-on-github/blob/b79a81a5316f26cad6f0a5e992ccc9252187f9b5/src/UpdateWatcher.php#L172-L197
4,482
searsaw/Drawbridge
src/commands/MigrationsCommand.php
MigrationsCommand.createMigration
public function createMigration() { $migration = $this->laravel->path . '/database/migrations/' . date('Y_m_d_His') . '_drawbridge_migrations_tables.php'; $view = $this->laravel->make('view')->make('drawbridge::migration')->render(); if (! file_exists($migration)) { $fs ...
php
public function createMigration() { $migration = $this->laravel->path . '/database/migrations/' . date('Y_m_d_His') . '_drawbridge_migrations_tables.php'; $view = $this->laravel->make('view')->make('drawbridge::migration')->render(); if (! file_exists($migration)) { $fs ...
[ "public", "function", "createMigration", "(", ")", "{", "$", "migration", "=", "$", "this", "->", "laravel", "->", "path", ".", "'/database/migrations/'", ".", "date", "(", "'Y_m_d_His'", ")", ".", "'_drawbridge_migrations_tables.php'", ";", "$", "view", "=", ...
Create migration for tables @return bool
[ "Create", "migration", "for", "tables" ]
156bd8238a623d245fbbbb509eb5dd148338f5a6
https://github.com/searsaw/Drawbridge/blob/156bd8238a623d245fbbbb509eb5dd148338f5a6/src/commands/MigrationsCommand.php#L57-L74
4,483
netgen/ngclasslist
datatypes/ngclasslist/ngclasslisttype.php
NgClassListType.validateObjectAttributeHTTPInput
function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute ) { $classList = $http->postVariable( $base . self::CLASS_LIST_VARIABLE . $contentObjectAttribute->attribute( "id" ), array() ); $classList = !is_array( $classList ) ? array() : $classList; if ( empty( $classLi...
php
function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute ) { $classList = $http->postVariable( $base . self::CLASS_LIST_VARIABLE . $contentObjectAttribute->attribute( "id" ), array() ); $classList = !is_array( $classList ) ? array() : $classList; if ( empty( $classLi...
[ "function", "validateObjectAttributeHTTPInput", "(", "$", "http", ",", "$", "base", ",", "$", "contentObjectAttribute", ")", "{", "$", "classList", "=", "$", "http", "->", "postVariable", "(", "$", "base", ".", "self", "::", "CLASS_LIST_VARIABLE", ".", "$", ...
Validates the input and returns the validity status code @param eZHTTPTool $http @param string $base @param eZContentObjectAttribute $contentObjectAttribute @return int
[ "Validates", "the", "input", "and", "returns", "the", "validity", "status", "code" ]
9fa5fc88bfb021982e206a6d3a0d82546752e6b7
https://github.com/netgen/ngclasslist/blob/9fa5fc88bfb021982e206a6d3a0d82546752e6b7/datatypes/ngclasslist/ngclasslisttype.php#L50-L86
4,484
mirko-pagliai/reflection
src/ReflectionTrait.php
ReflectionTrait.getProperty
public function getProperty(&$object, $propertyName) { $property = $this->getPropertyInstance($object, $propertyName); $property->setAccessible(true); return $property->getValue($object); }
php
public function getProperty(&$object, $propertyName) { $property = $this->getPropertyInstance($object, $propertyName); $property->setAccessible(true); return $property->getValue($object); }
[ "public", "function", "getProperty", "(", "&", "$", "object", ",", "$", "propertyName", ")", "{", "$", "property", "=", "$", "this", "->", "getPropertyInstance", "(", "$", "object", ",", "$", "propertyName", ")", ";", "$", "property", "->", "setAccessible"...
Gets a property value @param object $object Instantiated object that has the property @param string $propertyName Property name @return mixed Property value @uses getPropertyInstance()
[ "Gets", "a", "property", "value" ]
40462184304e455d9d367b4a14e9cb0eb39a1d99
https://github.com/mirko-pagliai/reflection/blob/40462184304e455d9d367b4a14e9cb0eb39a1d99/src/ReflectionTrait.php#L52-L58
4,485
phossa2/libs
src/Phossa2/Route/Route.php
Route.validatePattern
protected function validatePattern(/*# string */ $pattern) { if (!is_string($pattern) || substr_count($pattern, '[') !== substr_count($pattern, ']') || substr_count($pattern, '{') !== substr_count($pattern, '}') ) { throw new LogicException( Messag...
php
protected function validatePattern(/*# string */ $pattern) { if (!is_string($pattern) || substr_count($pattern, '[') !== substr_count($pattern, ']') || substr_count($pattern, '{') !== substr_count($pattern, '}') ) { throw new LogicException( Messag...
[ "protected", "function", "validatePattern", "(", "/*# string */", "$", "pattern", ")", "{", "if", "(", "!", "is_string", "(", "$", "pattern", ")", "||", "substr_count", "(", "$", "pattern", ",", "'['", ")", "!==", "substr_count", "(", "$", "pattern", ",", ...
Validate the pattern @param string $pattern @throws LogicException @access protected
[ "Validate", "the", "pattern" ]
921e485c8cc29067f279da2cdd06f47a9bddd115
https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Route/Route.php#L167-L178
4,486
jjpmann/ee-addons
src/Extension/BaseExtension.php
BaseExtension.applyConfigOverrides
public function applyConfigOverrides() { // init $config_items = []; foreach ($this->settings_default as $key => $value) { if (ee()->config->item($key)) { $config_items[$key] = ee()->config->item($key); } } if (is_array($this->setting...
php
public function applyConfigOverrides() { // init $config_items = []; foreach ($this->settings_default as $key => $value) { if (ee()->config->item($key)) { $config_items[$key] = ee()->config->item($key); } } if (is_array($this->setting...
[ "public", "function", "applyConfigOverrides", "(", ")", "{", "// init", "$", "config_items", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "settings_default", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "ee", "(", ")", "->", "...
Config Overrides. This function will merge with config overrides @return void
[ "Config", "Overrides", "." ]
239fff4022e0d1c401a1af5b9b97fc518751ab4a
https://github.com/jjpmann/ee-addons/blob/239fff4022e0d1c401a1af5b9b97fc518751ab4a/src/Extension/BaseExtension.php#L97-L111
4,487
jjpmann/ee-addons
src/Extension/BaseExtension.php
BaseExtension._log
public function _log($message) { ee()->load->library('logger'); ee()->load->library('user_agent'); ee()->logger->developer($this->package.' - '.$message); }
php
public function _log($message) { ee()->load->library('logger'); ee()->load->library('user_agent'); ee()->logger->developer($this->package.' - '.$message); }
[ "public", "function", "_log", "(", "$", "message", ")", "{", "ee", "(", ")", "->", "load", "->", "library", "(", "'logger'", ")", ";", "ee", "(", ")", "->", "load", "->", "library", "(", "'user_agent'", ")", ";", "ee", "(", ")", "->", "logger", "...
Log to the developer log if the setting is turned on. @return void
[ "Log", "to", "the", "developer", "log", "if", "the", "setting", "is", "turned", "on", "." ]
239fff4022e0d1c401a1af5b9b97fc518751ab4a
https://github.com/jjpmann/ee-addons/blob/239fff4022e0d1c401a1af5b9b97fc518751ab4a/src/Extension/BaseExtension.php#L118-L124
4,488
jjpmann/ee-addons
src/Extension/BaseExtension.php
BaseExtension.add_new_hooks
private function add_new_hooks() { // ADD New Actions foreach ($this->hooks as $hook => $method) { // check if its not installed if (!isset($this->current_hooks[$hook])) { $data = [ 'class' => $this->package, 'metho...
php
private function add_new_hooks() { // ADD New Actions foreach ($this->hooks as $hook => $method) { // check if its not installed if (!isset($this->current_hooks[$hook])) { $data = [ 'class' => $this->package, 'metho...
[ "private", "function", "add_new_hooks", "(", ")", "{", "// ADD New Actions", "foreach", "(", "$", "this", "->", "hooks", "as", "$", "hook", "=>", "$", "method", ")", "{", "// check if its not installed", "if", "(", "!", "isset", "(", "$", "this", "->", "cu...
Add New Hooks.
[ "Add", "New", "Hooks", "." ]
239fff4022e0d1c401a1af5b9b97fc518751ab4a
https://github.com/jjpmann/ee-addons/blob/239fff4022e0d1c401a1af5b9b97fc518751ab4a/src/Extension/BaseExtension.php#L145-L165
4,489
jjpmann/ee-addons
src/Extension/BaseExtension.php
BaseExtension.update_extension
public function update_extension($current = '') { if ($current == '' || $current == $this->version) { return false; } if ($current < '0.1') { // Update to version 1.0 } // Add any new hooks $this->add_new_hooks(); ee()->db->where('cl...
php
public function update_extension($current = '') { if ($current == '' || $current == $this->version) { return false; } if ($current < '0.1') { // Update to version 1.0 } // Add any new hooks $this->add_new_hooks(); ee()->db->where('cl...
[ "public", "function", "update_extension", "(", "$", "current", "=", "''", ")", "{", "if", "(", "$", "current", "==", "''", "||", "$", "current", "==", "$", "this", "->", "version", ")", "{", "return", "false", ";", "}", "if", "(", "$", "current", "...
Update Extension. This function performs any necessary db updates when the extension page is visited @return mixed void on update / false if none
[ "Update", "Extension", "." ]
239fff4022e0d1c401a1af5b9b97fc518751ab4a
https://github.com/jjpmann/ee-addons/blob/239fff4022e0d1c401a1af5b9b97fc518751ab4a/src/Extension/BaseExtension.php#L177-L195
4,490
marando/phpSOFA
src/Marando/IAU/iauApci13.php
iauApci13.Apci13
public static function Apci13($date1, $date2, iauASTROM &$astrom, &$eo) { $ehpv = []; $ebpv = []; $r = []; $x; $y; $s; /* Earth barycentric & heliocentric position/velocity (au, au/d). */ IAU::Epv00($date1, $date2, $ehpv, $ebpv); /* Form the equinox based BPN matrix, IAU 2006/20...
php
public static function Apci13($date1, $date2, iauASTROM &$astrom, &$eo) { $ehpv = []; $ebpv = []; $r = []; $x; $y; $s; /* Earth barycentric & heliocentric position/velocity (au, au/d). */ IAU::Epv00($date1, $date2, $ehpv, $ebpv); /* Form the equinox based BPN matrix, IAU 2006/20...
[ "public", "static", "function", "Apci13", "(", "$", "date1", ",", "$", "date2", ",", "iauASTROM", "&", "$", "astrom", ",", "&", "$", "eo", ")", "{", "$", "ehpv", "=", "[", "]", ";", "$", "ebpv", "=", "[", "]", ";", "$", "r", "=", "[", "]", ...
- - - - - - - - - - i a u A p c i 1 3 - - - - - - - - - - For a terrestrial observer, prepare star-independent astrometry parameters for transformations between ICRS and geocentric CIRS coordinates. The caller supplies the date, and SOFA models are used to predict the Earth ephemeris and CIP/CIO. The parameters prod...
[ "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "i", "a", "u", "A", "p", "c", "i", "1", "3", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-" ]
757fa49fe335ae1210eaa7735473fd4388b13f07
https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauApci13.php#L126-L153
4,491
phlexible/phlexible
src/Phlexible/Bundle/ElementtypeBundle/Field/AbstractField.php
AbstractField.fromRaw
public function fromRaw($value) { $type = $this->getDataType(); if ($type === 'json') { $value = json_decode($value, true); } elseif ($type === 'array') { $value = (array) $value; } elseif ($type === 'list') { $value = explode(',', $value); ...
php
public function fromRaw($value) { $type = $this->getDataType(); if ($type === 'json') { $value = json_decode($value, true); } elseif ($type === 'array') { $value = (array) $value; } elseif ($type === 'list') { $value = explode(',', $value); ...
[ "public", "function", "fromRaw", "(", "$", "value", ")", "{", "$", "type", "=", "$", "this", "->", "getDataType", "(", ")", ";", "if", "(", "$", "type", "===", "'json'", ")", "{", "$", "value", "=", "json_decode", "(", "$", "value", ",", "true", ...
From submitted value to object. @param string $value @return mixed
[ "From", "submitted", "value", "to", "object", "." ]
132f24924c9bb0dbb6c1ea84db0a463f97fa3893
https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Field/AbstractField.php#L52-L79
4,492
phlexible/phlexible
src/Phlexible/Bundle/ElementtypeBundle/Field/AbstractField.php
AbstractField.serialize
public function serialize($value) { if ($this->getDataType() === 'json') { return json_encode($value); } elseif ($this->getDataType() === 'array') { return json_encode($value); } elseif ($this->getDataType() === 'list') { return implode(',', $value); ...
php
public function serialize($value) { if ($this->getDataType() === 'json') { return json_encode($value); } elseif ($this->getDataType() === 'array') { return json_encode($value); } elseif ($this->getDataType() === 'list') { return implode(',', $value); ...
[ "public", "function", "serialize", "(", "$", "value", ")", "{", "if", "(", "$", "this", "->", "getDataType", "(", ")", "===", "'json'", ")", "{", "return", "json_encode", "(", "$", "value", ")", ";", "}", "elseif", "(", "$", "this", "->", "getDataTyp...
From object to database. @param mixed $value @return string
[ "From", "object", "to", "database", "." ]
132f24924c9bb0dbb6c1ea84db0a463f97fa3893
https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Field/AbstractField.php#L88-L99
4,493
phlexible/phlexible
src/Phlexible/Bundle/ElementtypeBundle/Field/AbstractField.php
AbstractField.unserialize
public function unserialize($value) { $type = $this->getDataType(); if ($type === 'json') { $value = json_decode($value, true); } elseif ($type === 'array') { $value = json_decode($value, true); } elseif ($type === 'list') { $value = explode(',', ...
php
public function unserialize($value) { $type = $this->getDataType(); if ($type === 'json') { $value = json_decode($value, true); } elseif ($type === 'array') { $value = json_decode($value, true); } elseif ($type === 'list') { $value = explode(',', ...
[ "public", "function", "unserialize", "(", "$", "value", ")", "{", "$", "type", "=", "$", "this", "->", "getDataType", "(", ")", ";", "if", "(", "$", "type", "===", "'json'", ")", "{", "$", "value", "=", "json_decode", "(", "$", "value", ",", "true"...
From database to object. @param string $value @return mixed
[ "From", "database", "to", "object", "." ]
132f24924c9bb0dbb6c1ea84db0a463f97fa3893
https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementtypeBundle/Field/AbstractField.php#L108-L135
4,494
avoo/QcmAdminBundle
Statistics/QuestionnaireStatistics.php
QuestionnaireStatistics.getScoreByCategory
public function getScoreByCategory() { $categories = array(); /** @var TemplateInterface $template */ foreach ($this->getData() as $template) { $category = $template->getQuestion()->getCategory(); if (!isset($categories[$category->getId()])) { $categ...
php
public function getScoreByCategory() { $categories = array(); /** @var TemplateInterface $template */ foreach ($this->getData() as $template) { $category = $template->getQuestion()->getCategory(); if (!isset($categories[$category->getId()])) { $categ...
[ "public", "function", "getScoreByCategory", "(", ")", "{", "$", "categories", "=", "array", "(", ")", ";", "/** @var TemplateInterface $template */", "foreach", "(", "$", "this", "->", "getData", "(", ")", "as", "$", "template", ")", "{", "$", "category", "=...
Get score by category @return array
[ "Get", "score", "by", "category" ]
fa0ec22d79c46580e09cc821f8b711babf1d09d5
https://github.com/avoo/QcmAdminBundle/blob/fa0ec22d79c46580e09cc821f8b711babf1d09d5/Statistics/QuestionnaireStatistics.php#L18-L43
4,495
avoo/QcmAdminBundle
Statistics/QuestionnaireStatistics.php
QuestionnaireStatistics.getScoreByLevel
public function getScoreByLevel() { $levels = array(); /** @var TemplateInterface $template */ foreach ($this->getData() as $template) { $question = $template->getQuestion(); if (!isset($levels[$question->getLevel()])) { $levels[$question->getLevel()...
php
public function getScoreByLevel() { $levels = array(); /** @var TemplateInterface $template */ foreach ($this->getData() as $template) { $question = $template->getQuestion(); if (!isset($levels[$question->getLevel()])) { $levels[$question->getLevel()...
[ "public", "function", "getScoreByLevel", "(", ")", "{", "$", "levels", "=", "array", "(", ")", ";", "/** @var TemplateInterface $template */", "foreach", "(", "$", "this", "->", "getData", "(", ")", "as", "$", "template", ")", "{", "$", "question", "=", "$...
Get Score by question level @return array
[ "Get", "Score", "by", "question", "level" ]
fa0ec22d79c46580e09cc821f8b711babf1d09d5
https://github.com/avoo/QcmAdminBundle/blob/fa0ec22d79c46580e09cc821f8b711babf1d09d5/Statistics/QuestionnaireStatistics.php#L50-L77
4,496
avoo/QcmAdminBundle
Statistics/QuestionnaireStatistics.php
QuestionnaireStatistics.getPercentagePartial
public function getPercentagePartial() { $total = $this->getTotal(); return round((($this->score->getValid() + $this->score->getPartial())/$total) * 100); }
php
public function getPercentagePartial() { $total = $this->getTotal(); return round((($this->score->getValid() + $this->score->getPartial())/$total) * 100); }
[ "public", "function", "getPercentagePartial", "(", ")", "{", "$", "total", "=", "$", "this", "->", "getTotal", "(", ")", ";", "return", "round", "(", "(", "(", "$", "this", "->", "score", "->", "getValid", "(", ")", "+", "$", "this", "->", "score", ...
Get percentage valid + partial
[ "Get", "percentage", "valid", "+", "partial" ]
fa0ec22d79c46580e09cc821f8b711babf1d09d5
https://github.com/avoo/QcmAdminBundle/blob/fa0ec22d79c46580e09cc821f8b711babf1d09d5/Statistics/QuestionnaireStatistics.php#L94-L99
4,497
avoo/QcmAdminBundle
Statistics/QuestionnaireStatistics.php
QuestionnaireStatistics.getTotal
public function getTotal() { return $this->score->getValid() + $this->score->getPartial() + $this->score->getNotValid(); }
php
public function getTotal() { return $this->score->getValid() + $this->score->getPartial() + $this->score->getNotValid(); }
[ "public", "function", "getTotal", "(", ")", "{", "return", "$", "this", "->", "score", "->", "getValid", "(", ")", "+", "$", "this", "->", "score", "->", "getPartial", "(", ")", "+", "$", "this", "->", "score", "->", "getNotValid", "(", ")", ";", "...
Get total answers @return integer
[ "Get", "total", "answers" ]
fa0ec22d79c46580e09cc821f8b711babf1d09d5
https://github.com/avoo/QcmAdminBundle/blob/fa0ec22d79c46580e09cc821f8b711babf1d09d5/Statistics/QuestionnaireStatistics.php#L106-L109
4,498
devbr/database
Model.php
Model.doIndex
final public function doIndex($start = 0, $len = 30, $search = null) { //SEarch if ($search !== null && is_array($search)) { $tmp = ' WHERE '; $and = ''; foreach ($search as $k => $v) { $tmp .= $and.$k.' LIKE "%'.$v.'%" '; $and = ' ...
php
final public function doIndex($start = 0, $len = 30, $search = null) { //SEarch if ($search !== null && is_array($search)) { $tmp = ' WHERE '; $and = ''; foreach ($search as $k => $v) { $tmp .= $and.$k.' LIKE "%'.$v.'%" '; $and = ' ...
[ "final", "public", "function", "doIndex", "(", "$", "start", "=", "0", ",", "$", "len", "=", "30", ",", "$", "search", "=", "null", ")", "{", "//SEarch", "if", "(", "$", "search", "!==", "null", "&&", "is_array", "(", "$", "search", ")", ")", "{"...
Lista todos || paginado
[ "Lista", "todos", "||", "paginado" ]
09269a39be6dd70d68cc3e6ffa18c23a09205238
https://github.com/devbr/database/blob/09269a39be6dd70d68cc3e6ffa18c23a09205238/Model.php#L57-L75
4,499
devbr/database
Model.php
Model.doShow
final public function doShow($id) { $this->db->query('SELECT * FROM '.$this->table.' WHERE id = :id', [':id'=>$id]); $result = $this->db->result(); return $result ? $result : false; }
php
final public function doShow($id) { $this->db->query('SELECT * FROM '.$this->table.' WHERE id = :id', [':id'=>$id]); $result = $this->db->result(); return $result ? $result : false; }
[ "final", "public", "function", "doShow", "(", "$", "id", ")", "{", "$", "this", "->", "db", "->", "query", "(", "'SELECT * FROM '", ".", "$", "this", "->", "table", ".", "' WHERE id = :id'", ",", "[", "':id'", "=>", "$", "id", "]", ")", ";", "$", "...
Lista o selecionado
[ "Lista", "o", "selecionado" ]
09269a39be6dd70d68cc3e6ffa18c23a09205238
https://github.com/devbr/database/blob/09269a39be6dd70d68cc3e6ffa18c23a09205238/Model.php#L78-L83