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
1,300
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.getFromWhere
public function getFromWhere($from, $where=NULL, $where_values=array(), $order=NULL, $limit=NULL, $offset=NULL){ $res= FALSE; try{ //Armo partes de la consulta if($order != NULL){$order= " ORDER BY " . $order;} if($limit != NULL){ $limit= " LIMIT " . $...
php
public function getFromWhere($from, $where=NULL, $where_values=array(), $order=NULL, $limit=NULL, $offset=NULL){ $res= FALSE; try{ //Armo partes de la consulta if($order != NULL){$order= " ORDER BY " . $order;} if($limit != NULL){ $limit= " LIMIT " . $...
[ "public", "function", "getFromWhere", "(", "$", "from", ",", "$", "where", "=", "NULL", ",", "$", "where_values", "=", "array", "(", ")", ",", "$", "order", "=", "NULL", ",", "$", "limit", "=", "NULL", ",", "$", "offset", "=", "NULL", ")", "{", "...
Devuelve el resultado de la consulta armada en base a los parametros @param string $from @param string $where @param array $where_values @param string $order @param type $limit @param type $offset @return \PDOStatement o FALSE @throws \PDOStatement
[ "Devuelve", "el", "resultado", "de", "la", "consulta", "armada", "en", "base", "a", "los", "parametros" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L389-L413
1,301
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.insert
public function insert($table, array $values){ try{ //Armo y preparo la consulta $query= $this->prepareInsert($table, $values); //Ejecuto la consulta $query->execute($values); //Retorno si salio todo bien o no return $this->isOk($query); ...
php
public function insert($table, array $values){ try{ //Armo y preparo la consulta $query= $this->prepareInsert($table, $values); //Ejecuto la consulta $query->execute($values); //Retorno si salio todo bien o no return $this->isOk($query); ...
[ "public", "function", "insert", "(", "$", "table", ",", "array", "$", "values", ")", "{", "try", "{", "//Armo y preparo la consulta", "$", "query", "=", "$", "this", "->", "prepareInsert", "(", "$", "table", ",", "$", "values", ")", ";", "//Ejecuto la cons...
Inserta en una tabla los valores indicados @param string $table @param array $values @return boolean @throws \PDOException
[ "Inserta", "en", "una", "tabla", "los", "valores", "indicados" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L421-L432
1,302
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.insertMany
public function insertMany($table, array $manyValues){ try{ reset($manyValues); if(current($manyValues) != FALSE){ //Armo y preparo la consulta $query= $this->prepareInsert($table, $manyValues[0]); } $ok= true; wh...
php
public function insertMany($table, array $manyValues){ try{ reset($manyValues); if(current($manyValues) != FALSE){ //Armo y preparo la consulta $query= $this->prepareInsert($table, $manyValues[0]); } $ok= true; wh...
[ "public", "function", "insertMany", "(", "$", "table", ",", "array", "$", "manyValues", ")", "{", "try", "{", "reset", "(", "$", "manyValues", ")", ";", "if", "(", "current", "(", "$", "manyValues", ")", "!=", "FALSE", ")", "{", "//Armo y preparo la cons...
Inserta en una tabla un conjunto de valores indicados. Cada elemento del vector guardado debe tener la misma estructura @param string $table @param array[array] $manyValues @return boolean @throws \PDOException
[ "Inserta", "en", "una", "tabla", "un", "conjunto", "de", "valores", "indicados", ".", "Cada", "elemento", "del", "vector", "guardado", "debe", "tener", "la", "misma", "estructura" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L440-L460
1,303
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.update
public function update($table, array $values){ $res= FALSE; try{ $query= $this->prepareUpdate($table, $values, $this->where); //Uno los values pasados y los del where $values= array_merge($values, $this->where_values); //Ejecuto la consulta $qu...
php
public function update($table, array $values){ $res= FALSE; try{ $query= $this->prepareUpdate($table, $values, $this->where); //Uno los values pasados y los del where $values= array_merge($values, $this->where_values); //Ejecuto la consulta $qu...
[ "public", "function", "update", "(", "$", "table", ",", "array", "$", "values", ")", "{", "$", "res", "=", "FALSE", ";", "try", "{", "$", "query", "=", "$", "this", "->", "prepareUpdate", "(", "$", "table", ",", "$", "values", ",", "$", "this", "...
Actualiza una tabla en base a los datos indicados y la consulta armada al estilo Active Record @param string $table @param array $values @return boolean @throws \PDOException
[ "Actualiza", "una", "tabla", "en", "base", "a", "los", "datos", "indicados", "y", "la", "consulta", "armada", "al", "estilo", "Active", "Record" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L468-L485
1,304
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.delete
public function delete($table){ $res= FALSE; try{ //Armo y preparo la consulta $query= $this->prepareDelete($table, $this->where); //Ejecuto la consulta $query->execute($this->where_values); //Veo si salio todo bien ...
php
public function delete($table){ $res= FALSE; try{ //Armo y preparo la consulta $query= $this->prepareDelete($table, $this->where); //Ejecuto la consulta $query->execute($this->where_values); //Veo si salio todo bien ...
[ "public", "function", "delete", "(", "$", "table", ")", "{", "$", "res", "=", "FALSE", ";", "try", "{", "//Armo y preparo la consulta", "$", "query", "=", "$", "this", "->", "prepareDelete", "(", "$", "table", ",", "$", "this", "->", "where", ")", ";",...
Elimina tuplas de una tabla en base a la consulta armada de la forma Active Record @param string $table @return boolean @throws \PDOException
[ "Elimina", "tuplas", "de", "una", "tabla", "en", "base", "a", "la", "consulta", "armada", "de", "la", "forma", "Active", "Record" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L492-L508
1,305
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.isOk
protected function isOk(\PDOStatement $query){ $error= $query->errorInfo(); if($error[0] == '00000'){ return TRUE; }else{ $this->catchError($error); return FALSE; } }
php
protected function isOk(\PDOStatement $query){ $error= $query->errorInfo(); if($error[0] == '00000'){ return TRUE; }else{ $this->catchError($error); return FALSE; } }
[ "protected", "function", "isOk", "(", "\\", "PDOStatement", "$", "query", ")", "{", "$", "error", "=", "$", "query", "->", "errorInfo", "(", ")", ";", "if", "(", "$", "error", "[", "0", "]", "==", "'00000'", ")", "{", "return", "TRUE", ";", "}", ...
Retorna si la consulta se realizao con exito, si no ocurrio ningun error. @param \PDOStatement $query @return boolean
[ "Retorna", "si", "la", "consulta", "se", "realizao", "con", "exito", "si", "no", "ocurrio", "ningun", "error", "." ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L517-L525
1,306
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.cleanVars
protected function cleanVars(){ $this->select= "*"; $this->from= ''; $this->where= ''; $this->where_values= array(); $this->group= ''; $this->having= ''; $this->order= ''; $this->limit= ''; }
php
protected function cleanVars(){ $this->select= "*"; $this->from= ''; $this->where= ''; $this->where_values= array(); $this->group= ''; $this->having= ''; $this->order= ''; $this->limit= ''; }
[ "protected", "function", "cleanVars", "(", ")", "{", "$", "this", "->", "select", "=", "\"*\"", ";", "$", "this", "->", "from", "=", "''", ";", "$", "this", "->", "where", "=", "''", ";", "$", "this", "->", "where_values", "=", "array", "(", ")", ...
Limpia las variables de instancia del ActiveRecord
[ "Limpia", "las", "variables", "de", "instancia", "del", "ActiveRecord" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L527-L536
1,307
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.prepareSelect
protected function prepareSelect($select, $from, $where='', $group='', $having='', $order='', $limit=''){ $sql= "SELECT " . $select; $sql.= " FROM " . $from; if($where != '' && $where != NULL){$sql.= " WHERE " . $where;} $sql.= $group; if($having != '' && $having != ...
php
protected function prepareSelect($select, $from, $where='', $group='', $having='', $order='', $limit=''){ $sql= "SELECT " . $select; $sql.= " FROM " . $from; if($where != '' && $where != NULL){$sql.= " WHERE " . $where;} $sql.= $group; if($having != '' && $having != ...
[ "protected", "function", "prepareSelect", "(", "$", "select", ",", "$", "from", ",", "$", "where", "=", "''", ",", "$", "group", "=", "''", ",", "$", "having", "=", "''", ",", "$", "order", "=", "''", ",", "$", "limit", "=", "''", ")", "{", "$"...
Retorna un PDOStatement SELECT armado en base a los parametros pasados @param string $select @param string $from @param string $where @param string $group @param string $having @param string $order @param string $limit return PDOStatement
[ "Retorna", "un", "PDOStatement", "SELECT", "armado", "en", "base", "a", "los", "parametros", "pasados" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L560-L570
1,308
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.prepareInsert
protected function prepareInsert($table, $values){ $sql= 'INSERT INTO ' . $table . ' ('; $value= 'values('; foreach ($values as $key => $val) { $sql.= $key . ','; $value.= ':' . $key . ','; } $sql = trim($sql, ','); $value = trim($value, ','); ...
php
protected function prepareInsert($table, $values){ $sql= 'INSERT INTO ' . $table . ' ('; $value= 'values('; foreach ($values as $key => $val) { $sql.= $key . ','; $value.= ':' . $key . ','; } $sql = trim($sql, ','); $value = trim($value, ','); ...
[ "protected", "function", "prepareInsert", "(", "$", "table", ",", "$", "values", ")", "{", "$", "sql", "=", "'INSERT INTO '", ".", "$", "table", ".", "' ('", ";", "$", "value", "=", "'values('", ";", "foreach", "(", "$", "values", "as", "$", "key", "...
Retorna un PDOStatement INSERT armado en base a los parametros pasados @param string $table @param array $values @return PDOStatement
[ "Retorna", "un", "PDOStatement", "INSERT", "armado", "en", "base", "a", "los", "parametros", "pasados" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L577-L589
1,309
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.prepareUpdate
protected function prepareUpdate($table, $values, $where){ $sql= 'UPDATE ' . $table . ' SET '; foreach ($values as $key => $value) { $sql .= $key . '=:' . $key . ','; } $sql = trim($sql, ','); if($where != ''){$sql.= " WHERE " . $where;} //Preparo la consulta ...
php
protected function prepareUpdate($table, $values, $where){ $sql= 'UPDATE ' . $table . ' SET '; foreach ($values as $key => $value) { $sql .= $key . '=:' . $key . ','; } $sql = trim($sql, ','); if($where != ''){$sql.= " WHERE " . $where;} //Preparo la consulta ...
[ "protected", "function", "prepareUpdate", "(", "$", "table", ",", "$", "values", ",", "$", "where", ")", "{", "$", "sql", "=", "'UPDATE '", ".", "$", "table", ".", "' SET '", ";", "foreach", "(", "$", "values", "as", "$", "key", "=>", "$", "value", ...
Retorna un PDOStatement UPDATE armado en base a los parametros pasados @param string $table @param array $values @param string $where @return PDOStatement
[ "Retorna", "un", "PDOStatement", "UPDATE", "armado", "en", "base", "a", "los", "parametros", "pasados" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L597-L606
1,310
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.prepareDelete
protected function prepareDelete($table, $where){ $sql= 'DELETE FROM ' . $table . ' '; if($where != ''){$sql.= " WHERE " . $where;} //Preparo la consulta y la retorno return $this->connection->prepare($sql); }
php
protected function prepareDelete($table, $where){ $sql= 'DELETE FROM ' . $table . ' '; if($where != ''){$sql.= " WHERE " . $where;} //Preparo la consulta y la retorno return $this->connection->prepare($sql); }
[ "protected", "function", "prepareDelete", "(", "$", "table", ",", "$", "where", ")", "{", "$", "sql", "=", "'DELETE FROM '", ".", "$", "table", ".", "' '", ";", "if", "(", "$", "where", "!=", "''", ")", "{", "$", "sql", ".=", "\" WHERE \"", ".", "$...
Retorna un PDOStatement DELETE armado en base a los parametros pasados @param string $table @param string $where @return PDOStatement
[ "Retorna", "un", "PDOStatement", "DELETE", "armado", "en", "base", "a", "los", "parametros", "pasados" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L613-L618
1,311
nattreid/security
src/Control/tryUser/TryUser.php
TryUser.set
public function set(int $id): bool { if (!$this->isAllowed()) { return false; } $hash = $this->hasher->hash($id); $uniqid = uniqid(); $this->session->setExpiration('5 minutes'); $this->session->$uniqid = $hash; $this->id = $uniqid; $this->presenter->redirect($this->redirect); return true; }
php
public function set(int $id): bool { if (!$this->isAllowed()) { return false; } $hash = $this->hasher->hash($id); $uniqid = uniqid(); $this->session->setExpiration('5 minutes'); $this->session->$uniqid = $hash; $this->id = $uniqid; $this->presenter->redirect($this->redirect); return true; }
[ "public", "function", "set", "(", "int", "$", "id", ")", ":", "bool", "{", "if", "(", "!", "$", "this", "->", "isAllowed", "(", ")", ")", "{", "return", "false", ";", "}", "$", "hash", "=", "$", "this", "->", "hasher", "->", "hash", "(", "$", ...
Nastavi testovaci ucet a presmeruje @param int $id @return bool pokud uzivatel nema prava k teto metode, vrati false @throws AbortException
[ "Nastavi", "testovaci", "ucet", "a", "presmeruje" ]
ed649e5bdf453cea2d5352e643dbf201193de01d
https://github.com/nattreid/security/blob/ed649e5bdf453cea2d5352e643dbf201193de01d/src/Control/tryUser/TryUser.php#L104-L116
1,312
emaphp/eMapper
lib/eMapper/Result/Mapper/ComplexMapper.php
ComplexMapper.validateIndex
protected function validateIndex($index, $indexType) { if (is_null($this->resultMap)) { //find index column on given result if (!array_key_exists($index, $this->columnTypes)) { if (is_numeric($index) && array_key_exists(intval($index), $this->columnTypes)) $index = intval($index); else throw...
php
protected function validateIndex($index, $indexType) { if (is_null($this->resultMap)) { //find index column on given result if (!array_key_exists($index, $this->columnTypes)) { if (is_numeric($index) && array_key_exists(intval($index), $this->columnTypes)) $index = intval($index); else throw...
[ "protected", "function", "validateIndex", "(", "$", "index", ",", "$", "indexType", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "resultMap", ")", ")", "{", "//find index column on given result", "if", "(", "!", "array_key_exists", "(", "$", "inde...
Validates a user defined index againts current result @param string $index @param string $indexType @throws \UnexpectedValueException @return array
[ "Validates", "a", "user", "defined", "index", "againts", "current", "result" ]
df7100e601d2a1363d07028a786b6ceb22271829
https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Result/Mapper/ComplexMapper.php#L79-L110
1,313
emaphp/eMapper
lib/eMapper/Result/Mapper/ComplexMapper.php
ComplexMapper.validateGroup
protected function validateGroup($group, $groupType) { if (is_null($this->resultMap)) { //find group column if (!array_key_exists($group, $this->columnTypes)) { if (is_numeric($group) && array_key_exists(intval($group), $this->columnTypes)) $group = intval($group); else throw new \UnexpectedVa...
php
protected function validateGroup($group, $groupType) { if (is_null($this->resultMap)) { //find group column if (!array_key_exists($group, $this->columnTypes)) { if (is_numeric($group) && array_key_exists(intval($group), $this->columnTypes)) $group = intval($group); else throw new \UnexpectedVa...
[ "protected", "function", "validateGroup", "(", "$", "group", ",", "$", "groupType", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "resultMap", ")", ")", "{", "//find group column", "if", "(", "!", "array_key_exists", "(", "$", "group", ",", "$"...
Validates a user defined group against current result @param string $group @param string $groupType @throws \UnexpectedValueException @return array
[ "Validates", "a", "user", "defined", "group", "against", "current", "result" ]
df7100e601d2a1363d07028a786b6ceb22271829
https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Result/Mapper/ComplexMapper.php#L119-L150
1,314
emaphp/eMapper
lib/eMapper/Result/Mapper/ComplexMapper.php
ComplexMapper.buildTypeHandlerList
protected function buildTypeHandlerList() { foreach ($this->properties as $name => $propertyProfile) { $column = $propertyProfile->getColumn(); if (!array_key_exists($column, $this->columnTypes)) continue; $this->availableColumns[$name] = $column; $type = $propertyProfile->getType(); i...
php
protected function buildTypeHandlerList() { foreach ($this->properties as $name => $propertyProfile) { $column = $propertyProfile->getColumn(); if (!array_key_exists($column, $this->columnTypes)) continue; $this->availableColumns[$name] = $column; $type = $propertyProfile->getType(); i...
[ "protected", "function", "buildTypeHandlerList", "(", ")", "{", "foreach", "(", "$", "this", "->", "properties", "as", "$", "name", "=>", "$", "propertyProfile", ")", "{", "$", "column", "=", "$", "propertyProfile", "->", "getColumn", "(", ")", ";", "if", ...
Builds a list of type handlers for the available columns @throws \UnexpectedValueException
[ "Builds", "a", "list", "of", "type", "handlers", "for", "the", "available", "columns" ]
df7100e601d2a1363d07028a786b6ceb22271829
https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Result/Mapper/ComplexMapper.php#L180-L203
1,315
easy-system/es-error
src/Strategy/AbstractErrorStrategy.php
AbstractErrorStrategy.processResponse
public function processResponse(ResponseInterface $response, SystemEvent $event) { if ($event->getName() === SystemEvent::FINISH) { $event->stopPropagation(true); $server = $this->getServer(); $emitter = $server->getEmitter(); $emitter->emit($response); ...
php
public function processResponse(ResponseInterface $response, SystemEvent $event) { if ($event->getName() === SystemEvent::FINISH) { $event->stopPropagation(true); $server = $this->getServer(); $emitter = $server->getEmitter(); $emitter->emit($response); ...
[ "public", "function", "processResponse", "(", "ResponseInterface", "$", "response", ",", "SystemEvent", "$", "event", ")", "{", "if", "(", "$", "event", "->", "getName", "(", ")", "===", "SystemEvent", "::", "FINISH", ")", "{", "$", "event", "->", "stopPro...
Processes the response. @param \Psr\Http\Message\ResponseInterface $response The response @param \Es\System\SystemEvent $event The system event
[ "Processes", "the", "response", "." ]
5248c52f2992acc9ddf3542092ad7bbbb440e621
https://github.com/easy-system/es-error/blob/5248c52f2992acc9ddf3542092ad7bbbb440e621/src/Strategy/AbstractErrorStrategy.php#L61-L74
1,316
vphantom/pyritephp
src/Pyrite/AuditTrail.php
AuditTrail.add
public static function add($objectType, $objectId = null, $action = null, $fieldName = null, $oldValue = null, $newValue = null, $userId = 0, $content = '') { global $PPHP; $db = $PPHP['db']; $ip = '127.0.0.1'; $req = grab('request'); if (isset($req['remote_addr'])) { ...
php
public static function add($objectType, $objectId = null, $action = null, $fieldName = null, $oldValue = null, $newValue = null, $userId = 0, $content = '') { global $PPHP; $db = $PPHP['db']; $ip = '127.0.0.1'; $req = grab('request'); if (isset($req['remote_addr'])) { ...
[ "public", "static", "function", "add", "(", "$", "objectType", ",", "$", "objectId", "=", "null", ",", "$", "action", "=", "null", ",", "$", "fieldName", "=", "null", ",", "$", "oldValue", "=", "null", ",", "$", "newValue", "=", "null", ",", "$", "...
Add a new transaction to the audit trail Suggested minimum set of actions: created modified deleted You can either use these positional arguments or specify a single associative array argument with only the keys you need defined. At least an action should be specified (i.e. 'rebooted', perhaps) and typically also o...
[ "Add", "a", "new", "transaction", "to", "the", "audit", "trail" ]
e609daa714298a254bf5a945a1d6985c9d4d539d
https://github.com/vphantom/pyritephp/blob/e609daa714298a254bf5a945a1d6985c9d4d539d/src/Pyrite/AuditTrail.php#L105-L166
1,317
vphantom/pyritephp
src/Pyrite/AuditTrail.php
AuditTrail.getLastLogin
public static function getLastLogin($userId) { global $PPHP; $db = $PPHP['db']; $last = $db->selectSingleArray( " SELECT timestamp, ip, datetime(timestamp, 'localtime') AS localtimestamp FROM transactions WHERE objectType='user' AND objectId=? ...
php
public static function getLastLogin($userId) { global $PPHP; $db = $PPHP['db']; $last = $db->selectSingleArray( " SELECT timestamp, ip, datetime(timestamp, 'localtime') AS localtimestamp FROM transactions WHERE objectType='user' AND objectId=? ...
[ "public", "static", "function", "getLastLogin", "(", "$", "userId", ")", "{", "global", "$", "PPHP", ";", "$", "db", "=", "$", "PPHP", "[", "'db'", "]", ";", "$", "last", "=", "$", "db", "->", "selectSingleArray", "(", "\"\n SELECT timestamp, ip...
Get user's last login details The last login is an associative array with the following keys: timestamp - UTC localtimestamp - Local time zone ip - IP address @param int $userId User ID @return array Last login, if any
[ "Get", "user", "s", "last", "login", "details" ]
e609daa714298a254bf5a945a1d6985c9d4d539d
https://github.com/vphantom/pyritephp/blob/e609daa714298a254bf5a945a1d6985c9d4d539d/src/Pyrite/AuditTrail.php#L293-L310
1,318
vphantom/pyritephp
src/Pyrite/AuditTrail.php
AuditTrail.getObjectIds
public static function getObjectIds($objectType, $begin = null, $end = null) { global $PPHP; $db = $PPHP['db']; $q = $db->query("SELECT DISTINCT(objectId) FROM transactions WHERE objectType=?", $objectType); if ($begin !== null && $end !== null) { $q->and("timestamp BETW...
php
public static function getObjectIds($objectType, $begin = null, $end = null) { global $PPHP; $db = $PPHP['db']; $q = $db->query("SELECT DISTINCT(objectId) FROM transactions WHERE objectType=?", $objectType); if ($begin !== null && $end !== null) { $q->and("timestamp BETW...
[ "public", "static", "function", "getObjectIds", "(", "$", "objectType", ",", "$", "begin", "=", "null", ",", "$", "end", "=", "null", ")", "{", "global", "$", "PPHP", ";", "$", "db", "=", "$", "PPHP", "[", "'db'", "]", ";", "$", "q", "=", "$", ...
Get IDs with activity present Get all objectIds of $objectType for which there is activity. If $begin is specified, search period is restricted to transactions on and after that date. If $end is also specified, search period is further restricted to end on that date, inclusively. @param string $objectType Type...
[ "Get", "IDs", "with", "activity", "present" ]
e609daa714298a254bf5a945a1d6985c9d4d539d
https://github.com/vphantom/pyritephp/blob/e609daa714298a254bf5a945a1d6985c9d4d539d/src/Pyrite/AuditTrail.php#L326-L342
1,319
fortifi/sdk
api/Foundation/Responses/FortifiApiResponse.php
FortifiApiResponse.prepareForTransport
public function prepareForTransport() { foreach($this as $k => $v) { if($v instanceof FortifiApiResponse) { $v->prepareForTransport(); } else if(is_array($v)) { foreach($v as $vi => $vv) { if($vv instanceof FortifiApiResponse) { ...
php
public function prepareForTransport() { foreach($this as $k => $v) { if($v instanceof FortifiApiResponse) { $v->prepareForTransport(); } else if(is_array($v)) { foreach($v as $vi => $vv) { if($vv instanceof FortifiApiResponse) { ...
[ "public", "function", "prepareForTransport", "(", ")", "{", "foreach", "(", "$", "this", "as", "$", "k", "=>", "$", "v", ")", "{", "if", "(", "$", "v", "instanceof", "FortifiApiResponse", ")", "{", "$", "v", "->", "prepareForTransport", "(", ")", ";", ...
Executed before sending the response
[ "Executed", "before", "sending", "the", "response" ]
4d0471c72c7954271c692d32265fd42f698392e4
https://github.com/fortifi/sdk/blob/4d0471c72c7954271c692d32265fd42f698392e4/api/Foundation/Responses/FortifiApiResponse.php#L36-L55
1,320
webriq/core
module/Core/src/Grid/Core/Model/Settings/StructureAbstract.php
StructureAbstract.setSetting
public function setSetting( $name, $value ) { $old = isset( $this->settings[$name] ) ? $this->settings[$name] : null; if ( $old instanceof self || $value instanceof self ) { if ( $old instanceof self && $value instanceof self ) { ...
php
public function setSetting( $name, $value ) { $old = isset( $this->settings[$name] ) ? $this->settings[$name] : null; if ( $old instanceof self || $value instanceof self ) { if ( $old instanceof self && $value instanceof self ) { ...
[ "public", "function", "setSetting", "(", "$", "name", ",", "$", "value", ")", "{", "$", "old", "=", "isset", "(", "$", "this", "->", "settings", "[", "$", "name", "]", ")", "?", "$", "this", "->", "settings", "[", "$", "name", "]", ":", "null", ...
Set a setting by name @param string $name @param string|\StructureAbstract $value @return \Core\Model\Settings\Structure
[ "Set", "a", "setting", "by", "name" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/Model/Settings/StructureAbstract.php#L102-L152
1,321
neat-php/http
classes/Upload.php
Upload.capture
public static function capture($files = null) { $files = $files ?? $_FILES; if (!is_array($files)) { return null; } $keys = array_keys($files); sort($keys); $multi = $keys !== ['error', 'name', 'size', 'tmp_name', 'type']; if (!$multi && is_array(...
php
public static function capture($files = null) { $files = $files ?? $_FILES; if (!is_array($files)) { return null; } $keys = array_keys($files); sort($keys); $multi = $keys !== ['error', 'name', 'size', 'tmp_name', 'type']; if (!$multi && is_array(...
[ "public", "static", "function", "capture", "(", "$", "files", "=", "null", ")", "{", "$", "files", "=", "$", "files", "??", "$", "_FILES", ";", "if", "(", "!", "is_array", "(", "$", "files", ")", ")", "{", "return", "null", ";", "}", "$", "keys",...
Capture uploaded files @param array $files @return null|Upload|Upload[]|Upload[][]|...
[ "Capture", "uploaded", "files" ]
5d4781a8481c1f708fd642292e44244435a8369c
https://github.com/neat-php/http/blob/5d4781a8481c1f708fd642292e44244435a8369c/classes/Upload.php#L165-L187
1,322
marc1706/otp-authenticate
lib/OTPHelper.php
OTPHelper.generateKeyURI
public function generateKeyURI($type, $secret, $account, $issuer = '', $counter = 0, $algorithm = '', $digits = '', $period = '') { // Check if type is supported $this->validateType($type); $this->validateAlgorithm($algorithm); // Format label string $this->formatLabel($issuer, 'issuer'); $this->formatLab...
php
public function generateKeyURI($type, $secret, $account, $issuer = '', $counter = 0, $algorithm = '', $digits = '', $period = '') { // Check if type is supported $this->validateType($type); $this->validateAlgorithm($algorithm); // Format label string $this->formatLabel($issuer, 'issuer'); $this->formatLab...
[ "public", "function", "generateKeyURI", "(", "$", "type", ",", "$", "secret", ",", "$", "account", ",", "$", "issuer", "=", "''", ",", "$", "counter", "=", "0", ",", "$", "algorithm", "=", "''", ",", "$", "digits", "=", "''", ",", "$", "period", ...
Generate OTP key URI @param string $type OTP type @param string $secret Base32 encoded secret @param string $account Account name @param string $issuer Issuer name (optional) @param int $counter Counter for HOTP (optional) @param string $algorithm Algorithm name (optional) @param string $digits Number of digits for co...
[ "Generate", "OTP", "key", "URI" ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPHelper.php#L52-L69
1,323
marc1706/otp-authenticate
lib/OTPHelper.php
OTPHelper.formatLabel
protected function formatLabel($string, $part) { $string = trim($string); if ($part === 'account') { $this->setAccount($string); } else if ($part === 'issuer') { $this->setIssuer($string); } }
php
protected function formatLabel($string, $part) { $string = trim($string); if ($part === 'account') { $this->setAccount($string); } else if ($part === 'issuer') { $this->setIssuer($string); } }
[ "protected", "function", "formatLabel", "(", "$", "string", ",", "$", "part", ")", "{", "$", "string", "=", "trim", "(", "$", "string", ")", ";", "if", "(", "$", "part", "===", "'account'", ")", "{", "$", "this", "->", "setAccount", "(", "$", "stri...
Format label string according to expected urlencoded standards. @param string $string The label string @param string $part Part of label
[ "Format", "label", "string", "according", "to", "expected", "urlencoded", "standards", "." ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPHelper.php#L107-L119
1,324
marc1706/otp-authenticate
lib/OTPHelper.php
OTPHelper.setAccount
protected function setAccount($account) { if (empty($account)) { throw new \InvalidArgumentException("Label can't contain empty strings"); } $this->label .= str_replace('%40', '@', rawurlencode($account)); }
php
protected function setAccount($account) { if (empty($account)) { throw new \InvalidArgumentException("Label can't contain empty strings"); } $this->label .= str_replace('%40', '@', rawurlencode($account)); }
[ "protected", "function", "setAccount", "(", "$", "account", ")", "{", "if", "(", "empty", "(", "$", "account", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"Label can't contain empty strings\"", ")", ";", "}", "$", "this", "->", "l...
Format and and set account name @param string $account Account name @throws \InvalidArgumentException When given account name is an empty string
[ "Format", "and", "and", "set", "account", "name" ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPHelper.php#L128-L136
1,325
marc1706/otp-authenticate
lib/OTPHelper.php
OTPHelper.setIssuer
protected function setIssuer($issuer) { if (!empty($issuer)) { $this->label = rawurlencode($issuer) . ':'; $this->issuer = '&issuer=' . rawurlencode($issuer); } }
php
protected function setIssuer($issuer) { if (!empty($issuer)) { $this->label = rawurlencode($issuer) . ':'; $this->issuer = '&issuer=' . rawurlencode($issuer); } }
[ "protected", "function", "setIssuer", "(", "$", "issuer", ")", "{", "if", "(", "!", "empty", "(", "$", "issuer", ")", ")", "{", "$", "this", "->", "label", "=", "rawurlencode", "(", "$", "issuer", ")", ".", "':'", ";", "$", "this", "->", "issuer", ...
Format and set issuer @param string $issuer Issuer name
[ "Format", "and", "set", "issuer" ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPHelper.php#L143-L150
1,326
marc1706/otp-authenticate
lib/OTPHelper.php
OTPHelper.setCounter
protected function setCounter($type, $counter) { if ($type === 'hotp') { if ($counter !== 0 && empty($counter)) { throw new \InvalidArgumentException("Counter can't be empty if HOTP is being used"); } $this->parameters .= "&counter=$counter"; } }
php
protected function setCounter($type, $counter) { if ($type === 'hotp') { if ($counter !== 0 && empty($counter)) { throw new \InvalidArgumentException("Counter can't be empty if HOTP is being used"); } $this->parameters .= "&counter=$counter"; } }
[ "protected", "function", "setCounter", "(", "$", "type", ",", "$", "counter", ")", "{", "if", "(", "$", "type", "===", "'hotp'", ")", "{", "if", "(", "$", "counter", "!==", "0", "&&", "empty", "(", "$", "counter", ")", ")", "{", "throw", "new", "...
Set counter value if hotp is being used @param string $type Type of OTP auth, either HOTP or TOTP @param int $counter Counter value @throws \InvalidArgumentException If counter is empty while using HOTP
[ "Set", "counter", "value", "if", "hotp", "is", "being", "used" ]
a2ea1ed3a958fe6bfafc5866a07f204d9d30c588
https://github.com/marc1706/otp-authenticate/blob/a2ea1ed3a958fe6bfafc5866a07f204d9d30c588/lib/OTPHelper.php#L174-L185
1,327
novuso/system
src/Utility/ClassName.php
ClassName.full
public static function full($object): string { if (is_string($object)) { return str_replace('.', '\\', $object); } if (is_object($object)) { return trim(get_class($object), '\\'); } $message = sprintf( '%s expects $object to be an object ...
php
public static function full($object): string { if (is_string($object)) { return str_replace('.', '\\', $object); } if (is_object($object)) { return trim(get_class($object), '\\'); } $message = sprintf( '%s expects $object to be an object ...
[ "public", "static", "function", "full", "(", "$", "object", ")", ":", "string", "{", "if", "(", "is_string", "(", "$", "object", ")", ")", "{", "return", "str_replace", "(", "'.'", ",", "'\\\\'", ",", "$", "object", ")", ";", "}", "if", "(", "is_ob...
Retrieves the fully qualified class name of an object @param object|string $object An object, fully qualified class name, or canonical class name @return string @throws TypeException When $object is not a string or object
[ "Retrieves", "the", "fully", "qualified", "class", "name", "of", "an", "object" ]
e34038b391826edc68d0b5fccfba96642de9d6f0
https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/ClassName.php#L29-L46
1,328
a2c/BaconGeneratorBundle
Manipulator/BaconRoutingManipulator.php
BaconRoutingManipulator.addAnnotationController
public function addAnnotationController($bundle, $controller) { $current = ''; if (file_exists($this->file)) { $current = file_get_contents($this->file); } elseif (!is_dir($dir = dirname($this->file))) { mkdir($dir, 0777, true); } $code = sprintf("%s...
php
public function addAnnotationController($bundle, $controller) { $current = ''; if (file_exists($this->file)) { $current = file_get_contents($this->file); } elseif (!is_dir($dir = dirname($this->file))) { mkdir($dir, 0777, true); } $code = sprintf("%s...
[ "public", "function", "addAnnotationController", "(", "$", "bundle", ",", "$", "controller", ")", "{", "$", "current", "=", "''", ";", "if", "(", "file_exists", "(", "$", "this", "->", "file", ")", ")", "{", "$", "current", "=", "file_get_contents", "(",...
Add an annotation controller resource. @param string $bundle @param string $controller @return bool
[ "Add", "an", "annotation", "controller", "resource", "." ]
af862548b136a7d5c4c7cf1845c4211c9e32d100
https://github.com/a2c/BaconGeneratorBundle/blob/af862548b136a7d5c4c7cf1845c4211c9e32d100/Manipulator/BaconRoutingManipulator.php#L57-L79
1,329
avoo/FrameworkGeneratorBundle
Command/CreateResourceCommand.php
CreateResourceCommand.createProgressBar
protected function createProgressBar(OutputInterface $output, $length = 10) { $progress = $this->getHelper('progress'); $progress->setBarCharacter('<info>|</info>'); $progress->setEmptyBarCharacter(' '); $progress->setProgressCharacter('|'); $progress->start($output, $length...
php
protected function createProgressBar(OutputInterface $output, $length = 10) { $progress = $this->getHelper('progress'); $progress->setBarCharacter('<info>|</info>'); $progress->setEmptyBarCharacter(' '); $progress->setProgressCharacter('|'); $progress->start($output, $length...
[ "protected", "function", "createProgressBar", "(", "OutputInterface", "$", "output", ",", "$", "length", "=", "10", ")", "{", "$", "progress", "=", "$", "this", "->", "getHelper", "(", "'progress'", ")", ";", "$", "progress", "->", "setBarCharacter", "(", ...
Create progress bar @param OutputInterface $output @param int $length @return ProgressHelper
[ "Create", "progress", "bar" ]
3178268b9e58e6c60c27e0b9ea976944c1f61a48
https://github.com/avoo/FrameworkGeneratorBundle/blob/3178268b9e58e6c60c27e0b9ea976944c1f61a48/Command/CreateResourceCommand.php#L268-L278
1,330
avoo/FrameworkGeneratorBundle
Command/CreateResourceCommand.php
CreateResourceCommand.validateTemplate
private function validateTemplate($template, $templateList) { if (empty($template)) { throw new \Exception('The template name is required.'); } if (!in_array($template, $templateList)) { throw new \InvalidArgumentException( sprintf('The template "%s" ...
php
private function validateTemplate($template, $templateList) { if (empty($template)) { throw new \Exception('The template name is required.'); } if (!in_array($template, $templateList)) { throw new \InvalidArgumentException( sprintf('The template "%s" ...
[ "private", "function", "validateTemplate", "(", "$", "template", ",", "$", "templateList", ")", "{", "if", "(", "empty", "(", "$", "template", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'The template name is required.'", ")", ";", "}", "if", "...
Validate template name @param string $template @param array $templateList @throws \Exception
[ "Validate", "template", "name" ]
3178268b9e58e6c60c27e0b9ea976944c1f61a48
https://github.com/avoo/FrameworkGeneratorBundle/blob/3178268b9e58e6c60c27e0b9ea976944c1f61a48/Command/CreateResourceCommand.php#L306-L317
1,331
FlexPress/component-routing
src/FlexPress/Components/Routing/Route.php
Route.setCallable
public function setCallable($callableExpression) { if (strpos("@", $callableExpression) === false) { $callableExpression .= "@indexAction"; } list($controllerName, $action) = explode("@", $callableExpression); $controller = $this->pimple[$controllerName]; $cal...
php
public function setCallable($callableExpression) { if (strpos("@", $callableExpression) === false) { $callableExpression .= "@indexAction"; } list($controllerName, $action) = explode("@", $callableExpression); $controller = $this->pimple[$controllerName]; $cal...
[ "public", "function", "setCallable", "(", "$", "callableExpression", ")", "{", "if", "(", "strpos", "(", "\"@\"", ",", "$", "callableExpression", ")", "===", "false", ")", "{", "$", "callableExpression", ".=", "\"@indexAction\"", ";", "}", "list", "(", "$", ...
Sets the controller and action @param $callableExpression - A string in the format 'controller@action' @throws \InvalidArgumentException @author Tim Perry
[ "Sets", "the", "controller", "and", "action" ]
c1a0c6f1f4522a54e21ee18a8b24adfc1cc28f56
https://github.com/FlexPress/component-routing/blob/c1a0c6f1f4522a54e21ee18a8b24adfc1cc28f56/src/FlexPress/Components/Routing/Route.php#L49-L74
1,332
FlexPress/component-routing
src/FlexPress/Components/Routing/Route.php
Route.addConditionsFromArray
public function addConditionsFromArray(array $conditions) { foreach ($conditions as $condition) { if (!is_callable($condition)) { $message = "One or more of the conditions you provided are not callable, "; $message .= "please pass an array of callable functions....
php
public function addConditionsFromArray(array $conditions) { foreach ($conditions as $condition) { if (!is_callable($condition)) { $message = "One or more of the conditions you provided are not callable, "; $message .= "please pass an array of callable functions....
[ "public", "function", "addConditionsFromArray", "(", "array", "$", "conditions", ")", "{", "foreach", "(", "$", "conditions", "as", "$", "condition", ")", "{", "if", "(", "!", "is_callable", "(", "$", "condition", ")", ")", "{", "$", "message", "=", "\"O...
Adds conditions to the route from the given array @param array $conditions - an array of conditions @throws \InvalidArgumentException @author Tim Perry
[ "Adds", "conditions", "to", "the", "route", "from", "the", "given", "array" ]
c1a0c6f1f4522a54e21ee18a8b24adfc1cc28f56
https://github.com/FlexPress/component-routing/blob/c1a0c6f1f4522a54e21ee18a8b24adfc1cc28f56/src/FlexPress/Components/Routing/Route.php#L84-L99
1,333
FlexPress/component-routing
src/FlexPress/Components/Routing/Route.php
Route.run
public function run() { if (!isset($this->conditions) || !isset($this->callable) ) { $message = "You have called the run function but have not provided both a array of conditions"; $message .= " and a callable function, which will be called if all the given condi...
php
public function run() { if (!isset($this->conditions) || !isset($this->callable) ) { $message = "You have called the run function but have not provided both a array of conditions"; $message .= " and a callable function, which will be called if all the given condi...
[ "public", "function", "run", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "conditions", ")", "||", "!", "isset", "(", "$", "this", "->", "callable", ")", ")", "{", "$", "message", "=", "\"You have called the run function but have not pro...
Runs through all the callable functions provided, if all are met call the given callable @author Tim Perry
[ "Runs", "through", "all", "the", "callable", "functions", "provided", "if", "all", "are", "met", "call", "the", "given", "callable" ]
c1a0c6f1f4522a54e21ee18a8b24adfc1cc28f56
https://github.com/FlexPress/component-routing/blob/c1a0c6f1f4522a54e21ee18a8b24adfc1cc28f56/src/FlexPress/Components/Routing/Route.php#L105-L132
1,334
simple-php-mvc/installer-module
src/InstallerModule/Generator/ModelGenerator.php
ModelGenerator.generateBody
protected function generateBody($modelName, array $properties) { $linesProperties = array(""); $linesMethods = array(""); foreach ($properties as $field) { foreach ($field as $property) { $linesProperties[] = " /**"; $linesProperties...
php
protected function generateBody($modelName, array $properties) { $linesProperties = array(""); $linesMethods = array(""); foreach ($properties as $field) { foreach ($field as $property) { $linesProperties[] = " /**"; $linesProperties...
[ "protected", "function", "generateBody", "(", "$", "modelName", ",", "array", "$", "properties", ")", "{", "$", "linesProperties", "=", "array", "(", "\"\"", ")", ";", "$", "linesMethods", "=", "array", "(", "\"\"", ")", ";", "foreach", "(", "$", "proper...
Generate array properties, getters and setters @param string $modelName @param array $properties @return string
[ "Generate", "array", "properties", "getters", "and", "setters" ]
62bd5bac05418b5f712dfcead1edc75ef14d60e3
https://github.com/simple-php-mvc/installer-module/blob/62bd5bac05418b5f712dfcead1edc75ef14d60e3/src/InstallerModule/Generator/ModelGenerator.php#L51-L104
1,335
cakeoven/CakeTwitterBootstrap
View/Helper/BootstrapHtmlHelper.php
BootstrapHtmlHelper.panelHeader
public function panelHeader($title, $h = 'h1') { $panelTitle = parent::tag($h, $title, ['class' => 'panel-title']); return parent::tag("div", $panelTitle, ['class' => 'panel-heading']); }
php
public function panelHeader($title, $h = 'h1') { $panelTitle = parent::tag($h, $title, ['class' => 'panel-title']); return parent::tag("div", $panelTitle, ['class' => 'panel-heading']); }
[ "public", "function", "panelHeader", "(", "$", "title", ",", "$", "h", "=", "'h1'", ")", "{", "$", "panelTitle", "=", "parent", "::", "tag", "(", "$", "h", ",", "$", "title", ",", "[", "'class'", "=>", "'panel-title'", "]", ")", ";", "return", "par...
Returns a panel header @param string $title @param string $h @return string
[ "Returns", "a", "panel", "header" ]
99b7304a9c8715cb9c989afd5d57dc24d7f95b43
https://github.com/cakeoven/CakeTwitterBootstrap/blob/99b7304a9c8715cb9c989afd5d57dc24d7f95b43/View/Helper/BootstrapHtmlHelper.php#L53-L57
1,336
cakeoven/CakeTwitterBootstrap
View/Helper/BootstrapHtmlHelper.php
BootstrapHtmlHelper.modalHeader
public function modalHeader($title, $h = 'h4') { $modalTitle = parent::tag($h, $title, ['class' => 'modal-title']); return parent::tag("div", $modalTitle, ["class" => 'modal-header']); }
php
public function modalHeader($title, $h = 'h4') { $modalTitle = parent::tag($h, $title, ['class' => 'modal-title']); return parent::tag("div", $modalTitle, ["class" => 'modal-header']); }
[ "public", "function", "modalHeader", "(", "$", "title", ",", "$", "h", "=", "'h4'", ")", "{", "$", "modalTitle", "=", "parent", "::", "tag", "(", "$", "h", ",", "$", "title", ",", "[", "'class'", "=>", "'modal-title'", "]", ")", ";", "return", "par...
Returns a modal header @param string $title @param string $h @return string
[ "Returns", "a", "modal", "header" ]
99b7304a9c8715cb9c989afd5d57dc24d7f95b43
https://github.com/cakeoven/CakeTwitterBootstrap/blob/99b7304a9c8715cb9c989afd5d57dc24d7f95b43/View/Helper/BootstrapHtmlHelper.php#L66-L70
1,337
cakeoven/CakeTwitterBootstrap
View/Helper/BootstrapHtmlHelper.php
BootstrapHtmlHelper.descriptionList
public function descriptionList($data, $options = [], $dtOpts = [], $ddOpts = []) { if (empty($data) || !is_array($data)) { return false; } $out = []; $dtOptions = parent::_parseAttributes($dtOpts); $ddOptions = parent::_parseAttributes($ddOpts); foreach...
php
public function descriptionList($data, $options = [], $dtOpts = [], $ddOpts = []) { if (empty($data) || !is_array($data)) { return false; } $out = []; $dtOptions = parent::_parseAttributes($dtOpts); $ddOptions = parent::_parseAttributes($ddOpts); foreach...
[ "public", "function", "descriptionList", "(", "$", "data", ",", "$", "options", "=", "[", "]", ",", "$", "dtOpts", "=", "[", "]", ",", "$", "ddOpts", "=", "[", "]", ")", "{", "if", "(", "empty", "(", "$", "data", ")", "||", "!", "is_array", "("...
returns a dl element @param string $data @param array $options @param array $dtOpts @param array $ddOpts @return string
[ "returns", "a", "dl", "element" ]
99b7304a9c8715cb9c989afd5d57dc24d7f95b43
https://github.com/cakeoven/CakeTwitterBootstrap/blob/99b7304a9c8715cb9c989afd5d57dc24d7f95b43/View/Helper/BootstrapHtmlHelper.php#L81-L97
1,338
cakeoven/CakeTwitterBootstrap
View/Helper/BootstrapHtmlHelper.php
BootstrapHtmlHelper.well
public function well($text, $size = null, $options = []) { $options = ['class' => 'well']; if (!empty($size)) { switch ($size) { case 'lg': case 'large': $options = parent::addClass($options, 'well-lg'); break; ...
php
public function well($text, $size = null, $options = []) { $options = ['class' => 'well']; if (!empty($size)) { switch ($size) { case 'lg': case 'large': $options = parent::addClass($options, 'well-lg'); break; ...
[ "public", "function", "well", "(", "$", "text", ",", "$", "size", "=", "null", ",", "$", "options", "=", "[", "]", ")", "{", "$", "options", "=", "[", "'class'", "=>", "'well'", "]", ";", "if", "(", "!", "empty", "(", "$", "size", ")", ")", "...
creates a div with well properties @param string $text @param string $size @param array $options @return string
[ "creates", "a", "div", "with", "well", "properties" ]
99b7304a9c8715cb9c989afd5d57dc24d7f95b43
https://github.com/cakeoven/CakeTwitterBootstrap/blob/99b7304a9c8715cb9c989afd5d57dc24d7f95b43/View/Helper/BootstrapHtmlHelper.php#L107-L124
1,339
cakeoven/CakeTwitterBootstrap
View/Helper/BootstrapHtmlHelper.php
BootstrapHtmlHelper.lead
public function lead($content, $options = []) { $options = array_merge(['class' => 'lead'], $options); return parent::tag('p', $content, $options); }
php
public function lead($content, $options = []) { $options = array_merge(['class' => 'lead'], $options); return parent::tag('p', $content, $options); }
[ "public", "function", "lead", "(", "$", "content", ",", "$", "options", "=", "[", "]", ")", "{", "$", "options", "=", "array_merge", "(", "[", "'class'", "=>", "'lead'", "]", ",", "$", "options", ")", ";", "return", "parent", "::", "tag", "(", "'p'...
Creates a paragraph with lead class @param string $content @param array $options @return string
[ "Creates", "a", "paragraph", "with", "lead", "class" ]
99b7304a9c8715cb9c989afd5d57dc24d7f95b43
https://github.com/cakeoven/CakeTwitterBootstrap/blob/99b7304a9c8715cb9c989afd5d57dc24d7f95b43/View/Helper/BootstrapHtmlHelper.php#L133-L137
1,340
cakeoven/CakeTwitterBootstrap
View/Helper/BootstrapHtmlHelper.php
BootstrapHtmlHelper._generateListGroupText
protected function _generateListGroupText($title) { if (is_array($title)) { $text = ''; if (!empty($title['header'])) { $text .= $this->tag('h4', $title['header'], ['class' => 'list-group-item-heading']); } if (!empty($title['text'])) { ...
php
protected function _generateListGroupText($title) { if (is_array($title)) { $text = ''; if (!empty($title['header'])) { $text .= $this->tag('h4', $title['header'], ['class' => 'list-group-item-heading']); } if (!empty($title['text'])) { ...
[ "protected", "function", "_generateListGroupText", "(", "$", "title", ")", "{", "if", "(", "is_array", "(", "$", "title", ")", ")", "{", "$", "text", "=", "''", ";", "if", "(", "!", "empty", "(", "$", "title", "[", "'header'", "]", ")", ")", "{", ...
_generateListGroupText Generates the text for the list group item @param string $title @return string
[ "_generateListGroupText", "Generates", "the", "text", "for", "the", "list", "group", "item" ]
99b7304a9c8715cb9c989afd5d57dc24d7f95b43
https://github.com/cakeoven/CakeTwitterBootstrap/blob/99b7304a9c8715cb9c989afd5d57dc24d7f95b43/View/Helper/BootstrapHtmlHelper.php#L253-L267
1,341
cakeoven/CakeTwitterBootstrap
View/Helper/BootstrapHtmlHelper.php
BootstrapHtmlHelper.badge
public function badge($text, $options = []) { $defaults = array_merge(['class' => 'badge'], $options); return parent::tag('span', $text, $defaults); }
php
public function badge($text, $options = []) { $defaults = array_merge(['class' => 'badge'], $options); return parent::tag('span', $text, $defaults); }
[ "public", "function", "badge", "(", "$", "text", ",", "$", "options", "=", "[", "]", ")", "{", "$", "defaults", "=", "array_merge", "(", "[", "'class'", "=>", "'badge'", "]", ",", "$", "options", ")", ";", "return", "parent", "::", "tag", "(", "'sp...
return a badge @param string $text @param array $options @return string
[ "return", "a", "badge" ]
99b7304a9c8715cb9c989afd5d57dc24d7f95b43
https://github.com/cakeoven/CakeTwitterBootstrap/blob/99b7304a9c8715cb9c989afd5d57dc24d7f95b43/View/Helper/BootstrapHtmlHelper.php#L299-L303
1,342
cakeoven/CakeTwitterBootstrap
View/Helper/BootstrapHtmlHelper.php
BootstrapHtmlHelper.status
public function status($value, $url = []) { $icon = $value == true ? 'check' : 'times'; $contextual = $value == true ? 'success' : 'danger'; return $this->label('', $contextual, ['icon' => $icon]); }
php
public function status($value, $url = []) { $icon = $value == true ? 'check' : 'times'; $contextual = $value == true ? 'success' : 'danger'; return $this->label('', $contextual, ['icon' => $icon]); }
[ "public", "function", "status", "(", "$", "value", ",", "$", "url", "=", "[", "]", ")", "{", "$", "icon", "=", "$", "value", "==", "true", "?", "'check'", ":", "'times'", ";", "$", "contextual", "=", "$", "value", "==", "true", "?", "'success'", ...
Returns a well formatted check. Used special for booleans @param string $value @param array $url @return string
[ "Returns", "a", "well", "formatted", "check", ".", "Used", "special", "for", "booleans" ]
99b7304a9c8715cb9c989afd5d57dc24d7f95b43
https://github.com/cakeoven/CakeTwitterBootstrap/blob/99b7304a9c8715cb9c989afd5d57dc24d7f95b43/View/Helper/BootstrapHtmlHelper.php#L333-L338
1,343
cakeoven/CakeTwitterBootstrap
View/Helper/BootstrapHtmlHelper.php
BootstrapHtmlHelper.icon
public function icon($type, $text = '', array $options = []) { $icon = $this->iconPrefix; $class = "$icon $icon-$type"; if (isset($options['class']) && !empty($class)) { $options['class'] = $class . ' ' . $options['class']; } else { $options['class'] = $class...
php
public function icon($type, $text = '', array $options = []) { $icon = $this->iconPrefix; $class = "$icon $icon-$type"; if (isset($options['class']) && !empty($class)) { $options['class'] = $class . ' ' . $options['class']; } else { $options['class'] = $class...
[ "public", "function", "icon", "(", "$", "type", ",", "$", "text", "=", "''", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "icon", "=", "$", "this", "->", "iconPrefix", ";", "$", "class", "=", "\"$icon $icon-$type\"", ";", "if", "(", ...
Returns an icon element followed by a text @example `<i class="fa fa-search"></i> Text` @param string $type @param string $text @param array $options @return string
[ "Returns", "an", "icon", "element", "followed", "by", "a", "text" ]
99b7304a9c8715cb9c989afd5d57dc24d7f95b43
https://github.com/cakeoven/CakeTwitterBootstrap/blob/99b7304a9c8715cb9c989afd5d57dc24d7f95b43/View/Helper/BootstrapHtmlHelper.php#L349-L361
1,344
cakeoven/CakeTwitterBootstrap
View/Helper/BootstrapHtmlHelper.php
BootstrapHtmlHelper._icon
protected function _icon($title, array $options = []) { if (empty($options) || !isset($options['icon'])) { return $title; } $options = $options['icon']; if (is_array($options)) { if (!isset($options['class']) || empty($options['class'])) { ret...
php
protected function _icon($title, array $options = []) { if (empty($options) || !isset($options['icon'])) { return $title; } $options = $options['icon']; if (is_array($options)) { if (!isset($options['class']) || empty($options['class'])) { ret...
[ "protected", "function", "_icon", "(", "$", "title", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "empty", "(", "$", "options", ")", "||", "!", "isset", "(", "$", "options", "[", "'icon'", "]", ")", ")", "{", "return", "$", ...
Returns an icon element followed by a text. This function is used for generating an icon for internal functions inside this helper. @param string $title @param string|array $options @return string todo We need to refactor this function in order to load an array of icon class with no prefix on the class
[ "Returns", "an", "icon", "element", "followed", "by", "a", "text", ".", "This", "function", "is", "used", "for", "generating", "an", "icon", "for", "internal", "functions", "inside", "this", "helper", "." ]
99b7304a9c8715cb9c989afd5d57dc24d7f95b43
https://github.com/cakeoven/CakeTwitterBootstrap/blob/99b7304a9c8715cb9c989afd5d57dc24d7f95b43/View/Helper/BootstrapHtmlHelper.php#L373-L394
1,345
synapsestudios/synapse-base
src/Synapse/Mapper/InserterTrait.php
InserterTrait.insertRow
protected function insertRow(AbstractEntity $entity) { $values = $entity->getDbValues(); $columns = array_keys($values); if ($this->autoIncrementColumn && ! array_key_exists($this->autoIncrementColumn, $values)) { throw new LogicException('auto_increment column ' . $this->autoI...
php
protected function insertRow(AbstractEntity $entity) { $values = $entity->getDbValues(); $columns = array_keys($values); if ($this->autoIncrementColumn && ! array_key_exists($this->autoIncrementColumn, $values)) { throw new LogicException('auto_increment column ' . $this->autoI...
[ "protected", "function", "insertRow", "(", "AbstractEntity", "$", "entity", ")", "{", "$", "values", "=", "$", "entity", "->", "getDbValues", "(", ")", ";", "$", "columns", "=", "array_keys", "(", "$", "values", ")", ";", "if", "(", "$", "this", "->", ...
Insert an entity's DB row using the given values. Set the ID on the entity from the query result. @param AbstractEntity $entity
[ "Insert", "an", "entity", "s", "DB", "row", "using", "the", "given", "values", ".", "Set", "the", "ID", "on", "the", "entity", "from", "the", "query", "result", "." ]
60c830550491742a077ab063f924e2f0b63825da
https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/InserterTrait.php#L45-L67
1,346
calgamo/di
src/Compiler/Compiler.php
Compiler.compile
public function compile(CompilerConfig $config) : Compiler { $cache_dir = $config->getCacheDir(); if (!$cache_dir){ throw new CacheDirectoryConfigurationException($cache_dir); } // cehck cache dir $cache_dir = new File($cache_dir); ...
php
public function compile(CompilerConfig $config) : Compiler { $cache_dir = $config->getCacheDir(); if (!$cache_dir){ throw new CacheDirectoryConfigurationException($cache_dir); } // cehck cache dir $cache_dir = new File($cache_dir); ...
[ "public", "function", "compile", "(", "CompilerConfig", "$", "config", ")", ":", "Compiler", "{", "$", "cache_dir", "=", "$", "config", "->", "getCacheDir", "(", ")", ";", "if", "(", "!", "$", "cache_dir", ")", "{", "throw", "new", "CacheDirectoryConfigura...
Compile setup code @param CompilerConfig $config @return Compiler @throws CacheDirectoryConfigurationException @throws CacheDirectoryNotFoundException @throws CacheDirectoryNotWritableException @throws FileOutputException @throws SlotIdNotDefinedException @throws InvalidSlotRestrictionException @throws ComponentIdNo...
[ "Compile", "setup", "code" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L71-L100
1,347
calgamo/di
src/Compiler/Compiler.php
Compiler.constructor
private function constructor(string $class_name, array $params = null) { $this->state->category = CompilerState::CATEGORY_CONSTRUCTOR; $this->state->name = ''; $params_str = ''; if (is_array($params)){ $params_str = $this->decorateParamsForMethodCall($params); } ...
php
private function constructor(string $class_name, array $params = null) { $this->state->category = CompilerState::CATEGORY_CONSTRUCTOR; $this->state->name = ''; $params_str = ''; if (is_array($params)){ $params_str = $this->decorateParamsForMethodCall($params); } ...
[ "private", "function", "constructor", "(", "string", "$", "class_name", ",", "array", "$", "params", "=", "null", ")", "{", "$", "this", "->", "state", "->", "category", "=", "CompilerState", "::", "CATEGORY_CONSTRUCTOR", ";", "$", "this", "->", "state", "...
Make constructor code @param string $class_name @param array $params @return string @throws CompileErrorException
[ "Make", "constructor", "code" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L330-L339
1,348
calgamo/di
src/Compiler/Compiler.php
Compiler.methodCallList
private function methodCallList(array $method_injections) { $this->state->category = CompilerState::CATEGORY_METHOD; $ret = ''; foreach($method_injections as $injection){ $method_name = $injection['method'] ?? null; $params = $injection['params'] ?? null; ...
php
private function methodCallList(array $method_injections) { $this->state->category = CompilerState::CATEGORY_METHOD; $ret = ''; foreach($method_injections as $injection){ $method_name = $injection['method'] ?? null; $params = $injection['params'] ?? null; ...
[ "private", "function", "methodCallList", "(", "array", "$", "method_injections", ")", "{", "$", "this", "->", "state", "->", "category", "=", "CompilerState", "::", "CATEGORY_METHOD", ";", "$", "ret", "=", "''", ";", "foreach", "(", "$", "method_injections", ...
Make method call code @param array $method_injections @return string @throws CompileErrorException
[ "Make", "method", "call", "code" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L350-L368
1,349
calgamo/di
src/Compiler/Compiler.php
Compiler.propertySetList
private function propertySetList(array $property_injections) { $this->state->category = CompilerState::CATEGORY_PROPERTY; $ret = ''; foreach($property_injections as $injection){ $property_name = $injection['property'] ?? null; $value = $injection['value'] ?? null; ...
php
private function propertySetList(array $property_injections) { $this->state->category = CompilerState::CATEGORY_PROPERTY; $ret = ''; foreach($property_injections as $injection){ $property_name = $injection['property'] ?? null; $value = $injection['value'] ?? null; ...
[ "private", "function", "propertySetList", "(", "array", "$", "property_injections", ")", "{", "$", "this", "->", "state", "->", "category", "=", "CompilerState", "::", "CATEGORY_PROPERTY", ";", "$", "ret", "=", "''", ";", "foreach", "(", "$", "property_injecti...
Make property set code @param array $property_injections @return string @throws CompileErrorException
[ "Make", "property", "set", "code" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L379-L402
1,350
calgamo/di
src/Compiler/Compiler.php
Compiler.findPropertyInjections
private function findPropertyInjections(array $injections) { $ret = []; if (is_array($injections)) { foreach ($injections as $injection) { if (!isset($injection['property'])){ continue; } $ret[] = $injection; ...
php
private function findPropertyInjections(array $injections) { $ret = []; if (is_array($injections)) { foreach ($injections as $injection) { if (!isset($injection['property'])){ continue; } $ret[] = $injection; ...
[ "private", "function", "findPropertyInjections", "(", "array", "$", "injections", ")", "{", "$", "ret", "=", "[", "]", ";", "if", "(", "is_array", "(", "$", "injections", ")", ")", "{", "foreach", "(", "$", "injections", "as", "$", "injection", ")", "{...
find property injection @param array $injections @return array
[ "find", "property", "injection" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L482-L494
1,351
calgamo/di
src/Compiler/Compiler.php
Compiler.decorateParamsForMethodCall
private function decorateParamsForMethodCall(array $params) : string { $params_out = []; foreach($params as $param) { $params_out[] = $this->decorateValue($param); } return implode(',',$params_out); }
php
private function decorateParamsForMethodCall(array $params) : string { $params_out = []; foreach($params as $param) { $params_out[] = $this->decorateValue($param); } return implode(',',$params_out); }
[ "private", "function", "decorateParamsForMethodCall", "(", "array", "$", "params", ")", ":", "string", "{", "$", "params_out", "=", "[", "]", ";", "foreach", "(", "$", "params", "as", "$", "param", ")", "{", "$", "params_out", "[", "]", "=", "$", "this...
Modify param array for method call @param array $params @return string @throws CompileErrorException
[ "Modify", "param", "array", "for", "method", "call" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L505-L512
1,352
calgamo/di
src/Compiler/Compiler.php
Compiler.decorateValue
private function decorateValue($value) : string { $ret = 'null'; switch(gettype($value)){ case 'string': $ret = $this->decorateStringValue($value); break; case 'integer': case 'double': $ret = $value; ...
php
private function decorateValue($value) : string { $ret = 'null'; switch(gettype($value)){ case 'string': $ret = $this->decorateStringValue($value); break; case 'integer': case 'double': $ret = $value; ...
[ "private", "function", "decorateValue", "(", "$", "value", ")", ":", "string", "{", "$", "ret", "=", "'null'", ";", "switch", "(", "gettype", "(", "$", "value", ")", ")", "{", "case", "'string'", ":", "$", "ret", "=", "$", "this", "->", "decorateStri...
Modify value for function call or setting property @param mixed $value @return string @throws CompileErrorException
[ "Modify", "value", "for", "function", "call", "or", "setting", "property" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L546-L565
1,353
calgamo/di
src/Compiler/Compiler.php
Compiler.decorateStringValue
private function decorateStringValue(string $value) : string { if ($value === '@this'){ return "\$c"; } if (preg_match('/^@id:(.*)$/s',$value,$matches)){ $id = trim($matches[1]); return "\$c['" . self::escapeSingleQuote($id) . "']"; } ...
php
private function decorateStringValue(string $value) : string { if ($value === '@this'){ return "\$c"; } if (preg_match('/^@id:(.*)$/s',$value,$matches)){ $id = trim($matches[1]); return "\$c['" . self::escapeSingleQuote($id) . "']"; } ...
[ "private", "function", "decorateStringValue", "(", "string", "$", "value", ")", ":", "string", "{", "if", "(", "$", "value", "===", "'@this'", ")", "{", "return", "\"\\$c\"", ";", "}", "if", "(", "preg_match", "(", "'/^@id:(.*)$/s'", ",", "$", "value", "...
Modify string value for function call or setting property @param string $value @return string @throws CompileErrorException
[ "Modify", "string", "value", "for", "function", "call", "or", "setting", "property" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L576-L628
1,354
calgamo/di
src/Compiler/Compiler.php
Compiler.validateCallable
private function validateCallable(string $str) { ob_start(); try{ $_ = @eval('return '.$str.';'); if (!is_callable($_)){ throw new ValidateCallableException($str); } } catch(\Throwable $e){ ob_end_clean(); th...
php
private function validateCallable(string $str) { ob_start(); try{ $_ = @eval('return '.$str.';'); if (!is_callable($_)){ throw new ValidateCallableException($str); } } catch(\Throwable $e){ ob_end_clean(); th...
[ "private", "function", "validateCallable", "(", "string", "$", "str", ")", "{", "ob_start", "(", ")", ";", "try", "{", "$", "_", "=", "@", "eval", "(", "'return '", ".", "$", "str", ".", "';'", ")", ";", "if", "(", "!", "is_callable", "(", "$", "...
Validate if expression is callable @param string $str @throws CompileErrorException
[ "Validate", "if", "expression", "is", "callable" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L649-L663
1,355
calgamo/di
src/Compiler/Compiler.php
Compiler.validateInteger
private function validateInteger(string $str) : int { $ret = filter_var($str,FILTER_VALIDATE_INT); if ($ret === false){ throw new CompileErrorException('invalid integer value', $this->state); } return $ret; }
php
private function validateInteger(string $str) : int { $ret = filter_var($str,FILTER_VALIDATE_INT); if ($ret === false){ throw new CompileErrorException('invalid integer value', $this->state); } return $ret; }
[ "private", "function", "validateInteger", "(", "string", "$", "str", ")", ":", "int", "{", "$", "ret", "=", "filter_var", "(", "$", "str", ",", "FILTER_VALIDATE_INT", ")", ";", "if", "(", "$", "ret", "===", "false", ")", "{", "throw", "new", "CompileEr...
Validate if expression is integer value @param string $str @return int @throws CompileErrorException
[ "Validate", "if", "expression", "is", "integer", "value" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L674-L681
1,356
calgamo/di
src/Compiler/Compiler.php
Compiler.validateJson
private function validateJson(string $str) : array { $ret = json_decode($str,true); if ($ret === null){ throw new CompileErrorException('invalid json value:' . json_last_error_msg(), $this->state); } if (!is_array($ret)){ throw new CompileErrorException('@json...
php
private function validateJson(string $str) : array { $ret = json_decode($str,true); if ($ret === null){ throw new CompileErrorException('invalid json value:' . json_last_error_msg(), $this->state); } if (!is_array($ret)){ throw new CompileErrorException('@json...
[ "private", "function", "validateJson", "(", "string", "$", "str", ")", ":", "array", "{", "$", "ret", "=", "json_decode", "(", "$", "str", ",", "true", ")", ";", "if", "(", "$", "ret", "===", "null", ")", "{", "throw", "new", "CompileErrorException", ...
Validate if expression is json value @param string $str @return array @throws CompileErrorException
[ "Validate", "if", "expression", "is", "json", "value" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L728-L738
1,357
calgamo/di
src/Compiler/Compiler.php
Compiler.findSlotById
private function findSlotById(string $id, array $slots) { $slot = null; foreach($slots as $s){ $slot_id = $s['id'] ?? null; if ($slot_id == $id){ $slot = $s; break; } } return $slot; }
php
private function findSlotById(string $id, array $slots) { $slot = null; foreach($slots as $s){ $slot_id = $s['id'] ?? null; if ($slot_id == $id){ $slot = $s; break; } } return $slot; }
[ "private", "function", "findSlotById", "(", "string", "$", "id", ",", "array", "$", "slots", ")", "{", "$", "slot", "=", "null", ";", "foreach", "(", "$", "slots", "as", "$", "s", ")", "{", "$", "slot_id", "=", "$", "s", "[", "'id'", "]", "??", ...
Find slot by id @param string $id @param array $slots @return array|null
[ "Find", "slot", "by", "id" ]
d7630628a1d6f385839a9d0a8de41aadbea657a9
https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Compiler/Compiler.php#L748-L759
1,358
infusephp/rest-api
src/Serializer/ModelSerializer.php
ModelSerializer.toArray
public function toArray(Model $model) { // start with the base representation of the model if (method_exists($model, 'withoutArrayHook')) { $model->withoutArrayHook(); } $result = $model->toArray(); // apply namespacing to excluded properties $namedExc = ...
php
public function toArray(Model $model) { // start with the base representation of the model if (method_exists($model, 'withoutArrayHook')) { $model->withoutArrayHook(); } $result = $model->toArray(); // apply namespacing to excluded properties $namedExc = ...
[ "public", "function", "toArray", "(", "Model", "$", "model", ")", "{", "// start with the base representation of the model", "if", "(", "method_exists", "(", "$", "model", ",", "'withoutArrayHook'", ")", ")", "{", "$", "model", "->", "withoutArrayHook", "(", ")", ...
Serializes a model to an array. @param Model $model model to be serialized @return array properties
[ "Serializes", "a", "model", "to", "an", "array", "." ]
3a02152048ea38ec5f0adaed3f10a17730086ec7
https://github.com/infusephp/rest-api/blob/3a02152048ea38ec5f0adaed3f10a17730086ec7/src/Serializer/ModelSerializer.php#L148-L219
1,359
infusephp/rest-api
src/Serializer/ModelSerializer.php
ModelSerializer.expand
private function expand(Model $model, array $result, array $namedExc, array $namedInc, array $namedExp) { foreach ($namedExp as $k => $subExp) { $value = array_value($result, $k); if (!$this->isExpandable($model, $k, $value)) { continue; } $su...
php
private function expand(Model $model, array $result, array $namedExc, array $namedInc, array $namedExp) { foreach ($namedExp as $k => $subExp) { $value = array_value($result, $k); if (!$this->isExpandable($model, $k, $value)) { continue; } $su...
[ "private", "function", "expand", "(", "Model", "$", "model", ",", "array", "$", "result", ",", "array", "$", "namedExc", ",", "array", "$", "namedInc", ",", "array", "$", "namedExp", ")", "{", "foreach", "(", "$", "namedExp", "as", "$", "k", "=>", "$...
Expands any relational properties within a result. @param array $model @param array $result @param array $namedExc @param array $namedInc @param array $namedExp @return array
[ "Expands", "any", "relational", "properties", "within", "a", "result", "." ]
3a02152048ea38ec5f0adaed3f10a17730086ec7
https://github.com/infusephp/rest-api/blob/3a02152048ea38ec5f0adaed3f10a17730086ec7/src/Serializer/ModelSerializer.php#L232-L263
1,360
infusephp/rest-api
src/Serializer/ModelSerializer.php
ModelSerializer.isExpandable
private function isExpandable(Model $model, $k, $value) { // if the value is falsey then do not expand it // could be null, excluded, or not included if (!$value) { return false; } // if not a property or no relationship model specified // then do not exp...
php
private function isExpandable(Model $model, $k, $value) { // if the value is falsey then do not expand it // could be null, excluded, or not included if (!$value) { return false; } // if not a property or no relationship model specified // then do not exp...
[ "private", "function", "isExpandable", "(", "Model", "$", "model", ",", "$", "k", ",", "$", "value", ")", "{", "// if the value is falsey then do not expand it", "// could be null, excluded, or not included", "if", "(", "!", "$", "value", ")", "{", "return", "false"...
Expands a model. @param Model $model @param string $k @param mixed $value @return bool
[ "Expands", "a", "model", "." ]
3a02152048ea38ec5f0adaed3f10a17730086ec7
https://github.com/infusephp/rest-api/blob/3a02152048ea38ec5f0adaed3f10a17730086ec7/src/Serializer/ModelSerializer.php#L274-L290
1,361
znframework/package-security
NastyCode.php
NastyCode.encode
public static function encode(String $string, $badWords = NULL, $changeChar = '[badchars]') : String { if( empty($badWords) ) { $secnc = Properties::$ncEncode; $badWords = $secnc['badChars']; $changeChar = $secnc['changeBadChars']; } $regex...
php
public static function encode(String $string, $badWords = NULL, $changeChar = '[badchars]') : String { if( empty($badWords) ) { $secnc = Properties::$ncEncode; $badWords = $secnc['badChars']; $changeChar = $secnc['changeBadChars']; } $regex...
[ "public", "static", "function", "encode", "(", "String", "$", "string", ",", "$", "badWords", "=", "NULL", ",", "$", "changeChar", "=", "'[badchars]'", ")", ":", "String", "{", "if", "(", "empty", "(", "$", "badWords", ")", ")", "{", "$", "secnc", "=...
Encode Nasty Code @param string $string @param mixed $badWords = NULL @param mixed $changeChar = '[badchars]' @return string
[ "Encode", "Nasty", "Code" ]
dfced60e243ab9f52a1b5bbdb695bfc39b26cac0
https://github.com/znframework/package-security/blob/dfced60e243ab9f52a1b5bbdb695bfc39b26cac0/NastyCode.php#L25-L63
1,362
jhorlima/wp-mocabonita
src/tools/MbException.php
MbException.getData
public function getData() { if ($this->data instanceof Arrayable) { $this->data = $this->data->toArray(); } if (!is_array($this->data)) { $this->data = null; } return $this->data; }
php
public function getData() { if ($this->data instanceof Arrayable) { $this->data = $this->data->toArray(); } if (!is_array($this->data)) { $this->data = null; } return $this->data; }
[ "public", "function", "getData", "(", ")", "{", "if", "(", "$", "this", "->", "data", "instanceof", "Arrayable", ")", "{", "$", "this", "->", "data", "=", "$", "this", "->", "data", "->", "toArray", "(", ")", ";", "}", "if", "(", "!", "is_array", ...
Get exception data @return array|string
[ "Get", "exception", "data" ]
a864b40d5452bc9b892f02a6bb28c02639f25fa8
https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/tools/MbException.php#L45-L56
1,363
jivoo/core
src/Log/StreamHandler.php
StreamHandler.format
public static function format(array $record) { $seconds = (int) $record['time']; $millis = floor(($record['time'] - $seconds) * 1000); $timestamp = date('Y-m-d H:i:s', $seconds); $timestamp .= sprintf('.%03d ', $millis); $timestamp .= date('P'); $level = '[' . $record...
php
public static function format(array $record) { $seconds = (int) $record['time']; $millis = floor(($record['time'] - $seconds) * 1000); $timestamp = date('Y-m-d H:i:s', $seconds); $timestamp .= sprintf('.%03d ', $millis); $timestamp .= date('P'); $level = '[' . $record...
[ "public", "static", "function", "format", "(", "array", "$", "record", ")", "{", "$", "seconds", "=", "(", "int", ")", "$", "record", "[", "'time'", "]", ";", "$", "millis", "=", "floor", "(", "(", "$", "record", "[", "'time'", "]", "-", "$", "se...
Format a log message for a log file. @param array $record Log message array. @return string Formatted log message followed by a line break.
[ "Format", "a", "log", "message", "for", "a", "log", "file", "." ]
4ef3445068f0ff9c0a6512cb741831a847013b76
https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Log/StreamHandler.php#L87-L104
1,364
SergioMadness/framework
framework/basic/db/QueryBuilder.php
QueryBuilder.select
public static function select() { $result = null; switch (static::getDriver()) { case self::DRIVER_MYSQL: $result = new \pwf\components\querybuilder\adapters\MySQL\SelectBuilder(); break; case self::DRIVER_PG: $result = new \pw...
php
public static function select() { $result = null; switch (static::getDriver()) { case self::DRIVER_MYSQL: $result = new \pwf\components\querybuilder\adapters\MySQL\SelectBuilder(); break; case self::DRIVER_PG: $result = new \pw...
[ "public", "static", "function", "select", "(", ")", "{", "$", "result", "=", "null", ";", "switch", "(", "static", "::", "getDriver", "(", ")", ")", "{", "case", "self", "::", "DRIVER_MYSQL", ":", "$", "result", "=", "new", "\\", "pwf", "\\", "compon...
Get query builder @return \pwf\components\querybuilder\interfaces\SelectBuilder @throws \Exception
[ "Get", "query", "builder" ]
a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e
https://github.com/SergioMadness/framework/blob/a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e/framework/basic/db/QueryBuilder.php#L50-L66
1,365
SergioMadness/framework
framework/basic/db/QueryBuilder.php
QueryBuilder.insert
public static function insert() { $result = null; switch (static::getDriver()) { case self::DRIVER_MYSQL: $result = new \pwf\components\querybuilder\adapters\MySQL\InsertBuilder(); break; case self::DRIVER_PG: $result = new \pw...
php
public static function insert() { $result = null; switch (static::getDriver()) { case self::DRIVER_MYSQL: $result = new \pwf\components\querybuilder\adapters\MySQL\InsertBuilder(); break; case self::DRIVER_PG: $result = new \pw...
[ "public", "static", "function", "insert", "(", ")", "{", "$", "result", "=", "null", ";", "switch", "(", "static", "::", "getDriver", "(", ")", ")", "{", "case", "self", "::", "DRIVER_MYSQL", ":", "$", "result", "=", "new", "\\", "pwf", "\\", "compon...
Get insert builder @return \pwf\components\querybuilder\interfaces\InsertBuilder @throws \Exception
[ "Get", "insert", "builder" ]
a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e
https://github.com/SergioMadness/framework/blob/a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e/framework/basic/db/QueryBuilder.php#L74-L90
1,366
SergioMadness/framework
framework/basic/db/QueryBuilder.php
QueryBuilder.update
public static function update() { $result = null; switch (static::getDriver()) { case self::DRIVER_MYSQL: $result = new \pwf\components\querybuilder\adapters\MySQL\UpdateBuilder(); break; case self::DRIVER_PG: $result = new \pw...
php
public static function update() { $result = null; switch (static::getDriver()) { case self::DRIVER_MYSQL: $result = new \pwf\components\querybuilder\adapters\MySQL\UpdateBuilder(); break; case self::DRIVER_PG: $result = new \pw...
[ "public", "static", "function", "update", "(", ")", "{", "$", "result", "=", "null", ";", "switch", "(", "static", "::", "getDriver", "(", ")", ")", "{", "case", "self", "::", "DRIVER_MYSQL", ":", "$", "result", "=", "new", "\\", "pwf", "\\", "compon...
Get update builder @return \pwf\components\querybuilder\interfaces\UpdateBuilder @throws \Exception
[ "Get", "update", "builder" ]
a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e
https://github.com/SergioMadness/framework/blob/a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e/framework/basic/db/QueryBuilder.php#L98-L114
1,367
SergioMadness/framework
framework/basic/db/QueryBuilder.php
QueryBuilder.delete
public static function delete() { $result = null; switch (static::getDriver()) { case self::DRIVER_MYSQL: $result = new \pwf\components\querybuilder\adapters\MySQL\DeleteBuilder(); break; case self::DRIVER_PG: $result = new \pw...
php
public static function delete() { $result = null; switch (static::getDriver()) { case self::DRIVER_MYSQL: $result = new \pwf\components\querybuilder\adapters\MySQL\DeleteBuilder(); break; case self::DRIVER_PG: $result = new \pw...
[ "public", "static", "function", "delete", "(", ")", "{", "$", "result", "=", "null", ";", "switch", "(", "static", "::", "getDriver", "(", ")", ")", "{", "case", "self", "::", "DRIVER_MYSQL", ":", "$", "result", "=", "new", "\\", "pwf", "\\", "compon...
Get delete builder @return \pwf\components\querybuilder\interfaces\DeleteBuilder @throws \Exception
[ "Get", "delete", "builder" ]
a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e
https://github.com/SergioMadness/framework/blob/a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e/framework/basic/db/QueryBuilder.php#L122-L138
1,368
SergioMadness/framework
framework/basic/db/QueryBuilder.php
QueryBuilder.getConditionBuilder
public static function getConditionBuilder() { $result = null; switch (static::getDriver()) { default: $result = new \pwf\components\querybuilder\adapters\SQL\ConditionBuilder(); } return $result; }
php
public static function getConditionBuilder() { $result = null; switch (static::getDriver()) { default: $result = new \pwf\components\querybuilder\adapters\SQL\ConditionBuilder(); } return $result; }
[ "public", "static", "function", "getConditionBuilder", "(", ")", "{", "$", "result", "=", "null", ";", "switch", "(", "static", "::", "getDriver", "(", ")", ")", "{", "default", ":", "$", "result", "=", "new", "\\", "pwf", "\\", "components", "\\", "qu...
Get condition builder @return \pwf\components\querybuilder\adapters\SQL\ConditionBuilder
[ "Get", "condition", "builder" ]
a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e
https://github.com/SergioMadness/framework/blob/a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e/framework/basic/db/QueryBuilder.php#L145-L155
1,369
liftkit/database
src/Connection/MsSql.php
MsSql.primaryKey
public function primaryKey ($tableName) { if (! isset($this->primaryKeys[$tableName])) { $sql = "SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu ON tc.CONSTRAINT_NAME = ccu.Constraint_name WHERE tc.CONSTRAINT_TYPE = 'Prima...
php
public function primaryKey ($tableName) { if (! isset($this->primaryKeys[$tableName])) { $sql = "SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu ON tc.CONSTRAINT_NAME = ccu.Constraint_name WHERE tc.CONSTRAINT_TYPE = 'Prima...
[ "public", "function", "primaryKey", "(", "$", "tableName", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "primaryKeys", "[", "$", "tableName", "]", ")", ")", "{", "$", "sql", "=", "\"SELECT *\n\t\t\t\t\t FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS ...
primaryKey function. @access public @param string $tableName @return string
[ "primaryKey", "function", "." ]
752099ef8c71be0c187c9d6eea172b9afd723629
https://github.com/liftkit/database/blob/752099ef8c71be0c187c9d6eea172b9afd723629/src/Connection/MsSql.php#L82-L97
1,370
theD1360/ArrayHelper
src/Utilities/Arr.php
Arr.isEmpty
public function isEmpty($key = null) { if ($key === null) { return empty($this->data); } return empty($this->data[$key]); }
php
public function isEmpty($key = null) { if ($key === null) { return empty($this->data); } return empty($this->data[$key]); }
[ "public", "function", "isEmpty", "(", "$", "key", "=", "null", ")", "{", "if", "(", "$", "key", "===", "null", ")", "{", "return", "empty", "(", "$", "this", "->", "data", ")", ";", "}", "return", "empty", "(", "$", "this", "->", "data", "[", "...
is empty will return if the specified key is empty if no key provided it will check itself.
[ "is", "empty", "will", "return", "if", "the", "specified", "key", "is", "empty", "if", "no", "key", "provided", "it", "will", "check", "itself", "." ]
1b637bb56002de2b4c70f5359f009eebc4557a1f
https://github.com/theD1360/ArrayHelper/blob/1b637bb56002de2b4c70f5359f009eebc4557a1f/src/Utilities/Arr.php#L82-L88
1,371
theD1360/ArrayHelper
src/Utilities/Arr.php
Arr.merge
public function merge($arr = []) { $newData = array_merge($this->toArray(), $arr); return $this->reset($newData); }
php
public function merge($arr = []) { $newData = array_merge($this->toArray(), $arr); return $this->reset($newData); }
[ "public", "function", "merge", "(", "$", "arr", "=", "[", "]", ")", "{", "$", "newData", "=", "array_merge", "(", "$", "this", "->", "toArray", "(", ")", ",", "$", "arr", ")", ";", "return", "$", "this", "->", "reset", "(", "$", "newData", ")", ...
array then rebuilds the data array. Returns itself
[ "array", "then", "rebuilds", "the", "data", "array", ".", "Returns", "itself" ]
1b637bb56002de2b4c70f5359f009eebc4557a1f
https://github.com/theD1360/ArrayHelper/blob/1b637bb56002de2b4c70f5359f009eebc4557a1f/src/Utilities/Arr.php#L283-L287
1,372
mvqn/ucrm-module-rest
src/UCRM/REST/Endpoints/Helpers/ClientHelper.php
ClientHelper.resetAllInvoiceOptions
public function resetAllInvoiceOptions(): Client { $this->sendInvoiceByPost = null; $this->invoiceMaturityDays = null; $this->stopServiceDue = null; $this->stopServiceDueDays = null; // TODO: Add 'Late fee delay' to list of resets when made available! /** @var Client...
php
public function resetAllInvoiceOptions(): Client { $this->sendInvoiceByPost = null; $this->invoiceMaturityDays = null; $this->stopServiceDue = null; $this->stopServiceDueDays = null; // TODO: Add 'Late fee delay' to list of resets when made available! /** @var Client...
[ "public", "function", "resetAllInvoiceOptions", "(", ")", ":", "Client", "{", "$", "this", "->", "sendInvoiceByPost", "=", "null", ";", "$", "this", "->", "invoiceMaturityDays", "=", "null", ";", "$", "this", "->", "stopServiceDue", "=", "null", ";", "$", ...
Resets all Invoice Options for this Client. @return Client Returns the current Client, for method chaining purposes.
[ "Resets", "all", "Invoice", "Options", "for", "this", "Client", "." ]
b5df714b5697ea12005ffbae84e13f3f15900322
https://github.com/mvqn/ucrm-module-rest/blob/b5df714b5697ea12005ffbae84e13f3f15900322/src/UCRM/REST/Endpoints/Helpers/ClientHelper.php#L41-L51
1,373
mvqn/ucrm-module-rest
src/UCRM/REST/Endpoints/Helpers/ClientHelper.php
ClientHelper.createResidential
public static function createResidential(string $firstName, string $lastName): Client { $organization = Organization::getByDefault(); $client = new Client([ "clientType" => Client::CLIENT_TYPE_RESIDENTIAL, "isLead" => false, "invoiceAddressSameAsContact" => true,...
php
public static function createResidential(string $firstName, string $lastName): Client { $organization = Organization::getByDefault(); $client = new Client([ "clientType" => Client::CLIENT_TYPE_RESIDENTIAL, "isLead" => false, "invoiceAddressSameAsContact" => true,...
[ "public", "static", "function", "createResidential", "(", "string", "$", "firstName", ",", "string", "$", "lastName", ")", ":", "Client", "{", "$", "organization", "=", "Organization", "::", "getByDefault", "(", ")", ";", "$", "client", "=", "new", "Client",...
Creates the minimal Residential Client to be used as a starting point for a new Client. @param string $firstName The Client's first name. @param string $lastName The Client's last name. @return Client Returns a partially generated Client for further use before insertion. @throws \Exception
[ "Creates", "the", "minimal", "Residential", "Client", "to", "be", "used", "as", "a", "starting", "point", "for", "a", "new", "Client", "." ]
b5df714b5697ea12005ffbae84e13f3f15900322
https://github.com/mvqn/ucrm-module-rest/blob/b5df714b5697ea12005ffbae84e13f3f15900322/src/UCRM/REST/Endpoints/Helpers/ClientHelper.php#L118-L133
1,374
mvqn/ucrm-module-rest
src/UCRM/REST/Endpoints/Helpers/ClientHelper.php
ClientHelper.createCommercial
public static function createCommercial(string $companyName): Client { $organization = Organization::getByDefault(); $client = new Client([ "clientType" => Client::CLIENT_TYPE_COMMERCIAL, "isLead" => false, "invoiceAddressSameAsContact" => true, "orga...
php
public static function createCommercial(string $companyName): Client { $organization = Organization::getByDefault(); $client = new Client([ "clientType" => Client::CLIENT_TYPE_COMMERCIAL, "isLead" => false, "invoiceAddressSameAsContact" => true, "orga...
[ "public", "static", "function", "createCommercial", "(", "string", "$", "companyName", ")", ":", "Client", "{", "$", "organization", "=", "Organization", "::", "getByDefault", "(", ")", ";", "$", "client", "=", "new", "Client", "(", "[", "\"clientType\"", "=...
Creates the minimal Commericial Client to be used as a starting point for a new Client. @param string $companyName The company name of this Commercial Client. @return Client Returns a partially generated Client for further use before insertion. @throws \Exception
[ "Creates", "the", "minimal", "Commericial", "Client", "to", "be", "used", "as", "a", "starting", "point", "for", "a", "new", "Client", "." ]
b5df714b5697ea12005ffbae84e13f3f15900322
https://github.com/mvqn/ucrm-module-rest/blob/b5df714b5697ea12005ffbae84e13f3f15900322/src/UCRM/REST/Endpoints/Helpers/ClientHelper.php#L171-L185
1,375
mvqn/ucrm-module-rest
src/UCRM/REST/Endpoints/Helpers/ClientHelper.php
ClientHelper.getByUserIdent
public static function getByUserIdent(string $userIdent): ?Client { /** @var Client $client */ $client = Client::get("", [], [ "userIdent" => $userIdent ])->first(); // Custom ID is Unique, so return the only result or null! return $client; }
php
public static function getByUserIdent(string $userIdent): ?Client { /** @var Client $client */ $client = Client::get("", [], [ "userIdent" => $userIdent ])->first(); // Custom ID is Unique, so return the only result or null! return $client; }
[ "public", "static", "function", "getByUserIdent", "(", "string", "$", "userIdent", ")", ":", "?", "Client", "{", "/** @var Client $client */", "$", "client", "=", "Client", "::", "get", "(", "\"\"", ",", "[", "]", ",", "[", "\"userIdent\"", "=>", "$", "use...
Sends an HTTP GET Request using the calling class's annotated information, for an object, given the Custom ID. @param string $userIdent The Custom ID of the Client for which to retrieve. @return Client|null Returns the matching Client or NULL, if none was found. @throws \Exception
[ "Sends", "an", "HTTP", "GET", "Request", "using", "the", "calling", "class", "s", "annotated", "information", "for", "an", "object", "given", "the", "Custom", "ID", "." ]
b5df714b5697ea12005ffbae84e13f3f15900322
https://github.com/mvqn/ucrm-module-rest/blob/b5df714b5697ea12005ffbae84e13f3f15900322/src/UCRM/REST/Endpoints/Helpers/ClientHelper.php#L223-L230
1,376
mvqn/ucrm-module-rest
src/UCRM/REST/Endpoints/Helpers/ClientHelper.php
ClientHelper.getByCustomAttribute
public static function getByCustomAttribute(string $key, string $value): ClientCollection { // TODO: Determine if this is ALWAYS the case! $key = lcfirst($key); /** @var ClientCollection $clients */ $clients = Client::get("", [], [ "customAttributeKey" => $key, "customAttributeValue...
php
public static function getByCustomAttribute(string $key, string $value): ClientCollection { // TODO: Determine if this is ALWAYS the case! $key = lcfirst($key); /** @var ClientCollection $clients */ $clients = Client::get("", [], [ "customAttributeKey" => $key, "customAttributeValue...
[ "public", "static", "function", "getByCustomAttribute", "(", "string", "$", "key", ",", "string", "$", "value", ")", ":", "ClientCollection", "{", "// TODO: Determine if this is ALWAYS the case!", "$", "key", "=", "lcfirst", "(", "$", "key", ")", ";", "/** @var Cl...
Sends an HTTP GET Request using the calling class's annotated information, for objects, given an Attribute pair. @param string $key The Custom Attribute Key for which to search, will be converted to camel case as needed. @param string $value The Custom Attribute Value for which to search. @return ClientCollection Retu...
[ "Sends", "an", "HTTP", "GET", "Request", "using", "the", "calling", "class", "s", "annotated", "information", "for", "objects", "given", "an", "Attribute", "pair", "." ]
b5df714b5697ea12005ffbae84e13f3f15900322
https://github.com/mvqn/ucrm-module-rest/blob/b5df714b5697ea12005ffbae84e13f3f15900322/src/UCRM/REST/Endpoints/Helpers/ClientHelper.php#L241-L249
1,377
codezero-be/utilities
src/UrlHelper.php
UrlHelper.joinSlugs
public function joinSlugs(array $urlParts) { $urlParts = array_map(function($urlPart){ return trim($urlPart, '/'); }, $urlParts); return implode('/', $urlParts); }
php
public function joinSlugs(array $urlParts) { $urlParts = array_map(function($urlPart){ return trim($urlPart, '/'); }, $urlParts); return implode('/', $urlParts); }
[ "public", "function", "joinSlugs", "(", "array", "$", "urlParts", ")", "{", "$", "urlParts", "=", "array_map", "(", "function", "(", "$", "urlPart", ")", "{", "return", "trim", "(", "$", "urlPart", ",", "'/'", ")", ";", "}", ",", "$", "urlParts", ")"...
Join URL parts without double slashes @param array $urlParts @return string
[ "Join", "URL", "parts", "without", "double", "slashes" ]
798b4c3a7f27fdae1dc3eccb7bb4c59f62622db2
https://github.com/codezero-be/utilities/blob/798b4c3a7f27fdae1dc3eccb7bb4c59f62622db2/src/UrlHelper.php#L12-L19
1,378
railsphp/framework
src/Rails/ActiveRecord/Base/Methods/AssociationsMethodsTrait.php
AssociationsMethodsTrait.getAssociation
public function getAssociation($name, $autoLoad = true) { if (isset($this->loadedAssociations[$name])) { return $this->loadedAssociations[$name]; } elseif ($autoLoad && $this->getAssociations()->exists($name)) { $this->loadedAssociations[$name] = $this->getAss...
php
public function getAssociation($name, $autoLoad = true) { if (isset($this->loadedAssociations[$name])) { return $this->loadedAssociations[$name]; } elseif ($autoLoad && $this->getAssociations()->exists($name)) { $this->loadedAssociations[$name] = $this->getAss...
[ "public", "function", "getAssociation", "(", "$", "name", ",", "$", "autoLoad", "=", "true", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "loadedAssociations", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "loadedAssociati...
If the association isn't yet loaded, it is loaded and returned. If the association doesn't exist, `null` is returned. Note that unset one-to-one associations return `false`. return null|false|object
[ "If", "the", "association", "isn", "t", "yet", "loaded", "it", "is", "loaded", "and", "returned", ".", "If", "the", "association", "doesn", "t", "exist", "null", "is", "returned", ".", "Note", "that", "unset", "one", "-", "to", "-", "one", "associations"...
2ac9d3e493035dcc68f3c3812423327127327cd5
https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActiveRecord/Base/Methods/AssociationsMethodsTrait.php#L27-L37
1,379
railsphp/framework
src/Rails/ActiveRecord/Base/Methods/AssociationsMethodsTrait.php
AssociationsMethodsTrait.setAssociation
public function setAssociation($name, $value, $raw = false) { if ($raw) { $this->loadedAssociations[$name] = $value; } else { return (new Setter())->set($this, $name, $value); } }
php
public function setAssociation($name, $value, $raw = false) { if ($raw) { $this->loadedAssociations[$name] = $value; } else { return (new Setter())->set($this, $name, $value); } }
[ "public", "function", "setAssociation", "(", "$", "name", ",", "$", "value", ",", "$", "raw", "=", "false", ")", "{", "if", "(", "$", "raw", ")", "{", "$", "this", "->", "loadedAssociations", "[", "$", "name", "]", "=", "$", "value", ";", "}", "e...
Associates an object to a one-to-one association. Other associations are done in CollectionProxy.
[ "Associates", "an", "object", "to", "a", "one", "-", "to", "-", "one", "association", ".", "Other", "associations", "are", "done", "in", "CollectionProxy", "." ]
2ac9d3e493035dcc68f3c3812423327127327cd5
https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActiveRecord/Base/Methods/AssociationsMethodsTrait.php#L43-L50
1,380
phapi/di
src/Phapi/Di/Container.php
Container.make
public function make($key) { // Check if set if (!isset($this->keys[$key])) { throw new \InvalidArgumentException('Identifier "'. $key .'" is not defined.'); } // Check if it is a simple value (string, int etc) that // should be returned if ( ...
php
public function make($key) { // Check if set if (!isset($this->keys[$key])) { throw new \InvalidArgumentException('Identifier "'. $key .'" is not defined.'); } // Check if it is a simple value (string, int etc) that // should be returned if ( ...
[ "public", "function", "make", "(", "$", "key", ")", "{", "// Check if set", "if", "(", "!", "isset", "(", "$", "this", "->", "keys", "[", "$", "key", "]", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Identifier \"'", ".", "$"...
Get something from the container @param $key string Identifier @return mixed
[ "Get", "something", "from", "the", "container" ]
869f0f0245540f167192ddf72a195adb70aae5a9
https://github.com/phapi/di/blob/869f0f0245540f167192ddf72a195adb70aae5a9/src/Phapi/Di/Container.php#L112-L139
1,381
black-forest/piwik-bundle
src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php
PiwikVisit.addVisitAction
public function addVisitAction(\BlackForest\PiwikBundle\Entity\PiwikVisitAction $visitAction) { $this->visitAction[] = $visitAction; return $this; }
php
public function addVisitAction(\BlackForest\PiwikBundle\Entity\PiwikVisitAction $visitAction) { $this->visitAction[] = $visitAction; return $this; }
[ "public", "function", "addVisitAction", "(", "\\", "BlackForest", "\\", "PiwikBundle", "\\", "Entity", "\\", "PiwikVisitAction", "$", "visitAction", ")", "{", "$", "this", "->", "visitAction", "[", "]", "=", "$", "visitAction", ";", "return", "$", "this", ";...
Add visitAction. @param \BlackForest\PiwikBundle\Entity\PiwikVisitAction $visitAction @return PiwikVisit
[ "Add", "visitAction", "." ]
be1000f898f9583bb4ecbe4ca1933ab7b7e0e785
https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php#L826-L831
1,382
black-forest/piwik-bundle
src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php
PiwikVisit.removeVisitAction
public function removeVisitAction(\BlackForest\PiwikBundle\Entity\PiwikVisitAction $visitAction) { return $this->visitAction->removeElement($visitAction); }
php
public function removeVisitAction(\BlackForest\PiwikBundle\Entity\PiwikVisitAction $visitAction) { return $this->visitAction->removeElement($visitAction); }
[ "public", "function", "removeVisitAction", "(", "\\", "BlackForest", "\\", "PiwikBundle", "\\", "Entity", "\\", "PiwikVisitAction", "$", "visitAction", ")", "{", "return", "$", "this", "->", "visitAction", "->", "removeElement", "(", "$", "visitAction", ")", ";"...
Remove visitAction. @param \BlackForest\PiwikBundle\Entity\PiwikVisitAction $visitAction @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
[ "Remove", "visitAction", "." ]
be1000f898f9583bb4ecbe4ca1933ab7b7e0e785
https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php#L840-L843
1,383
black-forest/piwik-bundle
src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php
PiwikVisit.setVisitor
public function setVisitor(\BlackForest\PiwikBundle\Entity\PiwikVisitor $visitor = null) { $this->visitor = $visitor; return $this; }
php
public function setVisitor(\BlackForest\PiwikBundle\Entity\PiwikVisitor $visitor = null) { $this->visitor = $visitor; return $this; }
[ "public", "function", "setVisitor", "(", "\\", "BlackForest", "\\", "PiwikBundle", "\\", "Entity", "\\", "PiwikVisitor", "$", "visitor", "=", "null", ")", "{", "$", "this", "->", "visitor", "=", "$", "visitor", ";", "return", "$", "this", ";", "}" ]
Set visitor. @param \BlackForest\PiwikBundle\Entity\PiwikVisitor|null $visitor @return PiwikVisit
[ "Set", "visitor", "." ]
be1000f898f9583bb4ecbe4ca1933ab7b7e0e785
https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php#L910-L915
1,384
black-forest/piwik-bundle
src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php
PiwikVisit.setSearchEngine
public function setSearchEngine(\BlackForest\PiwikBundle\Entity\PiwikSearchEngine $searchEngine = null) { $this->searchEngine = $searchEngine; return $this; }
php
public function setSearchEngine(\BlackForest\PiwikBundle\Entity\PiwikSearchEngine $searchEngine = null) { $this->searchEngine = $searchEngine; return $this; }
[ "public", "function", "setSearchEngine", "(", "\\", "BlackForest", "\\", "PiwikBundle", "\\", "Entity", "\\", "PiwikSearchEngine", "$", "searchEngine", "=", "null", ")", "{", "$", "this", "->", "searchEngine", "=", "$", "searchEngine", ";", "return", "$", "thi...
Set searchEngine. @param \BlackForest\PiwikBundle\Entity\PiwikSearchEngine|null $searchEngine @return PiwikVisit
[ "Set", "searchEngine", "." ]
be1000f898f9583bb4ecbe4ca1933ab7b7e0e785
https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php#L1006-L1011
1,385
black-forest/piwik-bundle
src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php
PiwikVisit.setDevice
public function setDevice(\BlackForest\PiwikBundle\Entity\PiwikDevice $device = null) { $this->device = $device; return $this; }
php
public function setDevice(\BlackForest\PiwikBundle\Entity\PiwikDevice $device = null) { $this->device = $device; return $this; }
[ "public", "function", "setDevice", "(", "\\", "BlackForest", "\\", "PiwikBundle", "\\", "Entity", "\\", "PiwikDevice", "$", "device", "=", "null", ")", "{", "$", "this", "->", "device", "=", "$", "device", ";", "return", "$", "this", ";", "}" ]
Set device. @param \BlackForest\PiwikBundle\Entity\PiwikDevice|null $device @return PiwikVisit
[ "Set", "device", "." ]
be1000f898f9583bb4ecbe4ca1933ab7b7e0e785
https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php#L1054-L1059
1,386
black-forest/piwik-bundle
src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php
PiwikVisit.setOperatingSystem
public function setOperatingSystem(\BlackForest\PiwikBundle\Entity\PiwikOperatingSystem $operatingSystem = null) { $this->operatingSystem = $operatingSystem; return $this; }
php
public function setOperatingSystem(\BlackForest\PiwikBundle\Entity\PiwikOperatingSystem $operatingSystem = null) { $this->operatingSystem = $operatingSystem; return $this; }
[ "public", "function", "setOperatingSystem", "(", "\\", "BlackForest", "\\", "PiwikBundle", "\\", "Entity", "\\", "PiwikOperatingSystem", "$", "operatingSystem", "=", "null", ")", "{", "$", "this", "->", "operatingSystem", "=", "$", "operatingSystem", ";", "return"...
Set operatingSystem. @param \BlackForest\PiwikBundle\Entity\PiwikOperatingSystem|null $operatingSystem @return PiwikVisit
[ "Set", "operatingSystem", "." ]
be1000f898f9583bb4ecbe4ca1933ab7b7e0e785
https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php#L1078-L1083
1,387
black-forest/piwik-bundle
src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php
PiwikVisit.setBrowser
public function setBrowser(\BlackForest\PiwikBundle\Entity\PiwikBrowser $browser = null) { $this->browser = $browser; return $this; }
php
public function setBrowser(\BlackForest\PiwikBundle\Entity\PiwikBrowser $browser = null) { $this->browser = $browser; return $this; }
[ "public", "function", "setBrowser", "(", "\\", "BlackForest", "\\", "PiwikBundle", "\\", "Entity", "\\", "PiwikBrowser", "$", "browser", "=", "null", ")", "{", "$", "this", "->", "browser", "=", "$", "browser", ";", "return", "$", "this", ";", "}" ]
Set browser. @param \BlackForest\PiwikBundle\Entity\PiwikBrowser|null $browser @return PiwikVisit
[ "Set", "browser", "." ]
be1000f898f9583bb4ecbe4ca1933ab7b7e0e785
https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php#L1102-L1107
1,388
black-forest/piwik-bundle
src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php
PiwikVisit.setLocation
public function setLocation(\BlackForest\PiwikBundle\Entity\PiwikLocation $location = null) { $this->location = $location; return $this; }
php
public function setLocation(\BlackForest\PiwikBundle\Entity\PiwikLocation $location = null) { $this->location = $location; return $this; }
[ "public", "function", "setLocation", "(", "\\", "BlackForest", "\\", "PiwikBundle", "\\", "Entity", "\\", "PiwikLocation", "$", "location", "=", "null", ")", "{", "$", "this", "->", "location", "=", "$", "location", ";", "return", "$", "this", ";", "}" ]
Set location. @param \BlackForest\PiwikBundle\Entity\PiwikLocation|null $location @return PiwikVisit
[ "Set", "location", "." ]
be1000f898f9583bb4ecbe4ca1933ab7b7e0e785
https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php#L1150-L1155
1,389
black-forest/piwik-bundle
src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php
PiwikVisit.setResolution
public function setResolution(\BlackForest\PiwikBundle\Entity\PiwikResolution $resolution = null) { $this->resolution = $resolution; return $this; }
php
public function setResolution(\BlackForest\PiwikBundle\Entity\PiwikResolution $resolution = null) { $this->resolution = $resolution; return $this; }
[ "public", "function", "setResolution", "(", "\\", "BlackForest", "\\", "PiwikBundle", "\\", "Entity", "\\", "PiwikResolution", "$", "resolution", "=", "null", ")", "{", "$", "this", "->", "resolution", "=", "$", "resolution", ";", "return", "$", "this", ";",...
Set resolution. @param \BlackForest\PiwikBundle\Entity\PiwikResolution|null $resolution @return PiwikVisit
[ "Set", "resolution", "." ]
be1000f898f9583bb4ecbe4ca1933ab7b7e0e785
https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php#L1174-L1179
1,390
black-forest/piwik-bundle
src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php
PiwikVisit.setPlugin
public function setPlugin(\BlackForest\PiwikBundle\Entity\PiwikVisitPlugin $plugin = null) { $this->plugin = $plugin; return $this; }
php
public function setPlugin(\BlackForest\PiwikBundle\Entity\PiwikVisitPlugin $plugin = null) { $this->plugin = $plugin; return $this; }
[ "public", "function", "setPlugin", "(", "\\", "BlackForest", "\\", "PiwikBundle", "\\", "Entity", "\\", "PiwikVisitPlugin", "$", "plugin", "=", "null", ")", "{", "$", "this", "->", "plugin", "=", "$", "plugin", ";", "return", "$", "this", ";", "}" ]
Set plugin. @param \BlackForest\PiwikBundle\Entity\PiwikVisitPlugin|null $plugin @return PiwikVisit
[ "Set", "plugin", "." ]
be1000f898f9583bb4ecbe4ca1933ab7b7e0e785
https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikVisit.php#L1198-L1203
1,391
leodido/conversio
library/Adapter/AbstractOptionsEnabledAdapter.php
AbstractOptionsEnabledAdapter.setOptions
public function setOptions(AbstractOptions $options) { $optionsClass = Conversion::getOptionsFullQualifiedClassName($this); $inputOptionsClass = get_class($options); if ($inputOptionsClass !== $optionsClass) { throw new Exception\DomainException(sprintf( '"%s" exp...
php
public function setOptions(AbstractOptions $options) { $optionsClass = Conversion::getOptionsFullQualifiedClassName($this); $inputOptionsClass = get_class($options); if ($inputOptionsClass !== $optionsClass) { throw new Exception\DomainException(sprintf( '"%s" exp...
[ "public", "function", "setOptions", "(", "AbstractOptions", "$", "options", ")", "{", "$", "optionsClass", "=", "Conversion", "::", "getOptionsFullQualifiedClassName", "(", "$", "this", ")", ";", "$", "inputOptionsClass", "=", "get_class", "(", "$", "options", "...
Set the adapter options instance @param AbstractOptions $options @return $this
[ "Set", "the", "adapter", "options", "instance" ]
ebbb626b0cf2a44729af6d46d753b5a4b06d9835
https://github.com/leodido/conversio/blob/ebbb626b0cf2a44729af6d46d753b5a4b06d9835/library/Adapter/AbstractOptionsEnabledAdapter.php#L32-L46
1,392
leodido/conversio
library/Adapter/AbstractOptionsEnabledAdapter.php
AbstractOptionsEnabledAdapter.getOptions
public function getOptions() { if (!$this->options) { throw new Exception\RuntimeException(sprintf( 'No options instance set for the adapter "%s"', get_class($this) )); } return $this->options; }
php
public function getOptions() { if (!$this->options) { throw new Exception\RuntimeException(sprintf( 'No options instance set for the adapter "%s"', get_class($this) )); } return $this->options; }
[ "public", "function", "getOptions", "(", ")", "{", "if", "(", "!", "$", "this", "->", "options", ")", "{", "throw", "new", "Exception", "\\", "RuntimeException", "(", "sprintf", "(", "'No options instance set for the adapter \"%s\"'", ",", "get_class", "(", "$",...
Retrieve the adapter options instance @return AbstractOptions
[ "Retrieve", "the", "adapter", "options", "instance" ]
ebbb626b0cf2a44729af6d46d753b5a4b06d9835
https://github.com/leodido/conversio/blob/ebbb626b0cf2a44729af6d46d753b5a4b06d9835/library/Adapter/AbstractOptionsEnabledAdapter.php#L53-L62
1,393
webriq/core
module/Paragraph/src/Grid/Paragraph/Controller/Plugin/ParagraphLayout.php
ParagraphLayout.setMiddleParagraphLayoutId
public function setMiddleParagraphLayoutId( $layoutParagraphId = null ) { $middleLayout = $this->middleLayoutModel ->findMiddleParagraphLayoutById( $layoutParagraphId ); if ( ! empty( $middleLayout ) ) ...
php
public function setMiddleParagraphLayoutId( $layoutParagraphId = null ) { $middleLayout = $this->middleLayoutModel ->findMiddleParagraphLayoutById( $layoutParagraphId ); if ( ! empty( $middleLayout ) ) ...
[ "public", "function", "setMiddleParagraphLayoutId", "(", "$", "layoutParagraphId", "=", "null", ")", "{", "$", "middleLayout", "=", "$", "this", "->", "middleLayoutModel", "->", "findMiddleParagraphLayoutById", "(", "$", "layoutParagraphId", ")", ";", "if", "(", "...
Set middle-layout for paragraph-layout @param int|null $layoutParagraphId @return \Paragraph\Controller\Plugin\ParagraphLayout @throws \Zend\Mvc\Exception\LogicException if controller not pluggable
[ "Set", "middle", "-", "layout", "for", "paragraph", "-", "layout" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Controller/Plugin/ParagraphLayout.php#L39-L62
1,394
Dhii/state-machine-abstract
src/TransitionAwareTrait.php
TransitionAwareTrait._setTransition
protected function _setTransition($transition) { if ($transition !== null && !is_string($transition) && !($transition instanceof Stringable)) { throw $this->_createInvalidArgumentException( $this->__('Argument is not a valid transition'), null, nul...
php
protected function _setTransition($transition) { if ($transition !== null && !is_string($transition) && !($transition instanceof Stringable)) { throw $this->_createInvalidArgumentException( $this->__('Argument is not a valid transition'), null, nul...
[ "protected", "function", "_setTransition", "(", "$", "transition", ")", "{", "if", "(", "$", "transition", "!==", "null", "&&", "!", "is_string", "(", "$", "transition", ")", "&&", "!", "(", "$", "transition", "instanceof", "Stringable", ")", ")", "{", "...
Sets the transition for this instance. @since [*next-version*] @param string|Stringable|null $transition The transition, or null.
[ "Sets", "the", "transition", "for", "this", "instance", "." ]
cb5f706edd74d1c747f09f505b859255b13a5b27
https://github.com/Dhii/state-machine-abstract/blob/cb5f706edd74d1c747f09f505b859255b13a5b27/src/TransitionAwareTrait.php#L44-L56
1,395
konservs/brilliant.framework
libraries/BFactory.php
BFactory.getDBO
public static function getDBO() { if (!empty(self::$db)) { return self::$db; } BLog::addToLog('[BFactory] Connecting to the database "' . MYSQL_DB_HOST . '"...'); self::$db = BMySQL::getInstanceAndConnect(); if (empty(self::$db)) { BLog::addToLog('[BFactory] Could not connect to the MySQL database!', LL...
php
public static function getDBO() { if (!empty(self::$db)) { return self::$db; } BLog::addToLog('[BFactory] Connecting to the database "' . MYSQL_DB_HOST . '"...'); self::$db = BMySQL::getInstanceAndConnect(); if (empty(self::$db)) { BLog::addToLog('[BFactory] Could not connect to the MySQL database!', LL...
[ "public", "static", "function", "getDBO", "(", ")", "{", "if", "(", "!", "empty", "(", "self", "::", "$", "db", ")", ")", "{", "return", "self", "::", "$", "db", ";", "}", "BLog", "::", "addToLog", "(", "'[BFactory] Connecting to the database \"'", ".", ...
Get BMySQL instance @return BMySQL|null
[ "Get", "BMySQL", "instance" ]
95f03f1917f746fee98bea8a906ba0588c87762d
https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/BFactory.php#L23-L34
1,396
konservs/brilliant.framework
libraries/BFactory.php
BFactory.getTempFn
public static function getTempFn() { $tempFileName = BROOTPATH . 'temp' . DIRECTORY_SEPARATOR; $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); for ($i = 0; $i < 15; $i++) { $tempFileName .= $characters[rand(0, $charactersLength - 1)]; ...
php
public static function getTempFn() { $tempFileName = BROOTPATH . 'temp' . DIRECTORY_SEPARATOR; $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); for ($i = 0; $i < 15; $i++) { $tempFileName .= $characters[rand(0, $charactersLength - 1)]; ...
[ "public", "static", "function", "getTempFn", "(", ")", "{", "$", "tempFileName", "=", "BROOTPATH", ".", "'temp'", ".", "DIRECTORY_SEPARATOR", ";", "$", "characters", "=", "'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'", ";", "$", "charactersLength", "...
Get temporary filename @return string
[ "Get", "temporary", "filename" ]
95f03f1917f746fee98bea8a906ba0588c87762d
https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/BFactory.php#L53-L62
1,397
funkeye/console
src/Console.php
Console.getInstance
public static function getInstance() { if( is_null(self::$_oInstance) ) { $c = __CLASS__; self::$_oInstance = new $c; } return self::$_oInstance; }
php
public static function getInstance() { if( is_null(self::$_oInstance) ) { $c = __CLASS__; self::$_oInstance = new $c; } return self::$_oInstance; }
[ "public", "static", "function", "getInstance", "(", ")", "{", "if", "(", "is_null", "(", "self", "::", "$", "_oInstance", ")", ")", "{", "$", "c", "=", "__CLASS__", ";", "self", "::", "$", "_oInstance", "=", "new", "$", "c", ";", "}", "return", "se...
get a valid instance of this class @return object
[ "get", "a", "valid", "instance", "of", "this", "class" ]
e613c0472004156a68ef6171590c93a71d5b8f9c
https://github.com/funkeye/console/blob/e613c0472004156a68ef6171590c93a71d5b8f9c/src/Console.php#L54-L60
1,398
synapsestudios/synapse-base
src/Synapse/Validator/Constraints/BelongsToEntityValidator.php
BelongsToEntityValidator.addViolation
protected function addViolation($value, Constraint $constraint) { $this->context->addViolation( $constraint->message, [ '{{ id_field }}' => $constraint->getIdField(), '{{ value }}' => $value ], $value ); }
php
protected function addViolation($value, Constraint $constraint) { $this->context->addViolation( $constraint->message, [ '{{ id_field }}' => $constraint->getIdField(), '{{ value }}' => $value ], $value ); }
[ "protected", "function", "addViolation", "(", "$", "value", ",", "Constraint", "$", "constraint", ")", "{", "$", "this", "->", "context", "->", "addViolation", "(", "$", "constraint", "->", "message", ",", "[", "'{{ id_field }}'", "=>", "$", "constraint", "-...
Add violation with error message @param $value
[ "Add", "violation", "with", "error", "message" ]
60c830550491742a077ab063f924e2f0b63825da
https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Validator/Constraints/BelongsToEntityValidator.php#L47-L57
1,399
Webiny/BackupService
src/Webiny/BackupService/Lib/Compress.php
Compress.addSources
public function addSources(array $sources) { foreach ($sources as $s) { if (!file_exists($s)) { throw new \Exception(sprintf('Unable to compress %s because the destination doesn\'t exist.', $s)); } $this->sources[] = $s; } }
php
public function addSources(array $sources) { foreach ($sources as $s) { if (!file_exists($s)) { throw new \Exception(sprintf('Unable to compress %s because the destination doesn\'t exist.', $s)); } $this->sources[] = $s; } }
[ "public", "function", "addSources", "(", "array", "$", "sources", ")", "{", "foreach", "(", "$", "sources", "as", "$", "s", ")", "{", "if", "(", "!", "file_exists", "(", "$", "s", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "sprintf", "(...
Add one or more file or folders to the archive. @param array $sources @throws \Exception
[ "Add", "one", "or", "more", "file", "or", "folders", "to", "the", "archive", "." ]
9728ddaa67e5703ac7898a6f69a0ad14ac37a256
https://github.com/Webiny/BackupService/blob/9728ddaa67e5703ac7898a6f69a0ad14ac37a256/src/Webiny/BackupService/Lib/Compress.php#L64-L72