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
199,200
mossphp/moss-storage
Moss/Storage/Query/Accessor/Accessor.php
Accessor.addPropertyValue
public function addPropertyValue(&$entity, $field, $value) { $container = $this->getPropertyValue($entity, $field, $entity); if (!is_array($container)) { $container = empty($container) ? [] : [$container]; } $container[] = $value; $this->setPropertyValue($entity...
php
public function addPropertyValue(&$entity, $field, $value) { $container = $this->getPropertyValue($entity, $field, $entity); if (!is_array($container)) { $container = empty($container) ? [] : [$container]; } $container[] = $value; $this->setPropertyValue($entity...
[ "public", "function", "addPropertyValue", "(", "&", "$", "entity", ",", "$", "field", ",", "$", "value", ")", "{", "$", "container", "=", "$", "this", "->", "getPropertyValue", "(", "$", "entity", ",", "$", "field", ",", "$", "entity", ")", ";", "if"...
Adds value to array property If property is not an array - will be converted into one preserving existing value as first element @param mixed $entity @param string $field @param mixed $value @throws AccessorException
[ "Adds", "value", "to", "array", "property", "If", "property", "is", "not", "an", "array", "-", "will", "be", "converted", "into", "one", "preserving", "existing", "value", "as", "first", "element" ]
0d123e7ae6bbfce1e2a18e73bf70997277b430c1
https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Accessor/Accessor.php#L161-L171
199,201
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.getTableAlias
public function getTableAlias($table_name = null) { if (!$table_name) { $table_name = $this->getTableName(); } $bits = explode("_", $table_name); $alias = ''; foreach ($bits as $bit) { $alias .= strtolower(substr($bit, 0, 1)); } return ...
php
public function getTableAlias($table_name = null) { if (!$table_name) { $table_name = $this->getTableName(); } $bits = explode("_", $table_name); $alias = ''; foreach ($bits as $bit) { $alias .= strtolower(substr($bit, 0, 1)); } return ...
[ "public", "function", "getTableAlias", "(", "$", "table_name", "=", "null", ")", "{", "if", "(", "!", "$", "table_name", ")", "{", "$", "table_name", "=", "$", "this", "->", "getTableName", "(", ")", ";", "}", "$", "bits", "=", "explode", "(", "\"_\"...
Get the short alias name of a table. @param string $table_name Optional table name @return string Table alias
[ "Get", "the", "short", "alias", "name", "of", "a", "table", "." ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L97-L108
199,202
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.getTablePrimaryKey
public function getTablePrimaryKey() { trigger_error('getTablePrimaryKey() is deprecated. Use getIDField() instead.', E_USER_DEPRECATED); $keys = $this->getPrimaryKeyIndex(); return isset($keys[0])?$keys[0]:false; }
php
public function getTablePrimaryKey() { trigger_error('getTablePrimaryKey() is deprecated. Use getIDField() instead.', E_USER_DEPRECATED); $keys = $this->getPrimaryKeyIndex(); return isset($keys[0])?$keys[0]:false; }
[ "public", "function", "getTablePrimaryKey", "(", ")", "{", "trigger_error", "(", "'getTablePrimaryKey() is deprecated. Use getIDField() instead.'", ",", "E_USER_DEPRECATED", ")", ";", "$", "keys", "=", "$", "this", "->", "getPrimaryKeyIndex", "(", ")", ";", "return", ...
Get table primary key column name @deprecated @return string|false
[ "Get", "table", "primary", "key", "column", "name" ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L126-L132
199,203
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.getPrimaryKeyIndex
public function getPrimaryKeyIndex() { $database = DatabaseLayer::getInstance(); $columns = array(); if ($this instanceof VersionedActiveRecord) { $schema = $this->getClassSchema(); $firstColumn = reset($schema)['name']; $columns = [$firstColumn => $firs...
php
public function getPrimaryKeyIndex() { $database = DatabaseLayer::getInstance(); $columns = array(); if ($this instanceof VersionedActiveRecord) { $schema = $this->getClassSchema(); $firstColumn = reset($schema)['name']; $columns = [$firstColumn => $firs...
[ "public", "function", "getPrimaryKeyIndex", "(", ")", "{", "$", "database", "=", "DatabaseLayer", "::", "getInstance", "(", ")", ";", "$", "columns", "=", "array", "(", ")", ";", "if", "(", "$", "this", "instanceof", "VersionedActiveRecord", ")", "{", "$",...
Get a unique key to use as an index @return string[]
[ "Get", "a", "unique", "key", "to", "use", "as", "an", "index" ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L139-L156
199,204
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.getId
public function getId() { $col = $this->getIDField(); if (property_exists($this, $col)) { $id = $this->$col; if ($id > 0) { return $id; } } return false; }
php
public function getId() { $col = $this->getIDField(); if (property_exists($this, $col)) { $id = $this->$col; if ($id > 0) { return $id; } } return false; }
[ "public", "function", "getId", "(", ")", "{", "$", "col", "=", "$", "this", "->", "getIDField", "(", ")", ";", "if", "(", "property_exists", "(", "$", "this", ",", "$", "col", ")", ")", "{", "$", "id", "=", "$", "this", "->", "$", "col", ";", ...
Get object ID @return integer
[ "Get", "object", "ID" ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L162-L173
199,205
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.getLabel
public function getLabel() { if (property_exists($this, '_label_column')) { if (property_exists($this, $this->_label_column)) { $label_column = $this->_label_column; return $this->$label_column; } } if (property_exists($this, 'name')) {...
php
public function getLabel() { if (property_exists($this, '_label_column')) { if (property_exists($this, $this->_label_column)) { $label_column = $this->_label_column; return $this->$label_column; } } if (property_exists($this, 'name')) {...
[ "public", "function", "getLabel", "(", ")", "{", "if", "(", "property_exists", "(", "$", "this", ",", "'_label_column'", ")", ")", "{", "if", "(", "property_exists", "(", "$", "this", ",", "$", "this", "->", "_label_column", ")", ")", "{", "$", "label_...
Get a label for the object. Perhaps a Name or Description field. @return string
[ "Get", "a", "label", "for", "the", "object", ".", "Perhaps", "a", "Name", "or", "Description", "field", "." ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L179-L194
199,206
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.__calculateSaveDownRows
public function __calculateSaveDownRows() { if (!$this->_columns) { foreach (get_object_vars($this) as $potential_column => $discard) { switch ($potential_column) { case 'table': case substr($potential_column, 0, 1) == "_": ...
php
public function __calculateSaveDownRows() { if (!$this->_columns) { foreach (get_object_vars($this) as $potential_column => $discard) { switch ($potential_column) { case 'table': case substr($potential_column, 0, 1) == "_": ...
[ "public", "function", "__calculateSaveDownRows", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_columns", ")", "{", "foreach", "(", "get_object_vars", "(", "$", "this", ")", "as", "$", "potential_column", "=>", "$", "discard", ")", "{", "switch", "(...
Work out which columns should be saved down.
[ "Work", "out", "which", "columns", "should", "be", "saved", "down", "." ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L199-L233
199,207
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.save
public function save($automatic_reload = true) { // Run Pre-saver. $this->preSave(); // Run Field Fixer. $this->__fieldFix(); // Calculate row to save_down $this->__calculateSaveDownRows(); $primary_key_column = $this->getIDField(); // Make an array...
php
public function save($automatic_reload = true) { // Run Pre-saver. $this->preSave(); // Run Field Fixer. $this->__fieldFix(); // Calculate row to save_down $this->__calculateSaveDownRows(); $primary_key_column = $this->getIDField(); // Make an array...
[ "public", "function", "save", "(", "$", "automatic_reload", "=", "true", ")", "{", "// Run Pre-saver.", "$", "this", "->", "preSave", "(", ")", ";", "// Run Field Fixer.", "$", "this", "->", "__fieldFix", "(", ")", ";", "// Calculate row to save_down", "$", "t...
Save the selected record. This will do an INSERT or UPDATE as appropriate @param boolean $automatic_reload Whether or not to automatically reload @return ActiveRecord
[ "Save", "the", "selected", "record", ".", "This", "will", "do", "an", "INSERT", "or", "UPDATE", "as", "appropriate" ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L283-L349
199,208
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.reload
public function reload() { $item = $this->getById($this->getId()); if ($item !== false) { $this->loadFromRow($item); return $this; } else { return false; } }
php
public function reload() { $item = $this->getById($this->getId()); if ($item !== false) { $this->loadFromRow($item); return $this; } else { return false; } }
[ "public", "function", "reload", "(", ")", "{", "$", "item", "=", "$", "this", "->", "getById", "(", "$", "this", "->", "getId", "(", ")", ")", ";", "if", "(", "$", "item", "!==", "false", ")", "{", "$", "this", "->", "loadFromRow", "(", "$", "i...
Reload the selected record @return ActiveRecord|false
[ "Reload", "the", "selected", "record" ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L355-L364
199,209
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.delete
public function delete() { $database = DatabaseLayer::getInstance(); $delete = $database->delete($this->getTableName(), $this->getTableAlias()); $delete->setModel($this); $delete->condition($this->getIDField(), $this->getId()); $delete->execute($this->getClass()); /...
php
public function delete() { $database = DatabaseLayer::getInstance(); $delete = $database->delete($this->getTableName(), $this->getTableAlias()); $delete->setModel($this); $delete->condition($this->getIDField(), $this->getId()); $delete->execute($this->getClass()); /...
[ "public", "function", "delete", "(", ")", "{", "$", "database", "=", "DatabaseLayer", "::", "getInstance", "(", ")", ";", "$", "delete", "=", "$", "database", "->", "delete", "(", "$", "this", "->", "getTableName", "(", ")", ",", "$", "this", "->", "...
Delete the selected record @return boolean
[ "Delete", "the", "selected", "record" ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L369-L382
199,210
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.getBySlug
public static function getBySlug($slug) { $slug_parts = explode("-", $slug, 2); $class = get_called_class(); $temp_this = new $class(); $primary_key = $temp_this->getIDField(); return self::search()->where($primary_key, $slug_parts[0])->execOne(); }
php
public static function getBySlug($slug) { $slug_parts = explode("-", $slug, 2); $class = get_called_class(); $temp_this = new $class(); $primary_key = $temp_this->getIDField(); return self::search()->where($primary_key, $slug_parts[0])->execOne(); }
[ "public", "static", "function", "getBySlug", "(", "$", "slug", ")", "{", "$", "slug_parts", "=", "explode", "(", "\"-\"", ",", "$", "slug", ",", "2", ")", ";", "$", "class", "=", "get_called_class", "(", ")", ";", "$", "temp_this", "=", "new", "$", ...
Pull a database record by the slug we're given. @param $slug string Slug @return mixed
[ "Pull", "a", "database", "record", "by", "the", "slug", "we", "re", "given", "." ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L430-L437
199,211
Thruio/ActiveRecord
src/ActiveRecord.php
ActiveRecord.__fieldFix
public function __fieldFix() { $schema = $this->getClassSchema(); foreach ($this->__calculateSaveDownRows() as $column) { if (!isset($schema[$column]['type'])) { throw new Exception("No type hinting/docblock found for '{$column}' in '" . get_called_class() . "'.", E_USER_...
php
public function __fieldFix() { $schema = $this->getClassSchema(); foreach ($this->__calculateSaveDownRows() as $column) { if (!isset($schema[$column]['type'])) { throw new Exception("No type hinting/docblock found for '{$column}' in '" . get_called_class() . "'.", E_USER_...
[ "public", "function", "__fieldFix", "(", ")", "{", "$", "schema", "=", "$", "this", "->", "getClassSchema", "(", ")", ";", "foreach", "(", "$", "this", "->", "__calculateSaveDownRows", "(", ")", "as", "$", "column", ")", "{", "if", "(", "!", "isset", ...
Fix types of fields to match definition
[ "Fix", "types", "of", "fields", "to", "match", "definition" ]
90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461
https://github.com/Thruio/ActiveRecord/blob/90b0f838cd0e0fb7f3b56a0c38632ff08b3c3461/src/ActiveRecord.php#L500-L514
199,212
ingro/Rest
src/Ingruz/Rest/Controllers/RestDingoController.php
RestDingoController.respondNotFound
protected function respondNotFound($message = '') { if (empty($message)) { $message = ucfirst($this->baseClass).' does not exist'; } return $this->respondWithError($message, 404); }
php
protected function respondNotFound($message = '') { if (empty($message)) { $message = ucfirst($this->baseClass).' does not exist'; } return $this->respondWithError($message, 404); }
[ "protected", "function", "respondNotFound", "(", "$", "message", "=", "''", ")", "{", "if", "(", "empty", "(", "$", "message", ")", ")", "{", "$", "message", "=", "ucfirst", "(", "$", "this", "->", "baseClass", ")", ".", "' does not exist'", ";", "}", ...
Respond with an error in case the resource request is not found @param string $message @return Response
[ "Respond", "with", "an", "error", "in", "case", "the", "resource", "request", "is", "not", "found" ]
922bed071b8ea41feb067d97a3e283f944a86cb8
https://github.com/ingro/Rest/blob/922bed071b8ea41feb067d97a3e283f944a86cb8/src/Ingruz/Rest/Controllers/RestDingoController.php#L165-L173
199,213
phossa/phossa-shared
src/Phossa/Shared/Message/Loader/LanguageLoader.php
LanguageLoader.loadMessages
public function loadMessages(/*# string */ $className)/*# : array */ { $map = []; // reflect if (class_exists($className)) { $class = new \ReflectionClass($className); $file = $class->getFileName(); // language file 'Message.php' -> 'Message.zh_CN.php' ...
php
public function loadMessages(/*# string */ $className)/*# : array */ { $map = []; // reflect if (class_exists($className)) { $class = new \ReflectionClass($className); $file = $class->getFileName(); // language file 'Message.php' -> 'Message.zh_CN.php' ...
[ "public", "function", "loadMessages", "(", "/*# string */", "$", "className", ")", "/*# : array */", "{", "$", "map", "=", "[", "]", ";", "// reflect", "if", "(", "class_exists", "(", "$", "className", ")", ")", "{", "$", "class", "=", "new", "\\", "Refl...
Load language file from the same directory of message class. language file name is something like 'Message.zh_CN.php' {@inheritDoc}
[ "Load", "language", "file", "from", "the", "same", "directory", "of", "message", "class", "." ]
fcf140c09e94c3a441ee4e285de0b4c18cb6504b
https://github.com/phossa/phossa-shared/blob/fcf140c09e94c3a441ee4e285de0b4c18cb6504b/src/Phossa/Shared/Message/Loader/LanguageLoader.php#L85-L104
199,214
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Event/PreUpdateEventArgs.php
PreUpdateEventArgs.setNewValue
public function setNewValue($attribute, $value) { $this->assertValidAttribute($attribute); $this->documentChangeSet[$attribute][1] = $value; $this->getDocumentManager()->getUnitOfWork()->setDocumentChangeSet($this->getDocument(), $this->documentChangeSet); }
php
public function setNewValue($attribute, $value) { $this->assertValidAttribute($attribute); $this->documentChangeSet[$attribute][1] = $value; $this->getDocumentManager()->getUnitOfWork()->setDocumentChangeSet($this->getDocument(), $this->documentChangeSet); }
[ "public", "function", "setNewValue", "(", "$", "attribute", ",", "$", "value", ")", "{", "$", "this", "->", "assertValidAttribute", "(", "$", "attribute", ")", ";", "$", "this", "->", "documentChangeSet", "[", "$", "attribute", "]", "[", "1", "]", "=", ...
Sets the new value of this attribute. @param string $attribute @param mixed $value
[ "Sets", "the", "new", "value", "of", "this", "attribute", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Event/PreUpdateEventArgs.php#L84-L90
199,215
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Event/PreUpdateEventArgs.php
PreUpdateEventArgs.assertValidAttribute
private function assertValidAttribute($attribute) { if ( ! isset($this->documentChangeSet[$attribute])) { throw new \InvalidArgumentException(sprintf( 'Attribute "%s" is not a valid attribute of the document "%s" in PreUpdateEventArgs.', $attribute, ...
php
private function assertValidAttribute($attribute) { if ( ! isset($this->documentChangeSet[$attribute])) { throw new \InvalidArgumentException(sprintf( 'Attribute "%s" is not a valid attribute of the document "%s" in PreUpdateEventArgs.', $attribute, ...
[ "private", "function", "assertValidAttribute", "(", "$", "attribute", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "documentChangeSet", "[", "$", "attribute", "]", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf",...
Asserts the attribute exists in changeset. @param string $attribute @throws \InvalidArgumentException if the attribute has no changeset
[ "Asserts", "the", "attribute", "exists", "in", "changeset", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Event/PreUpdateEventArgs.php#L98-L107
199,216
shgysk8zer0/core_api
traits/path_info.php
Path_Info.getPathInfo
final public function getPathInfo($path, $use_include_path = false) { if ($use_include_path) { $path = stream_resolve_include_path($path); } else { $path = realpath($path); } if (is_string($path)) { list( $this->dirname, $this->basename, $this->extension, $this->filename ) = array_...
php
final public function getPathInfo($path, $use_include_path = false) { if ($use_include_path) { $path = stream_resolve_include_path($path); } else { $path = realpath($path); } if (is_string($path)) { list( $this->dirname, $this->basename, $this->extension, $this->filename ) = array_...
[ "final", "public", "function", "getPathInfo", "(", "$", "path", ",", "$", "use_include_path", "=", "false", ")", "{", "if", "(", "$", "use_include_path", ")", "{", "$", "path", "=", "stream_resolve_include_path", "(", "$", "path", ")", ";", "}", "else", ...
Retrieves information about path components @param string $path The path to work with @param bool $use_include_path Whether or not to search inclde_path @return void
[ "Retrieves", "information", "about", "path", "components" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/path_info.php#L79-L97
199,217
fxpio/fxp-doctrine-extensions
Filter/Listener/AbstractFilterSubscriber.php
AbstractFilterSubscriber.onEvent
public function onEvent(Event $event): void { if (!$event instanceof GetResponseEvent || !$this->injected) { if (null !== ($filter = $this->getFilter())) { $this->injectParameters($filter); } } }
php
public function onEvent(Event $event): void { if (!$event instanceof GetResponseEvent || !$this->injected) { if (null !== ($filter = $this->getFilter())) { $this->injectParameters($filter); } } }
[ "public", "function", "onEvent", "(", "Event", "$", "event", ")", ":", "void", "{", "if", "(", "!", "$", "event", "instanceof", "GetResponseEvent", "||", "!", "$", "this", "->", "injected", ")", "{", "if", "(", "null", "!==", "(", "$", "filter", "=",...
Action on the event. @param Event $event The event
[ "Action", "on", "the", "event", "." ]
82942f51d47cdd79a20a5725ee1b3ecfc69e9d77
https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Filter/Listener/AbstractFilterSubscriber.php#L65-L72
199,218
fxpio/fxp-doctrine-extensions
Filter/Listener/AbstractFilterSubscriber.php
AbstractFilterSubscriber.getFilter
protected function getFilter() { $supports = $this->supports(); $filters = $this->entityManager->getFilters()->getEnabledFilters(); $fFilter = null; foreach ($filters as $name => $filter) { if ($filter instanceof $supports) { $fFilter = $filter; ...
php
protected function getFilter() { $supports = $this->supports(); $filters = $this->entityManager->getFilters()->getEnabledFilters(); $fFilter = null; foreach ($filters as $name => $filter) { if ($filter instanceof $supports) { $fFilter = $filter; ...
[ "protected", "function", "getFilter", "(", ")", "{", "$", "supports", "=", "$", "this", "->", "supports", "(", ")", ";", "$", "filters", "=", "$", "this", "->", "entityManager", "->", "getFilters", "(", ")", "->", "getEnabledFilters", "(", ")", ";", "$...
Get the supported filter. @return null|SQLFilter
[ "Get", "the", "supported", "filter", "." ]
82942f51d47cdd79a20a5725ee1b3ecfc69e9d77
https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Filter/Listener/AbstractFilterSubscriber.php#L79-L94
199,219
Bistro/Router
lib/Bistro/Router/Route.php
Route.isMatch
public function isMatch($method, $url) { $match = false; if (\in_array($method, $this->responds_to)) { \preg_match($this->compile(), $url, $matches); if ( ! empty($matches)) { $this->matched_params = \array_merge( $this->defaults, $this->method_defaults[$method], $this->cleanMatches...
php
public function isMatch($method, $url) { $match = false; if (\in_array($method, $this->responds_to)) { \preg_match($this->compile(), $url, $matches); if ( ! empty($matches)) { $this->matched_params = \array_merge( $this->defaults, $this->method_defaults[$method], $this->cleanMatches...
[ "public", "function", "isMatch", "(", "$", "method", ",", "$", "url", ")", "{", "$", "match", "=", "false", ";", "if", "(", "\\", "in_array", "(", "$", "method", ",", "$", "this", "->", "responds_to", ")", ")", "{", "\\", "preg_match", "(", "$", ...
Check to see if this route is a match. @param string $method The request method @param string $url The accessed url @return boolean [description]
[ "Check", "to", "see", "if", "this", "route", "is", "a", "match", "." ]
ab5c3fff119c0e6c43c05300122b236afabfff41
https://github.com/Bistro/Router/blob/ab5c3fff119c0e6c43c05300122b236afabfff41/lib/Bistro/Router/Route.php#L66-L87
199,220
Bistro/Router
lib/Bistro/Router/Route.php
Route.url
public function url($params = array()) { if ($this->isStatic()) { return $this->pattern; } $url = $this->pattern; foreach ($this->getSegments($url) as $segment) { $func = $segment['optional'] === true ? 'replaceOptional' : 'replaceRequired'; $url = $this->{$func}($url, $segment['name'], $segment...
php
public function url($params = array()) { if ($this->isStatic()) { return $this->pattern; } $url = $this->pattern; foreach ($this->getSegments($url) as $segment) { $func = $segment['optional'] === true ? 'replaceOptional' : 'replaceRequired'; $url = $this->{$func}($url, $segment['name'], $segment...
[ "public", "function", "url", "(", "$", "params", "=", "array", "(", ")", ")", "{", "if", "(", "$", "this", "->", "isStatic", "(", ")", ")", "{", "return", "$", "this", "->", "pattern", ";", "}", "$", "url", "=", "$", "this", "->", "pattern", ";...
A reverse routing helper. @throws \UnexpectedValueException @param array $params Parameters to set named options to @return string
[ "A", "reverse", "routing", "helper", "." ]
ab5c3fff119c0e6c43c05300122b236afabfff41
https://github.com/Bistro/Router/blob/ab5c3fff119c0e6c43c05300122b236afabfff41/lib/Bistro/Router/Route.php#L145-L161
199,221
Bistro/Router
lib/Bistro/Router/Route.php
Route.compile
protected function compile() { if ($this->compiled !== false) { return $this->compiled; } if ($this->isStatic()) { $this->compiled = '~^'.$this->pattern.'$~'; return $this->compiled; } $compiled = $this->pattern; foreach ($this->getSegments($compiled) as $segment) { $compiled = \str_rep...
php
protected function compile() { if ($this->compiled !== false) { return $this->compiled; } if ($this->isStatic()) { $this->compiled = '~^'.$this->pattern.'$~'; return $this->compiled; } $compiled = $this->pattern; foreach ($this->getSegments($compiled) as $segment) { $compiled = \str_rep...
[ "protected", "function", "compile", "(", ")", "{", "if", "(", "$", "this", "->", "compiled", "!==", "false", ")", "{", "return", "$", "this", "->", "compiled", ";", "}", "if", "(", "$", "this", "->", "isStatic", "(", ")", ")", "{", "$", "this", "...
Compiles the pattern into one suitable for regex. @return string The regex pattern
[ "Compiles", "the", "pattern", "into", "one", "suitable", "for", "regex", "." ]
ab5c3fff119c0e6c43c05300122b236afabfff41
https://github.com/Bistro/Router/blob/ab5c3fff119c0e6c43c05300122b236afabfff41/lib/Bistro/Router/Route.php#L168-L189
199,222
Bistro/Router
lib/Bistro/Router/Route.php
Route.getSegments
protected function getSegments($pattern) { $segments = array(); $parts = \explode("/", ltrim($pattern, "/")); foreach ($parts as $segment) { if (\strpos($segment, ":") !== false) { $segments[] = $this->parseSegment($segment); } } return $segments; }
php
protected function getSegments($pattern) { $segments = array(); $parts = \explode("/", ltrim($pattern, "/")); foreach ($parts as $segment) { if (\strpos($segment, ":") !== false) { $segments[] = $this->parseSegment($segment); } } return $segments; }
[ "protected", "function", "getSegments", "(", "$", "pattern", ")", "{", "$", "segments", "=", "array", "(", ")", ";", "$", "parts", "=", "\\", "explode", "(", "\"/\"", ",", "ltrim", "(", "$", "pattern", ",", "\"/\"", ")", ")", ";", "foreach", "(", "...
Gets an array of url segments @param string $pattern The route pattern @return array An array containing url segments
[ "Gets", "an", "array", "of", "url", "segments" ]
ab5c3fff119c0e6c43c05300122b236afabfff41
https://github.com/Bistro/Router/blob/ab5c3fff119c0e6c43c05300122b236afabfff41/lib/Bistro/Router/Route.php#L197-L211
199,223
Bistro/Router
lib/Bistro/Router/Route.php
Route.parseSegment
protected function parseSegment($segment) { $optional = false; list($regex, $name) = \explode(":", $segment); if (\substr($name, -1) === "?") { $name = \substr($name, 0, -1); $optional = true; } if ($regex === "") { $regex = "[^\/]+"; } $regex = "/(?P<{$name}>{$regex})"; if ($optional...
php
protected function parseSegment($segment) { $optional = false; list($regex, $name) = \explode(":", $segment); if (\substr($name, -1) === "?") { $name = \substr($name, 0, -1); $optional = true; } if ($regex === "") { $regex = "[^\/]+"; } $regex = "/(?P<{$name}>{$regex})"; if ($optional...
[ "protected", "function", "parseSegment", "(", "$", "segment", ")", "{", "$", "optional", "=", "false", ";", "list", "(", "$", "regex", ",", "$", "name", ")", "=", "\\", "explode", "(", "\":\"", ",", "$", "segment", ")", ";", "if", "(", "\\", "subst...
Pulls out relevent information on a given segment. @param string $segment The segment @return array ['segment' => (string), name' => (string), 'regex' => (string), 'optional' => (boolean)]
[ "Pulls", "out", "relevent", "information", "on", "a", "given", "segment", "." ]
ab5c3fff119c0e6c43c05300122b236afabfff41
https://github.com/Bistro/Router/blob/ab5c3fff119c0e6c43c05300122b236afabfff41/lib/Bistro/Router/Route.php#L219-L250
199,224
Mandarin-Medien/MMCmfRoutingBundle
Controller/NodeRouteController.php
NodeRouteController.nodeRouteAction
public function nodeRouteAction(NodeRoute $nodeRoute) { if($node = $this->get('mm_cmf_routing.node_resolver')->resolve($nodeRoute)) { if ($nodeRoute instanceof RedirectNodeRoute) { return $this->redirectAction($nodeRoute); } else { if ($nodeRoute->g...
php
public function nodeRouteAction(NodeRoute $nodeRoute) { if($node = $this->get('mm_cmf_routing.node_resolver')->resolve($nodeRoute)) { if ($nodeRoute instanceof RedirectNodeRoute) { return $this->redirectAction($nodeRoute); } else { if ($nodeRoute->g...
[ "public", "function", "nodeRouteAction", "(", "NodeRoute", "$", "nodeRoute", ")", "{", "if", "(", "$", "node", "=", "$", "this", "->", "get", "(", "'mm_cmf_routing.node_resolver'", ")", "->", "resolve", "(", "$", "nodeRoute", ")", ")", "{", "if", "(", "$...
process the the node route call @param NodeRoute $nodeRoute @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response @throws NotFoundHttpException
[ "process", "the", "the", "node", "route", "call" ]
7db1b03f5e120bd473486c0be6ab76c6146cd2d0
https://github.com/Mandarin-Medien/MMCmfRoutingBundle/blob/7db1b03f5e120bd473486c0be6ab76c6146cd2d0/Controller/NodeRouteController.php#L28-L65
199,225
pdyn/base
Utils.php
Utils.genRandomStr
public static function genRandomStr($l) { $p = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $s = ''; for ($i = 0; $i < $l; $i++) { $s .= $p[mt_rand(0, (mb_strlen($p) - 1))]; } return $s; }
php
public static function genRandomStr($l) { $p = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $s = ''; for ($i = 0; $i < $l; $i++) { $s .= $p[mt_rand(0, (mb_strlen($p) - 1))]; } return $s; }
[ "public", "static", "function", "genRandomStr", "(", "$", "l", ")", "{", "$", "p", "=", "'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'", ";", "$", "s", "=", "''", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "l", ";", ...
Generate a random string of letters and numbers of a specific length. @param int $l The desired length of the string. @return string The generated string.
[ "Generate", "a", "random", "string", "of", "letters", "and", "numbers", "of", "a", "specific", "length", "." ]
0b93961693954a6b4e1c6df7e345e5cdf07f26ff
https://github.com/pdyn/base/blob/0b93961693954a6b4e1c6df7e345e5cdf07f26ff/Utils.php#L41-L48
199,226
pdyn/base
Utils.php
Utils.uniqid
public static function uniqid($length = false) { if ($length <= 13) { return uniqid(); } $uniq = strrev(str_replace('.', '', uniqid('', true))); $uniqlen = mb_strlen($uniq); if ($length === false || $length === $uniqlen) { return $uniq; } elseif ($length < $uniqlen) { return mb_substr($uniq, 0, $le...
php
public static function uniqid($length = false) { if ($length <= 13) { return uniqid(); } $uniq = strrev(str_replace('.', '', uniqid('', true))); $uniqlen = mb_strlen($uniq); if ($length === false || $length === $uniqlen) { return $uniq; } elseif ($length < $uniqlen) { return mb_substr($uniq, 0, $le...
[ "public", "static", "function", "uniqid", "(", "$", "length", "=", "false", ")", "{", "if", "(", "$", "length", "<=", "13", ")", "{", "return", "uniqid", "(", ")", ";", "}", "$", "uniq", "=", "strrev", "(", "str_replace", "(", "'.'", ",", "''", "...
Generate a guaranteed unique value of a specified length. @param int|bool $length A desired length, or false to use uniqid length. @return string The unique string.
[ "Generate", "a", "guaranteed", "unique", "value", "of", "a", "specified", "length", "." ]
0b93961693954a6b4e1c6df7e345e5cdf07f26ff
https://github.com/pdyn/base/blob/0b93961693954a6b4e1c6df7e345e5cdf07f26ff/Utils.php#L55-L68
199,227
Vectrex/vxPHP
src/Autoload/Psr4.php
Psr4.addPrefix
public function addPrefix($prefix, $baseDirs, $prepend = FALSE) { $baseDirs = (array) $baseDirs; // normalize the namespace prefix $prefix = trim($prefix, '\\') . '\\'; // initialize the namespace prefix array if needed if (! isset($this->prefixes[$prefix])) { $this->prefixes[$prefix] = []; } ...
php
public function addPrefix($prefix, $baseDirs, $prepend = FALSE) { $baseDirs = (array) $baseDirs; // normalize the namespace prefix $prefix = trim($prefix, '\\') . '\\'; // initialize the namespace prefix array if needed if (! isset($this->prefixes[$prefix])) { $this->prefixes[$prefix] = []; } ...
[ "public", "function", "addPrefix", "(", "$", "prefix", ",", "$", "baseDirs", ",", "$", "prepend", "=", "FALSE", ")", "{", "$", "baseDirs", "=", "(", "array", ")", "$", "baseDirs", ";", "// normalize the namespace prefix", "$", "prefix", "=", "trim", "(", ...
add a base directory for a namespace prefix @param string $prefix @param string|array $baseDirs: one or more base directories for the namespace prefix @param bool $prepend: if true, prepend base directories to prefix instead of appending them; this causes them to be searched first rather than last. @return void
[ "add", "a", "base", "directory", "for", "a", "namespace", "prefix" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Autoload/Psr4.php#L100-L124
199,228
Vectrex/vxPHP
src/Autoload/Psr4.php
Psr4.setPrefixes
public function setPrefixes(array $prefixes) { $this->prefixes = []; foreach ($prefixes as $prefix => $baseDir) { $this->addPrefix($prefix, $baseDir); } }
php
public function setPrefixes(array $prefixes) { $this->prefixes = []; foreach ($prefixes as $prefix => $baseDir) { $this->addPrefix($prefix, $baseDir); } }
[ "public", "function", "setPrefixes", "(", "array", "$", "prefixes", ")", "{", "$", "this", "->", "prefixes", "=", "[", "]", ";", "foreach", "(", "$", "prefixes", "as", "$", "prefix", "=>", "$", "baseDir", ")", "{", "$", "this", "->", "addPrefix", "("...
set all namespace prefixes and their base directories; overwrites existing prefixes @param array $prefixes: associative array of namespace prefixes and their base directories @return void
[ "set", "all", "namespace", "prefixes", "and", "their", "base", "directories", ";", "overwrites", "existing", "prefixes" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Autoload/Psr4.php#L134-L139
199,229
Vectrex/vxPHP
src/Autoload/Psr4.php
Psr4.loadFile
protected function loadFile($prefix, $relativeClass) { // any base directories for this namespace prefix? if (!isset($this->prefixes[$prefix])) { $this->debug[] = $prefix . ': no base dirs'; return FALSE; } // search base directories for this namespace prefix foreach($this->prefixes[$prefix] as $bas...
php
protected function loadFile($prefix, $relativeClass) { // any base directories for this namespace prefix? if (!isset($this->prefixes[$prefix])) { $this->debug[] = $prefix . ': no base dirs'; return FALSE; } // search base directories for this namespace prefix foreach($this->prefixes[$prefix] as $bas...
[ "protected", "function", "loadFile", "(", "$", "prefix", ",", "$", "relativeClass", ")", "{", "// any base directories for this namespace prefix?", "if", "(", "!", "isset", "(", "$", "this", "->", "prefixes", "[", "$", "prefix", "]", ")", ")", "{", "$", "thi...
loads mapped file for a namespace prefix and relative class @param string $prefix @param string $relativeClass @return mixed name of mapped file that was loaded or FALSE if file could not be loaded
[ "loads", "mapped", "file", "for", "a", "namespace", "prefix", "and", "relative", "class" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Autoload/Psr4.php#L278-L316
199,230
Ydle/HubBundle
Controller/NodesController.php
NodesController.nodesFormAction
public function nodesFormAction(Request $request) { $node = new Node(); // Manage edition mode $this->currentNode = $request->get('node'); if ($this->currentNode) { $node = $this->get("ydle.node.manager")->find($request->get('node')); } $action = $this->ge...
php
public function nodesFormAction(Request $request) { $node = new Node(); // Manage edition mode $this->currentNode = $request->get('node'); if ($this->currentNode) { $node = $this->get("ydle.node.manager")->find($request->get('node')); } $action = $this->ge...
[ "public", "function", "nodesFormAction", "(", "Request", "$", "request", ")", "{", "$", "node", "=", "new", "Node", "(", ")", ";", "// Manage edition mode", "$", "this", "->", "currentNode", "=", "$", "request", "->", "get", "(", "'node'", ")", ";", "if"...
Display a form to create or edit a node. @param Request $request
[ "Display", "a", "form", "to", "create", "or", "edit", "a", "node", "." ]
7fa423241246bcfd115f2ed3ad3997b4b63adb01
https://github.com/Ydle/HubBundle/blob/7fa423241246bcfd115f2ed3ad3997b4b63adb01/Controller/NodesController.php#L40-L58
199,231
squareproton/Bond
src/Bond/RecordManager/Task.php
Task.setObject
public function setObject( $object, $throwExceptionOnFailure = true ) { // tasks only work on objects if( !is_object($object) ) { throw new BadTaskException("A task must be object"); return false; } $error = null; if( $isCompatible = static::isCompa...
php
public function setObject( $object, $throwExceptionOnFailure = true ) { // tasks only work on objects if( !is_object($object) ) { throw new BadTaskException("A task must be object"); return false; } $error = null; if( $isCompatible = static::isCompa...
[ "public", "function", "setObject", "(", "$", "object", ",", "$", "throwExceptionOnFailure", "=", "true", ")", "{", "// tasks only work on objects", "if", "(", "!", "is_object", "(", "$", "object", ")", ")", "{", "throw", "new", "BadTaskException", "(", "\"A ta...
Set a task's object property @param object $object @param booly Throw exception if the even we can't set the object @return Were we able to set this property
[ "Set", "a", "task", "s", "object", "property" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Task.php#L75-L96
199,232
ezra-obiwale/dSCore
src/Core/AInjector.php
AInjector.getConfigInject
protected function getConfigInject($type) { switch (strtolower($type)) { case 'all': case 'a': return engineGet('inject', 'all'); case 'controllers': case 'controller': case 'c': return array_merge(engineGet('inject', 'a...
php
protected function getConfigInject($type) { switch (strtolower($type)) { case 'all': case 'a': return engineGet('inject', 'all'); case 'controllers': case 'controller': case 'c': return array_merge(engineGet('inject', 'a...
[ "protected", "function", "getConfigInject", "(", "$", "type", ")", "{", "switch", "(", "strtolower", "(", "$", "type", ")", ")", "{", "case", "'all'", ":", "case", "'a'", ":", "return", "engineGet", "(", "'inject'", ",", "'all'", ")", ";", "case", "'co...
Fetches classes to inject from the config file. If given type is not "all", the required is merged with the "all" @param string $type all, controllers|controller|c,services|service|s, views|view|v @return array
[ "Fetches", "classes", "to", "inject", "from", "the", "config", "file", ".", "If", "given", "type", "is", "not", "all", "the", "required", "is", "merged", "with", "the", "all" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AInjector.php#L45-L63
199,233
ezra-obiwale/dSCore
src/Core/AInjector.php
AInjector.checkInjections
final public function checkInjections($className) { if (is_array($this->inject())) { foreach ($this->inject() as $classArray) { if (!is_array($classArray) || (is_array($classArray) && !isset($classArray['class'])) || (is_array($classArr...
php
final public function checkInjections($className) { if (is_array($this->inject())) { foreach ($this->inject() as $classArray) { if (!is_array($classArray) || (is_array($classArray) && !isset($classArray['class'])) || (is_array($classArr...
[ "final", "public", "function", "checkInjections", "(", "$", "className", ")", "{", "if", "(", "is_array", "(", "$", "this", "->", "inject", "(", ")", ")", ")", "{", "foreach", "(", "$", "this", "->", "inject", "(", ")", "as", "$", "classArray", ")", ...
Checks the injection for cyclic dependencies @param string $className @return boolean
[ "Checks", "the", "injection", "for", "cyclic", "dependencies" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AInjector.php#L77-L94
199,234
ezra-obiwale/dSCore
src/Core/AInjector.php
AInjector.canInject
private function canInject(array $classArray, $className = null) { $className = ($className === null) ? $this->getClass() : $className; if (!self::addInjecting($className)) { return false; } $refClass = new \ReflectionClass($classArray['class']); if ($refClass->isS...
php
private function canInject(array $classArray, $className = null) { $className = ($className === null) ? $this->getClass() : $className; if (!self::addInjecting($className)) { return false; } $refClass = new \ReflectionClass($classArray['class']); if ($refClass->isS...
[ "private", "function", "canInject", "(", "array", "$", "classArray", ",", "$", "className", "=", "null", ")", "{", "$", "className", "=", "(", "$", "className", "===", "null", ")", "?", "$", "this", "->", "getClass", "(", ")", ":", "$", "className", ...
Checks if the class can be injected @param array $classArray @param string|null $className @return boolean
[ "Checks", "if", "the", "class", "can", "be", "injected" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AInjector.php#L114-L134
199,235
ezra-obiwale/dSCore
src/Core/AInjector.php
AInjector.doInject
private function doInject() { foreach ($this->prepareInject() as $alias => $classArray) { if (!is_array($classArray)) { throw new \Exception('Injection failed. Values of injection array in class "' . $this->getClass() . '" must be an array'); } ...
php
private function doInject() { foreach ($this->prepareInject() as $alias => $classArray) { if (!is_array($classArray)) { throw new \Exception('Injection failed. Values of injection array in class "' . $this->getClass() . '" must be an array'); } ...
[ "private", "function", "doInject", "(", ")", "{", "foreach", "(", "$", "this", "->", "prepareInject", "(", ")", "as", "$", "alias", "=>", "$", "classArray", ")", "{", "if", "(", "!", "is_array", "(", "$", "classArray", ")", ")", "{", "throw", "new", ...
Performs the actual injection @throws \Exception
[ "Performs", "the", "actual", "injection" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AInjector.php#L140-L168
199,236
Danack/Weaver
src/Weaver/CompositeWeaveGenerator.php
CompositeWeaveGenerator.addPropertiesAndConstantsForContainer
private function addPropertiesAndConstantsForContainer() { $this->addPropertiesAndConstantsFromReflection($this->containerClassReflection); foreach ($this->compositeClassReflectionArray as $compositeClassReflection) { $paramName = $this->getComponentName($compositeClassReflection); ...
php
private function addPropertiesAndConstantsForContainer() { $this->addPropertiesAndConstantsFromReflection($this->containerClassReflection); foreach ($this->compositeClassReflectionArray as $compositeClassReflection) { $paramName = $this->getComponentName($compositeClassReflection); ...
[ "private", "function", "addPropertiesAndConstantsForContainer", "(", ")", "{", "$", "this", "->", "addPropertiesAndConstantsFromReflection", "(", "$", "this", "->", "containerClassReflection", ")", ";", "foreach", "(", "$", "this", "->", "compositeClassReflectionArray", ...
Adds the properties and constants from the decorating class to the class being weaved. @internal param $originalSourceClass
[ "Adds", "the", "properties", "and", "constants", "from", "the", "decorating", "class", "to", "the", "class", "being", "weaved", "." ]
414894cd397daff22d2c71e4988784a1f71b702e
https://github.com/Danack/Weaver/blob/414894cd397daff22d2c71e4988784a1f71b702e/src/Weaver/CompositeWeaveGenerator.php#L263-L271
199,237
AdamB7586/menu-builder
src/Builder/Link.php
Link.title
public static function title($link) { if(isset($link['title']) || isset($link['label'])){ return ' title="'.trim(isset($link['title']) && !empty(trim($link['title'])) ? $link['title'] : $link['label']).'"'; } return false; }
php
public static function title($link) { if(isset($link['title']) || isset($link['label'])){ return ' title="'.trim(isset($link['title']) && !empty(trim($link['title'])) ? $link['title'] : $link['label']).'"'; } return false; }
[ "public", "static", "function", "title", "(", "$", "link", ")", "{", "if", "(", "isset", "(", "$", "link", "[", "'title'", "]", ")", "||", "isset", "(", "$", "link", "[", "'label'", "]", ")", ")", "{", "return", "' title=\"'", ".", "trim", "(", "...
Returns the HTML title element @param array $link This should be an array containing all of the set link values @return string
[ "Returns", "the", "HTML", "title", "element" ]
dbc192bca7d59475068c19d1a07a039e5f997ee4
https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Link.php#L32-L37
199,238
AdamB7586/menu-builder
src/Builder/Link.php
Link.label
public static function label($link) { if(isset($link['label']) && !empty(trim($link['label']))) { return trim($link['label']); } elseif(isset($link['title']) && !empty(trim($link['title']))) { return trim($link['title']); } return false; }
php
public static function label($link) { if(isset($link['label']) && !empty(trim($link['label']))) { return trim($link['label']); } elseif(isset($link['title']) && !empty(trim($link['title']))) { return trim($link['title']); } return false; }
[ "public", "static", "function", "label", "(", "$", "link", ")", "{", "if", "(", "isset", "(", "$", "link", "[", "'label'", "]", ")", "&&", "!", "empty", "(", "trim", "(", "$", "link", "[", "'label'", "]", ")", ")", ")", "{", "return", "trim", "...
Returns the link label element @param array $link This should be an array containing all of the set link values @return string Returns a valid string from the link label
[ "Returns", "the", "link", "label", "element" ]
dbc192bca7d59475068c19d1a07a039e5f997ee4
https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Link.php#L68-L76
199,239
AdamB7586/menu-builder
src/Builder/Link.php
Link.href
public static function href($link) { if(isset($link['uri']) || isset($link['fragment'])) { return ' href="'.URI::getHref($link).'"'; } return false; }
php
public static function href($link) { if(isset($link['uri']) || isset($link['fragment'])) { return ' href="'.URI::getHref($link).'"'; } return false; }
[ "public", "static", "function", "href", "(", "$", "link", ")", "{", "if", "(", "isset", "(", "$", "link", "[", "'uri'", "]", ")", "||", "isset", "(", "$", "link", "[", "'fragment'", "]", ")", ")", "{", "return", "' href=\"'", ".", "URI", "::", "g...
Returns the link href element @param array $link This should be an array containing all of the set link values @return string|false Returns the HTML href element if the uri or fragment information is set
[ "Returns", "the", "link", "href", "element" ]
dbc192bca7d59475068c19d1a07a039e5f997ee4
https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Link.php#L83-L88
199,240
AdamB7586/menu-builder
src/Builder/Link.php
Link.htmlClass
public static function htmlClass($class, $activeClass) { if((isset($class) && is_string($class) && !empty(trim($class))) || (is_string($activeClass) && !empty(trim($activeClass)))) { return ' class="'.trim(trim($class).' '.$activeClass).'"'; } return false; }
php
public static function htmlClass($class, $activeClass) { if((isset($class) && is_string($class) && !empty(trim($class))) || (is_string($activeClass) && !empty(trim($activeClass)))) { return ' class="'.trim(trim($class).' '.$activeClass).'"'; } return false; }
[ "public", "static", "function", "htmlClass", "(", "$", "class", ",", "$", "activeClass", ")", "{", "if", "(", "(", "isset", "(", "$", "class", ")", "&&", "is_string", "(", "$", "class", ")", "&&", "!", "empty", "(", "trim", "(", "$", "class", ")", ...
Returns the HTML class element @param string $class Should be a string containing the classes to add @param string $activeClass If the link is active the active class will be set else will be empty @return string|false If element is set and is valid will return the HTML element else return false
[ "Returns", "the", "HTML", "class", "element" ]
dbc192bca7d59475068c19d1a07a039e5f997ee4
https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Link.php#L96-L101
199,241
AdamB7586/menu-builder
src/Builder/Link.php
Link.htmlID
public static function htmlID($link) { if(isset($link['id']) && is_string($link['id']) && !empty(trim($link['id']))) { return ' id="'.trim($link['id']).'"'; } return false; }
php
public static function htmlID($link) { if(isset($link['id']) && is_string($link['id']) && !empty(trim($link['id']))) { return ' id="'.trim($link['id']).'"'; } return false; }
[ "public", "static", "function", "htmlID", "(", "$", "link", ")", "{", "if", "(", "isset", "(", "$", "link", "[", "'id'", "]", ")", "&&", "is_string", "(", "$", "link", "[", "'id'", "]", ")", "&&", "!", "empty", "(", "trim", "(", "$", "link", "[...
Returns the HTML id element @param array $link This should be an array containing all of the set link values @return string|false If element is set and is valid will return the HTML element else return false
[ "Returns", "the", "HTML", "id", "element" ]
dbc192bca7d59475068c19d1a07a039e5f997ee4
https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Link.php#L108-L113
199,242
AdamB7586/menu-builder
src/Builder/Link.php
Link.fontIcon
public static function fontIcon($link){ if(isset($link['font-icon']) && is_string($link['font-icon']) && !empty(trim($link['font-icon']))){ return '<span class="'.trim($link['font-icon']).'"></span> '; } return false; }
php
public static function fontIcon($link){ if(isset($link['font-icon']) && is_string($link['font-icon']) && !empty(trim($link['font-icon']))){ return '<span class="'.trim($link['font-icon']).'"></span> '; } return false; }
[ "public", "static", "function", "fontIcon", "(", "$", "link", ")", "{", "if", "(", "isset", "(", "$", "link", "[", "'font-icon'", "]", ")", "&&", "is_string", "(", "$", "link", "[", "'font-icon'", "]", ")", "&&", "!", "empty", "(", "trim", "(", "$"...
Inserts a given font ion in a span class @param array $link This should be an array containing all of the set link values @return string|boolean If the font icon is set will return a string else will return false
[ "Inserts", "a", "given", "font", "ion", "in", "a", "span", "class" ]
dbc192bca7d59475068c19d1a07a039e5f997ee4
https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Link.php#L120-L125
199,243
AdamB7586/menu-builder
src/Builder/Link.php
Link.formatLink
public static function formatLink($link, $activeClass, $hasChild = false, $breadcrumbLink = false) { return "<a".self::href($link).self::title($link).self::htmlClass(($breadcrumbLink ? '' : self::$linkDefaults['a_default'].' ').(isset($link['class']) ? $link['class'] : ''), $activeClass).self::target($link).sel...
php
public static function formatLink($link, $activeClass, $hasChild = false, $breadcrumbLink = false) { return "<a".self::href($link).self::title($link).self::htmlClass(($breadcrumbLink ? '' : self::$linkDefaults['a_default'].' ').(isset($link['class']) ? $link['class'] : ''), $activeClass).self::target($link).sel...
[ "public", "static", "function", "formatLink", "(", "$", "link", ",", "$", "activeClass", ",", "$", "hasChild", "=", "false", ",", "$", "breadcrumbLink", "=", "false", ")", "{", "return", "\"<a\"", ".", "self", "::", "href", "(", "$", "link", ")", ".", ...
Returns a formatted link with all of the attributes @param array $link This should be an array containing all of the set link values @param string $activeClass If the link is active should have the active class string set else should be empty @param boolean If the element has any child elements set to true else set to ...
[ "Returns", "a", "formatted", "link", "with", "all", "of", "the", "attributes" ]
dbc192bca7d59475068c19d1a07a039e5f997ee4
https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Link.php#L134-L136
199,244
Innmind/Colour
src/HSLA.php
HSLA.hueToPoint
private function hueToPoint(float $p, float $q, float $t): float { if ($t < 0) { $t += 1; } if ($t > 1) { $t -= 1; } switch (true) { case $t < 1 / 6: return $p + ($q - $p) * 6 * $t; case $t < 1 / 2: ...
php
private function hueToPoint(float $p, float $q, float $t): float { if ($t < 0) { $t += 1; } if ($t > 1) { $t -= 1; } switch (true) { case $t < 1 / 6: return $p + ($q - $p) * 6 * $t; case $t < 1 / 2: ...
[ "private", "function", "hueToPoint", "(", "float", "$", "p", ",", "float", "$", "q", ",", "float", "$", "t", ")", ":", "float", "{", "if", "(", "$", "t", "<", "0", ")", "{", "$", "t", "+=", "1", ";", "}", "if", "(", "$", "t", ">", "1", ")...
Formula taken from the internet, don't know what it means @param float $p Don't know what it represents @param float $q Don't know what it represents @param float $t Don't know what it represents @return float
[ "Formula", "taken", "from", "the", "internet", "don", "t", "know", "what", "it", "means" ]
7fcddde00d74aba6bce6af4e4d70f323b9267f70
https://github.com/Innmind/Colour/blob/7fcddde00d74aba6bce6af4e4d70f323b9267f70/src/HSLA.php#L246-L268
199,245
WellCommerce/LocaleBundle
Doctrine/ORM/Filter/LocaleFilter.php
LocaleFilter.addFilterConstraint
public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) { if (!$targetEntity->reflClass->implementsInterface(\WellCommerce\Bundle\LocaleBundle\Entity\LocaleAwareInterface::class)) { return ""; } return $targetTableAlias . '.locale = ' . $this->getPara...
php
public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) { if (!$targetEntity->reflClass->implementsInterface(\WellCommerce\Bundle\LocaleBundle\Entity\LocaleAwareInterface::class)) { return ""; } return $targetTableAlias . '.locale = ' . $this->getPara...
[ "public", "function", "addFilterConstraint", "(", "ClassMetadata", "$", "targetEntity", ",", "$", "targetTableAlias", ")", "{", "if", "(", "!", "$", "targetEntity", "->", "reflClass", "->", "implementsInterface", "(", "\\", "WellCommerce", "\\", "Bundle", "\\", ...
Adds locale filter to query @param ClassMetadata $targetEntity @param string $targetTableAlias @return string
[ "Adds", "locale", "filter", "to", "query" ]
da61e059b789ccc748fd3cb0e881780fe6e6d3c6
https://github.com/WellCommerce/LocaleBundle/blob/da61e059b789ccc748fd3cb0e881780fe6e6d3c6/Doctrine/ORM/Filter/LocaleFilter.php#L33-L40
199,246
bseddon/XPath20
Iterator/FollowingNodeIterator.php
FollowingNodeIterator.fromFollowingNodeIteratorParts
protected function fromFollowingNodeIteratorParts() { if ( is_null( $this->typeTest ) ) { if ( is_null( $this->nameTest ) ) $this->kind = XPathNodeType::All; else $this->kind = XPathNodeType::Element; } else $this->kind = $this->typeTest->GetNodeKind(); }
php
protected function fromFollowingNodeIteratorParts() { if ( is_null( $this->typeTest ) ) { if ( is_null( $this->nameTest ) ) $this->kind = XPathNodeType::All; else $this->kind = XPathNodeType::Element; } else $this->kind = $this->typeTest->GetNodeKind(); }
[ "protected", "function", "fromFollowingNodeIteratorParts", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "typeTest", ")", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "nameTest", ")", ")", "$", "this", "->", "kind", "=", "XPat...
Supports constructing an instance
[ "Supports", "constructing", "an", "instance" ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/Iterator/FollowingNodeIterator.php#L70-L81
199,247
FlexModel/FlexModelBundle
DependencyInjection/FlexModelFactory.php
FlexModelFactory.createFlexModel
public static function createFlexModel($identifier, $resource, $cachePath) { $domDocument = new DOMDocument('1.0', 'UTF-8'); $domDocument->load($resource); $domDocument->xinclude(); $flexModel = new FlexModel($identifier); $flexModel->load($domDocument, $cachePath); ...
php
public static function createFlexModel($identifier, $resource, $cachePath) { $domDocument = new DOMDocument('1.0', 'UTF-8'); $domDocument->load($resource); $domDocument->xinclude(); $flexModel = new FlexModel($identifier); $flexModel->load($domDocument, $cachePath); ...
[ "public", "static", "function", "createFlexModel", "(", "$", "identifier", ",", "$", "resource", ",", "$", "cachePath", ")", "{", "$", "domDocument", "=", "new", "DOMDocument", "(", "'1.0'", ",", "'UTF-8'", ")", ";", "$", "domDocument", "->", "load", "(", ...
Creates a new FlexModel instance. @param string $identifier @param string $resource @param string $cachePath @return FlexModel
[ "Creates", "a", "new", "FlexModel", "instance", "." ]
7b4720d25b0dc6baf29b1da8ad7c67dfb2686460
https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/DependencyInjection/FlexModelFactory.php#L24-L34
199,248
ComPHPPuebla/restful-extensions
src/ComPHPPuebla/Slim/Middleware/JsonpMiddleware.php
JsonpMiddleware.call
public function call() { if ('application/json' !== $this->app->request()->headers('Accept')) { $this->next->call(); return; //Only JSON can be turned into JSONP } $callback = $this->app->request()->get('callback'); $this->next->call(); if (empty(...
php
public function call() { if ('application/json' !== $this->app->request()->headers('Accept')) { $this->next->call(); return; //Only JSON can be turned into JSONP } $callback = $this->app->request()->get('callback'); $this->next->call(); if (empty(...
[ "public", "function", "call", "(", ")", "{", "if", "(", "'application/json'", "!==", "$", "this", "->", "app", "->", "request", "(", ")", "->", "headers", "(", "'Accept'", ")", ")", "{", "$", "this", "->", "next", "->", "call", "(", ")", ";", "retu...
Adjust the content type accordingly and add the given callback name to the response for JSONP requests @see \Slim\Middleware::call()
[ "Adjust", "the", "content", "type", "accordingly", "and", "add", "the", "given", "callback", "name", "to", "the", "response", "for", "JSONP", "requests" ]
3dc5e554d7ebe1305eed4cd4ec71a6944316199c
https://github.com/ComPHPPuebla/restful-extensions/blob/3dc5e554d7ebe1305eed4cd4ec71a6944316199c/src/ComPHPPuebla/Slim/Middleware/JsonpMiddleware.php#L14-L35
199,249
itcreator/custom-cmf
Module/System/src/Cmf/System/Controller/RedirectController.php
RedirectController.defaultAction
public function defaultAction() { $lng = \Cmf\Language\Factory::get($this); HelperFactory::getMeta()->clear(); HelperFactory::getJS()->clear(); HelperFactory::getStyle()->clear(); HelperFactory::getTitle()->setTitle('Redirect'); if ($path = urldecode(Application::getR...
php
public function defaultAction() { $lng = \Cmf\Language\Factory::get($this); HelperFactory::getMeta()->clear(); HelperFactory::getJS()->clear(); HelperFactory::getStyle()->clear(); HelperFactory::getTitle()->setTitle('Redirect'); if ($path = urldecode(Application::getR...
[ "public", "function", "defaultAction", "(", ")", "{", "$", "lng", "=", "\\", "Cmf", "\\", "Language", "\\", "Factory", "::", "get", "(", "$", "this", ")", ";", "HelperFactory", "::", "getMeta", "(", ")", "->", "clear", "(", ")", ";", "HelperFactory", ...
This method display redirect page @return array
[ "This", "method", "display", "redirect", "page" ]
42fc0535dfa0f641856f06673f6ab596b2020c40
https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/System/src/Cmf/System/Controller/RedirectController.php#L26-L41
199,250
stubbles/stubbles-dbal
src/main/php/config/DatabaseConfiguration.php
DatabaseConfiguration.fromArray
public static function fromArray(string $id, string $dsn, array $properties): DatabaseConfiguration { $self = new self($id, $dsn); if (isset($properties['username'])) { $self->userName = $properties['username']; unset($properties['username']); } if (isset($pr...
php
public static function fromArray(string $id, string $dsn, array $properties): DatabaseConfiguration { $self = new self($id, $dsn); if (isset($properties['username'])) { $self->userName = $properties['username']; unset($properties['username']); } if (isset($pr...
[ "public", "static", "function", "fromArray", "(", "string", "$", "id", ",", "string", "$", "dsn", ",", "array", "$", "properties", ")", ":", "DatabaseConfiguration", "{", "$", "self", "=", "new", "self", "(", "$", "id", ",", "$", "dsn", ")", ";", "if...
create connection data instance from an array Please note that this method does not support driver options. Driver options must be set separately. @param string $id @param string $dsn @param array $properties @return \stubbles\db\config\DatabaseConfiguration
[ "create", "connection", "data", "instance", "from", "an", "array" ]
b42a589025a9e511b40a2798ac84df94d6451c36
https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/config/DatabaseConfiguration.php#L82-L107
199,251
aztech-digital/phinject
src/ObjectContainer.php
ObjectContainer.lateBind
public function lateBind($key, & $item) { if (is_array($item)) { return $this->classes[$key] = $item; } return $this->registry->rset($key, $item); }
php
public function lateBind($key, & $item) { if (is_array($item)) { return $this->classes[$key] = $item; } return $this->registry->rset($key, $item); }
[ "public", "function", "lateBind", "(", "$", "key", ",", "&", "$", "item", ")", "{", "if", "(", "is_array", "(", "$", "item", ")", ")", "{", "return", "$", "this", "->", "classes", "[", "$", "key", "]", "=", "$", "item", ";", "}", "return", "$",...
Binds by reference an existing object or an object definition to a key in the container. @param string $key The key to which the new object/definition should be bound. @param mixed $item An array or an object to bind. If $item is an object, it will be registered as a singleton in the object registry. Otherwise, $item ...
[ "Binds", "by", "reference", "an", "existing", "object", "or", "an", "object", "definition", "to", "a", "key", "in", "the", "container", "." ]
1bb2fb3b5ef44e62f168af71134c613c48b58d95
https://github.com/aztech-digital/phinject/blob/1bb2fb3b5ef44e62f168af71134c613c48b58d95/src/ObjectContainer.php#L133-L140
199,252
jbouzekri/SculpinTagCloudBundle
Model/TagCloud.php
TagCloud.current
public function current() { $keys = array_keys($this->tags); return $this->tags[$keys[$this->position]]; }
php
public function current() { $keys = array_keys($this->tags); return $this->tags[$keys[$this->position]]; }
[ "public", "function", "current", "(", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "this", "->", "tags", ")", ";", "return", "$", "this", "->", "tags", "[", "$", "keys", "[", "$", "this", "->", "position", "]", "]", ";", "}" ]
Iterator current item @return \Jb\Bundle\TagCloudBundle\Model\Tag
[ "Iterator", "current", "item" ]
936cf34ce60cb8fb4774931b1841fc775a3e9208
https://github.com/jbouzekri/SculpinTagCloudBundle/blob/936cf34ce60cb8fb4774931b1841fc775a3e9208/Model/TagCloud.php#L125-L129
199,253
jbouzekri/SculpinTagCloudBundle
Model/TagCloud.php
TagCloud.valid
public function valid() { $keys = array_keys($this->tags); return isset($keys[$this->position]) && isset($this->tags[$keys[$this->position]]); }
php
public function valid() { $keys = array_keys($this->tags); return isset($keys[$this->position]) && isset($this->tags[$keys[$this->position]]); }
[ "public", "function", "valid", "(", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "this", "->", "tags", ")", ";", "return", "isset", "(", "$", "keys", "[", "$", "this", "->", "position", "]", ")", "&&", "isset", "(", "$", "this", "->", "tag...
Iterator item exists @return boolean
[ "Iterator", "item", "exists" ]
936cf34ce60cb8fb4774931b1841fc775a3e9208
https://github.com/jbouzekri/SculpinTagCloudBundle/blob/936cf34ce60cb8fb4774931b1841fc775a3e9208/Model/TagCloud.php#L156-L160
199,254
jbouzekri/SculpinTagCloudBundle
Model/TagCloud.php
TagCloud.slice
public function slice($offset, $length = null) { $this->tags = array_slice($this->tags, $offset, $length, true); return $this; }
php
public function slice($offset, $length = null) { $this->tags = array_slice($this->tags, $offset, $length, true); return $this; }
[ "public", "function", "slice", "(", "$", "offset", ",", "$", "length", "=", "null", ")", "{", "$", "this", "->", "tags", "=", "array_slice", "(", "$", "this", "->", "tags", ",", "$", "offset", ",", "$", "length", ",", "true", ")", ";", "return", ...
Slice the tag cloud @param int $offset @param int $length @return \Jb\Bundle\TagCloudBundle\Model\TagCloud
[ "Slice", "the", "tag", "cloud" ]
936cf34ce60cb8fb4774931b1841fc775a3e9208
https://github.com/jbouzekri/SculpinTagCloudBundle/blob/936cf34ce60cb8fb4774931b1841fc775a3e9208/Model/TagCloud.php#L170-L175
199,255
PenoaksDev/Milky-Framework
src/Milky/Binding/Globals.php
Globals.getByClass
public static function getByClass( $class ) { $results = []; foreach ( static::$globals as $k => $v ) if ( $v instanceof $class ) $results[$k] = $v; return $results; }
php
public static function getByClass( $class ) { $results = []; foreach ( static::$globals as $k => $v ) if ( $v instanceof $class ) $results[$k] = $v; return $results; }
[ "public", "static", "function", "getByClass", "(", "$", "class", ")", "{", "$", "results", "=", "[", "]", ";", "foreach", "(", "static", "::", "$", "globals", "as", "$", "k", "=>", "$", "v", ")", "if", "(", "$", "v", "instanceof", "$", "class", "...
Gets globals by their final class @param string $class @return array
[ "Gets", "globals", "by", "their", "final", "class" ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Binding/Globals.php#L88-L95
199,256
wb-crowdfusion/crowdfusion
system/core/classes/libraries/benchmark/Benchmark.php
Benchmark.start
public function start($name, $preset = null, $isGlobalStart = false) { if(!$this->isEnabled()) return; // if(empty($name)) // throw new BenchmarkException("Empty timer name!"); // // $name = $this->uniqueTimerName($name); $t = $this->getTime(); $this->t...
php
public function start($name, $preset = null, $isGlobalStart = false) { if(!$this->isEnabled()) return; // if(empty($name)) // throw new BenchmarkException("Empty timer name!"); // // $name = $this->uniqueTimerName($name); $t = $this->getTime(); $this->t...
[ "public", "function", "start", "(", "$", "name", ",", "$", "preset", "=", "null", ",", "$", "isGlobalStart", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "isEnabled", "(", ")", ")", "return", ";", "// if(empty($name))", "// throw new Be...
Starts a timer with the given name The {@link $preset} parameter is useful for starting a timer for a process that begin before the Benchmark instance was available, ex. at the start of the entire request The {@link $isGlobalStart} parameter is required if you'd like {@link getTotals()} to return aggregate times for ...
[ "Starts", "a", "timer", "with", "the", "given", "name" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/benchmark/Benchmark.php#L95-L121
199,257
wb-crowdfusion/crowdfusion
system/core/classes/libraries/benchmark/Benchmark.php
Benchmark.end
public function end($name) { if(!$this->isEnabled()) return; $aggregate = 0; // if (empty($name)) // throw new BenchmarkException("Empty timer name!"); // // if (array_key_exists($name, $this->timers) && !empty($this->timers[$name]['end'])) { // $inc...
php
public function end($name) { if(!$this->isEnabled()) return; $aggregate = 0; // if (empty($name)) // throw new BenchmarkException("Empty timer name!"); // // if (array_key_exists($name, $this->timers) && !empty($this->timers[$name]['end'])) { // $inc...
[ "public", "function", "end", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "isEnabled", "(", ")", ")", "return", ";", "$", "aggregate", "=", "0", ";", "// if (empty($name))", "// throw new BenchmarkException(\"Empty timer name!\");", "//", ...
Ends and stores the elapsed time for the timer with the given name If is in aggregation mode, also stores the aggregate time for this timer. This is useful for tracing a request and noticing large lapses in processing that may not have a timer implemented. If a timer by the same name has already been stored, this fun...
[ "Ends", "and", "stores", "the", "elapsed", "time", "for", "the", "timer", "with", "the", "given", "name" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/benchmark/Benchmark.php#L139-L175
199,258
jacksleight/coast
library/Config.php
Config.fromArray
public function fromArray(array $opts) { $this->_opts = \Coast\array_merge_smart( $this->_opts, $opts ); return $this; }
php
public function fromArray(array $opts) { $this->_opts = \Coast\array_merge_smart( $this->_opts, $opts ); return $this; }
[ "public", "function", "fromArray", "(", "array", "$", "opts", ")", "{", "$", "this", "->", "_opts", "=", "\\", "Coast", "\\", "array_merge_smart", "(", "$", "this", "->", "_opts", ",", "$", "opts", ")", ";", "return", "$", "this", ";", "}" ]
Import from an array. @param string $name @return mixed
[ "Import", "from", "an", "array", "." ]
cd6cd41e8304adce41f59f799d4183adcaf666f9
https://github.com/jacksleight/coast/blob/cd6cd41e8304adce41f59f799d4183adcaf666f9/library/Config.php#L61-L68
199,259
shgysk8zer0/core_api
traits/errors.php
Errors.errorToException
protected static function errorToException( $level, $message, $file, $line ) { try { throw new \ErrorException($message, 0, $level, $file, $line); } catch(\ErrorException $e) { return $e; } }
php
protected static function errorToException( $level, $message, $file, $line ) { try { throw new \ErrorException($message, 0, $level, $file, $line); } catch(\ErrorException $e) { return $e; } }
[ "protected", "static", "function", "errorToException", "(", "$", "level", ",", "$", "message", ",", "$", "file", ",", "$", "line", ")", "{", "try", "{", "throw", "new", "\\", "ErrorException", "(", "$", "message", ",", "0", ",", "$", "level", ",", "$...
Throws, catches, and returns an \ErrorException created from error args @param int $level Any of the error levels (E_*) @param string $message Message given with the error @param string $file File generating the error @param int $line Line on which the error occured @return \ErrorException @see http://ph...
[ "Throws", "catches", "and", "returns", "an", "\\", "ErrorException", "created", "from", "error", "args" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/errors.php#L39-L51
199,260
jayalfredprufrock/codeigniter-messages
libraries/messages.php
Messages.add
public function add($type, $message, $data = FALSE, $title = FALSE) { $messages = $this->_session_get(); if (!is_array($messages)) { $messages = array(); } if (is_a($message, 'Exception')) { $title = 'Exception Thrown!'; $message = $message->getMessage(); ...
php
public function add($type, $message, $data = FALSE, $title = FALSE) { $messages = $this->_session_get(); if (!is_array($messages)) { $messages = array(); } if (is_a($message, 'Exception')) { $title = 'Exception Thrown!'; $message = $message->getMessage(); ...
[ "public", "function", "add", "(", "$", "type", ",", "$", "message", ",", "$", "data", "=", "FALSE", ",", "$", "title", "=", "FALSE", ")", "{", "$", "messages", "=", "$", "this", "->", "_session_get", "(", ")", ";", "if", "(", "!", "is_array", "("...
Adds a message to the a list. The optional parameter $data may be a primitive value or an array. If the $data parameter is present, $message must be a {@link http://www.php.net/manual/en/function.sprintf.php printf()}-style template string that includes formatting for the value(s) in $data. The $message formatting str...
[ "Adds", "a", "message", "to", "the", "a", "list", "." ]
d1891b0439c08b2df902effde171d25e4dbc6c79
https://github.com/jayalfredprufrock/codeigniter-messages/blob/d1891b0439c08b2df902effde171d25e4dbc6c79/libraries/messages.php#L48-L75
199,261
jayalfredprufrock/codeigniter-messages
libraries/messages.php
Messages.clear
public function clear($type = FALSE) { if ($type === FALSE){ $this->_session_unset(); } else { $messages = $this->_session_get(); if (is_array($messages)) { foreach($messages as $i=>$message){ if ($message->type == $type){ unset($messages[$i]); } ...
php
public function clear($type = FALSE) { if ($type === FALSE){ $this->_session_unset(); } else { $messages = $this->_session_get(); if (is_array($messages)) { foreach($messages as $i=>$message){ if ($message->type == $type){ unset($messages[$i]); } ...
[ "public", "function", "clear", "(", "$", "type", "=", "FALSE", ")", "{", "if", "(", "$", "type", "===", "FALSE", ")", "{", "$", "this", "->", "_session_unset", "(", ")", ";", "}", "else", "{", "$", "messages", "=", "$", "this", "->", "_session_get"...
Removes messages from the list. If $type is given, clears only messages of that type If $type is not given, clears all messages @param string $type type of messages to remove @return $this
[ "Removes", "messages", "from", "the", "list", "." ]
d1891b0439c08b2df902effde171d25e4dbc6c79
https://github.com/jayalfredprufrock/codeigniter-messages/blob/d1891b0439c08b2df902effde171d25e4dbc6c79/libraries/messages.php#L86-L119
199,262
jayalfredprufrock/codeigniter-messages
libraries/messages.php
Messages.peek
public function peek($type = FALSE) { $messages = $this->_session_get(); if (!is_array($messages)){ return array(); } if ($type === FALSE) { return $messages; } else { $tmessages = array(); foreach($messages as $message){ if ($message->type == $t...
php
public function peek($type = FALSE) { $messages = $this->_session_get(); if (!is_array($messages)){ return array(); } if ($type === FALSE) { return $messages; } else { $tmessages = array(); foreach($messages as $message){ if ($message->type == $t...
[ "public", "function", "peek", "(", "$", "type", "=", "FALSE", ")", "{", "$", "messages", "=", "$", "this", "->", "_session_get", "(", ")", ";", "if", "(", "!", "is_array", "(", "$", "messages", ")", ")", "{", "return", "array", "(", ")", ";", "}"...
Returns an array of messages to be displayed without removing them from the session If $type is given, returns an array of messages of that type If $type is not given, returns an array of all messages objects, in the order they were added. Each message object contains two properties, type and text. @param string $typ...
[ "Returns", "an", "array", "of", "messages", "to", "be", "displayed", "without", "removing", "them", "from", "the", "session" ]
d1891b0439c08b2df902effde171d25e4dbc6c79
https://github.com/jayalfredprufrock/codeigniter-messages/blob/d1891b0439c08b2df902effde171d25e4dbc6c79/libraries/messages.php#L183-L212
199,263
shgysk8zer0/core_api
traits/fileuploads.php
FileUploads._hasFileKeys
final private static function _hasFileKeys(Array $file): Bool { $valid = true; foreach(['error', 'tmp_name', 'type', 'size', 'name'] as $key) { if (! array_key_exists($key, $file)) { $valid = false; break; } } return $valid; }
php
final private static function _hasFileKeys(Array $file): Bool { $valid = true; foreach(['error', 'tmp_name', 'type', 'size', 'name'] as $key) { if (! array_key_exists($key, $file)) { $valid = false; break; } } return $valid; }
[ "final", "private", "static", "function", "_hasFileKeys", "(", "Array", "$", "file", ")", ":", "Bool", "{", "$", "valid", "=", "true", ";", "foreach", "(", "[", "'error'", ",", "'tmp_name'", ",", "'type'", ",", "'size'", ",", "'name'", "]", "as", "$", ...
Verifies that an array has all keys expected of a file upload @param Array $file Array, such as from `$_FILES` to validate @return Bool If $file has all array keys expected of an upload
[ "Verifies", "that", "an", "array", "has", "all", "keys", "expected", "of", "a", "file", "upload" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/fileuploads.php#L136-L146
199,264
gplcart/cli
controllers/commands/Cart.php
Cart.cmdGetCart
public function cmdGetCart() { $result = $this->getListCart(); $this->outputFormat($result); $this->outputFormatTableCart($result); $this->output(); }
php
public function cmdGetCart() { $result = $this->getListCart(); $this->outputFormat($result); $this->outputFormatTableCart($result); $this->output(); }
[ "public", "function", "cmdGetCart", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListCart", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableCart", "(", "$", "result", ")"...
Callback for "cart-get" command
[ "Callback", "for", "cart", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Cart.php#L40-L46
199,265
gplcart/cli
controllers/commands/Cart.php
Cart.cmdDeleteCart
public function cmdDeleteCart() { $id = $this->getParam(0); $options = null; if ($this->getParam('user')) { $options = array('user_id' => $id); } else if ($this->getParam('sku')) { $options = array('sku' => $id); } else if ($this->getParam('order')) ...
php
public function cmdDeleteCart() { $id = $this->getParam(0); $options = null; if ($this->getParam('user')) { $options = array('user_id' => $id); } else if ($this->getParam('sku')) { $options = array('sku' => $id); } else if ($this->getParam('order')) ...
[ "public", "function", "cmdDeleteCart", "(", ")", "{", "$", "id", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "$", "options", "=", "null", ";", "if", "(", "$", "this", "->", "getParam", "(", "'user'", ")", ")", "{", "$", "options", "="...
Callback for "cart-delete" command
[ "Callback", "for", "cart", "-", "delete", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Cart.php#L51-L94
199,266
gplcart/cli
controllers/commands/Cart.php
Cart.getListCart
protected function getListCart() { $id = $this->getParam(0); if (!isset($id)) { return $this->cart->getList(array('limit' => $this->getLimit())); } if ($this->getParam('user')) { return $this->cart->getList(array('user_id' => $id, 'limit' => $this->getLimit(...
php
protected function getListCart() { $id = $this->getParam(0); if (!isset($id)) { return $this->cart->getList(array('limit' => $this->getLimit())); } if ($this->getParam('user')) { return $this->cart->getList(array('user_id' => $id, 'limit' => $this->getLimit(...
[ "protected", "function", "getListCart", "(", ")", "{", "$", "id", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "if", "(", "!", "isset", "(", "$", "id", ")", ")", "{", "return", "$", "this", "->", "cart", "->", "getList", "(", "array", ...
Returns an array of cart items @return array
[ "Returns", "an", "array", "of", "cart", "items" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Cart.php#L114-L149
199,267
gplcart/cli
controllers/commands/Cart.php
Cart.submitAddCart
protected function submitAddCart() { $this->setSubmitted(null, $this->getParam()); $this->setSubmittedJson('data'); $this->validateComponent('cart'); $this->addAddCart(); }
php
protected function submitAddCart() { $this->setSubmitted(null, $this->getParam()); $this->setSubmittedJson('data'); $this->validateComponent('cart'); $this->addAddCart(); }
[ "protected", "function", "submitAddCart", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "setSubmittedJson", "(", "'data'", ")", ";", "$", "this", "->", "validat...
Add a new cart item at once
[ "Add", "a", "new", "cart", "item", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Cart.php#L187-L193
199,268
gplcart/cli
controllers/commands/Cart.php
Cart.wizardAddCart
protected function wizardAddCart() { // Required $this->validatePrompt('user_id', $this->text('User ID'), 'cart'); $this->validatePrompt('product_id', $this->text('Product ID'), 'cart'); $this->validatePrompt('sku', $this->text('Product SKU'), 'cart'); $this->validatePrompt('...
php
protected function wizardAddCart() { // Required $this->validatePrompt('user_id', $this->text('User ID'), 'cart'); $this->validatePrompt('product_id', $this->text('Product ID'), 'cart'); $this->validatePrompt('sku', $this->text('Product SKU'), 'cart'); $this->validatePrompt('...
[ "protected", "function", "wizardAddCart", "(", ")", "{", "// Required", "$", "this", "->", "validatePrompt", "(", "'user_id'", ",", "$", "this", "->", "text", "(", "'User ID'", ")", ",", "'cart'", ")", ";", "$", "this", "->", "validatePrompt", "(", "'produ...
Add a new cart item step by step
[ "Add", "a", "new", "cart", "item", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Cart.php#L198-L214
199,269
gplcart/cli
controllers/commands/Cart.php
Cart.addAddCart
protected function addAddCart() { if (!$this->isError()) { $id = $this->cart->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
php
protected function addAddCart() { if (!$this->isError()) { $id = $this->cart->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
[ "protected", "function", "addAddCart", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", ")", "{", "$", "id", "=", "$", "this", "->", "cart", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", ";", "if", "(...
Add a new cart item
[ "Add", "a", "new", "cart", "item" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Cart.php#L219-L228
199,270
koolkode/context
src/Scope/AbstractScopeManager.php
AbstractScopeManager.bindContext
protected function bindContext($object = NULL) { if($object !== NULL && !is_object($object)) { throw new \InvalidArgumentException(sprintf('Expecting an object, given %s', gettype($object))); } $previous = $this->context; $this->context = $object; if($object === NULL) { $this->proxies = new \Sp...
php
protected function bindContext($object = NULL) { if($object !== NULL && !is_object($object)) { throw new \InvalidArgumentException(sprintf('Expecting an object, given %s', gettype($object))); } $previous = $this->context; $this->context = $object; if($object === NULL) { $this->proxies = new \Sp...
[ "protected", "function", "bindContext", "(", "$", "object", "=", "NULL", ")", "{", "if", "(", "$", "object", "!==", "NULL", "&&", "!", "is_object", "(", "$", "object", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", ...
Bind the scope to the given object. @param object $object @return object The previous context or NULL when the scope was not active.
[ "Bind", "the", "scope", "to", "the", "given", "object", "." ]
f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36
https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Scope/AbstractScopeManager.php#L226-L254
199,271
koolkode/context
src/Scope/AbstractScopeManager.php
AbstractScopeManager.unbindContext
protected function unbindContext($object, $terminate = true) { if(!is_object($object)) { throw new \InvalidArgumentException(sprintf('Expecting an object, given %s', gettype($object))); } if($this->context === $object) { $this->context = NULL; $this->proxies = new \SplObjectStorage(); } if(...
php
protected function unbindContext($object, $terminate = true) { if(!is_object($object)) { throw new \InvalidArgumentException(sprintf('Expecting an object, given %s', gettype($object))); } if($this->context === $object) { $this->context = NULL; $this->proxies = new \SplObjectStorage(); } if(...
[ "protected", "function", "unbindContext", "(", "$", "object", ",", "$", "terminate", "=", "true", ")", "{", "if", "(", "!", "is_object", "(", "$", "object", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Expecting a...
Unbind scope from the given object, will optionally destroy all contextual instances bound to the object. @param object $object @param boolean $terminate Clear all contextual instances? @throws \InvalidArgumentException
[ "Unbind", "scope", "from", "the", "given", "object", "will", "optionally", "destroy", "all", "contextual", "instances", "bound", "to", "the", "object", "." ]
f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36
https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Scope/AbstractScopeManager.php#L264-L281
199,272
koolkode/context
src/Scope/AbstractScopeManager.php
AbstractScopeManager.initializeProxy
protected function initializeProxy($typeName, callable $factory = NULL) { $proxyName = $this->container->loadScopedProxy($typeName); if($factory === NULL) { $factory = function() { throw new ScopeNotActiveException(sprintf('Scope "%s" is not active', $this->getScope())); }; } return new $prox...
php
protected function initializeProxy($typeName, callable $factory = NULL) { $proxyName = $this->container->loadScopedProxy($typeName); if($factory === NULL) { $factory = function() { throw new ScopeNotActiveException(sprintf('Scope "%s" is not active', $this->getScope())); }; } return new $prox...
[ "protected", "function", "initializeProxy", "(", "$", "typeName", ",", "callable", "$", "factory", "=", "NULL", ")", "{", "$", "proxyName", "=", "$", "this", "->", "container", "->", "loadScopedProxy", "(", "$", "typeName", ")", ";", "if", "(", "$", "fac...
Create a scoped proxy for the given type. @param string $typeName @param callable $factory Will be called when the proxy is activated. @return ScopedProxyInterface
[ "Create", "a", "scoped", "proxy", "for", "the", "given", "type", "." ]
f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36
https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Scope/AbstractScopeManager.php#L290-L302
199,273
koolkode/context
src/Scope/AbstractScopeManager.php
AbstractScopeManager.bindFactoryProxy
protected function bindFactoryProxy($typeName, callable $factory) { $proxy = $this->initializeProxy($typeName, $factory); $this->scopedProxies[$proxy->K2GetProxyBinding()] = $proxy; $this->container->bindInstance($typeName, $proxy, true); return $proxy; }
php
protected function bindFactoryProxy($typeName, callable $factory) { $proxy = $this->initializeProxy($typeName, $factory); $this->scopedProxies[$proxy->K2GetProxyBinding()] = $proxy; $this->container->bindInstance($typeName, $proxy, true); return $proxy; }
[ "protected", "function", "bindFactoryProxy", "(", "$", "typeName", ",", "callable", "$", "factory", ")", "{", "$", "proxy", "=", "$", "this", "->", "initializeProxy", "(", "$", "typeName", ",", "$", "factory", ")", ";", "$", "this", "->", "scopedProxies", ...
Creates a factory-based proxy for the target type and binds it to the DI container. @param string $typeName @param callable $factory @return ScopedProxyInterface
[ "Creates", "a", "factory", "-", "based", "proxy", "for", "the", "target", "type", "and", "binds", "it", "to", "the", "DI", "container", "." ]
f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36
https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Scope/AbstractScopeManager.php#L311-L319
199,274
Xsaven/laravel-intelect-admin
src/Console/UninstallCommand.php
UninstallCommand.removeFilesAndDirectories
protected function removeFilesAndDirectories() { $this->laravel['files']->deleteDirectory(config('lia.directory')); $this->laravel['files']->deleteDirectory(public_path('vendor/lia/')); $this->laravel['files']->delete(config_path('lia.php')); $this->laravel['files']->delete(config_pa...
php
protected function removeFilesAndDirectories() { $this->laravel['files']->deleteDirectory(config('lia.directory')); $this->laravel['files']->deleteDirectory(public_path('vendor/lia/')); $this->laravel['files']->delete(config_path('lia.php')); $this->laravel['files']->delete(config_pa...
[ "protected", "function", "removeFilesAndDirectories", "(", ")", "{", "$", "this", "->", "laravel", "[", "'files'", "]", "->", "deleteDirectory", "(", "config", "(", "'lia.directory'", ")", ")", ";", "$", "this", "->", "laravel", "[", "'files'", "]", "->", ...
Remove files and directories. @return void
[ "Remove", "files", "and", "directories", "." ]
592574633d12c74cf25b43dd6694fee496abefcb
https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Console/UninstallCommand.php#L44-L50
199,275
bkstg/schedule-bundle
EventSubscriber/ProductionMenuSubscriber.php
ProductionMenuSubscriber.addScheduleItem
public function addScheduleItem(ProductionMenuCollectionEvent $event): void { $menu = $event->getMenu(); $group = $event->getGroup(); // Create overview menu item. $schedule = $this->factory->createItem('menu_item.schedule', [ 'route' => 'bkstg_calendar_production', ...
php
public function addScheduleItem(ProductionMenuCollectionEvent $event): void { $menu = $event->getMenu(); $group = $event->getGroup(); // Create overview menu item. $schedule = $this->factory->createItem('menu_item.schedule', [ 'route' => 'bkstg_calendar_production', ...
[ "public", "function", "addScheduleItem", "(", "ProductionMenuCollectionEvent", "$", "event", ")", ":", "void", "{", "$", "menu", "=", "$", "event", "->", "getMenu", "(", ")", ";", "$", "group", "=", "$", "event", "->", "getGroup", "(", ")", ";", "// Crea...
Add the schedule menu item. @param ProductionMenuCollectionEvent $event The menu collection event. @return void
[ "Add", "the", "schedule", "menu", "item", "." ]
e64ac897aa7b28bc48319470d65de13cd4788afe
https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/EventSubscriber/ProductionMenuSubscriber.php#L60-L92
199,276
inwendo/iw_client_latex_php
lib/Api/DocumentApi.php
DocumentApi.setApiClient
public function setApiClient(\Inwendo\Latex\Common\ApiClient $apiClient) { $this->apiClient = $apiClient; return $this; }
php
public function setApiClient(\Inwendo\Latex\Common\ApiClient $apiClient) { $this->apiClient = $apiClient; return $this; }
[ "public", "function", "setApiClient", "(", "\\", "Inwendo", "\\", "Latex", "\\", "Common", "\\", "ApiClient", "$", "apiClient", ")", "{", "$", "this", "->", "apiClient", "=", "$", "apiClient", ";", "return", "$", "this", ";", "}" ]
Set the API client @param \Inwendo\Latex\Common\ApiClient $apiClient set the API client @return DocumentApi
[ "Set", "the", "API", "client" ]
6f24b2cf473a4981845666f20fa906994bada5c2
https://github.com/inwendo/iw_client_latex_php/blob/6f24b2cf473a4981845666f20fa906994bada5c2/lib/Api/DocumentApi.php#L99-L103
199,277
sndsgd/sndsgd-field
src/Field.php
Field.addAliases
public function addAliases($alias) { foreach (func_get_args() as $alias) { $this->aliases[$alias] = true; } return $this; }
php
public function addAliases($alias) { foreach (func_get_args() as $alias) { $this->aliases[$alias] = true; } return $this; }
[ "public", "function", "addAliases", "(", "$", "alias", ")", "{", "foreach", "(", "func_get_args", "(", ")", "as", "$", "alias", ")", "{", "$", "this", "->", "aliases", "[", "$", "alias", "]", "=", "true", ";", "}", "return", "$", "this", ";", "}" ]
Add one or more aliases to the field @param string $alias,... @return \sndsgd\Field
[ "Add", "one", "or", "more", "aliases", "to", "the", "field" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/Field.php#L140-L146
199,278
sndsgd/sndsgd-field
src/Field.php
Field.setExportHandler
public function setExportHandler($type) { if ( $type === self::EXPORT_NORMAL || $type === self::EXPORT_ARRAY || $type === self::EXPORT_SKIP || is_callable($type) ) { $this->exportHandler = $type; return $this; } ...
php
public function setExportHandler($type) { if ( $type === self::EXPORT_NORMAL || $type === self::EXPORT_ARRAY || $type === self::EXPORT_SKIP || is_callable($type) ) { $this->exportHandler = $type; return $this; } ...
[ "public", "function", "setExportHandler", "(", "$", "type", ")", "{", "if", "(", "$", "type", "===", "self", "::", "EXPORT_NORMAL", "||", "$", "type", "===", "self", "::", "EXPORT_ARRAY", "||", "$", "type", "===", "self", "::", "EXPORT_SKIP", "||", "is_c...
Set the method by which to export the value @param integer|callable $type @return \sndsgd\Field @throws InvalidArgumentException If $type is not valid
[ "Set", "the", "method", "by", "which", "to", "export", "the", "value" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/Field.php#L232-L250
199,279
sndsgd/sndsgd-field
src/Field.php
Field.addValue
public function addValue($value, $index = null) { if ($this->value === null) { $this->value = []; } if ($index === null) { $this->value[] = $value; } else { $this->value[$index] = $value; } return $this; }
php
public function addValue($value, $index = null) { if ($this->value === null) { $this->value = []; } if ($index === null) { $this->value[] = $value; } else { $this->value[$index] = $value; } return $this; }
[ "public", "function", "addValue", "(", "$", "value", ",", "$", "index", "=", "null", ")", "{", "if", "(", "$", "this", "->", "value", "===", "null", ")", "{", "$", "this", "->", "value", "=", "[", "]", ";", "}", "if", "(", "$", "index", "===", ...
Add a value @param string|number $value The value to add @param string|integer|null $index The value key in the values array @return \sndsgd\Field
[ "Add", "a", "value" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/Field.php#L267-L281
199,280
sndsgd/sndsgd-field
src/Field.php
Field.setValue
public function setValue($value, $index = null) { if ($index === null) { $this->value = Arr::cast($value); } else { $this->value[$index] = $value; } return $this; }
php
public function setValue($value, $index = null) { if ($index === null) { $this->value = Arr::cast($value); } else { $this->value[$index] = $value; } return $this; }
[ "public", "function", "setValue", "(", "$", "value", ",", "$", "index", "=", "null", ")", "{", "if", "(", "$", "index", "===", "null", ")", "{", "$", "this", "->", "value", "=", "Arr", "::", "cast", "(", "$", "value", ")", ";", "}", "else", "{"...
Set one or all values @param string|integer|float|array<string|integer|float> $value @param integer|null $index @return \sndsgd\Field
[ "Set", "one", "or", "all", "values" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/Field.php#L290-L299
199,281
sndsgd/sndsgd-field
src/Field.php
Field.getValue
public function getValue($index = 0) { if ($index === 0 && $this->value === null) { return $this->defaultValue; } return (is_array($this->value) && array_key_exists($index, $this->value)) ? $this->value[$index] : null; }
php
public function getValue($index = 0) { if ($index === 0 && $this->value === null) { return $this->defaultValue; } return (is_array($this->value) && array_key_exists($index, $this->value)) ? $this->value[$index] : null; }
[ "public", "function", "getValue", "(", "$", "index", "=", "0", ")", "{", "if", "(", "$", "index", "===", "0", "&&", "$", "this", "->", "value", "===", "null", ")", "{", "return", "$", "this", "->", "defaultValue", ";", "}", "return", "(", "is_array...
Get a single value @param integer $index @return number|string|null
[ "Get", "a", "single", "value" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/Field.php#L318-L327
199,282
sndsgd/sndsgd-field
src/Field.php
Field.getValuesAsArray
private function getValuesAsArray() { if ($this->value === null) { return is_array($this->defaultValue) ? $this->defaultValue : [ $this->defaultValue ]; } return $this->value; }
php
private function getValuesAsArray() { if ($this->value === null) { return is_array($this->defaultValue) ? $this->defaultValue : [ $this->defaultValue ]; } return $this->value; }
[ "private", "function", "getValuesAsArray", "(", ")", "{", "if", "(", "$", "this", "->", "value", "===", "null", ")", "{", "return", "is_array", "(", "$", "this", "->", "defaultValue", ")", "?", "$", "this", "->", "defaultValue", ":", "[", "$", "this", ...
Get all of the current values as an array of values If no value is currently set, the default value will be returned @return array<string|integer|float|boolean|null>
[ "Get", "all", "of", "the", "current", "values", "as", "an", "array", "of", "values" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/Field.php#L335-L343
199,283
sndsgd/sndsgd-field
src/Field.php
Field.addRule
public function addRule(Rule $rule) { $classname = $rule->getClass(); if ($this->hasRule($classname) === true) { throw new Exception( "failed to add rule; the field {$this->name} already has an ". "instance of '$classname'" ); } ...
php
public function addRule(Rule $rule) { $classname = $rule->getClass(); if ($this->hasRule($classname) === true) { throw new Exception( "failed to add rule; the field {$this->name} already has an ". "instance of '$classname'" ); } ...
[ "public", "function", "addRule", "(", "Rule", "$", "rule", ")", "{", "$", "classname", "=", "$", "rule", "->", "getClass", "(", ")", ";", "if", "(", "$", "this", "->", "hasRule", "(", "$", "classname", ")", "===", "true", ")", "{", "throw", "new", ...
Add a validation rule to the field @param \sndsgd\field\Rule $rule @return \sndsgd\Field The field instance
[ "Add", "a", "validation", "rule", "to", "the", "field" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/Field.php#L381-L397
199,284
sndsgd/sndsgd-field
src/Field.php
Field.validate
public function validate(Collection $collection = null) { $this->errors = []; foreach ($this->getValuesAsArray() as $index => $value) { # skip fields with a null value if they are not required if ($value === null && $this->hasRule(Rule::REQUIRED) === false) { ...
php
public function validate(Collection $collection = null) { $this->errors = []; foreach ($this->getValuesAsArray() as $index => $value) { # skip fields with a null value if they are not required if ($value === null && $this->hasRule(Rule::REQUIRED) === false) { ...
[ "public", "function", "validate", "(", "Collection", "$", "collection", "=", "null", ")", "{", "$", "this", "->", "errors", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getValuesAsArray", "(", ")", "as", "$", "index", "=>", "$", "value", "...
Validate all the values in the field @param \sndsgd\field\Collection|null $collection A field collection @return boolean True if all values are
[ "Validate", "all", "the", "values", "in", "the", "field" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/Field.php#L440-L467
199,285
TuumPHP/Web
src/Middleware/MatchRootTrait.php
MatchRootTrait.matchRoot
public function matchRoot(&$request) { // empty means match always. if (empty($this->_patterns)) { return true; } $path = $request->getPathToMatch(); $method = $request->getMethod(); foreach ($this->_patterns as $pattern) { if ($matched = Mat...
php
public function matchRoot(&$request) { // empty means match always. if (empty($this->_patterns)) { return true; } $path = $request->getPathToMatch(); $method = $request->getMethod(); foreach ($this->_patterns as $pattern) { if ($matched = Mat...
[ "public", "function", "matchRoot", "(", "&", "$", "request", ")", "{", "// empty means match always.", "if", "(", "empty", "(", "$", "this", "->", "_patterns", ")", ")", "{", "return", "true", ";", "}", "$", "path", "=", "$", "request", "->", "getPathToM...
check if the requested path matches with the root. returns $request if matches, or return false if not matched (i.e. execute the next middleware). @param Request $request @return bool
[ "check", "if", "the", "requested", "path", "matches", "with", "the", "root", "." ]
8f296b6358aa93226ce08d6cc54a309f5b0a9820
https://github.com/TuumPHP/Web/blob/8f296b6358aa93226ce08d6cc54a309f5b0a9820/src/Middleware/MatchRootTrait.php#L42-L59
199,286
jmfeurprier/perf-caching
lib/perf/Caching/FileSystemStorage.php
FileSystemStorage.flushAll
public function flushAll() { $mask = '*' . self::CACHE_FILE_SUFFIX; foreach (glob($this->basePath . $mask) as $cacheFilePath) { if (!unlink($cacheFilePath)) { throw new \RuntimeException("Failed to delete cache file '{$cacheFilePath}'."); } } }
php
public function flushAll() { $mask = '*' . self::CACHE_FILE_SUFFIX; foreach (glob($this->basePath . $mask) as $cacheFilePath) { if (!unlink($cacheFilePath)) { throw new \RuntimeException("Failed to delete cache file '{$cacheFilePath}'."); } } }
[ "public", "function", "flushAll", "(", ")", "{", "$", "mask", "=", "'*'", ".", "self", "::", "CACHE_FILE_SUFFIX", ";", "foreach", "(", "glob", "(", "$", "this", "->", "basePath", ".", "$", "mask", ")", "as", "$", "cacheFilePath", ")", "{", "if", "(",...
Deletes every cache file. @return void @throws \RuntimeException
[ "Deletes", "every", "cache", "file", "." ]
16cf61dae3aa4d6dcb8722e14760934457087173
https://github.com/jmfeurprier/perf-caching/blob/16cf61dae3aa4d6dcb8722e14760934457087173/lib/perf/Caching/FileSystemStorage.php#L114-L123
199,287
itkg/core
src/Itkg/Core/Legacy/Kernel.php
Kernel.loadRouting
protected function loadRouting() { $parser = new YamlParser(); $routes = array(); foreach ($this->getRoutingFiles() as $file) { $routes = array_merge($routes, $parser->parse(file_get_contents($file))); } foreach ($routes as $name => $routeInfos) { $th...
php
protected function loadRouting() { $parser = new YamlParser(); $routes = array(); foreach ($this->getRoutingFiles() as $file) { $routes = array_merge($routes, $parser->parse(file_get_contents($file))); } foreach ($routes as $name => $routeInfos) { $th...
[ "protected", "function", "loadRouting", "(", ")", "{", "$", "parser", "=", "new", "YamlParser", "(", ")", ";", "$", "routes", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "getRoutingFiles", "(", ")", "as", "$", "file", ")", "{", ...
Load routing from routing files @return $this
[ "Load", "routing", "from", "routing", "files" ]
e5e4efb05feb4d23b0df41f2b21fd095103e593b
https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Legacy/Kernel.php#L62-L75
199,288
itkg/core
src/Itkg/Core/Legacy/Kernel.php
Kernel.processRouteInfos
private function processRouteInfos($name, array $routeInfos) { $className = null; if (isset($routeInfos['sequence'])) { $className = $routeInfos['sequence']; $this->container['core']['router']->addRouteSequence($className); } if (isset($routeInfos['pattern'])...
php
private function processRouteInfos($name, array $routeInfos) { $className = null; if (isset($routeInfos['sequence'])) { $className = $routeInfos['sequence']; $this->container['core']['router']->addRouteSequence($className); } if (isset($routeInfos['pattern'])...
[ "private", "function", "processRouteInfos", "(", "$", "name", ",", "array", "$", "routeInfos", ")", "{", "$", "className", "=", "null", ";", "if", "(", "isset", "(", "$", "routeInfos", "[", "'sequence'", "]", ")", ")", "{", "$", "className", "=", "$", ...
Process route infos @param string $name @param array $routeInfos
[ "Process", "route", "infos" ]
e5e4efb05feb4d23b0df41f2b21fd095103e593b
https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Legacy/Kernel.php#L83-L106
199,289
VTacius/ldapPM
src/Controlador/ldapOperations.php
ldapOperations.iterarEntradas
private function iterarEntradas($busquedaLdap, array $atributos){ $datos = array(); if (($entrada = ldap_first_entry($this->conexionLdap, $busquedaLdap))) { do { // Ejecutamos al menos una vez el mapeo de entradas con sus atributos, a menos // que no haya nad...
php
private function iterarEntradas($busquedaLdap, array $atributos){ $datos = array(); if (($entrada = ldap_first_entry($this->conexionLdap, $busquedaLdap))) { do { // Ejecutamos al menos una vez el mapeo de entradas con sus atributos, a menos // que no haya nad...
[ "private", "function", "iterarEntradas", "(", "$", "busquedaLdap", ",", "array", "$", "atributos", ")", "{", "$", "datos", "=", "array", "(", ")", ";", "if", "(", "(", "$", "entrada", "=", "ldap_first_entry", "(", "$", "this", "->", "conexionLdap", ",", ...
Auxiliar directo de busqueda. Dado un ldap result, itera por el para conseguir sus datos @param ldap result $busquedaLdap @param array $atributos @return boolean
[ "Auxiliar", "directo", "de", "busqueda", ".", "Dado", "un", "ldap", "result", "itera", "por", "el", "para", "conseguir", "sus", "datos" ]
728af24cd0a5ca4fbed76ffb52aa4800b118879f
https://github.com/VTacius/ldapPM/blob/728af24cd0a5ca4fbed76ffb52aa4800b118879f/src/Controlador/ldapOperations.php#L46-L58
199,290
hiqdev/minii-helpers
src/BaseInflector.php
BaseInflector.ordinalize
public static function ordinalize($number) { if (in_array(($number % 100), range(11, 13))) { return $number . 'th'; } switch ($number % 10) { case 1: return $number . 'st'; case 2: return $number . 'nd'; case 3: ...
php
public static function ordinalize($number) { if (in_array(($number % 100), range(11, 13))) { return $number . 'th'; } switch ($number % 10) { case 1: return $number . 'st'; case 2: return $number . 'nd'; case 3: ...
[ "public", "static", "function", "ordinalize", "(", "$", "number", ")", "{", "if", "(", "in_array", "(", "(", "$", "number", "%", "100", ")", ",", "range", "(", "11", ",", "13", ")", ")", ")", "{", "return", "$", "number", ".", "'th'", ";", "}", ...
Converts number to its ordinal English form. For example, converts 13 to 13th, 2 to 2nd ... @param integer $number the number to get its ordinal value @return string
[ "Converts", "number", "to", "its", "ordinal", "English", "form", ".", "For", "example", "converts", "13", "to", "13th", "2", "to", "2nd", "..." ]
001b7a56a6ebdc432c4683fe47c00a913f8e57d7
https://github.com/hiqdev/minii-helpers/blob/001b7a56a6ebdc432c4683fe47c00a913f8e57d7/src/BaseInflector.php#L475-L490
199,291
Kris-Kuiper/sFire-Framework
src/Image/Driver/GD.php
GD.pixelate
public function pixelate($blocksize = 5, $effect = 50) { $this -> filter(IMG_FILTER_PIXELATE, $blocksize, $effect); return $this -> image; }
php
public function pixelate($blocksize = 5, $effect = 50) { $this -> filter(IMG_FILTER_PIXELATE, $blocksize, $effect); return $this -> image; }
[ "public", "function", "pixelate", "(", "$", "blocksize", "=", "5", ",", "$", "effect", "=", "50", ")", "{", "$", "this", "->", "filter", "(", "IMG_FILTER_PIXELATE", ",", "$", "blocksize", ",", "$", "effect", ")", ";", "return", "$", "this", "->", "im...
Give current image a pixelate filter @param int $blocksize @param int $effect @return resource
[ "Give", "current", "image", "a", "pixelate", "filter" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Image/Driver/GD.php#L274-L278
199,292
Kris-Kuiper/sFire-Framework
src/Image/Driver/GD.php
GD.createImage
private function createImage($x, $y, $width, $height, $new_width, $new_height, $interlace = false) { $resource = imagecreatetruecolor($new_width, $new_height); if(false === imagesavealpha($resource, true)) { trigger_error('Could not set the flag to save full alpha channel', E_USER_ERROR); } if(fal...
php
private function createImage($x, $y, $width, $height, $new_width, $new_height, $interlace = false) { $resource = imagecreatetruecolor($new_width, $new_height); if(false === imagesavealpha($resource, true)) { trigger_error('Could not set the flag to save full alpha channel', E_USER_ERROR); } if(fal...
[ "private", "function", "createImage", "(", "$", "x", ",", "$", "y", ",", "$", "width", ",", "$", "height", ",", "$", "new_width", ",", "$", "new_height", ",", "$", "interlace", "=", "false", ")", "{", "$", "resource", "=", "imagecreatetruecolor", "(", ...
Creates new image resource. Returns false if failed. @param int $x @param int $y @param int $width @param int $height @param int $new_width @param int $new_height @param boolean $interlace @return resource|boolean
[ "Creates", "new", "image", "resource", ".", "Returns", "false", "if", "failed", "." ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Image/Driver/GD.php#L385-L412
199,293
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/DisplayFilterer.php
DisplayFilterer.substring
public function substring () { $start = $this->getParameter('start'); $length = $this->getParameter('length'); if (empty($start)) $start = 0; if (empty($length)) $length = strlen($this->getParameter('value')) - (int)$start; $str = substr($this->get...
php
public function substring () { $start = $this->getParameter('start'); $length = $this->getParameter('length'); if (empty($start)) $start = 0; if (empty($length)) $length = strlen($this->getParameter('value')) - (int)$start; $str = substr($this->get...
[ "public", "function", "substring", "(", ")", "{", "$", "start", "=", "$", "this", "->", "getParameter", "(", "'start'", ")", ";", "$", "length", "=", "$", "this", "->", "getParameter", "(", "'length'", ")", ";", "if", "(", "empty", "(", "$", "start",...
Returns a substring from param 'value'. Returns the 1st letter if only 'value' is specified Expected Params: value string the string to operate upon start integer (optional) the starting point for our substring, default 0 length integer (optional) the length of the substring. default 1 @return string
[ "Returns", "a", "substring", "from", "param", "value", ".", "Returns", "the", "1st", "letter", "if", "only", "value", "is", "specified" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/DisplayFilterer.php#L110-L124
199,294
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/DisplayFilterer.php
DisplayFilterer.showVars
public function showVars() { $what = $this->getParameter('scope'); switch ( $what ) { case 'global': case 'globals': case 'system': case 'systems': $debug = $this->getGlobals(); break; default: ...
php
public function showVars() { $what = $this->getParameter('scope'); switch ( $what ) { case 'global': case 'globals': case 'system': case 'systems': $debug = $this->getGlobals(); break; default: ...
[ "public", "function", "showVars", "(", ")", "{", "$", "what", "=", "$", "this", "->", "getParameter", "(", "'scope'", ")", ";", "switch", "(", "$", "what", ")", "{", "case", "'global'", ":", "case", "'globals'", ":", "case", "'system'", ":", "case", ...
Returns debuggging information about the current vars Expected Params: scope string (optional) If set to 'globals', then dump the globals. Otherwise dump the locals. @return string
[ "Returns", "debuggging", "information", "about", "the", "current", "vars" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/DisplayFilterer.php#L134-L151
199,295
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/DisplayFilterer.php
DisplayFilterer.htmlEscape
public function htmlEscape() { if ($this->getParameter('value') == null) return; return str_replace('%', '&#37;', htmlentities($this->getParameter('value'), ENT_QUOTES, 'UTF-8', false)); }
php
public function htmlEscape() { if ($this->getParameter('value') == null) return; return str_replace('%', '&#37;', htmlentities($this->getParameter('value'), ENT_QUOTES, 'UTF-8', false)); }
[ "public", "function", "htmlEscape", "(", ")", "{", "if", "(", "$", "this", "->", "getParameter", "(", "'value'", ")", "==", "null", ")", "return", ";", "return", "str_replace", "(", "'%'", ",", "'&#37;'", ",", "htmlentities", "(", "$", "this", "->", "g...
HTML-Escapes the specified parameter. Converts all html chars into their entities equivalent Expected Param: value string @return string
[ "HTML", "-", "Escapes", "the", "specified", "parameter", ".", "Converts", "all", "html", "chars", "into", "their", "entities", "equivalent" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/DisplayFilterer.php#L213-L219
199,296
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/DisplayFilterer.php
DisplayFilterer.strReplace
function strReplace() { if (($this->getParameter('needle') == null) || ($this->getParameter('haystack') == null)) return $this->getParameter('haystack'); $needle = $this->getParameter('needle'); if($needle == '\n') $needle = "\n"; return str_replace($needle,...
php
function strReplace() { if (($this->getParameter('needle') == null) || ($this->getParameter('haystack') == null)) return $this->getParameter('haystack'); $needle = $this->getParameter('needle'); if($needle == '\n') $needle = "\n"; return str_replace($needle,...
[ "function", "strReplace", "(", ")", "{", "if", "(", "(", "$", "this", "->", "getParameter", "(", "'needle'", ")", "==", "null", ")", "||", "(", "$", "this", "->", "getParameter", "(", "'haystack'", ")", "==", "null", ")", ")", "return", "$", "this", ...
Performs a string replace on the specified param Expected Params: needle string The item to search for haystack string The string to look in replace string The string to replace the found text with @return string
[ "Performs", "a", "string", "replace", "on", "the", "specified", "param" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/DisplayFilterer.php#L247-L257
199,297
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/DisplayFilterer.php
DisplayFilterer.pregReplace
public function pregReplace() { if ($this->getParameter('pattern') == null) return $this->getParameter('subject'); return preg_replace($this->getParameter('pattern'), $this->getParameter('replace'), $this->getParameter('subject')); }
php
public function pregReplace() { if ($this->getParameter('pattern') == null) return $this->getParameter('subject'); return preg_replace($this->getParameter('pattern'), $this->getParameter('replace'), $this->getParameter('subject')); }
[ "public", "function", "pregReplace", "(", ")", "{", "if", "(", "$", "this", "->", "getParameter", "(", "'pattern'", ")", "==", "null", ")", "return", "$", "this", "->", "getParameter", "(", "'subject'", ")", ";", "return", "preg_replace", "(", "$", "this...
Performs a regular expression search and replace Expected Params: pattern regex The regular expression used to locate the text to replace subject string The string to look at replace string The text to replace the found items with @return string
[ "Performs", "a", "regular", "expression", "search", "and", "replace" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/DisplayFilterer.php#L269-L274
199,298
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/DisplayFilterer.php
DisplayFilterer.firstLetter
protected function firstLetter() { $string = trim((string) $this->getParameter('string')); $lower = (boolean) $this->getParameter('lower'); return StringUtils::firstLetter($string, $lower); }
php
protected function firstLetter() { $string = trim((string) $this->getParameter('string')); $lower = (boolean) $this->getParameter('lower'); return StringUtils::firstLetter($string, $lower); }
[ "protected", "function", "firstLetter", "(", ")", "{", "$", "string", "=", "trim", "(", "(", "string", ")", "$", "this", "->", "getParameter", "(", "'string'", ")", ")", ";", "$", "lower", "=", "(", "boolean", ")", "$", "this", "->", "getParameter", ...
Return the first character from a string. Expected Params: string string lower boolean return string in lower case. defaults to false @return string
[ "Return", "the", "first", "character", "from", "a", "string", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/DisplayFilterer.php#L285-L290
199,299
wb-crowdfusion/crowdfusion
system/core/classes/mvc/filters/DisplayFilterer.php
DisplayFilterer.trim
public function trim() { return StringUtils::trim( $this->getParameter('value'), $this->getParameter('len'), $this->getParameter('keeptags'), $this->getParameter('decodehtml'), $this->getParameter('stripurls')); }
php
public function trim() { return StringUtils::trim( $this->getParameter('value'), $this->getParameter('len'), $this->getParameter('keeptags'), $this->getParameter('decodehtml'), $this->getParameter('stripurls')); }
[ "public", "function", "trim", "(", ")", "{", "return", "StringUtils", "::", "trim", "(", "$", "this", "->", "getParameter", "(", "'value'", ")", ",", "$", "this", "->", "getParameter", "(", "'len'", ")", ",", "$", "this", "->", "getParameter", "(", "'k...
Trims a string to a specified length. It will allow tags listed in 'KeepTags' to remain and will intelligently append the trimmed text with '...' or '-' depending on if the trim ends on a word or a space. Expected Params: len integer The length to trim the string to value string The string to trim KeepTags st...
[ "Trims", "a", "string", "to", "a", "specified", "length", ".", "It", "will", "allow", "tags", "listed", "in", "KeepTags", "to", "remain", "and", "will", "intelligently", "append", "the", "trimmed", "text", "with", "...", "or", "-", "depending", "on", "if",...
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/DisplayFilterer.php#L319-L327