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
201,000
manialib/manialink
src/Manialib/Manialink/Utils.php
Utils.getAlignedPos
final public static function getAlignedPos(Base $object, $newHalign, $newValign) { $newPosX = self::getAlignedPosX( $object->getPosnX(), $object->getRealSizeX(), $object->getHalign(), $newHalign); $newPosY = self::getAlignedPosY( $object->getPosnY(), $object->getRealS...
php
final public static function getAlignedPos(Base $object, $newHalign, $newValign) { $newPosX = self::getAlignedPosX( $object->getPosnX(), $object->getRealSizeX(), $object->getHalign(), $newHalign); $newPosY = self::getAlignedPosY( $object->getPosnY(), $object->getRealS...
[ "final", "public", "static", "function", "getAlignedPos", "(", "Base", "$", "object", ",", "$", "newHalign", ",", "$", "newValign", ")", "{", "$", "newPosX", "=", "self", "::", "getAlignedPosX", "(", "$", "object", "->", "getPosnX", "(", ")", ",", "$", ...
Returns the position of an element in relation to another element and according to their respective alignments @param Base Parent element @param string Horizontal alignement of the element you want to place @param string Vertical alignement of the element you want to place @return array Calculated position of the elem...
[ "Returns", "the", "position", "of", "an", "element", "in", "relation", "to", "another", "element", "and", "according", "to", "their", "respective", "alignments" ]
a24c7979b3aa6b470556e95ba60a76a994bf506c
https://github.com/manialib/manialink/blob/a24c7979b3aa6b470556e95ba60a76a994bf506c/src/Manialib/Manialink/Utils.php#L104-L111
201,001
ekyna/Resource
Search/Elastica/ResourceRepository.php
ResourceRepository.createMatchQuery
protected function createMatchQuery($expression, array $fields = []) { if (0 == strlen($expression)) { return new Query\MatchAll(); } if (empty($fields)) { $fields = $this->getDefaultMatchFields(); } $query = new Query\MultiMatch(); $query ...
php
protected function createMatchQuery($expression, array $fields = []) { if (0 == strlen($expression)) { return new Query\MatchAll(); } if (empty($fields)) { $fields = $this->getDefaultMatchFields(); } $query = new Query\MultiMatch(); $query ...
[ "protected", "function", "createMatchQuery", "(", "$", "expression", ",", "array", "$", "fields", "=", "[", "]", ")", "{", "if", "(", "0", "==", "strlen", "(", "$", "expression", ")", ")", "{", "return", "new", "Query", "\\", "MatchAll", "(", ")", ";...
Creates the match query. @param string $expression @param array $fields @return Query\AbstractQuery
[ "Creates", "the", "match", "query", "." ]
96ee3d28e02bd9513705408e3bb7f88a76e52f56
https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Search/Elastica/ResourceRepository.php#L37-L53
201,002
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/ImageSizeReducer.php
ImageSizeReducer.writeXML
public function writeXML( \XMLWriter $w, string $elementName = 'ImageSizeReducer' ) { $w->startElement( $elementName ); $this->writeXMLAttributes( $w ); $w->endElement(); }
php
public function writeXML( \XMLWriter $w, string $elementName = 'ImageSizeReducer' ) { $w->startElement( $elementName ); $this->writeXMLAttributes( $w ); $w->endElement(); }
[ "public", "function", "writeXML", "(", "\\", "XMLWriter", "$", "w", ",", "string", "$", "elementName", "=", "'ImageSizeReducer'", ")", "{", "$", "w", "->", "startElement", "(", "$", "elementName", ")", ";", "$", "this", "->", "writeXMLAttributes", "(", "$"...
Writes all instance options to an XML element. @param \XMLWriter $w @param string $elementName
[ "Writes", "all", "instance", "options", "to", "an", "XML", "element", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/ImageSizeReducer.php#L171-L178
201,003
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/ImageSizeReducer.php
ImageSizeReducer.writeXMLAttributes
public function writeXMLAttributes( \XMLWriter $w ) { switch ( $this->data[ 'type' ] ) { case ImageSizeReducerType::CROP: $w->writeAttribute( 'type', 'crop' ); $w->writeAttribute( 'width', $this->data[ 'width' ] ); $w->writeAttribute( 'height', $this->dat...
php
public function writeXMLAttributes( \XMLWriter $w ) { switch ( $this->data[ 'type' ] ) { case ImageSizeReducerType::CROP: $w->writeAttribute( 'type', 'crop' ); $w->writeAttribute( 'width', $this->data[ 'width' ] ); $w->writeAttribute( 'height', $this->dat...
[ "public", "function", "writeXMLAttributes", "(", "\\", "XMLWriter", "$", "w", ")", "{", "switch", "(", "$", "this", "->", "data", "[", "'type'", "]", ")", "{", "case", "ImageSizeReducerType", "::", "CROP", ":", "$", "w", "->", "writeAttribute", "(", "'ty...
Writes all instance options to XML attributes inside the opened XML element. @param \XMLWriter $w
[ "Writes", "all", "instance", "options", "to", "XML", "attributes", "inside", "the", "opened", "XML", "element", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/ImageSizeReducer.php#L185-L219
201,004
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/ImageSizeReducer.php
ImageSizeReducer.Create
protected static function Create( int $type, int $width, int $height, int $gravity = Gravity::MIDDLE_CENTER, int $portraitLength = 0, int $landscapeLength = 0 ) : ImageSizeReducer { switch ( $type ) { case ImageSizeReducerType::CROP: if ( $width < 1 ) ...
php
protected static function Create( int $type, int $width, int $height, int $gravity = Gravity::MIDDLE_CENTER, int $portraitLength = 0, int $landscapeLength = 0 ) : ImageSizeReducer { switch ( $type ) { case ImageSizeReducerType::CROP: if ( $width < 1 ) ...
[ "protected", "static", "function", "Create", "(", "int", "$", "type", ",", "int", "$", "width", ",", "int", "$", "height", ",", "int", "$", "gravity", "=", "Gravity", "::", "MIDDLE_CENTER", ",", "int", "$", "portraitLength", "=", "0", ",", "int", "$", ...
Init an Image size reducer. @param int $type The the image size reducer type @param int $width The width of the required resulting image @param int $height The height of the required resulting image @param int $gravity The gravity of the cropped image part @param int $portraitLength @param int $landscapeLengt...
[ "Init", "an", "Image", "size", "reducer", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/ImageSizeReducer.php#L636-L708
201,005
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/ImageSizeReducer.php
ImageSizeReducer.TryParse
public static function TryParse( $value, &$refReducer = null ) : bool { if ( \is_null( $value ) ) { return false; } if ( $value instanceof \SimpleXMLElement ) { return static::TryParseXmlElement( $value, $refReducer ); } if ( \is_string( $value ) && ! ...
php
public static function TryParse( $value, &$refReducer = null ) : bool { if ( \is_null( $value ) ) { return false; } if ( $value instanceof \SimpleXMLElement ) { return static::TryParseXmlElement( $value, $refReducer ); } if ( \is_string( $value ) && ! ...
[ "public", "static", "function", "TryParse", "(", "$", "value", ",", "&", "$", "refReducer", "=", "null", ")", ":", "bool", "{", "if", "(", "\\", "is_null", "(", "$", "value", ")", ")", "{", "return", "false", ";", "}", "if", "(", "$", "value", "i...
Tries to parse the defined value to an ImageSizeReducer instance @param \SimpleXMLElement|array|string $value @param \Beluga\Drawing\Image\ImageSizeReducer $refReducer Returns the resulting reducer instance if the method return TRUE @return bool
[ "Tries", "to", "parse", "the", "defined", "value", "to", "an", "ImageSizeReducer", "instance" ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/ImageSizeReducer.php#L811-L888
201,006
SlabPHP/database
src/Models/MySQL/Join.php
Join.resolve
public function resolve($databaseResult) { $className = $this->className; try { $object = new $className(); $this->loader ->mapObjectWithOptions($object, $databaseResult); $databaseResult->{$this->fieldName} = $object; } catch (\Exceptio...
php
public function resolve($databaseResult) { $className = $this->className; try { $object = new $className(); $this->loader ->mapObjectWithOptions($object, $databaseResult); $databaseResult->{$this->fieldName} = $object; } catch (\Exceptio...
[ "public", "function", "resolve", "(", "$", "databaseResult", ")", "{", "$", "className", "=", "$", "this", "->", "className", ";", "try", "{", "$", "object", "=", "new", "$", "className", "(", ")", ";", "$", "this", "->", "loader", "->", "mapObjectWith...
Resolve data by splicing in the completed object @param $databaseResult
[ "Resolve", "data", "by", "splicing", "in", "the", "completed", "object" ]
d77c38f2260429c6e054633eb0daf3f755c988a9
https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Join.php#L70-L85
201,007
SlabPHP/database
src/Models/MySQL/Join.php
Join.joinOn
public function joinOn($foreignKeyColumn) { return 'join ' . $this->getTable() . ' on ' . $this->loader->getPrimaryKey($this->alias) . ' = ' . $foreignKeyColumn . ' '; }
php
public function joinOn($foreignKeyColumn) { return 'join ' . $this->getTable() . ' on ' . $this->loader->getPrimaryKey($this->alias) . ' = ' . $foreignKeyColumn . ' '; }
[ "public", "function", "joinOn", "(", "$", "foreignKeyColumn", ")", "{", "return", "'join '", ".", "$", "this", "->", "getTable", "(", ")", ".", "' on '", ".", "$", "this", "->", "loader", "->", "getPrimaryKey", "(", "$", "this", "->", "alias", ")", "."...
Print out Join SQL @param $foreignKeyColumn @return string
[ "Print", "out", "Join", "SQL" ]
d77c38f2260429c6e054633eb0daf3f755c988a9
https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Models/MySQL/Join.php#L113-L116
201,008
PenoaksDev/Milky-Framework
src/Milky/Http/Routing/ResourceRegistrar.php
ResourceRegistrar.prefixedResource
protected function prefixedResource( $name, $controller, array $options ) { list( $name, $prefix ) = $this->getResourcePrefix( $name ); // We need to extract the base resource from the resource name. Nested resources // are supported in the framework, but we need to know what name to use for a // place-holder...
php
protected function prefixedResource( $name, $controller, array $options ) { list( $name, $prefix ) = $this->getResourcePrefix( $name ); // We need to extract the base resource from the resource name. Nested resources // are supported in the framework, but we need to know what name to use for a // place-holder...
[ "protected", "function", "prefixedResource", "(", "$", "name", ",", "$", "controller", ",", "array", "$", "options", ")", "{", "list", "(", "$", "name", ",", "$", "prefix", ")", "=", "$", "this", "->", "getResourcePrefix", "(", "$", "name", ")", ";", ...
Build a set of prefixed resource routes. @param string $name @param string $controller @param array $options
[ "Build", "a", "set", "of", "prefixed", "resource", "routes", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Routing/ResourceRegistrar.php#L92-L105
201,009
PenoaksDev/Milky-Framework
src/Milky/Http/Routing/ResourceRegistrar.php
ResourceRegistrar.addResourceShow
protected function addResourceShow( $name, $base, $controller, $options ) { $uri = $this->getResourceUri( $name ) . '/{' . $base . ''; $action = $this->getResourceAction( $name, $controller, 'show', $options ); return $this->router->get( $uri, $action ); }
php
protected function addResourceShow( $name, $base, $controller, $options ) { $uri = $this->getResourceUri( $name ) . '/{' . $base . ''; $action = $this->getResourceAction( $name, $controller, 'show', $options ); return $this->router->get( $uri, $action ); }
[ "protected", "function", "addResourceShow", "(", "$", "name", ",", "$", "base", ",", "$", "controller", ",", "$", "options", ")", "{", "$", "uri", "=", "$", "this", "->", "getResourceUri", "(", "$", "name", ")", ".", "'/{'", ".", "$", "base", ".", ...
Add the show method for a resourceful route. @param string $name @param string $base @param string $controller @param array $options @return Route
[ "Add", "the", "show", "method", "for", "a", "resourceful", "route", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Routing/ResourceRegistrar.php#L337-L344
201,010
WesamMikhail/Utils
src/Strings.php
Strings.generateRandomAlphaNumericString
public static function generateRandomAlphaNumericString($length) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $size = strlen($chars); $randomChars = array(); for ($i = 0; $i < $length; $i++) { $randomChars[] = $chars[mt_rand(0, $size - 1)]; ...
php
public static function generateRandomAlphaNumericString($length) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $size = strlen($chars); $randomChars = array(); for ($i = 0; $i < $length; $i++) { $randomChars[] = $chars[mt_rand(0, $size - 1)]; ...
[ "public", "static", "function", "generateRandomAlphaNumericString", "(", "$", "length", ")", "{", "$", "chars", "=", "\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"", ";", "$", "size", "=", "strlen", "(", "$", "chars", ")", ";", "$", "randomChars",...
Generate a random string with repeatable letters. @param int $length Length of desired random string @return string Random string
[ "Generate", "a", "random", "string", "with", "repeatable", "letters", "." ]
54933740f4500a7a1ebd37c7226cc00bc36e58db
https://github.com/WesamMikhail/Utils/blob/54933740f4500a7a1ebd37c7226cc00bc36e58db/src/Strings.php#L20-L30
201,011
Nicklas766/Comment
src/Comment/Modules/User.php
User.verifyPassword
public function verifyPassword($name, $pass) { $this->find("name", $name); return password_verify($pass, $this->pass); }
php
public function verifyPassword($name, $pass) { $this->find("name", $name); return password_verify($pass, $this->pass); }
[ "public", "function", "verifyPassword", "(", "$", "name", ",", "$", "pass", ")", "{", "$", "this", "->", "find", "(", "\"name\"", ",", "$", "name", ")", ";", "return", "password_verify", "(", "$", "pass", ",", "$", "this", "->", "pass", ")", ";", "...
Verify the name and the pass, if successful the object contains all details from the database row. @param string $name name to check. @param string $pass the pass to use. @return boolean true if name and pass matches, else false.
[ "Verify", "the", "name", "and", "the", "pass", "if", "successful", "the", "object", "contains", "all", "details", "from", "the", "database", "row", "." ]
1483eaf1ebb120b8bd6c2a1552c084b3a288ff25
https://github.com/Nicklas766/Comment/blob/1483eaf1ebb120b8bd6c2a1552c084b3a288ff25/src/Comment/Modules/User.php#L192-L196
201,012
Nicklas766/Comment
src/Comment/Modules/User.php
User.controlAuthority
public function controlAuthority($loggedUser, $name) { $this->find("name", $loggedUser); // IF AUTHORITY == admin, then continue if ($this->authority != "admin") { return ($this->name == $name); } return true; }
php
public function controlAuthority($loggedUser, $name) { $this->find("name", $loggedUser); // IF AUTHORITY == admin, then continue if ($this->authority != "admin") { return ($this->name == $name); } return true; }
[ "public", "function", "controlAuthority", "(", "$", "loggedUser", ",", "$", "name", ")", "{", "$", "this", "->", "find", "(", "\"name\"", ",", "$", "loggedUser", ")", ";", "// IF AUTHORITY == admin, then continue", "if", "(", "$", "this", "->", "authority", ...
Check if a post belongs to user @return boolean
[ "Check", "if", "a", "post", "belongs", "to", "user" ]
1483eaf1ebb120b8bd6c2a1552c084b3a288ff25
https://github.com/Nicklas766/Comment/blob/1483eaf1ebb120b8bd6c2a1552c084b3a288ff25/src/Comment/Modules/User.php#L220-L228
201,013
EvanDarwin/JSend
src/JSendBuilder.php
JSendBuilder.get
public function get() { return new JSendResponse($this->status, $this->data, $this->errors, $this->code, $this->message); }
php
public function get() { return new JSendResponse($this->status, $this->data, $this->errors, $this->code, $this->message); }
[ "public", "function", "get", "(", ")", "{", "return", "new", "JSendResponse", "(", "$", "this", "->", "status", ",", "$", "this", "->", "data", ",", "$", "this", "->", "errors", ",", "$", "this", "->", "code", ",", "$", "this", "->", "message", ")"...
Returns the built object @return \EvanDarwin\JSend\JSendResponse @throws \InvalidArgumentException
[ "Returns", "the", "built", "object" ]
a31f7590e8503590d10012510ffc50a0ef064d02
https://github.com/EvanDarwin/JSend/blob/a31f7590e8503590d10012510ffc50a0ef064d02/src/JSendBuilder.php#L174-L177
201,014
wevrem/dStruct
src/dConnection.php
dConnection.getStatement
function getStatement($cKey, $sqlCallback, $types, $params) { // Lazily prepare and cache the statement. if (!$this->stmtCache[$cKey]) { if (!($stmt = $this->mysqli->prepare( $sqlCallback instanceof \Closure ? $sqlCallback() : $sqlCallback ))) { throw new \Exception("Statement Error: {$this->mysqli->error}", $th...
php
function getStatement($cKey, $sqlCallback, $types, $params) { // Lazily prepare and cache the statement. if (!$this->stmtCache[$cKey]) { if (!($stmt = $this->mysqli->prepare( $sqlCallback instanceof \Closure ? $sqlCallback() : $sqlCallback ))) { throw new \Exception("Statement Error: {$this->mysqli->error}", $th...
[ "function", "getStatement", "(", "$", "cKey", ",", "$", "sqlCallback", ",", "$", "types", ",", "$", "params", ")", "{", "// Lazily prepare and cache the statement.", "if", "(", "!", "$", "this", "->", "stmtCache", "[", "$", "cKey", "]", ")", "{", "if", "...
array and returns the statement ready to execute.
[ "array", "and", "returns", "the", "statement", "ready", "to", "execute", "." ]
6ede2c26a377475f48de043536d1f46e8863d8b3
https://github.com/wevrem/dStruct/blob/6ede2c26a377475f48de043536d1f46e8863d8b3/src/dConnection.php#L235-L247
201,015
Brainsware/sauce
lib/Sauce/Path.php
Path.check
public static function check ($path, $fd, $rw) { if ($fd == 'f') { if (is_file($path) != true) { return false; } } elseif ($fd == 'd') { if (is_dir($path) != true) { return false; } } else { return fa...
php
public static function check ($path, $fd, $rw) { if ($fd == 'f') { if (is_file($path) != true) { return false; } } elseif ($fd == 'd') { if (is_dir($path) != true) { return false; } } else { return fa...
[ "public", "static", "function", "check", "(", "$", "path", ",", "$", "fd", ",", "$", "rw", ")", "{", "if", "(", "$", "fd", "==", "'f'", ")", "{", "if", "(", "is_file", "(", "$", "path", ")", "!=", "true", ")", "{", "return", "false", ";", "}"...
Checks a file or directory existence and readability @param string $path /path/to/dir/or/file @param string $fd Either 'f' for file or 'd' for directory. @param string $rw Either 'w' for a check on writability or 'r' for a check on readability. @return bool
[ "Checks", "a", "file", "or", "directory", "existence", "and", "readability" ]
2294fd27286bf42cfac6d744e242b2bd9eea353d
https://github.com/Brainsware/sauce/blob/2294fd27286bf42cfac6d744e242b2bd9eea353d/lib/Sauce/Path.php#L81-L112
201,016
shazam/easy-config
src/Config.php
Config.loadConfig
public function loadConfig($configFiles) { if (!is_array($configFiles)) { $configFiles = array($configFiles); } $this->configFiles = $configFiles; foreach ($configFiles as $configFile) { $this->config = array_merge( $this->config, ...
php
public function loadConfig($configFiles) { if (!is_array($configFiles)) { $configFiles = array($configFiles); } $this->configFiles = $configFiles; foreach ($configFiles as $configFile) { $this->config = array_merge( $this->config, ...
[ "public", "function", "loadConfig", "(", "$", "configFiles", ")", "{", "if", "(", "!", "is_array", "(", "$", "configFiles", ")", ")", "{", "$", "configFiles", "=", "array", "(", "$", "configFiles", ")", ";", "}", "$", "this", "->", "configFiles", "=", ...
Sets to the config property the merged content from all the config files. @param array|string $configFiles
[ "Sets", "to", "the", "config", "property", "the", "merged", "content", "from", "all", "the", "config", "files", "." ]
4017fc4c9669abf2fe58cc2ed4dd5dab5d7224a8
https://github.com/shazam/easy-config/blob/4017fc4c9669abf2fe58cc2ed4dd5dab5d7224a8/src/Config.php#L82-L96
201,017
shazam/easy-config
src/Config.php
Config.fetch
public function fetch(/* $key1, $key2, ... $keyN */) { $keys = func_get_args(); $config = $this->config; foreach ($keys as $key) { if (isset($config[$key])) { $config = $config[$key]; } else { throw new KeyNotFoundException("Key $key n...
php
public function fetch(/* $key1, $key2, ... $keyN */) { $keys = func_get_args(); $config = $this->config; foreach ($keys as $key) { if (isset($config[$key])) { $config = $config[$key]; } else { throw new KeyNotFoundException("Key $key n...
[ "public", "function", "fetch", "(", "/* $key1, $key2, ... $keyN */", ")", "{", "$", "keys", "=", "func_get_args", "(", ")", ";", "$", "config", "=", "$", "this", "->", "config", ";", "foreach", "(", "$", "keys", "as", "$", "key", ")", "{", "if", "(", ...
Fetches a single value from a key chain of N depth @return array|mixed @throws KeyNotFoundException
[ "Fetches", "a", "single", "value", "from", "a", "key", "chain", "of", "N", "depth" ]
4017fc4c9669abf2fe58cc2ed4dd5dab5d7224a8
https://github.com/shazam/easy-config/blob/4017fc4c9669abf2fe58cc2ed4dd5dab5d7224a8/src/Config.php#L111-L125
201,018
shazam/easy-config
src/Config.php
Config.flush
public function flush() { if ($this->useCache) { foreach ($this->configFiles as $configFile) { if (function_exists('apc_delete')) { \apc_delete($configFile); } } } $this->config = array(); }
php
public function flush() { if ($this->useCache) { foreach ($this->configFiles as $configFile) { if (function_exists('apc_delete')) { \apc_delete($configFile); } } } $this->config = array(); }
[ "public", "function", "flush", "(", ")", "{", "if", "(", "$", "this", "->", "useCache", ")", "{", "foreach", "(", "$", "this", "->", "configFiles", "as", "$", "configFile", ")", "{", "if", "(", "function_exists", "(", "'apc_delete'", ")", ")", "{", "...
If cache is used, flushes it. Otherwise it just empties config property.
[ "If", "cache", "is", "used", "flushes", "it", ".", "Otherwise", "it", "just", "empties", "config", "property", "." ]
4017fc4c9669abf2fe58cc2ed4dd5dab5d7224a8
https://github.com/shazam/easy-config/blob/4017fc4c9669abf2fe58cc2ed4dd5dab5d7224a8/src/Config.php#L140-L150
201,019
shazam/easy-config
src/Config.php
Config.loadConfigFile
private function loadConfigFile($configFile) { if ($this->useCache) { if (function_exists('apc_fetch')) { $config = apc_fetch($configFile); } elseif (function_exists('apcu_fetch')) { $config = apcu_fetch($configFile); } if (!em...
php
private function loadConfigFile($configFile) { if ($this->useCache) { if (function_exists('apc_fetch')) { $config = apc_fetch($configFile); } elseif (function_exists('apcu_fetch')) { $config = apcu_fetch($configFile); } if (!em...
[ "private", "function", "loadConfigFile", "(", "$", "configFile", ")", "{", "if", "(", "$", "this", "->", "useCache", ")", "{", "if", "(", "function_exists", "(", "'apc_fetch'", ")", ")", "{", "$", "config", "=", "apc_fetch", "(", "$", "configFile", ")", ...
Loads a config file into config property. If cache is used, first check if the config file was previously loaded. @throws FileNotFoundException @throws InvalidConfigFileException
[ "Loads", "a", "config", "file", "into", "config", "property", ".", "If", "cache", "is", "used", "first", "check", "if", "the", "config", "file", "was", "previously", "loaded", "." ]
4017fc4c9669abf2fe58cc2ed4dd5dab5d7224a8
https://github.com/shazam/easy-config/blob/4017fc4c9669abf2fe58cc2ed4dd5dab5d7224a8/src/Config.php#L158-L194
201,020
werx/core
src/Controller.php
Controller.initializeRequest
public function initializeRequest($request = null) { if (empty($request)) { $this->request = Request::createFromGlobals(); } else { $this->request = $request; } // Shortcuts to the request object for cleaner syntax. $this->input = new Input($this->request); }
php
public function initializeRequest($request = null) { if (empty($request)) { $this->request = Request::createFromGlobals(); } else { $this->request = $request; } // Shortcuts to the request object for cleaner syntax. $this->input = new Input($this->request); }
[ "public", "function", "initializeRequest", "(", "$", "request", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "request", ")", ")", "{", "$", "this", "->", "request", "=", "Request", "::", "createFromGlobals", "(", ")", ";", "}", "else", "{", "...
Get info about the HTTP Request @var \Symfony\Component\HttpFoundation\Request $request
[ "Get", "info", "about", "the", "HTTP", "Request" ]
9ab7a9f7a8c02e1d41ca40301afada8129ea0a79
https://github.com/werx/core/blob/9ab7a9f7a8c02e1d41ca40301afada8129ea0a79/src/Controller.php#L121-L131
201,021
werx/core
src/Controller.php
Controller.jsonp
public function jsonp($content = [], $jsonCallback = 'callback') { $response = new JsonResponse(); $response->setData($content); $response->setCallback($jsonCallback); $response->send(); }
php
public function jsonp($content = [], $jsonCallback = 'callback') { $response = new JsonResponse(); $response->setData($content); $response->setCallback($jsonCallback); $response->send(); }
[ "public", "function", "jsonp", "(", "$", "content", "=", "[", "]", ",", "$", "jsonCallback", "=", "'callback'", ")", "{", "$", "response", "=", "new", "JsonResponse", "(", ")", ";", "$", "response", "->", "setData", "(", "$", "content", ")", ";", "$"...
Send a jsonp response with given content. @param array $content @param string $jsonCallback
[ "Send", "a", "jsonp", "response", "with", "given", "content", "." ]
9ab7a9f7a8c02e1d41ca40301afada8129ea0a79
https://github.com/werx/core/blob/9ab7a9f7a8c02e1d41ca40301afada8129ea0a79/src/Controller.php#L242-L248
201,022
werx/core
src/Controller.php
Controller.getRequestedController
public function getRequestedController($default = null) { if (property_exists($this, 'app') && is_object($this->app) && property_exists($this->app, 'controller')) { return $this->app->controller; } elseif (!empty($default)) { return $default; } else { $reflect = new \ReflectionClass($this); return st...
php
public function getRequestedController($default = null) { if (property_exists($this, 'app') && is_object($this->app) && property_exists($this->app, 'controller')) { return $this->app->controller; } elseif (!empty($default)) { return $default; } else { $reflect = new \ReflectionClass($this); return st...
[ "public", "function", "getRequestedController", "(", "$", "default", "=", "null", ")", "{", "if", "(", "property_exists", "(", "$", "this", ",", "'app'", ")", "&&", "is_object", "(", "$", "this", "->", "app", ")", "&&", "property_exists", "(", "$", "this...
Which controller was requested? @param null $default @return null|string
[ "Which", "controller", "was", "requested?" ]
9ab7a9f7a8c02e1d41ca40301afada8129ea0a79
https://github.com/werx/core/blob/9ab7a9f7a8c02e1d41ca40301afada8129ea0a79/src/Controller.php#L256-L266
201,023
werx/core
src/Controller.php
Controller.getRequestedAction
public function getRequestedAction($default = 'index') { if (property_exists($this, 'app') && is_object($this->app) && property_exists($this->app, 'action')) { return $this->app->action; } else { return $default; } }
php
public function getRequestedAction($default = 'index') { if (property_exists($this, 'app') && is_object($this->app) && property_exists($this->app, 'action')) { return $this->app->action; } else { return $default; } }
[ "public", "function", "getRequestedAction", "(", "$", "default", "=", "'index'", ")", "{", "if", "(", "property_exists", "(", "$", "this", ",", "'app'", ")", "&&", "is_object", "(", "$", "this", "->", "app", ")", "&&", "property_exists", "(", "$", "this"...
Which action was requested? @param string $default @return string
[ "Which", "action", "was", "requested?" ]
9ab7a9f7a8c02e1d41ca40301afada8129ea0a79
https://github.com/werx/core/blob/9ab7a9f7a8c02e1d41ca40301afada8129ea0a79/src/Controller.php#L274-L281
201,024
AlexyaFramework/Database
Alexya/Database/ORM/Model.php
Model.initialize
public static function initialize(Connection $connection, string $baseNamespace = "\\") { self::$_connection = $connection; self::$_baseNamespace = Str::trailing($baseNamespace, "\\"); }
php
public static function initialize(Connection $connection, string $baseNamespace = "\\") { self::$_connection = $connection; self::$_baseNamespace = Str::trailing($baseNamespace, "\\"); }
[ "public", "static", "function", "initialize", "(", "Connection", "$", "connection", ",", "string", "$", "baseNamespace", "=", "\"\\\\\"", ")", "{", "self", "::", "$", "_connection", "=", "$", "connection", ";", "self", "::", "$", "_baseNamespace", "=", "Str"...
Initializes the class. @param Connection $connection Database connection. @param string $baseNamespace Base namespace of the ORM classes.
[ "Initializes", "the", "class", "." ]
5eb12dc183700ed2357495f4d2c2863ca033eb5a
https://github.com/AlexyaFramework/Database/blob/5eb12dc183700ed2357495f4d2c2863ca033eb5a/Alexya/Database/ORM/Model.php#L196-L200
201,025
AlexyaFramework/Database
Alexya/Database/ORM/Model.php
Model.find
public static function find($id, $limit = -1, string $table = "", bool $setRelations = true) { $query = new QueryBuilder(self::$_connection); $model = new static(); $query->select("*"); if($table === "") { $query->from($model->getTable()); } else { $...
php
public static function find($id, $limit = -1, string $table = "", bool $setRelations = true) { $query = new QueryBuilder(self::$_connection); $model = new static(); $query->select("*"); if($table === "") { $query->from($model->getTable()); } else { $...
[ "public", "static", "function", "find", "(", "$", "id", ",", "$", "limit", "=", "-", "1", ",", "string", "$", "table", "=", "\"\"", ",", "bool", "$", "setRelations", "=", "true", ")", "{", "$", "query", "=", "new", "QueryBuilder", "(", "self", "::"...
Finds and returns one or more record from the database. @param int|string|array $id Primary key value or `WHERE` clause. @param int|array $limit Amount of records to retrieve from database, if `-1` (or empty array) an instance of the Model class will be returned. @param string $table ...
[ "Finds", "and", "returns", "one", "or", "more", "record", "from", "the", "database", "." ]
5eb12dc183700ed2357495f4d2c2863ca033eb5a
https://github.com/AlexyaFramework/Database/blob/5eb12dc183700ed2357495f4d2c2863ca033eb5a/Alexya/Database/ORM/Model.php#L244-L293
201,026
AlexyaFramework/Database
Alexya/Database/ORM/Model.php
Model.all
public static function all(array $where = [], string $table = "", bool $setRelations = true) : array { $query = new QueryBuilder(self::$_connection); $model = new static(); $query->select("*"); if($table === "") { $query->from($model->getTable()); } else { ...
php
public static function all(array $where = [], string $table = "", bool $setRelations = true) : array { $query = new QueryBuilder(self::$_connection); $model = new static(); $query->select("*"); if($table === "") { $query->from($model->getTable()); } else { ...
[ "public", "static", "function", "all", "(", "array", "$", "where", "=", "[", "]", ",", "string", "$", "table", "=", "\"\"", ",", "bool", "$", "setRelations", "=", "true", ")", ":", "array", "{", "$", "query", "=", "new", "QueryBuilder", "(", "self", ...
Returns all records from database. @param array $where Where clause array. @param string $table Table that will be used to get the records from. @param bool $setRelations Whether relations should be processed or not. @return Model[] Records from database.
[ "Returns", "all", "records", "from", "database", "." ]
5eb12dc183700ed2357495f4d2c2863ca033eb5a
https://github.com/AlexyaFramework/Database/blob/5eb12dc183700ed2357495f4d2c2863ca033eb5a/Alexya/Database/ORM/Model.php#L304-L332
201,027
AlexyaFramework/Database
Alexya/Database/ORM/Model.php
Model._setWhere
private static function _setWhere($where, QueryBuilder $query, string $primaryKey = "id") : QueryBuilder { if(!is_array($where)) { return $query->where([ $primaryKey => $where ]); } $columns = $where; unset($columns["ORDER BY"]); unse...
php
private static function _setWhere($where, QueryBuilder $query, string $primaryKey = "id") : QueryBuilder { if(!is_array($where)) { return $query->where([ $primaryKey => $where ]); } $columns = $where; unset($columns["ORDER BY"]); unse...
[ "private", "static", "function", "_setWhere", "(", "$", "where", ",", "QueryBuilder", "$", "query", ",", "string", "$", "primaryKey", "=", "\"id\"", ")", ":", "QueryBuilder", "{", "if", "(", "!", "is_array", "(", "$", "where", ")", ")", "{", "return", ...
Sets the WHERE param to the query. @param int|array $where WHERE param. @param QueryBuilder $query Query to build. @param string $primaryKey Table primary key. @return QueryBuilder Query object.
[ "Sets", "the", "WHERE", "param", "to", "the", "query", "." ]
5eb12dc183700ed2357495f4d2c2863ca033eb5a
https://github.com/AlexyaFramework/Database/blob/5eb12dc183700ed2357495f4d2c2863ca033eb5a/Alexya/Database/ORM/Model.php#L384-L423
201,028
AlexyaFramework/Database
Alexya/Database/ORM/Model.php
Model.set
public function set(string $name, $value) { $this->_data[$name] = $value; if(!is_object($value)) { $this->_changed[$name] = $value; } }
php
public function set(string $name, $value) { $this->_data[$name] = $value; if(!is_object($value)) { $this->_changed[$name] = $value; } }
[ "public", "function", "set", "(", "string", "$", "name", ",", "$", "value", ")", "{", "$", "this", "->", "_data", "[", "$", "name", "]", "=", "$", "value", ";", "if", "(", "!", "is_object", "(", "$", "value", ")", ")", "{", "$", "this", "->", ...
Sets a column. @param string $name Column name. @param string $value Column value.
[ "Sets", "a", "column", "." ]
5eb12dc183700ed2357495f4d2c2863ca033eb5a
https://github.com/AlexyaFramework/Database/blob/5eb12dc183700ed2357495f4d2c2863ca033eb5a/Alexya/Database/ORM/Model.php#L768-L775
201,029
AlexyaFramework/Database
Alexya/Database/ORM/Model.php
Model.save
public function save() { $query = new QueryBuilder(self::$_connection); if($this->_isInsert) { $query->insert($this->getTable()) ->values($this->_changed); $id = self::$_connection->insert($query->getQuery()); $this->_data[$this->_primaryKey] =...
php
public function save() { $query = new QueryBuilder(self::$_connection); if($this->_isInsert) { $query->insert($this->getTable()) ->values($this->_changed); $id = self::$_connection->insert($query->getQuery()); $this->_data[$this->_primaryKey] =...
[ "public", "function", "save", "(", ")", "{", "$", "query", "=", "new", "QueryBuilder", "(", "self", "::", "$", "_connection", ")", ";", "if", "(", "$", "this", "->", "_isInsert", ")", "{", "$", "query", "->", "insert", "(", "$", "this", "->", "getT...
Saves the changes to the database.
[ "Saves", "the", "changes", "to", "the", "database", "." ]
5eb12dc183700ed2357495f4d2c2863ca033eb5a
https://github.com/AlexyaFramework/Database/blob/5eb12dc183700ed2357495f4d2c2863ca033eb5a/Alexya/Database/ORM/Model.php#L803-L828
201,030
AlexyaFramework/Database
Alexya/Database/ORM/Model.php
Model.getTable
public function getTable() : string { if(!empty($this->_table)) { return $this->_table; } $class = explode("\\", str_replace(self::$_baseNamespace, "", "\\".get_called_class())); $table = Str::snake(Str::plural($class)); $this->_table = $table; return $...
php
public function getTable() : string { if(!empty($this->_table)) { return $this->_table; } $class = explode("\\", str_replace(self::$_baseNamespace, "", "\\".get_called_class())); $table = Str::snake(Str::plural($class)); $this->_table = $table; return $...
[ "public", "function", "getTable", "(", ")", ":", "string", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "_table", ")", ")", "{", "return", "$", "this", "->", "_table", ";", "}", "$", "class", "=", "explode", "(", "\"\\\\\"", ",", "str_repl...
Builds and returns table name. @return string Table name.
[ "Builds", "and", "returns", "table", "name", "." ]
5eb12dc183700ed2357495f4d2c2863ca033eb5a
https://github.com/AlexyaFramework/Database/blob/5eb12dc183700ed2357495f4d2c2863ca033eb5a/Alexya/Database/ORM/Model.php#L835-L847
201,031
AlexyaFramework/Database
Alexya/Database/ORM/Model.php
Model.asArray
public function asArray(bool $decodeJSON = true) : array { if(!$decodeJSON) { return $this->_data; } $return = []; foreach($this->_data as $key => $value) { $decoded = json_decode($value); $return[$key] = $decoded; if( ...
php
public function asArray(bool $decodeJSON = true) : array { if(!$decodeJSON) { return $this->_data; } $return = []; foreach($this->_data as $key => $value) { $decoded = json_decode($value); $return[$key] = $decoded; if( ...
[ "public", "function", "asArray", "(", "bool", "$", "decodeJSON", "=", "true", ")", ":", "array", "{", "if", "(", "!", "$", "decodeJSON", ")", "{", "return", "$", "this", "->", "_data", ";", "}", "$", "return", "=", "[", "]", ";", "foreach", "(", ...
Returns table values. @param bool $decodeJSON Whether the JSONs should be decoded or not. @return array Table values.
[ "Returns", "table", "values", "." ]
5eb12dc183700ed2357495f4d2c2863ca033eb5a
https://github.com/AlexyaFramework/Database/blob/5eb12dc183700ed2357495f4d2c2863ca033eb5a/Alexya/Database/ORM/Model.php#L856-L876
201,032
AlexyaFramework/Database
Alexya/Database/ORM/Model.php
Model.asJSON
public function asJSON() : string { $fields = []; foreach($this->_data as $key => $value) { if(!is_object($value)) { $fields[$key] = $value; } } return json_encode($fields); }
php
public function asJSON() : string { $fields = []; foreach($this->_data as $key => $value) { if(!is_object($value)) { $fields[$key] = $value; } } return json_encode($fields); }
[ "public", "function", "asJSON", "(", ")", ":", "string", "{", "$", "fields", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "_data", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "!", "is_object", "(", "$", "value", ")", ")...
Returns values as a JSON. @return string Encoded JSON.
[ "Returns", "values", "as", "a", "JSON", "." ]
5eb12dc183700ed2357495f4d2c2863ca033eb5a
https://github.com/AlexyaFramework/Database/blob/5eb12dc183700ed2357495f4d2c2863ca033eb5a/Alexya/Database/ORM/Model.php#L883-L894
201,033
Sectorr/Core
Sectorr/Core/Http/Route.php
Route.findRoute
public static function findRoute($route, $properties = []) { // Check if properties for dynamic routing are given. if (! empty($properties)) { // Loop through all the created routes foreach (self::$routes as $r) { // Check if the given route name is equal to...
php
public static function findRoute($route, $properties = []) { // Check if properties for dynamic routing are given. if (! empty($properties)) { // Loop through all the created routes foreach (self::$routes as $r) { // Check if the given route name is equal to...
[ "public", "static", "function", "findRoute", "(", "$", "route", ",", "$", "properties", "=", "[", "]", ")", "{", "// Check if properties for dynamic routing are given.", "if", "(", "!", "empty", "(", "$", "properties", ")", ")", "{", "// Loop through all the creat...
Finds a route by the given route name. Also takes properties to put into the route url. @param $route @param array $properties @return string
[ "Finds", "a", "route", "by", "the", "given", "route", "name", ".", "Also", "takes", "properties", "to", "put", "into", "the", "route", "url", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Http/Route.php#L56-L95
201,034
Sectorr/Core
Sectorr/Core/Http/Route.php
Route.callController
private static function callController($route, $properties = []) { $props = $route['props']; $uses = $props['uses']; // Check if any middleware has been set. if (! empty($props['middleware'])) { if (! ctype_upper(substr($props['middleware'], 0, 1))) { $mi...
php
private static function callController($route, $properties = []) { $props = $route['props']; $uses = $props['uses']; // Check if any middleware has been set. if (! empty($props['middleware'])) { if (! ctype_upper(substr($props['middleware'], 0, 1))) { $mi...
[ "private", "static", "function", "callController", "(", "$", "route", ",", "$", "properties", "=", "[", "]", ")", "{", "$", "props", "=", "$", "route", "[", "'props'", "]", ";", "$", "uses", "=", "$", "props", "[", "'uses'", "]", ";", "// Check if an...
Call controller by route. @param $route @param array $properties @return @throws ControllerNotFoundException @throws MiddlewareNotFoundException
[ "Call", "controller", "by", "route", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Http/Route.php#L118-L155
201,035
Sectorr/Core
Sectorr/Core/Http/Route.php
Route.execute
public static function execute($currentRoute) { $currentRouteParts = explode('/', $currentRoute); foreach (self::$routes as $route) { // Check if route matches complete URL. if ($route['url'] == $currentRoute) { return self::callController($route); ...
php
public static function execute($currentRoute) { $currentRouteParts = explode('/', $currentRoute); foreach (self::$routes as $route) { // Check if route matches complete URL. if ($route['url'] == $currentRoute) { return self::callController($route); ...
[ "public", "static", "function", "execute", "(", "$", "currentRoute", ")", "{", "$", "currentRouteParts", "=", "explode", "(", "'/'", ",", "$", "currentRoute", ")", ";", "foreach", "(", "self", "::", "$", "routes", "as", "$", "route", ")", "{", "// Check ...
Execute routing. @param $currentRoute @throws RouteNotFoundException @return
[ "Execute", "routing", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Http/Route.php#L164-L216
201,036
flipbox/transformer
src/filters/TransformFilter.php
TransformFilter.transformDataProvider
protected function transformDataProvider(DataProviderInterface $dataProvider) { if (Craft::$app->getRequest()->getIsHead()) { return null; } else { if (!$transformer = $this->dataTransformer()) { return $dataProvider; } // The transfor...
php
protected function transformDataProvider(DataProviderInterface $dataProvider) { if (Craft::$app->getRequest()->getIsHead()) { return null; } else { if (!$transformer = $this->dataTransformer()) { return $dataProvider; } // The transfor...
[ "protected", "function", "transformDataProvider", "(", "DataProviderInterface", "$", "dataProvider", ")", "{", "if", "(", "Craft", "::", "$", "app", "->", "getRequest", "(", ")", "->", "getIsHead", "(", ")", ")", "{", "return", "null", ";", "}", "else", "{...
Serializes a data provider. @param DataProviderInterface $dataProvider @return array|DataProviderInterface the array representation of the data provider.
[ "Serializes", "a", "data", "provider", "." ]
1ca989b545f5e94520504a6890e2237610571726
https://github.com/flipbox/transformer/blob/1ca989b545f5e94520504a6890e2237610571726/src/filters/TransformFilter.php#L137-L161
201,037
WellCommerce/CategoryBundle
Manager/CategoryManager.php
CategoryManager.sortCategories
public function sortCategories(array $items) { $repository = $this->getRepository(); $em = $this->getDoctrineHelper()->getEntityManager(); foreach ($items as $item) { $parent = $repository->find($item['parent']); $child = $repository->find($item['id']); ...
php
public function sortCategories(array $items) { $repository = $this->getRepository(); $em = $this->getDoctrineHelper()->getEntityManager(); foreach ($items as $item) { $parent = $repository->find($item['parent']); $child = $repository->find($item['id']); ...
[ "public", "function", "sortCategories", "(", "array", "$", "items", ")", "{", "$", "repository", "=", "$", "this", "->", "getRepository", "(", ")", ";", "$", "em", "=", "$", "this", "->", "getDoctrineHelper", "(", ")", "->", "getEntityManager", "(", ")",...
Sorts categories passed in request @param array $items
[ "Sorts", "categories", "passed", "in", "request" ]
7a23ac678f91d15e86bdff624c4799be7b076e1a
https://github.com/WellCommerce/CategoryBundle/blob/7a23ac678f91d15e86bdff624c4799be7b076e1a/Manager/CategoryManager.php#L33-L49
201,038
WellCommerce/CategoryBundle
Manager/CategoryManager.php
CategoryManager.translateCategory
protected function translateCategory(Locale $locale, CategoryInterface $category, $name) { /** * @var $translation \WellCommerce\Bundle\CategoryBundle\Entity\CategoryTranslation */ $translation = $category->translate($locale->getCode()); $slug = $this->getLocaleSlug(...
php
protected function translateCategory(Locale $locale, CategoryInterface $category, $name) { /** * @var $translation \WellCommerce\Bundle\CategoryBundle\Entity\CategoryTranslation */ $translation = $category->translate($locale->getCode()); $slug = $this->getLocaleSlug(...
[ "protected", "function", "translateCategory", "(", "Locale", "$", "locale", ",", "CategoryInterface", "$", "category", ",", "$", "name", ")", "{", "/**\n * @var $translation \\WellCommerce\\Bundle\\CategoryBundle\\Entity\\CategoryTranslation\n */", "$", "translati...
Translates the category @param Locale $locale @param CategoryInterface $category @param string $name
[ "Translates", "the", "category" ]
7a23ac678f91d15e86bdff624c4799be7b076e1a
https://github.com/WellCommerce/CategoryBundle/blob/7a23ac678f91d15e86bdff624c4799be7b076e1a/Manager/CategoryManager.php#L87-L97
201,039
WellCommerce/CategoryBundle
Manager/CategoryManager.php
CategoryManager.getLocaleSlug
protected function getLocaleSlug(Locale $locale, $categoryName) { $slug = Sluggable::makeSlug($categoryName); $currentLocale = $this->getRequestHelper()->getCurrentLocale(); if ($locale->getCode() != $currentLocale) { $slug = Sluggable::makeSlug(sprintf('%s-%s', $categor...
php
protected function getLocaleSlug(Locale $locale, $categoryName) { $slug = Sluggable::makeSlug($categoryName); $currentLocale = $this->getRequestHelper()->getCurrentLocale(); if ($locale->getCode() != $currentLocale) { $slug = Sluggable::makeSlug(sprintf('%s-%s', $categor...
[ "protected", "function", "getLocaleSlug", "(", "Locale", "$", "locale", ",", "$", "categoryName", ")", "{", "$", "slug", "=", "Sluggable", "::", "makeSlug", "(", "$", "categoryName", ")", ";", "$", "currentLocale", "=", "$", "this", "->", "getRequestHelper",...
Returns category slug @param Locale $locale @param string $categoryName @return mixed|string
[ "Returns", "category", "slug" ]
7a23ac678f91d15e86bdff624c4799be7b076e1a
https://github.com/WellCommerce/CategoryBundle/blob/7a23ac678f91d15e86bdff624c4799be7b076e1a/Manager/CategoryManager.php#L107-L116
201,040
Blipfoto/php-sdk
src/Blipfoto/Api/Response.php
Response.data
public function data($key = null) { $data = $this->body['data']; if ($key !== null) { foreach (explode('.', $key) as $part) { if (isset($data[$part])) { $data = $data[$part]; } else { $data = null; break; } } } return $data; }
php
public function data($key = null) { $data = $this->body['data']; if ($key !== null) { foreach (explode('.', $key) as $part) { if (isset($data[$part])) { $data = $data[$part]; } else { $data = null; break; } } } return $data; }
[ "public", "function", "data", "(", "$", "key", "=", "null", ")", "{", "$", "data", "=", "$", "this", "->", "body", "[", "'data'", "]", ";", "if", "(", "$", "key", "!==", "null", ")", "{", "foreach", "(", "explode", "(", "'.'", ",", "$", "key", ...
Return the response's data, a key from the data, or null if the data or key does not exist. @param string $key (optional) @return mixed
[ "Return", "the", "response", "s", "data", "a", "key", "from", "the", "data", "or", "null", "if", "the", "data", "or", "key", "does", "not", "exist", "." ]
04f770ac7427e79d15f97b993c787651079cdeb4
https://github.com/Blipfoto/php-sdk/blob/04f770ac7427e79d15f97b993c787651079cdeb4/src/Blipfoto/Api/Response.php#L76-L89
201,041
Blipfoto/php-sdk
src/Blipfoto/Api/Response.php
Response.rateLimit
public function rateLimit($key = null) { return $key ? (isset($this->rate_limit[$key]) ? $this->rate_limit[$key] : null) : $this->rate_limit; }
php
public function rateLimit($key = null) { return $key ? (isset($this->rate_limit[$key]) ? $this->rate_limit[$key] : null) : $this->rate_limit; }
[ "public", "function", "rateLimit", "(", "$", "key", "=", "null", ")", "{", "return", "$", "key", "?", "(", "isset", "(", "$", "this", "->", "rate_limit", "[", "$", "key", "]", ")", "?", "$", "this", "->", "rate_limit", "[", "$", "key", "]", ":", ...
Return the response's rate limit info array, a key from the array, or null if the info or key does not exist. @param string $key (optional) @return mixed
[ "Return", "the", "response", "s", "rate", "limit", "info", "array", "a", "key", "from", "the", "array", "or", "null", "if", "the", "info", "or", "key", "does", "not", "exist", "." ]
04f770ac7427e79d15f97b993c787651079cdeb4
https://github.com/Blipfoto/php-sdk/blob/04f770ac7427e79d15f97b993c787651079cdeb4/src/Blipfoto/Api/Response.php#L97-L99
201,042
CalderaWP/caldera-interop
src/Traits/Rest/ProvidesHttpHeaders.php
ProvidesHttpHeaders.getHeader
public function getHeader(string $headerName) { return $this->hasHeader($headerName) ? $this->headers[ $headerName ] : null; }
php
public function getHeader(string $headerName) { return $this->hasHeader($headerName) ? $this->headers[ $headerName ] : null; }
[ "public", "function", "getHeader", "(", "string", "$", "headerName", ")", "{", "return", "$", "this", "->", "hasHeader", "(", "$", "headerName", ")", "?", "$", "this", "->", "headers", "[", "$", "headerName", "]", ":", "null", ";", "}" ]
Get header from request @param string $headerName @return string|null
[ "Get", "header", "from", "request" ]
d25c4bc930200b314fbd42d084080b5d85261c94
https://github.com/CalderaWP/caldera-interop/blob/d25c4bc930200b314fbd42d084080b5d85261c94/src/Traits/Rest/ProvidesHttpHeaders.php#L25-L28
201,043
CalderaWP/caldera-interop
src/Traits/Rest/ProvidesHttpHeaders.php
ProvidesHttpHeaders.setHeader
public function setHeader(string $headerName, $headerValue): HttpRequestContract { $this->headers[ $headerName ] = $headerValue; return $this; }
php
public function setHeader(string $headerName, $headerValue): HttpRequestContract { $this->headers[ $headerName ] = $headerValue; return $this; }
[ "public", "function", "setHeader", "(", "string", "$", "headerName", ",", "$", "headerValue", ")", ":", "HttpRequestContract", "{", "$", "this", "->", "headers", "[", "$", "headerName", "]", "=", "$", "headerValue", ";", "return", "$", "this", ";", "}" ]
Set header in request @param string $headerName @param mixed $headerValue @return HttpRequestContract
[ "Set", "header", "in", "request" ]
d25c4bc930200b314fbd42d084080b5d85261c94
https://github.com/CalderaWP/caldera-interop/blob/d25c4bc930200b314fbd42d084080b5d85261c94/src/Traits/Rest/ProvidesHttpHeaders.php#L53-L57
201,044
nails/module-blog
blog/controllers/_blog.php
NAILS_Blog_Controller.loadSkinAssets
protected function loadSkinAssets($aAssets, $aCssInline, $aJsInline, $sUrl) { $oAsset = Factory::service('Asset'); // CSS and JS if (!empty($aAssets) && is_array($aAssets)) { foreach ($aAssets as $asset) { if (is_string($asset)) { $oAsset->lo...
php
protected function loadSkinAssets($aAssets, $aCssInline, $aJsInline, $sUrl) { $oAsset = Factory::service('Asset'); // CSS and JS if (!empty($aAssets) && is_array($aAssets)) { foreach ($aAssets as $asset) { if (is_string($asset)) { $oAsset->lo...
[ "protected", "function", "loadSkinAssets", "(", "$", "aAssets", ",", "$", "aCssInline", ",", "$", "aJsInline", ",", "$", "sUrl", ")", "{", "$", "oAsset", "=", "Factory", "::", "service", "(", "'Asset'", ")", ";", "// CSS and JS", "if", "(", "!", "empty"...
Loads any assets required by the skin @param array $aAssets An array of skin assets @param array $aCssInline An array of inline CSS @param array $aJsInline An array of inline JS @param string $sUrl The URL to the skin's root directory @return void
[ "Loads", "any", "assets", "required", "by", "the", "skin" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/controllers/_blog.php#L165-L199
201,045
swokit/utils
src/AsyncTimer.php
AsyncTimer.tick
public static function tick(float $ms, callable $callback, $params = null) { $tid = Timer::tick($ms, $callback, $params); // save meta info self::$timers[$tid] = [ 'type' => 'tick', 'ctime' => \time(), // add time. 'interval' => $ms, ]; ...
php
public static function tick(float $ms, callable $callback, $params = null) { $tid = Timer::tick($ms, $callback, $params); // save meta info self::$timers[$tid] = [ 'type' => 'tick', 'ctime' => \time(), // add time. 'interval' => $ms, ]; ...
[ "public", "static", "function", "tick", "(", "float", "$", "ms", ",", "callable", "$", "callback", ",", "$", "params", "=", "null", ")", "{", "$", "tid", "=", "Timer", "::", "tick", "(", "$", "ms", ",", "$", "callback", ",", "$", "params", ")", "...
add a interval timer @param float $ms @param callable $callback @param mixed $params @return mixed
[ "add", "a", "interval", "timer" ]
a91688ee6970e33be14047bf4714da3299796f56
https://github.com/swokit/utils/blob/a91688ee6970e33be14047bf4714da3299796f56/src/AsyncTimer.php#L31-L43
201,046
fridge-project/dbal
src/Fridge/DBAL/Type/Type.php
Type.getType
public static function getType($type) { if (!isset(static::$mappedTypeInstances[$type])) { if (!static::hasType($type)) { throw TypeException::typeDoesNotExist($type); } static::$mappedTypeInstances[$type] = new static::$mappedTypeClasses[$type](); ...
php
public static function getType($type) { if (!isset(static::$mappedTypeInstances[$type])) { if (!static::hasType($type)) { throw TypeException::typeDoesNotExist($type); } static::$mappedTypeInstances[$type] = new static::$mappedTypeClasses[$type](); ...
[ "public", "static", "function", "getType", "(", "$", "type", ")", "{", "if", "(", "!", "isset", "(", "static", "::", "$", "mappedTypeInstances", "[", "$", "type", "]", ")", ")", "{", "if", "(", "!", "static", "::", "hasType", "(", "$", "type", ")",...
Gets a type. @param string $type The type name. @throws \Fridge\DBAL\Exception\TypeException If the type does not exist. @return \Fridge\DBAL\Type\TypeInterface The type.
[ "Gets", "a", "type", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Type/Type.php#L108-L119
201,047
fridge-project/dbal
src/Fridge/DBAL/Type/Type.php
Type.overrideType
public static function overrideType($type, $class) { if (!static::hasType($type)) { throw TypeException::typeDoesNotExist($type); } if (!class_exists($class)) { throw TypeException::classNotFound($class); } if (!in_array('Fridge\DBAL\Type\TypeInterfa...
php
public static function overrideType($type, $class) { if (!static::hasType($type)) { throw TypeException::typeDoesNotExist($type); } if (!class_exists($class)) { throw TypeException::classNotFound($class); } if (!in_array('Fridge\DBAL\Type\TypeInterfa...
[ "public", "static", "function", "overrideType", "(", "$", "type", ",", "$", "class", ")", "{", "if", "(", "!", "static", "::", "hasType", "(", "$", "type", ")", ")", "{", "throw", "TypeException", "::", "typeDoesNotExist", "(", "$", "type", ")", ";", ...
Overrides an existing type. @param string $type The type name. @param string $class The type class. @throws \Fridge\DBAL\Exception\TypeException If the type does not exist, if the class can not be found or if the class does not implement the TypeInterface.
[ "Overrides", "an", "existing", "type", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Type/Type.php#L156-L175
201,048
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.getFieldOutputEnumSetReadOnly
protected function getFieldOutputEnumSetReadOnly($val, $adnlThings) { $inputFeatures = [ 'name' => $val['COLUMN_NAME'] . $adnlThings['suffix'], 'id' => $val['COLUMN_NAME'], 'readonly' => 'readonly', 'class' => 'input_readonly', 'size' ...
php
protected function getFieldOutputEnumSetReadOnly($val, $adnlThings) { $inputFeatures = [ 'name' => $val['COLUMN_NAME'] . $adnlThings['suffix'], 'id' => $val['COLUMN_NAME'], 'readonly' => 'readonly', 'class' => 'input_readonly', 'size' ...
[ "protected", "function", "getFieldOutputEnumSetReadOnly", "(", "$", "val", ",", "$", "adnlThings", ")", "{", "$", "inputFeatures", "=", "[", "'name'", "=>", "$", "val", "[", "'COLUMN_NAME'", "]", ".", "$", "adnlThings", "[", "'suffix'", "]", ",", "'id'", "...
Creates an input for ENUM or SET if marked Read-Only @param array $val @param array $adnlThings @return string
[ "Creates", "an", "input", "for", "ENUM", "or", "SET", "if", "marked", "Read", "-", "Only" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L48-L59
201,049
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.getFieldOutputTT
protected function getFieldOutputTT($value, $szN, $iar = []) { $inAdtnl = [ 'id' => $value['COLUMN_NAME'], 'maxlength' => $szN, 'name' => $value['COLUMN_NAME'], 'size' => $szN, 'type' => 'text', 'value' => $thi...
php
protected function getFieldOutputTT($value, $szN, $iar = []) { $inAdtnl = [ 'id' => $value['COLUMN_NAME'], 'maxlength' => $szN, 'name' => $value['COLUMN_NAME'], 'size' => $szN, 'type' => 'text', 'value' => $thi...
[ "protected", "function", "getFieldOutputTT", "(", "$", "value", ",", "$", "szN", ",", "$", "iar", "=", "[", "]", ")", "{", "$", "inAdtnl", "=", "[", "'id'", "=>", "$", "value", "[", "'COLUMN_NAME'", "]", ",", "'maxlength'", "=>", "$", "szN", ",", "...
Builds output as text input type @param array $value @param integer $szN @param array $iar @return string
[ "Builds", "output", "as", "text", "input", "type" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L69-L83
201,050
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.getFieldValue
protected function getFieldValue($details) { $this->initializeSprGlbAndSession(); $rqCN = $this->tCmnRequest->request->get($details['COLUMN_NAME']); if (!is_null($rqCN)) { if (($details['IS_NULLABLE'] == 'YES') && ($rqCN == '')) { return 'NULL'; } ...
php
protected function getFieldValue($details) { $this->initializeSprGlbAndSession(); $rqCN = $this->tCmnRequest->request->get($details['COLUMN_NAME']); if (!is_null($rqCN)) { if (($details['IS_NULLABLE'] == 'YES') && ($rqCN == '')) { return 'NULL'; } ...
[ "protected", "function", "getFieldValue", "(", "$", "details", ")", "{", "$", "this", "->", "initializeSprGlbAndSession", "(", ")", ";", "$", "rqCN", "=", "$", "this", "->", "tCmnRequest", "->", "request", "->", "get", "(", "$", "details", "[", "'COLUMN_NA...
Returns given value for a field from REQUEST global variable @param array $details @return string
[ "Returns", "given", "value", "for", "a", "field", "from", "REQUEST", "global", "variable" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L91-L102
201,051
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.setFieldLabel
protected function setFieldLabel($details, $features, $fieldLabel) { $aLabel = ['for' => $details['COLUMN_NAME'], 'id' => $details['COLUMN_NAME'] . '_label']; if (isset($features['disabled'])) { if (in_array($details['COLUMN_NAME'], $features['disabled'])) { $aLabel = arr...
php
protected function setFieldLabel($details, $features, $fieldLabel) { $aLabel = ['for' => $details['COLUMN_NAME'], 'id' => $details['COLUMN_NAME'] . '_label']; if (isset($features['disabled'])) { if (in_array($details['COLUMN_NAME'], $features['disabled'])) { $aLabel = arr...
[ "protected", "function", "setFieldLabel", "(", "$", "details", ",", "$", "features", ",", "$", "fieldLabel", ")", "{", "$", "aLabel", "=", "[", "'for'", "=>", "$", "details", "[", "'COLUMN_NAME'", "]", ",", "'id'", "=>", "$", "details", "[", "'COLUMN_NAM...
Prepares the label for inputs @param array $details @param array $features @param string $fieldLabel @return string
[ "Prepares", "the", "label", "for", "inputs" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L129-L138
201,052
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.setFieldNumbers
protected function setFieldNumbers($fieldDetails, $outputFormated = false) { $sRtrn = $this->setFieldSpecific($fieldDetails); if ($outputFormated) { foreach ($sRtrn as $key => $value) { $sRtrn[$key] = $this->setNumberFormat($value); } } return ...
php
protected function setFieldNumbers($fieldDetails, $outputFormated = false) { $sRtrn = $this->setFieldSpecific($fieldDetails); if ($outputFormated) { foreach ($sRtrn as $key => $value) { $sRtrn[$key] = $this->setNumberFormat($value); } } return ...
[ "protected", "function", "setFieldNumbers", "(", "$", "fieldDetails", ",", "$", "outputFormated", "=", "false", ")", "{", "$", "sRtrn", "=", "$", "this", "->", "setFieldSpecific", "(", "$", "fieldDetails", ")", ";", "if", "(", "$", "outputFormated", ")", "...
Returns maximum length for a given MySQL field @param array $fieldDetails @param boolean $outputFormated @return array
[ "Returns", "maximum", "length", "for", "a", "given", "MySQL", "field" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L147-L156
201,053
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.setFieldSpecific
private function setFieldSpecific($fieldDetails) { if (in_array($fieldDetails['DATA_TYPE'], ['char', 'varchar', 'tinytext', 'text', 'mediumtext', 'longtext'])) { return ['M' => $fieldDetails['CHARACTER_MAXIMUM_LENGTH']]; } elseif (in_array($fieldDetails['DATA_TYPE'], ['decimal', 'numeric...
php
private function setFieldSpecific($fieldDetails) { if (in_array($fieldDetails['DATA_TYPE'], ['char', 'varchar', 'tinytext', 'text', 'mediumtext', 'longtext'])) { return ['M' => $fieldDetails['CHARACTER_MAXIMUM_LENGTH']]; } elseif (in_array($fieldDetails['DATA_TYPE'], ['decimal', 'numeric...
[ "private", "function", "setFieldSpecific", "(", "$", "fieldDetails", ")", "{", "if", "(", "in_array", "(", "$", "fieldDetails", "[", "'DATA_TYPE'", "]", ",", "[", "'char'", ",", "'varchar'", ",", "'tinytext'", ",", "'text'", ",", "'mediumtext'", ",", "'longt...
Establishes numbers of fields @param array $fieldDetails @return array
[ "Establishes", "numbers", "of", "fields" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L164-L174
201,054
danielgp/common-lib
source/MySQLiByDanielGPnumbers.php
MySQLiByDanielGPnumbers.setFormButtons
protected function setFormButtons($feat, $hiddenInfo = []) { $btn = []; $btn[] = '<input type="submit" id="submit" style="margin-left:220px;" value="' . $this->lclMsgCmn('i18n_Form_ButtonSave') . '" />'; if (isset($feat['insertAndUpdate'])) { $btn[] = '<input type="...
php
protected function setFormButtons($feat, $hiddenInfo = []) { $btn = []; $btn[] = '<input type="submit" id="submit" style="margin-left:220px;" value="' . $this->lclMsgCmn('i18n_Form_ButtonSave') . '" />'; if (isset($feat['insertAndUpdate'])) { $btn[] = '<input type="...
[ "protected", "function", "setFormButtons", "(", "$", "feat", ",", "$", "hiddenInfo", "=", "[", "]", ")", "{", "$", "btn", "=", "[", "]", ";", "$", "btn", "[", "]", "=", "'<input type=\"submit\" id=\"submit\" style=\"margin-left:220px;\" value=\"'", ".", "$", "...
Form default buttons @param array $feat @param array $hiddenInfo @return string
[ "Form", "default", "buttons" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPnumbers.php#L216-L230
201,055
rawphp/RawMail
src/RawPHP/RawMail/Mail.php
Mail.init
public function init( $config = NULL ) { $this->mailer = new PHPMailer(); foreach ( $config as $key => $value ) { switch ( $key ) { case 'from_email': $this->mailer->From = $value; break; case '...
php
public function init( $config = NULL ) { $this->mailer = new PHPMailer(); foreach ( $config as $key => $value ) { switch ( $key ) { case 'from_email': $this->mailer->From = $value; break; case '...
[ "public", "function", "init", "(", "$", "config", "=", "NULL", ")", "{", "$", "this", "->", "mailer", "=", "new", "PHPMailer", "(", ")", ";", "foreach", "(", "$", "config", "as", "$", "key", "=>", "$", "value", ")", "{", "switch", "(", "$", "key"...
Initialises the mailer. @param array $config configuration array @action ON_INIT_ACTION
[ "Initialises", "the", "mailer", "." ]
b84e7cc76b7e5db87ea8aabd77417f72162f47ab
https://github.com/rawphp/RawMail/blob/b84e7cc76b7e5db87ea8aabd77417f72162f47ab/src/RawPHP/RawMail/Mail.php#L87-L134
201,056
rawphp/RawMail
src/RawPHP/RawMail/Mail.php
Mail.addCC
public function addCC( $email ) { if ( is_array( $email ) ) { $this->mailer->addCC( $email[ 'email' ], $email[ 'name' ] ); } else { $this->mailer->addCC( $email ); } }
php
public function addCC( $email ) { if ( is_array( $email ) ) { $this->mailer->addCC( $email[ 'email' ], $email[ 'name' ] ); } else { $this->mailer->addCC( $email ); } }
[ "public", "function", "addCC", "(", "$", "email", ")", "{", "if", "(", "is_array", "(", "$", "email", ")", ")", "{", "$", "this", "->", "mailer", "->", "addCC", "(", "$", "email", "[", "'email'", "]", ",", "$", "email", "[", "'name'", "]", ")", ...
Adds a CC address to the email. @param mixed $email email string or email|name array array( 'name' => 'Information', 'email' => 'name@email.com' ); @action ON_ADD_CC_ACTION
[ "Adds", "a", "CC", "address", "to", "the", "email", "." ]
b84e7cc76b7e5db87ea8aabd77417f72162f47ab
https://github.com/rawphp/RawMail/blob/b84e7cc76b7e5db87ea8aabd77417f72162f47ab/src/RawPHP/RawMail/Mail.php#L216-L226
201,057
rawphp/RawMail
src/RawPHP/RawMail/Mail.php
Mail.addBCC
public function addBCC( $email ) { if ( is_array( $email ) ) { $this->mailer->addBCC( $email[ 'email' ], $email[ 'name' ] ); } else { $this->mailer->addBCC( $email ); } }
php
public function addBCC( $email ) { if ( is_array( $email ) ) { $this->mailer->addBCC( $email[ 'email' ], $email[ 'name' ] ); } else { $this->mailer->addBCC( $email ); } }
[ "public", "function", "addBCC", "(", "$", "email", ")", "{", "if", "(", "is_array", "(", "$", "email", ")", ")", "{", "$", "this", "->", "mailer", "->", "addBCC", "(", "$", "email", "[", "'email'", "]", ",", "$", "email", "[", "'name'", "]", ")",...
Adds a BCC address to the email. @param mixed $email email string or email|name array array( 'name' => 'Information', 'email' => 'name@email.com' ); @action ON_ADD_BCC_ACTION
[ "Adds", "a", "BCC", "address", "to", "the", "email", "." ]
b84e7cc76b7e5db87ea8aabd77417f72162f47ab
https://github.com/rawphp/RawMail/blob/b84e7cc76b7e5db87ea8aabd77417f72162f47ab/src/RawPHP/RawMail/Mail.php#L236-L246
201,058
lightwerk/SurfCaptain
Classes/Lightwerk/SurfCaptain/Domain/Model/Deployment.php
Deployment.getReferenceName
public function getReferenceName() { $options = $this->getOptions(); if (!empty($options['tag'])) { return 'Tag: ' . $options['tag']; } elseif (!empty($options['branch'])) { return 'Branch: ' . $options['branch']; } elseif (!empty($options['sha1'])) { ...
php
public function getReferenceName() { $options = $this->getOptions(); if (!empty($options['tag'])) { return 'Tag: ' . $options['tag']; } elseif (!empty($options['branch'])) { return 'Branch: ' . $options['branch']; } elseif (!empty($options['sha1'])) { ...
[ "public", "function", "getReferenceName", "(", ")", "{", "$", "options", "=", "$", "this", "->", "getOptions", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "options", "[", "'tag'", "]", ")", ")", "{", "return", "'Tag: '", ".", "$", "options", ...
Since sha1 is always shipped with branch and tag configuration, we consider it for referenceName only if neither tag nor branch was set. @return string
[ "Since", "sha1", "is", "always", "shipped", "with", "branch", "and", "tag", "configuration", "we", "consider", "it", "for", "referenceName", "only", "if", "neither", "tag", "nor", "branch", "was", "set", "." ]
2865e963fd634504d8923902cf422873749a0940
https://github.com/lightwerk/SurfCaptain/blob/2865e963fd634504d8923902cf422873749a0940/Classes/Lightwerk/SurfCaptain/Domain/Model/Deployment.php#L211-L222
201,059
ReindeerWeb/ClassHelper
src/ClassHelper.php
ClassHelper.singleton
public static function singleton($class = null) { if (!$class) { $class = get_called_class(); } if (!isset(self::$singletons[$class])) { self::$singletons[$class] = self::create($class); } return self::$singletons[$class]; }
php
public static function singleton($class = null) { if (!$class) { $class = get_called_class(); } if (!isset(self::$singletons[$class])) { self::$singletons[$class] = self::create($class); } return self::$singletons[$class]; }
[ "public", "static", "function", "singleton", "(", "$", "class", "=", "null", ")", "{", "if", "(", "!", "$", "class", ")", "{", "$", "class", "=", "get_called_class", "(", ")", ";", "}", "if", "(", "!", "isset", "(", "self", "::", "$", "singletons",...
Creates a class instance by the "singleton" design pattern. It will always return the same instance for this class. @param string $class Optional classname to create, if the called class should not be used @return static The singleton instance
[ "Creates", "a", "class", "instance", "by", "the", "singleton", "design", "pattern", ".", "It", "will", "always", "return", "the", "same", "instance", "for", "this", "class", "." ]
5d53f884d5d4e790c659ac5c5a0c155076ac8c3a
https://github.com/ReindeerWeb/ClassHelper/blob/5d53f884d5d4e790c659ac5c5a0c155076ac8c3a/src/ClassHelper.php#L62-L73
201,060
climphp/Clim
Clim/App.php
App.handleException
protected function handleException(Exception $e) { // if ($e instanceof MethodNotAllowedException) { // $handler = 'notAllowedHandler'; // $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()]; // } elseif ($e instanceof NotFoundException) { // ...
php
protected function handleException(Exception $e) { // if ($e instanceof MethodNotAllowedException) { // $handler = 'notAllowedHandler'; // $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()]; // } elseif ($e instanceof NotFoundException) { // ...
[ "protected", "function", "handleException", "(", "Exception", "$", "e", ")", "{", "// if ($e instanceof MethodNotAllowedException) {", "// $handler = 'notAllowedHandler';", "// $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()];", "// } elseif ($e instanceof Not...
Call relevant handler from the Container if needed. If it doesn't exist, then just print error @param Exception $e @return Context
[ "Call", "relevant", "handler", "from", "the", "Container", "if", "needed", ".", "If", "it", "doesn", "t", "exist", "then", "just", "print", "error" ]
d2d09a82e1b7a0b8d454e585e6db421ff02ec8e4
https://github.com/climphp/Clim/blob/d2d09a82e1b7a0b8d454e585e6db421ff02ec8e4/Clim/App.php#L180-L206
201,061
Linkvalue-Interne/MajoraFrameworkExtraBundle
src/Majora/Framework/Loader/Bridge/Api/ApiLoaderTrait.php
ApiLoaderTrait.apiCall
private function apiCall( $method, array $query = array(), callable $onSuccess, $emptyValue = null ) { try { return $onSuccess( $this->restApiClient->$method($query) ); } catch (BadResponseException $e) { if (($respo...
php
private function apiCall( $method, array $query = array(), callable $onSuccess, $emptyValue = null ) { try { return $onSuccess( $this->restApiClient->$method($query) ); } catch (BadResponseException $e) { if (($respo...
[ "private", "function", "apiCall", "(", "$", "method", ",", "array", "$", "query", "=", "array", "(", ")", ",", "callable", "$", "onSuccess", ",", "$", "emptyValue", "=", "null", ")", "{", "try", "{", "return", "$", "onSuccess", "(", "$", "this", "->"...
Performs an Api call on given method. @param string $method @param array $query @param callable $onSuccess @param mixed $emptyValue
[ "Performs", "an", "Api", "call", "on", "given", "method", "." ]
6f368380cfc39d27fafb0844e9a53b4d86d7c034
https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Loader/Bridge/Api/ApiLoaderTrait.php#L68-L87
201,062
helsingborg-stad/better-post-UI
source/php/Components/PageAttributes.php
PageAttributes.hasKey
public function hasKey(string $needle, array $haystack) : bool { foreach ($haystack as $key => $value) { if ($key === $needle) { return true; } if (is_array($value)) { if ($x = $this->hasKey($needle, $value)) { return $...
php
public function hasKey(string $needle, array $haystack) : bool { foreach ($haystack as $key => $value) { if ($key === $needle) { return true; } if (is_array($value)) { if ($x = $this->hasKey($needle, $value)) { return $...
[ "public", "function", "hasKey", "(", "string", "$", "needle", ",", "array", "$", "haystack", ")", ":", "bool", "{", "foreach", "(", "$", "haystack", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "$", "key", "===", "$", "needle", ")", ...
Check if array has key recursivly @param string $needle Array key to find @param array $haystack Array to search @return boolean
[ "Check", "if", "array", "has", "key", "recursivly" ]
0454e8d6f42787244d02f0e976825ed8dca579f0
https://github.com/helsingborg-stad/better-post-UI/blob/0454e8d6f42787244d02f0e976825ed8dca579f0/source/php/Components/PageAttributes.php#L56-L71
201,063
PatrolServer/patrolsdk-php
lib/Bucket.php
Bucket.save
public function save() { $bucket = $this->_post('servers/' . $this->server_id . '/software_bucket/' . $this->key, $this->dirty_values); $this->mergeValues($bucket); }
php
public function save() { $bucket = $this->_post('servers/' . $this->server_id . '/software_bucket/' . $this->key, $this->dirty_values); $this->mergeValues($bucket); }
[ "public", "function", "save", "(", ")", "{", "$", "bucket", "=", "$", "this", "->", "_post", "(", "'servers/'", ".", "$", "this", "->", "server_id", ".", "'/software_bucket/'", ".", "$", "this", "->", "key", ",", "$", "this", "->", "dirty_values", ")",...
Saves a bucket, if the bucket does not exist, a new bucket will be created
[ "Saves", "a", "bucket", "if", "the", "bucket", "does", "not", "exist", "a", "new", "bucket", "will", "be", "created" ]
2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2
https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/Bucket.php#L42-L45
201,064
stubbles/stubbles-webapp-session
src/main/php/id/NoneDurableSessionId.php
NoneDurableSessionId.name
public function name() { if (null === $this->sessionName) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $this->sessionName = ''; for ($i = 0; $i < 32; $i++) { $this->sessionName .= $characters[rand(0, strlen($characters)...
php
public function name() { if (null === $this->sessionName) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $this->sessionName = ''; for ($i = 0; $i < 32; $i++) { $this->sessionName .= $characters[rand(0, strlen($characters)...
[ "public", "function", "name", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "sessionName", ")", "{", "$", "characters", "=", "'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'", ";", "$", "this", "->", "sessionName", "=", "''", ";", ...
returns session name @return string
[ "returns", "session", "name" ]
2976fa28995bfb6ad00e3eac59ad689dd7892450
https://github.com/stubbles/stubbles-webapp-session/blob/2976fa28995bfb6ad00e3eac59ad689dd7892450/src/main/php/id/NoneDurableSessionId.php#L49-L60
201,065
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Map/C2PTableMap.php
C2PTableMap.doInsert
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(C2PTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for ...
php
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(C2PTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for ...
[ "public", "static", "function", "doInsert", "(", "$", "criteria", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "if", "(", "null", "===", "$", "con", ")", "{", "$", "con", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "ge...
Performs an INSERT on the database, given a C2P or Criteria object. @param mixed $criteria Criteria or C2P object containing data that is used to create the INSERT statement. @param ConnectionInterface $con the ConnectionInterface connection to use @return mixed The new primary key. @throws Pro...
[ "Performs", "an", "INSERT", "on", "the", "database", "given", "a", "C2P", "or", "Criteria", "object", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Map/C2PTableMap.php#L464-L485
201,066
mullanaphy/variable
src/PHY/Variable.php
Variable.convertVariableTo
public static function convertVariableTo(\PHY\Variable\AVar $variable, $convertTo = 'Obj') { $method = 'to'.$convertTo; if (!is_callable([$variable, $method])) { throw new \PHY\Variable\Exception('Could not convert "'.$variable->getType().'" to "'.$convertTo.'"'); ...
php
public static function convertVariableTo(\PHY\Variable\AVar $variable, $convertTo = 'Obj') { $method = 'to'.$convertTo; if (!is_callable([$variable, $method])) { throw new \PHY\Variable\Exception('Could not convert "'.$variable->getType().'" to "'.$convertTo.'"'); ...
[ "public", "static", "function", "convertVariableTo", "(", "\\", "PHY", "\\", "Variable", "\\", "AVar", "$", "variable", ",", "$", "convertTo", "=", "'Obj'", ")", "{", "$", "method", "=", "'to'", ".", "$", "convertTo", ";", "if", "(", "!", "is_callable", ...
Convert a variable to a different type. @param \PHY\Variable\AVar $variable @param string $convertTo @return \PHY\Variable\AVar
[ "Convert", "a", "variable", "to", "a", "different", "type", "." ]
e4eb274a1799a25e33e5e21cd260603c74628031
https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable.php#L50-L58
201,067
sourceboxio/sdk
src/Register/MicroService.php
MicroService.registerRoutes
protected function registerRoutes() { $http = Arr::get($this->triggers, 'http'); if (is_null($http)) { return; } // Validar try { Validator::validate($http, ['route' => 'required', 'methods' => 'required', 'function' => 'required']); } catch (...
php
protected function registerRoutes() { $http = Arr::get($this->triggers, 'http'); if (is_null($http)) { return; } // Validar try { Validator::validate($http, ['route' => 'required', 'methods' => 'required', 'function' => 'required']); } catch (...
[ "protected", "function", "registerRoutes", "(", ")", "{", "$", "http", "=", "Arr", "::", "get", "(", "$", "this", "->", "triggers", ",", "'http'", ")", ";", "if", "(", "is_null", "(", "$", "http", ")", ")", "{", "return", ";", "}", "// Validar", "t...
Registrar rotas.
[ "Registrar", "rotas", "." ]
e16e9e92580d48c2a348d119c2829a8d38528681
https://github.com/sourceboxio/sdk/blob/e16e9e92580d48c2a348d119c2829a8d38528681/src/Register/MicroService.php#L76-L111
201,068
Dhii/exception-helper-base
src/CreateRuntimeExceptionCapableTrait.php
CreateRuntimeExceptionCapableTrait._createRuntimeException
protected function _createRuntimeException($message = null, $code = null, $previous = null) { return new RuntimeException($message, $code, $previous); }
php
protected function _createRuntimeException($message = null, $code = null, $previous = null) { return new RuntimeException($message, $code, $previous); }
[ "protected", "function", "_createRuntimeException", "(", "$", "message", "=", "null", ",", "$", "code", "=", "null", ",", "$", "previous", "=", "null", ")", "{", "return", "new", "RuntimeException", "(", "$", "message", ",", "$", "code", ",", "$", "previ...
Creates a new Runtime exception. @since [*next-version*] @param string|Stringable|int|float|bool|null $message The message, if any. @param int|float|string|Stringable|null $code The numeric error code, if any. @param RootException|null $previous The inner exception, if any. @return Runti...
[ "Creates", "a", "new", "Runtime", "exception", "." ]
e97bfa6c0f79ea079e36b2f1d8f84d7566a3ccf5
https://github.com/Dhii/exception-helper-base/blob/e97bfa6c0f79ea079e36b2f1d8f84d7566a3ccf5/src/CreateRuntimeExceptionCapableTrait.php#L26-L29
201,069
jenskooij/cloudcontrol
src/storage/Repository.php
Repository.init
public function init($baseStorageDefaultPath, $baseStorageSqlPath) { $storageDefaultPath = realpath($baseStorageDefaultPath); $contentSqlPath = realpath($baseStorageSqlPath); $this->initConfigStorage($storageDefaultPath); $this->initContentDb($contentSqlPath); $this->save()...
php
public function init($baseStorageDefaultPath, $baseStorageSqlPath) { $storageDefaultPath = realpath($baseStorageDefaultPath); $contentSqlPath = realpath($baseStorageSqlPath); $this->initConfigStorage($storageDefaultPath); $this->initContentDb($contentSqlPath); $this->save()...
[ "public", "function", "init", "(", "$", "baseStorageDefaultPath", ",", "$", "baseStorageSqlPath", ")", "{", "$", "storageDefaultPath", "=", "realpath", "(", "$", "baseStorageDefaultPath", ")", ";", "$", "contentSqlPath", "=", "realpath", "(", "$", "baseStorageSqlP...
Initiates default storage @param $baseStorageDefaultPath @param $baseStorageSqlPath
[ "Initiates", "default", "storage" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/Repository.php#L107-L116
201,070
jenskooij/cloudcontrol
src/storage/Repository.php
Repository.save
public function save() { $host = $this; array_map(function ($value) use ($host) { $host->saveSubset($value); }, $this->fileBasedSubsets); }
php
public function save() { $host = $this; array_map(function ($value) use ($host) { $host->saveSubset($value); }, $this->fileBasedSubsets); }
[ "public", "function", "save", "(", ")", "{", "$", "host", "=", "$", "this", ";", "array_map", "(", "function", "(", "$", "value", ")", "use", "(", "$", "host", ")", "{", "$", "host", "->", "saveSubset", "(", "$", "value", ")", ";", "}", ",", "$...
Persist all subsets
[ "Persist", "all", "subsets" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/Repository.php#L163-L169
201,071
jenskooij/cloudcontrol
src/storage/Repository.php
Repository.saveSubset
public function saveSubset($subset) { $changes = $subset . 'Changes'; if ($this->$changes === true) { if (!defined('JSON_PRETTY_PRINT')) { $json = json_encode($this->$subset); } else { $json = json_encode($this->$subset, JSON_PRETTY_PRINT); ...
php
public function saveSubset($subset) { $changes = $subset . 'Changes'; if ($this->$changes === true) { if (!defined('JSON_PRETTY_PRINT')) { $json = json_encode($this->$subset); } else { $json = json_encode($this->$subset, JSON_PRETTY_PRINT); ...
[ "public", "function", "saveSubset", "(", "$", "subset", ")", "{", "$", "changes", "=", "$", "subset", ".", "'Changes'", ";", "if", "(", "$", "this", "->", "$", "changes", "===", "true", ")", "{", "if", "(", "!", "defined", "(", "'JSON_PRETTY_PRINT'", ...
Persist subset to disk @param $subset
[ "Persist", "subset", "to", "disk" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/Repository.php#L175-L189
201,072
jenskooij/cloudcontrol
src/storage/Repository.php
Repository.loadSubset
protected function loadSubset($subset) { $subsetStoragePath = $this->storagePath . DIRECTORY_SEPARATOR . $subset . '.json'; $json = file_get_contents($subsetStoragePath); $json = json_decode($json); $this->$subset = $json; return $json; }
php
protected function loadSubset($subset) { $subsetStoragePath = $this->storagePath . DIRECTORY_SEPARATOR . $subset . '.json'; $json = file_get_contents($subsetStoragePath); $json = json_decode($json); $this->$subset = $json; return $json; }
[ "protected", "function", "loadSubset", "(", "$", "subset", ")", "{", "$", "subsetStoragePath", "=", "$", "this", "->", "storagePath", ".", "DIRECTORY_SEPARATOR", ".", "$", "subset", ".", "'.json'", ";", "$", "json", "=", "file_get_contents", "(", "$", "subse...
Load subset from disk @param $subset @return mixed|string
[ "Load", "subset", "from", "disk" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/Repository.php#L196-L203
201,073
fabiopaiva/ZfcUserCrud
src/ZfcUserCrud/Entity/User.php
User.addRoles
public function addRoles(Collection $roles) { foreach($roles as $role){ $this->roles->add($role); } }
php
public function addRoles(Collection $roles) { foreach($roles as $role){ $this->roles->add($role); } }
[ "public", "function", "addRoles", "(", "Collection", "$", "roles", ")", "{", "foreach", "(", "$", "roles", "as", "$", "role", ")", "{", "$", "this", "->", "roles", "->", "add", "(", "$", "role", ")", ";", "}", "}" ]
Add a role to the user. @param Role $role @return void
[ "Add", "a", "role", "to", "the", "user", "." ]
8e93ab4e7b3594df5245ce8732fc0334ce4a3d40
https://github.com/fabiopaiva/ZfcUserCrud/blob/8e93ab4e7b3594df5245ce8732fc0334ce4a3d40/src/ZfcUserCrud/Entity/User.php#L244-L250
201,074
Torann/skosh-generator
src/Builder.php
Builder.registerTwigExtensions
private function registerTwigExtensions() { foreach ($this->app->getSetting('twig_extensions', []) as $extension) { $this->twig->addExtension(new $extension($this)); } }
php
private function registerTwigExtensions() { foreach ($this->app->getSetting('twig_extensions', []) as $extension) { $this->twig->addExtension(new $extension($this)); } }
[ "private", "function", "registerTwigExtensions", "(", ")", "{", "foreach", "(", "$", "this", "->", "app", "->", "getSetting", "(", "'twig_extensions'", ",", "[", "]", ")", "as", "$", "extension", ")", "{", "$", "this", "->", "twig", "->", "addExtension", ...
Register custom twig extensions.
[ "Register", "custom", "twig", "extensions", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L126-L131
201,075
Torann/skosh-generator
src/Builder.php
Builder.getUrl
public function getUrl($url) { if (!$url || starts_with($url, ['#', '//', 'mailto:', 'tel:', 'http'])) { return $url; } // Get URL root $root = $this->app->getSetting('url'); $url = trim($root, '/') . '/' . trim($url, '/'); // Force trailing slash ...
php
public function getUrl($url) { if (!$url || starts_with($url, ['#', '//', 'mailto:', 'tel:', 'http'])) { return $url; } // Get URL root $root = $this->app->getSetting('url'); $url = trim($root, '/') . '/' . trim($url, '/'); // Force trailing slash ...
[ "public", "function", "getUrl", "(", "$", "url", ")", "{", "if", "(", "!", "$", "url", "||", "starts_with", "(", "$", "url", ",", "[", "'#'", ",", "'//'", ",", "'mailto:'", ",", "'tel:'", ",", "'http'", "]", ")", ")", "{", "return", "$", "url", ...
Get the URL for the given page. @param string $url @return string
[ "Get", "the", "URL", "for", "the", "given", "page", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L159-L178
201,076
Torann/skosh-generator
src/Builder.php
Builder.getAsset
public function getAsset($path) { // Absolute path will not be in manifest if ($path[0] === '/') { return $this->getUrl($path); } // Get manifest $asset = $this->manifest->get($path); return $this->getUrl('/assets/' . trim($asset, '/')); }
php
public function getAsset($path) { // Absolute path will not be in manifest if ($path[0] === '/') { return $this->getUrl($path); } // Get manifest $asset = $this->manifest->get($path); return $this->getUrl('/assets/' . trim($asset, '/')); }
[ "public", "function", "getAsset", "(", "$", "path", ")", "{", "// Absolute path will not be in manifest", "if", "(", "$", "path", "[", "0", "]", "===", "'/'", ")", "{", "return", "$", "this", "->", "getUrl", "(", "$", "path", ")", ";", "}", "// Get manif...
Check asset manifest for a file @param string $path @return string
[ "Check", "asset", "manifest", "for", "a", "file" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L186-L197
201,077
Torann/skosh-generator
src/Builder.php
Builder.build
public function build() { $this->app->writeln("\n<comment>Adding root pages</comment>"); $this->addPages('\\Skosh\\Content\\Page'); $this->app->writeln("\n<comment>Adding posts</comment>"); $this->addPages('\\Skosh\\Content\\Post', 'path', '_posts'); $this->app->writeln("\n...
php
public function build() { $this->app->writeln("\n<comment>Adding root pages</comment>"); $this->addPages('\\Skosh\\Content\\Page'); $this->app->writeln("\n<comment>Adding posts</comment>"); $this->addPages('\\Skosh\\Content\\Post', 'path', '_posts'); $this->app->writeln("\n...
[ "public", "function", "build", "(", ")", "{", "$", "this", "->", "app", "->", "writeln", "(", "\"\\n<comment>Adding root pages</comment>\"", ")", ";", "$", "this", "->", "addPages", "(", "'\\\\Skosh\\\\Content\\\\Page'", ")", ";", "$", "this", "->", "app", "->...
Renders the site @return void
[ "Renders", "the", "site" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L204-L229
201,078
Torann/skosh-generator
src/Builder.php
Builder.savePage
public function savePage($target, $html) { $fs = new Filesystem(); $fs->dumpFile($this->target . DIRECTORY_SEPARATOR . $target, $html); }
php
public function savePage($target, $html) { $fs = new Filesystem(); $fs->dumpFile($this->target . DIRECTORY_SEPARATOR . $target, $html); }
[ "public", "function", "savePage", "(", "$", "target", ",", "$", "html", ")", "{", "$", "fs", "=", "new", "Filesystem", "(", ")", ";", "$", "fs", "->", "dumpFile", "(", "$", "this", "->", "target", ".", "DIRECTORY_SEPARATOR", ".", "$", "target", ",", ...
Save page to target file. @param string $html @param string $target
[ "Save", "page", "to", "target", "file", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L271-L275
201,079
Torann/skosh-generator
src/Builder.php
Builder.getParent
public function getParent($parentId) { if ($parentId && isset($this->site->pages[$parentId])) { return $this->site->pages[$parentId]; } return []; }
php
public function getParent($parentId) { if ($parentId && isset($this->site->pages[$parentId])) { return $this->site->pages[$parentId]; } return []; }
[ "public", "function", "getParent", "(", "$", "parentId", ")", "{", "if", "(", "$", "parentId", "&&", "isset", "(", "$", "this", "->", "site", "->", "pages", "[", "$", "parentId", "]", ")", ")", "{", "return", "$", "this", "->", "site", "->", "pages...
Get parent content. @param string $parentId @return array
[ "Get", "parent", "content", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L283-L290
201,080
Torann/skosh-generator
src/Builder.php
Builder.getPosts
public function getPosts(Content $content) { if (isset($this->site->categories[$content->id])) { return $this->site->categories[$content->id]; } else { if (isset($content->category) && isset($this->site->categories[$content->category])) { return $this-...
php
public function getPosts(Content $content) { if (isset($this->site->categories[$content->id])) { return $this->site->categories[$content->id]; } else { if (isset($content->category) && isset($this->site->categories[$content->category])) { return $this-...
[ "public", "function", "getPosts", "(", "Content", "$", "content", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "site", "->", "categories", "[", "$", "content", "->", "id", "]", ")", ")", "{", "return", "$", "this", "->", "site", "->", "cat...
Get posts for given content. @param Content $content @return array
[ "Get", "posts", "for", "given", "content", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L298-L310
201,081
Torann/skosh-generator
src/Builder.php
Builder.createServerConfig
public function createServerConfig() { // Load config $config = new Config($this->app->getEnvironment(), '.env'); // Save to protected file $config->export($this->target . DIRECTORY_SEPARATOR . '.env.php'); }
php
public function createServerConfig() { // Load config $config = new Config($this->app->getEnvironment(), '.env'); // Save to protected file $config->export($this->target . DIRECTORY_SEPARATOR . '.env.php'); }
[ "public", "function", "createServerConfig", "(", ")", "{", "// Load config", "$", "config", "=", "new", "Config", "(", "$", "this", "->", "app", "->", "getEnvironment", "(", ")", ",", "'.env'", ")", ";", "// Save to protected file", "$", "config", "->", "exp...
Create a server config file @return void
[ "Create", "a", "server", "config", "file" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L317-L324
201,082
Torann/skosh-generator
src/Builder.php
Builder.copyStaticFiles
public function copyStaticFiles() { $exclude = ['js', 'javascripts', 'stylesheets', 'less', 'sass']; // Include the excludes from the config $exclude = array_merge($exclude, (array) $this->app->getSetting('exclude', [])); // Create pattern $pattern = '/\\.(' . implode("|", ...
php
public function copyStaticFiles() { $exclude = ['js', 'javascripts', 'stylesheets', 'less', 'sass']; // Include the excludes from the config $exclude = array_merge($exclude, (array) $this->app->getSetting('exclude', [])); // Create pattern $pattern = '/\\.(' . implode("|", ...
[ "public", "function", "copyStaticFiles", "(", ")", "{", "$", "exclude", "=", "[", "'js'", ",", "'javascripts'", ",", "'stylesheets'", ",", "'less'", ",", "'sass'", "]", ";", "// Include the excludes from the config", "$", "exclude", "=", "array_merge", "(", "$",...
Copy static files to target Ignoring JS, CSS & LESS - Gulp handles that @return void
[ "Copy", "static", "files", "to", "target", "Ignoring", "JS", "CSS", "&", "LESS", "-", "Gulp", "handles", "that" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L332-L390
201,083
Torann/skosh-generator
src/Builder.php
Builder.cleanTarget
public function cleanTarget() { $filesystem = new Filesystem(); // Get files and directories to remove $files = array_diff(scandir($this->target), ['.', '..']); $files = preg_grep('/[^.gitignore]/i', $files); // Remove files foreach ($files as $file) { $...
php
public function cleanTarget() { $filesystem = new Filesystem(); // Get files and directories to remove $files = array_diff(scandir($this->target), ['.', '..']); $files = preg_grep('/[^.gitignore]/i', $files); // Remove files foreach ($files as $file) { $...
[ "public", "function", "cleanTarget", "(", ")", "{", "$", "filesystem", "=", "new", "Filesystem", "(", ")", ";", "// Get files and directories to remove", "$", "files", "=", "array_diff", "(", "scandir", "(", "$", "this", "->", "target", ")", ",", "[", "'.'",...
Clean target directory @return void
[ "Clean", "target", "directory" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L397-L412
201,084
Torann/skosh-generator
src/Builder.php
Builder.addPages
private function addPages($class, $path = 'notPath', $filter = '_') { $finder = new Finder(); $finder->files() ->in($this->source) ->$path($filter) ->name('/\\.(md|textile|xml|twig)$/'); foreach ($finder as $file) { $page = new $class(...
php
private function addPages($class, $path = 'notPath', $filter = '_') { $finder = new Finder(); $finder->files() ->in($this->source) ->$path($filter) ->name('/\\.(md|textile|xml|twig)$/'); foreach ($finder as $file) { $page = new $class(...
[ "private", "function", "addPages", "(", "$", "class", ",", "$", "path", "=", "'notPath'", ",", "$", "filter", "=", "'_'", ")", "{", "$", "finder", "=", "new", "Finder", "(", ")", ";", "$", "finder", "->", "files", "(", ")", "->", "in", "(", "$", ...
Add pages for rendering @param string $class @param string $path @param string $filter @return void
[ "Add", "pages", "for", "rendering" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Builder.php#L422-L443
201,085
gplcart/cli
controllers/commands/File.php
File.cmdGetFile
public function cmdGetFile() { $result = $this->getListFile(); $this->outputFormat($result); $this->outputFormatTableFile($result); $this->output(); }
php
public function cmdGetFile() { $result = $this->getListFile(); $this->outputFormat($result); $this->outputFormatTableFile($result); $this->output(); }
[ "public", "function", "cmdGetFile", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListFile", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableFile", "(", "$", "result", ")"...
Callback for "file-get" command
[ "Callback", "for", "file", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L40-L46
201,086
gplcart/cli
controllers/commands/File.php
File.cmdDeleteFile
public function cmdDeleteFile() { $id = $this->getParam(0); $all = $this->getParam('all'); if (empty($id) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $options = null; if (isset($id)) { if ($this->getParam('type'...
php
public function cmdDeleteFile() { $id = $this->getParam(0); $all = $this->getParam('all'); if (empty($id) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $options = null; if (isset($id)) { if ($this->getParam('type'...
[ "public", "function", "cmdDeleteFile", "(", ")", "{", "$", "id", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "$", "all", "=", "$", "this", "->", "getParam", "(", "'all'", ")", ";", "if", "(", "empty", "(", "$", "id", ")", "&&", "emp...
Callback for "file-delete" command
[ "Callback", "for", "file", "-", "delete", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L51-L100
201,087
gplcart/cli
controllers/commands/File.php
File.cmdUpdateFile
public function cmdUpdateFile() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
php
public function cmdUpdateFile() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
[ "public", "function", "cmdUpdateFile", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{", "$",...
Callback for "file-update" command
[ "Callback", "for", "file", "-", "update", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L137-L155
201,088
gplcart/cli
controllers/commands/File.php
File.addFile
protected function addFile() { if (!$this->isError()) { $id = $this->file->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
php
protected function addFile() { if (!$this->isError()) { $id = $this->file->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
[ "protected", "function", "addFile", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", ")", "{", "$", "id", "=", "$", "this", "->", "file", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", ";", "if", "(", ...
Add a new file record
[ "Add", "a", "new", "file", "record" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L228-L237
201,089
gplcart/cli
controllers/commands/File.php
File.updateFile
protected function updateFile($file_id) { if (!$this->isError() && !$this->file->update($file_id, $this->getSubmitted())) { $this->errorAndExit($this->text('Unexpected result')); } }
php
protected function updateFile($file_id) { if (!$this->isError() && !$this->file->update($file_id, $this->getSubmitted())) { $this->errorAndExit($this->text('Unexpected result')); } }
[ "protected", "function", "updateFile", "(", "$", "file_id", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", "&&", "!", "$", "this", "->", "file", "->", "update", "(", "$", "file_id", ",", "$", "this", "->", "getSubmitted", "(", ")...
Updates a file record @param string $file_id
[ "Updates", "a", "file", "record" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L243-L248
201,090
gplcart/cli
controllers/commands/File.php
File.submitAddFile
protected function submitAddFile() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('file'); $this->addFile(); }
php
protected function submitAddFile() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('file'); $this->addFile(); }
[ "protected", "function", "submitAddFile", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "validateComponent", "(", "'file'", ")", ";", "$", "this", "->", "addFil...
Add a new file record at once
[ "Add", "a", "new", "file", "record", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L253-L258
201,091
gplcart/cli
controllers/commands/File.php
File.wizardAddFile
protected function wizardAddFile() { $this->validatePrompt('path', $this->text('Path'), 'file'); $this->validatePrompt('entity', $this->text('Entity'), 'file'); $this->validatePrompt('entity_id', $this->text('Entity ID'), 'file', 0); $this->validatePrompt('title', $this->text('Title'...
php
protected function wizardAddFile() { $this->validatePrompt('path', $this->text('Path'), 'file'); $this->validatePrompt('entity', $this->text('Entity'), 'file'); $this->validatePrompt('entity_id', $this->text('Entity ID'), 'file', 0); $this->validatePrompt('title', $this->text('Title'...
[ "protected", "function", "wizardAddFile", "(", ")", "{", "$", "this", "->", "validatePrompt", "(", "'path'", ",", "$", "this", "->", "text", "(", "'Path'", ")", ",", "'file'", ")", ";", "$", "this", "->", "validatePrompt", "(", "'entity'", ",", "$", "t...
Add a new file record step by step
[ "Add", "a", "new", "file", "record", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/File.php#L263-L274
201,092
agentmedia/phine-builtin
src/BuiltIn/Modules/Backend/RegisterConfirmForm.php
RegisterConfirmForm.SaveGroups
private function SaveGroups() { $assignedIDs = $this->AssignedGroupIDs(); $selectedIDs = Request::PostArray('Group'); $this->ClearMembergroups($selectedIDs); foreach ($selectedIDs as $selectedID) { if (!in_array($selectedID, $assignedIDs)) { ...
php
private function SaveGroups() { $assignedIDs = $this->AssignedGroupIDs(); $selectedIDs = Request::PostArray('Group'); $this->ClearMembergroups($selectedIDs); foreach ($selectedIDs as $selectedID) { if (!in_array($selectedID, $assignedIDs)) { ...
[ "private", "function", "SaveGroups", "(", ")", "{", "$", "assignedIDs", "=", "$", "this", "->", "AssignedGroupIDs", "(", ")", ";", "$", "selectedIDs", "=", "Request", "::", "PostArray", "(", "'Group'", ")", ";", "$", "this", "->", "ClearMembergroups", "(",...
Saves the groups
[ "Saves", "the", "groups" ]
4dd05bc406a71e997bd4eaa16b12e23dbe62a456
https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Modules/Backend/RegisterConfirmForm.php#L146-L161
201,093
975L/ConfigBundle
Twig/ConfigParam.php
ConfigParam.configParam
public function configParam($parameter) { $value = $this->container->getParameter($parameter); return is_array($value) ? json_encode($value) : $value; }
php
public function configParam($parameter) { $value = $this->container->getParameter($parameter); return is_array($value) ? json_encode($value) : $value; }
[ "public", "function", "configParam", "(", "$", "parameter", ")", "{", "$", "value", "=", "$", "this", "->", "container", "->", "getParameter", "(", "$", "parameter", ")", ";", "return", "is_array", "(", "$", "value", ")", "?", "json_encode", "(", "$", ...
Returns the specified container's parameter @return string
[ "Returns", "the", "specified", "container", "s", "parameter" ]
1f9a9e937dbb79ad06fe5d456e7536d58bd56e19
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Twig/ConfigParam.php#L48-L53
201,094
net-tools/core
src/ExceptionHandlers/ExceptionHandler.php
ExceptionHandler._getException
protected function _getException(\Throwable $e, $h1) { try { return $this->_getFormatterStrategy()->format($e, $h1); } catch (\Throwable $e2) { return "Error '" . get_class($e2) . "' during processing of exception '" . get_class($e) . "' with message '{$e2->getMessage()}'."; } }
php
protected function _getException(\Throwable $e, $h1) { try { return $this->_getFormatterStrategy()->format($e, $h1); } catch (\Throwable $e2) { return "Error '" . get_class($e2) . "' during processing of exception '" . get_class($e) . "' with message '{$e2->getMessage()}'."; } }
[ "protected", "function", "_getException", "(", "\\", "Throwable", "$", "e", ",", "$", "h1", ")", "{", "try", "{", "return", "$", "this", "->", "_getFormatterStrategy", "(", ")", "->", "format", "(", "$", "e", ",", "$", "h1", ")", ";", "}", "catch", ...
Get exception stack trace as a string @param \Throwable $e Exception to handle @param string $h1 The title displayed on the error page @return string Exception stack trace as a string
[ "Get", "exception", "stack", "trace", "as", "a", "string" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/ExceptionHandlers/ExceptionHandler.php#L29-L39
201,095
net-tools/core
src/ExceptionHandlers/ExceptionHandler.php
ExceptionHandler._handleXMLHTTPCommandException
protected function _handleXMLHTTPCommandException(\Throwable $e) { // send xmlhttp headers header("Content-Type: application/json; charset=utf-8"); // no cache header("Expires: Sat, 1 Jan 2005 00:00:00 GMT"); header("Last-Modified: ".gmdate( "D, d M Y H:i:s")." GMT"); header("Cache-Control: no-cache,...
php
protected function _handleXMLHTTPCommandException(\Throwable $e) { // send xmlhttp headers header("Content-Type: application/json; charset=utf-8"); // no cache header("Expires: Sat, 1 Jan 2005 00:00:00 GMT"); header("Last-Modified: ".gmdate( "D, d M Y H:i:s")." GMT"); header("Cache-Control: no-cache,...
[ "protected", "function", "_handleXMLHTTPCommandException", "(", "\\", "Throwable", "$", "e", ")", "{", "// send xmlhttp headers", "header", "(", "\"Content-Type: application/json; charset=utf-8\"", ")", ";", "// no cache", "header", "(", "\"Expires: Sat, 1 Jan 2005 00:00:00 GMT...
Handle an exception during an XMLHTTP request. The XMLHTTP request JSON response will contain a 'exception' property with the exception data formatted as a human-readable string. The JSON formatted exception is outputed directly to standard output. @param \Throwable $e Exception
[ "Handle", "an", "exception", "during", "an", "XMLHTTP", "request", "." ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/ExceptionHandlers/ExceptionHandler.php#L174-L190
201,096
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.end
public function end() { # Calculate the Beginning + The maximum amount of results $calc = $this->start() + $this->max; # Only return this if it is not above the total otherwise return our maximum # example, 24 + 6 = 30, but with only 26 reselts it will display the total results iste...
php
public function end() { # Calculate the Beginning + The maximum amount of results $calc = $this->start() + $this->max; # Only return this if it is not above the total otherwise return our maximum # example, 24 + 6 = 30, but with only 26 reselts it will display the total results iste...
[ "public", "function", "end", "(", ")", "{", "# Calculate the Beginning + The maximum amount of results", "$", "calc", "=", "$", "this", "->", "start", "(", ")", "+", "$", "this", "->", "max", ";", "# Only return this if it is not above the total otherwise return our maxim...
This calculates the end of our result set, based on our current page @return int Final Calculation of where our result set should end
[ "This", "calculates", "the", "end", "of", "our", "result", "set", "based", "on", "our", "current", "page" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L72-L83
201,097
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.info
public function info($html) { $tags = array('{total}', '{start}', '{end}', '{page}', '{pages}'); $code = array($this->total, $this->start() + 1, $this->end(), $this->get, $this->pages()); return str_replace($tags, $code, $html); }
php
public function info($html) { $tags = array('{total}', '{start}', '{end}', '{page}', '{pages}'); $code = array($this->total, $this->start() + 1, $this->end(), $this->get, $this->pages()); return str_replace($tags, $code, $html); }
[ "public", "function", "info", "(", "$", "html", ")", "{", "$", "tags", "=", "array", "(", "'{total}'", ",", "'{start}'", ",", "'{end}'", ",", "'{page}'", ",", "'{pages}'", ")", ";", "$", "code", "=", "array", "(", "$", "this", "->", "total", ",", "...
Based on which page you are this returns informations like, start result, end result, total results, current page, total pages @param string $html The HTML you wish to use to display the link @return mixed return information we may need to display
[ "Based", "on", "which", "page", "you", "are", "this", "returns", "informations", "like", "start", "result", "end", "result", "total", "results", "current", "page", "total", "pages" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L99-L105
201,098
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.first
public function first($html, $html2 = '') { # Only show if you are not on page 1, otherwise show HTML2 $r = ($this->get != 1) ? str_replace('{nr}', 1, $html) : str_replace('{nr}', 1, $html2); return $r; }
php
public function first($html, $html2 = '') { # Only show if you are not on page 1, otherwise show HTML2 $r = ($this->get != 1) ? str_replace('{nr}', 1, $html) : str_replace('{nr}', 1, $html2); return $r; }
[ "public", "function", "first", "(", "$", "html", ",", "$", "html2", "=", "''", ")", "{", "# Only show if you are not on page 1, otherwise show HTML2", "$", "r", "=", "(", "$", "this", "->", "get", "!=", "1", ")", "?", "str_replace", "(", "'{nr}'", ",", "1"...
This shows the 'first' link with custom html @param string $html The HTML you wish to use to display the link @return string The Same HTML replaced the tags with the proper number
[ "This", "shows", "the", "first", "link", "with", "custom", "html" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L112-L118
201,099
freddieannobil/doo-pagination
src/DooPagination.php
DooPagination.previous
public function previous($html, $html2 = '') { # Only show if you are not on page 1, otherwise show HTML2 $r = ($this->get != 1) ? str_replace('{nr}', $this->get - 1, $html) : str_replace('{nr}', $this->get - 1, $html2); return $r; }
php
public function previous($html, $html2 = '') { # Only show if you are not on page 1, otherwise show HTML2 $r = ($this->get != 1) ? str_replace('{nr}', $this->get - 1, $html) : str_replace('{nr}', $this->get - 1, $html2); return $r; }
[ "public", "function", "previous", "(", "$", "html", ",", "$", "html2", "=", "''", ")", "{", "# Only show if you are not on page 1, otherwise show HTML2", "$", "r", "=", "(", "$", "this", "->", "get", "!=", "1", ")", "?", "str_replace", "(", "'{nr}'", ",", ...
This shows the 'previous' link with custom html @param string $html The HTML you wish to use to display the link @return string The Same HTML replaced the tags with the proper number
[ "This", "shows", "the", "previous", "link", "with", "custom", "html" ]
7f638c5647585386a71190610592249fd7f735de
https://github.com/freddieannobil/doo-pagination/blob/7f638c5647585386a71190610592249fd7f735de/src/DooPagination.php#L125-L131