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,600
phpffcms/ffcms-core
src/Helper/FileSystem/Directory.php
Directory.writable
public static function writable($path) { $path = Normalize::diskFullPath($path); if (!self::exist($path)) { return false; } return (is_dir($path) && is_writable($path)); }
php
public static function writable($path) { $path = Normalize::diskFullPath($path); if (!self::exist($path)) { return false; } return (is_dir($path) && is_writable($path)); }
[ "public", "static", "function", "writable", "(", "$", "path", ")", "{", "$", "path", "=", "Normalize", "::", "diskFullPath", "(", "$", "path", ")", ";", "if", "(", "!", "self", "::", "exist", "(", "$", "path", ")", ")", "{", "return", "false", ";",...
Check if directory is writable @param string $path @return bool
[ "Check", "if", "directory", "is", "writable" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/FileSystem/Directory.php#L32-L41
201,601
phpffcms/ffcms-core
src/Helper/FileSystem/Directory.php
Directory.create
public static function create($path, $chmod = 0755) { $path = Normalize::diskFullPath($path); if (self::exist($path)) { return false; } return @mkdir($path, $chmod, true); }
php
public static function create($path, $chmod = 0755) { $path = Normalize::diskFullPath($path); if (self::exist($path)) { return false; } return @mkdir($path, $chmod, true); }
[ "public", "static", "function", "create", "(", "$", "path", ",", "$", "chmod", "=", "0755", ")", "{", "$", "path", "=", "Normalize", "::", "diskFullPath", "(", "$", "path", ")", ";", "if", "(", "self", "::", "exist", "(", "$", "path", ")", ")", "...
Create directory with recursive support. @param string $path @param int $chmod @return bool
[ "Create", "directory", "with", "recursive", "support", "." ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/FileSystem/Directory.php#L49-L58
201,602
phpffcms/ffcms-core
src/Helper/FileSystem/Directory.php
Directory.remove
public static function remove($path) { $path = Normalize::diskFullPath($path); if (!self::exist($path)) { return false; } foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST)...
php
public static function remove($path) { $path = Normalize::diskFullPath($path); if (!self::exist($path)) { return false; } foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST)...
[ "public", "static", "function", "remove", "(", "$", "path", ")", "{", "$", "path", "=", "Normalize", "::", "diskFullPath", "(", "$", "path", ")", ";", "if", "(", "!", "self", "::", "exist", "(", "$", "path", ")", ")", "{", "return", "false", ";", ...
Remove directory recursive. @param string $path @return bool
[ "Remove", "directory", "recursive", "." ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/FileSystem/Directory.php#L65-L77
201,603
phpffcms/ffcms-core
src/Helper/FileSystem/Directory.php
Directory.scan
public static function scan($path, $mod = GLOB_ONLYDIR, $returnRelative = false) { $path = Normalize::diskFullPath($path); if (!self::exist($path)) { return false; } $pattern = rtrim($path, '/') . '/*'; $entry = glob($pattern, $mod); if ($returnRelative...
php
public static function scan($path, $mod = GLOB_ONLYDIR, $returnRelative = false) { $path = Normalize::diskFullPath($path); if (!self::exist($path)) { return false; } $pattern = rtrim($path, '/') . '/*'; $entry = glob($pattern, $mod); if ($returnRelative...
[ "public", "static", "function", "scan", "(", "$", "path", ",", "$", "mod", "=", "GLOB_ONLYDIR", ",", "$", "returnRelative", "=", "false", ")", "{", "$", "path", "=", "Normalize", "::", "diskFullPath", "(", "$", "path", ")", ";", "if", "(", "!", "self...
Scan files in directory and return full or relative path @param string $path @param int $mod @param bool|false $returnRelative @return array|bool
[ "Scan", "files", "in", "directory", "and", "return", "full", "or", "relative", "path" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/FileSystem/Directory.php#L86-L104
201,604
phpffcms/ffcms-core
src/Helper/FileSystem/Directory.php
Directory.recursiveChmod
public static function recursiveChmod($path, $mod = 0777) { $path = Normalize::diskFullPath($path); if (!self::exist($path)) { return; } $dir = new \DirectoryIterator($path); foreach ($dir as $item) { // change chmod for folders and files ...
php
public static function recursiveChmod($path, $mod = 0777) { $path = Normalize::diskFullPath($path); if (!self::exist($path)) { return; } $dir = new \DirectoryIterator($path); foreach ($dir as $item) { // change chmod for folders and files ...
[ "public", "static", "function", "recursiveChmod", "(", "$", "path", ",", "$", "mod", "=", "0777", ")", "{", "$", "path", "=", "Normalize", "::", "diskFullPath", "(", "$", "path", ")", ";", "if", "(", "!", "self", "::", "exist", "(", "$", "path", ")...
Change chmod recursive inside defined folder @param string $path @param int $mod
[ "Change", "chmod", "recursive", "inside", "defined", "folder" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/FileSystem/Directory.php#L135-L153
201,605
eureka-framework/component-response
src/Response/Json/Api.php
Api.getContent
public function getContent() { $json = new \stdClass(); $json->isSuccess = $this->isSuccess(); $json->errorCode = $this->getErrorCode(); $json->errorMessage = $this->getErrorMessage(); $json->data = $this->content; return $json; }
php
public function getContent() { $json = new \stdClass(); $json->isSuccess = $this->isSuccess(); $json->errorCode = $this->getErrorCode(); $json->errorMessage = $this->getErrorMessage(); $json->data = $this->content; return $json; }
[ "public", "function", "getContent", "(", ")", "{", "$", "json", "=", "new", "\\", "stdClass", "(", ")", ";", "$", "json", "->", "isSuccess", "=", "$", "this", "->", "isSuccess", "(", ")", ";", "$", "json", "->", "errorCode", "=", "$", "this", "->",...
Over getContent response. Add specific content to the response. @return string
[ "Over", "getContent", "response", ".", "Add", "specific", "content", "to", "the", "response", "." ]
f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a
https://github.com/eureka-framework/component-response/blob/f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a/src/Response/Json/Api.php#L39-L49
201,606
eureka-framework/component-response
src/Response/Json/Api.php
Api.setErrorMessage
final public function setErrorMessage($message) { $this->errorMessage = (string) $message; if (empty($this->errorMessage)) { throw new \RuntimeException('Error message cannot be empty !'); } return $this; }
php
final public function setErrorMessage($message) { $this->errorMessage = (string) $message; if (empty($this->errorMessage)) { throw new \RuntimeException('Error message cannot be empty !'); } return $this; }
[ "final", "public", "function", "setErrorMessage", "(", "$", "message", ")", "{", "$", "this", "->", "errorMessage", "=", "(", "string", ")", "$", "message", ";", "if", "(", "empty", "(", "$", "this", "->", "errorMessage", ")", ")", "{", "throw", "new",...
Set error message. @param string $message @return self @throws \RuntimeException
[ "Set", "error", "message", "." ]
f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a
https://github.com/eureka-framework/component-response/blob/f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a/src/Response/Json/Api.php#L114-L123
201,607
eureka-framework/component-response
src/Response/Json/Api.php
Api.appendContent
public function appendContent($key, $value) { if ($this->content === null) { $this->content = array(); } if (!is_array($this->content)) { throw new \InvalidArgumentException('Cannot append response content: Current content is not an array !'); } $thi...
php
public function appendContent($key, $value) { if ($this->content === null) { $this->content = array(); } if (!is_array($this->content)) { throw new \InvalidArgumentException('Cannot append response content: Current content is not an array !'); } $thi...
[ "public", "function", "appendContent", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "$", "this", "->", "content", "===", "null", ")", "{", "$", "this", "->", "content", "=", "array", "(", ")", ";", "}", "if", "(", "!", "is_array", "("...
Append content for the response. @param string $key @param mixed $value @return self @throws \InvalidArgumentException
[ "Append", "content", "for", "the", "response", "." ]
f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a
https://github.com/eureka-framework/component-response/blob/f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a/src/Response/Json/Api.php#L133-L146
201,608
nativgames-old/pegase
src/Pegase/Core/Router/Service/Router.php
Router.get
public function get($route_name) { $route = null; if(!array_key_exists($route_name, $this->routes)) echo "Router: error: the array key $route_name doesn't exists.<br />"; else { $route_infos = $this->routes[$route_name]; if($route_controller = $this->instancy_controller($route_inf...
php
public function get($route_name) { $route = null; if(!array_key_exists($route_name, $this->routes)) echo "Router: error: the array key $route_name doesn't exists.<br />"; else { $route_infos = $this->routes[$route_name]; if($route_controller = $this->instancy_controller($route_inf...
[ "public", "function", "get", "(", "$", "route_name", ")", "{", "$", "route", "=", "null", ";", "if", "(", "!", "array_key_exists", "(", "$", "route_name", ",", "$", "this", "->", "routes", ")", ")", "echo", "\"Router: error: the array key $route_name doesn't e...
returns the controller with 'route_name'
[ "returns", "the", "controller", "with", "route_name" ]
9a00e09a26f391c988aadecd7640c72316eaa521
https://github.com/nativgames-old/pegase/blob/9a00e09a26f391c988aadecd7640c72316eaa521/src/Pegase/Core/Router/Service/Router.php#L49-L63
201,609
afroware/jwtauth
src/JwT.php
JwT.check
public function check($getPayload = false) { try { $payload = $this->checkOrFail(); } catch (JwTException $e) { return false; } return $getPayload ? $payload : true; }
php
public function check($getPayload = false) { try { $payload = $this->checkOrFail(); } catch (JwTException $e) { return false; } return $getPayload ? $payload : true; }
[ "public", "function", "check", "(", "$", "getPayload", "=", "false", ")", "{", "try", "{", "$", "payload", "=", "$", "this", "->", "checkOrFail", "(", ")", ";", "}", "catch", "(", "JwTException", "$", "e", ")", "{", "return", "false", ";", "}", "re...
Check that the token is valid. @param bool $getPayload @return \Afroware\JwTauth\Payload|bool
[ "Check", "that", "the", "token", "is", "valid", "." ]
54a0aebd811d87bfdd2b3668696fd53f50490cc1
https://github.com/afroware/jwtauth/blob/54a0aebd811d87bfdd2b3668696fd53f50490cc1/src/JwT.php#L139-L148
201,610
brightnucleus/options-store
src/OptionRepository/AggregateOptionRepository.php
AggregateOptionRepository.has
public function has(string $key): bool { foreach ($this->repositories as $repository) { if ($repository->has($key)) { return true; } } return false; }
php
public function has(string $key): bool { foreach ($this->repositories as $repository) { if ($repository->has($key)) { return true; } } return false; }
[ "public", "function", "has", "(", "string", "$", "key", ")", ":", "bool", "{", "foreach", "(", "$", "this", "->", "repositories", "as", "$", "repository", ")", "{", "if", "(", "$", "repository", "->", "has", "(", "$", "key", ")", ")", "{", "return"...
Check whether the repository contains a given key. @since 0.1.0 @param string $key Key to check for. @return bool Whether the repository contained the requested key.
[ "Check", "whether", "the", "repository", "contains", "a", "given", "key", "." ]
9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1
https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/OptionRepository/AggregateOptionRepository.php#L72-L81
201,611
koolkode/security
src/Authentication/Token/HttpDigestToken.php
HttpDigestToken.isValidResponse
public function isValidResponse($ha1) { if($this->opaque === NULL) { return false; } if(!SecurityUtil::timingSafeEquals($this->auth->getOpaque(), $this->opaque)) { return false; } $args = [ $ha1, $this->nonce, $this->nc, $this->cnonce, $this->auth->getQualityOfProtection(), ...
php
public function isValidResponse($ha1) { if($this->opaque === NULL) { return false; } if(!SecurityUtil::timingSafeEquals($this->auth->getOpaque(), $this->opaque)) { return false; } $args = [ $ha1, $this->nonce, $this->nc, $this->cnonce, $this->auth->getQualityOfProtection(), ...
[ "public", "function", "isValidResponse", "(", "$", "ha1", ")", "{", "if", "(", "$", "this", "->", "opaque", "===", "NULL", ")", "{", "return", "false", ";", "}", "if", "(", "!", "SecurityUtil", "::", "timingSafeEquals", "(", "$", "this", "->", "auth", ...
Check if the response is valid using the given HA1 value. @param string $ha1 @return boolean
[ "Check", "if", "the", "response", "is", "valid", "using", "the", "given", "HA1", "value", "." ]
d3d8d42392f520754847d29b6df19aaa38c79e8e
https://github.com/koolkode/security/blob/d3d8d42392f520754847d29b6df19aaa38c79e8e/src/Authentication/Token/HttpDigestToken.php#L235-L257
201,612
theopera/framework
src/Component/WebApplication/RouteCollection.php
RouteCollection.addRoute
public function addRoute(string $path, string $controller, string $action = 'index', string $method = Request::METHOD_GET) : self { $endPoint = new RouteEndpoint($this->namespace, $controller, $action, $method); $this->routes[] = new Route($path, $endPoint); return $this; }
php
public function addRoute(string $path, string $controller, string $action = 'index', string $method = Request::METHOD_GET) : self { $endPoint = new RouteEndpoint($this->namespace, $controller, $action, $method); $this->routes[] = new Route($path, $endPoint); return $this; }
[ "public", "function", "addRoute", "(", "string", "$", "path", ",", "string", "$", "controller", ",", "string", "$", "action", "=", "'index'", ",", "string", "$", "method", "=", "Request", "::", "METHOD_GET", ")", ":", "self", "{", "$", "endPoint", "=", ...
Add a new route to the collection @param string $path @param string $controller @param string $action @param string $method @return $this
[ "Add", "a", "new", "route", "to", "the", "collection" ]
fa6165d3891a310faa580c81dee49a63c150c711
https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/WebApplication/RouteCollection.php#L50-L56
201,613
pluf/tenant
src/Tenant/Views/SpaRun.php
Tenant_Views_SpaRun.defaultSpa
public function defaultSpa($request, $match) { $name = Tenant_Service::setting('spa.default', 'not-found'); $spa = Tenant_SPA::getSpaByName($name); if (! isset($spa)) { $spa = Tenant_SpaService::getNotfoundSpa(); } // $resPath = $spa->getMainPagePath(); //...
php
public function defaultSpa($request, $match) { $name = Tenant_Service::setting('spa.default', 'not-found'); $spa = Tenant_SPA::getSpaByName($name); if (! isset($spa)) { $spa = Tenant_SpaService::getNotfoundSpa(); } // $resPath = $spa->getMainPagePath(); //...
[ "public", "function", "defaultSpa", "(", "$", "request", ",", "$", "match", ")", "{", "$", "name", "=", "Tenant_Service", "::", "setting", "(", "'spa.default'", ",", "'not-found'", ")", ";", "$", "spa", "=", "Tenant_SPA", "::", "getSpaByName", "(", "$", ...
Load default spa @param Pluf_HTTP_Request $request @param array $match @return Pluf_HTTP_Response_File|Pluf_HTTP_Response
[ "Load", "default", "spa" ]
a06359c52b9a257b5a0a186264e8770acfc54b73
https://github.com/pluf/tenant/blob/a06359c52b9a257b5a0a186264e8770acfc54b73/src/Tenant/Views/SpaRun.php#L41-L53
201,614
pluf/tenant
src/Tenant/Views/SpaRun.php
Tenant_Views_SpaRun.defaultSpaRobotsTxt
public function defaultSpaRobotsTxt($request, $match) { $name = Tenant_Service::setting('spa.default', 'not-found'); $spa = Tenant_SPA::getSpaByName($name); if (! isset($spa)) { $spa = Tenant_SpaService::getNotfoundSpa(); } $resourcePath = $spa->getResourcePath('r...
php
public function defaultSpaRobotsTxt($request, $match) { $name = Tenant_Service::setting('spa.default', 'not-found'); $spa = Tenant_SPA::getSpaByName($name); if (! isset($spa)) { $spa = Tenant_SpaService::getNotfoundSpa(); } $resourcePath = $spa->getResourcePath('r...
[ "public", "function", "defaultSpaRobotsTxt", "(", "$", "request", ",", "$", "match", ")", "{", "$", "name", "=", "Tenant_Service", "::", "setting", "(", "'spa.default'", ",", "'not-found'", ")", ";", "$", "spa", "=", "Tenant_SPA", "::", "getSpaByName", "(", ...
Load robots.txt of default spa @param Pluf_HTTP_Request $request @param array $match @return Pluf_HTTP_Response_File|Pluf_HTTP_Response
[ "Load", "robots", ".", "txt", "of", "default", "spa" ]
a06359c52b9a257b5a0a186264e8770acfc54b73
https://github.com/pluf/tenant/blob/a06359c52b9a257b5a0a186264e8770acfc54b73/src/Tenant/Views/SpaRun.php#L62-L72
201,615
pluf/tenant
src/Tenant/Views/SpaRun.php
Tenant_Views_SpaRun.loadResource
public function loadResource($request, $match) { // First part of path $firstPart = $match['firstPart']; // Remain part of path $remainPart = ''; if (array_key_exists('remainPart', $match)) { $remainPart = $match['remainPart']; } $spa = Tenant_SPA...
php
public function loadResource($request, $match) { // First part of path $firstPart = $match['firstPart']; // Remain part of path $remainPart = ''; if (array_key_exists('remainPart', $match)) { $remainPart = $match['remainPart']; } $spa = Tenant_SPA...
[ "public", "function", "loadResource", "(", "$", "request", ",", "$", "match", ")", "{", "// First part of path", "$", "firstPart", "=", "$", "match", "[", "'firstPart'", "]", ";", "// Remain part of path", "$", "remainPart", "=", "''", ";", "if", "(", "array...
Load a resource from SPA @param Pluf_HTTP_Request $request @param array $match @return Pluf_HTTP_Response_File|Pluf_HTTP_Response
[ "Load", "a", "resource", "from", "SPA" ]
a06359c52b9a257b5a0a186264e8770acfc54b73
https://github.com/pluf/tenant/blob/a06359c52b9a257b5a0a186264e8770acfc54b73/src/Tenant/Views/SpaRun.php#L81-L130
201,616
pluf/tenant
src/Tenant/Views/SpaRun.php
Tenant_Views_SpaRun.findTenantResource
private function findTenantResource($path) { $q = new Pluf_SQL('path=%s', array( $path )); $item = new Tenant_Resource(); $item = $item->getList(array( 'filter' => $q->gen() )); if (isset($item) && $item->count() == 1) { return $ite...
php
private function findTenantResource($path) { $q = new Pluf_SQL('path=%s', array( $path )); $item = new Tenant_Resource(); $item = $item->getList(array( 'filter' => $q->gen() )); if (isset($item) && $item->count() == 1) { return $ite...
[ "private", "function", "findTenantResource", "(", "$", "path", ")", "{", "$", "q", "=", "new", "Pluf_SQL", "(", "'path=%s'", ",", "array", "(", "$", "path", ")", ")", ";", "$", "item", "=", "new", "Tenant_Resource", "(", ")", ";", "$", "item", "=", ...
Finds tenant resource with path @param string $path of the resource @return Tenant_Resource the resource
[ "Finds", "tenant", "resource", "with", "path" ]
a06359c52b9a257b5a0a186264e8770acfc54b73
https://github.com/pluf/tenant/blob/a06359c52b9a257b5a0a186264e8770acfc54b73/src/Tenant/Views/SpaRun.php#L139-L152
201,617
balintsera/evista-perform
src/Form/TranspiledForm.php
TranspiledForm.transpile
public function transpile() { // Form /** * @var Form form */ $this->form = $this->transpiler->instantiateFormObject(); // Fields $fields = $this->transpiler->findFields(); if (!is_array($fields)) { throw new \Exception("No fields found"); } ...
php
public function transpile() { // Form /** * @var Form form */ $this->form = $this->transpiler->instantiateFormObject(); // Fields $fields = $this->transpiler->findFields(); if (!is_array($fields)) { throw new \Exception("No fields found"); } ...
[ "public", "function", "transpile", "(", ")", "{", "// Form", "/**\n * @var Form form\n*/", "$", "this", "->", "form", "=", "$", "this", "->", "transpiler", "->", "instantiateFormObject", "(", ")", ";", "// Fields", "$", "fields", "=", "$", "this", "->", "tra...
Convert a markup to a BaseForm objet @return mixed
[ "Convert", "a", "markup", "to", "a", "BaseForm", "objet" ]
2b8723852ebe824ed721f30293e1e0d2c14f4b21
https://github.com/balintsera/evista-perform/blob/2b8723852ebe824ed721f30293e1e0d2c14f4b21/src/Form/TranspiledForm.php#L38-L62
201,618
larakit/lk-validatebuilder
src/ValidateBuilder.php
ValidateBuilder.ruleBefore
function ruleBefore($date, $error_message = null) { if (!strtotime($date)) { throw new \Exception('Incorrect date'); } return $this->_rule('before:' . $date, $error_message); }
php
function ruleBefore($date, $error_message = null) { if (!strtotime($date)) { throw new \Exception('Incorrect date'); } return $this->_rule('before:' . $date, $error_message); }
[ "function", "ruleBefore", "(", "$", "date", ",", "$", "error_message", "=", "null", ")", "{", "if", "(", "!", "strtotime", "(", "$", "date", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'Incorrect date'", ")", ";", "}", "return", "$", "thi...
The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime function. @param $date @param null $error_message @return ValidateBuilder @throws \Exception
[ "The", "field", "under", "validation", "must", "be", "a", "value", "preceding", "the", "given", "date", ".", "The", "dates", "will", "be", "passed", "into", "the", "PHP", "strtotime", "function", "." ]
6cee7ccd3df570e9b043975859aad7ee501e5ab9
https://github.com/larakit/lk-validatebuilder/blob/6cee7ccd3df570e9b043975859aad7ee501e5ab9/src/ValidateBuilder.php#L409-L415
201,619
larakit/lk-validatebuilder
src/ValidateBuilder.php
ValidateBuilder.ruleBetween
function ruleBetween($min, $max, $error_message = null) { if (!is_numeric($min)) { throw new \Exception('Incorrect parameter MIN in rule between'); } if (!is_numeric($max)) { throw new \Exception('Incorrect parameter MAX in rule between'); } retur...
php
function ruleBetween($min, $max, $error_message = null) { if (!is_numeric($min)) { throw new \Exception('Incorrect parameter MIN in rule between'); } if (!is_numeric($max)) { throw new \Exception('Incorrect parameter MAX in rule between'); } retur...
[ "function", "ruleBetween", "(", "$", "min", ",", "$", "max", ",", "$", "error_message", "=", "null", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "min", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'Incorrect parameter MIN in rule between'"...
The field under validation must have a size between the given min and max. Strings, numerics, and files are evaluated in the same fashion as the size rule. @param int $min @param int $max @param null $error_message @return ValidateBuilder @throws \Exception
[ "The", "field", "under", "validation", "must", "have", "a", "size", "between", "the", "given", "min", "and", "max", ".", "Strings", "numerics", "and", "files", "are", "evaluated", "in", "the", "same", "fashion", "as", "the", "size", "rule", "." ]
6cee7ccd3df570e9b043975859aad7ee501e5ab9
https://github.com/larakit/lk-validatebuilder/blob/6cee7ccd3df570e9b043975859aad7ee501e5ab9/src/ValidateBuilder.php#L457-L466
201,620
larakit/lk-validatebuilder
src/ValidateBuilder.php
ValidateBuilder.ruleMin
function ruleMin($min, $error_message = null) { if (!is_numeric($min)) { throw new \Exception('Incorrect parameter MIN in rule min'); } return $this->_rule('min:' . $min, $error_message); }
php
function ruleMin($min, $error_message = null) { if (!is_numeric($min)) { throw new \Exception('Incorrect parameter MIN in rule min'); } return $this->_rule('min:' . $min, $error_message); }
[ "function", "ruleMin", "(", "$", "min", ",", "$", "error_message", "=", "null", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "min", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'Incorrect parameter MIN in rule min'", ")", ";", "}", "retur...
The field under validation must have a minimum value. Strings, numerics, and files are evaluated in the same fashion as the size rule. @param $min @param null $error_message @return ValidateBuilder @throws \Exception
[ "The", "field", "under", "validation", "must", "have", "a", "minimum", "value", ".", "Strings", "numerics", "and", "files", "are", "evaluated", "in", "the", "same", "fashion", "as", "the", "size", "rule", "." ]
6cee7ccd3df570e9b043975859aad7ee501e5ab9
https://github.com/larakit/lk-validatebuilder/blob/6cee7ccd3df570e9b043975859aad7ee501e5ab9/src/ValidateBuilder.php#L1075-L1081
201,621
larakit/lk-validatebuilder
src/ValidateBuilder.php
ValidateBuilder.ruleRequiredIf
function ruleRequiredIf($anotherfield, $value, $error_message = null) { return $this->_rule('required_if:' . $anotherfield . ',' . $value, $error_message); }
php
function ruleRequiredIf($anotherfield, $value, $error_message = null) { return $this->_rule('required_if:' . $anotherfield . ',' . $value, $error_message); }
[ "function", "ruleRequiredIf", "(", "$", "anotherfield", ",", "$", "value", ",", "$", "error_message", "=", "null", ")", "{", "return", "$", "this", "->", "_rule", "(", "'required_if:'", ".", "$", "anotherfield", ".", "','", ".", "$", "value", ",", "$", ...
The field under validation must be present if the anotherfield field is equal to any value. @param $anotherfield @param $value @param null $error_message @return ValidateBuilder @throws \Exception
[ "The", "field", "under", "validation", "must", "be", "present", "if", "the", "anotherfield", "field", "is", "equal", "to", "any", "value", "." ]
6cee7ccd3df570e9b043975859aad7ee501e5ab9
https://github.com/larakit/lk-validatebuilder/blob/6cee7ccd3df570e9b043975859aad7ee501e5ab9/src/ValidateBuilder.php#L1217-L1219
201,622
larakit/lk-validatebuilder
src/ValidateBuilder.php
ValidateBuilder.ruleRequiredUnless
function ruleRequiredUnless($anotherfield, $value, $error_message = null) { return $this->_rule('required_unless:' . $anotherfield . ',' . $value, $error_message); }
php
function ruleRequiredUnless($anotherfield, $value, $error_message = null) { return $this->_rule('required_unless:' . $anotherfield . ',' . $value, $error_message); }
[ "function", "ruleRequiredUnless", "(", "$", "anotherfield", ",", "$", "value", ",", "$", "error_message", "=", "null", ")", "{", "return", "$", "this", "->", "_rule", "(", "'required_unless:'", ".", "$", "anotherfield", ".", "','", ".", "$", "value", ",", ...
The field under validation must be present unless the anotherfield field is equal to any value. @param $anotherfield @param $value @param null $error_message @return ValidateBuilder @throws \Exception
[ "The", "field", "under", "validation", "must", "be", "present", "unless", "the", "anotherfield", "field", "is", "equal", "to", "any", "value", "." ]
6cee7ccd3df570e9b043975859aad7ee501e5ab9
https://github.com/larakit/lk-validatebuilder/blob/6cee7ccd3df570e9b043975859aad7ee501e5ab9/src/ValidateBuilder.php#L1241-L1243
201,623
larakit/lk-validatebuilder
src/ValidateBuilder.php
ValidateBuilder.ruleRequiredWith
function ruleRequiredWith($anotherfields, $error_message = null) { if (is_array($anotherfields)) { $anotherfields = implode(',', $anotherfields); } return $this->_rule('required_with:' . $anotherfields, $error_message); }
php
function ruleRequiredWith($anotherfields, $error_message = null) { if (is_array($anotherfields)) { $anotherfields = implode(',', $anotherfields); } return $this->_rule('required_with:' . $anotherfields, $error_message); }
[ "function", "ruleRequiredWith", "(", "$", "anotherfields", ",", "$", "error_message", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "anotherfields", ")", ")", "{", "$", "anotherfields", "=", "implode", "(", "','", ",", "$", "anotherfields", ")", ...
The field under validation must be present only if any of the other specified fields are present. @param $anotherfield @param $value @param null $error_message @return ValidateBuilder @throws \Exception
[ "The", "field", "under", "validation", "must", "be", "present", "only", "if", "any", "of", "the", "other", "specified", "fields", "are", "present", "." ]
6cee7ccd3df570e9b043975859aad7ee501e5ab9
https://github.com/larakit/lk-validatebuilder/blob/6cee7ccd3df570e9b043975859aad7ee501e5ab9/src/ValidateBuilder.php#L1265-L1271
201,624
larakit/lk-validatebuilder
src/ValidateBuilder.php
ValidateBuilder.ruleRequiredWithout
function ruleRequiredWithout($anotherfields, $error_message = null) { if (is_array($anotherfields)) { $anotherfields = implode(',', $anotherfields); } return $this->_rule('required_without:' . $anotherfields, $error_message); }
php
function ruleRequiredWithout($anotherfields, $error_message = null) { if (is_array($anotherfields)) { $anotherfields = implode(',', $anotherfields); } return $this->_rule('required_without:' . $anotherfields, $error_message); }
[ "function", "ruleRequiredWithout", "(", "$", "anotherfields", ",", "$", "error_message", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "anotherfields", ")", ")", "{", "$", "anotherfields", "=", "implode", "(", "','", ",", "$", "anotherfields", ")...
The field under validation must be present only when any of the other specified fields are not present. @param $anotherfields @param null $error_message @return ValidateBuilder @throws \Exception
[ "The", "field", "under", "validation", "must", "be", "present", "only", "when", "any", "of", "the", "other", "specified", "fields", "are", "not", "present", "." ]
6cee7ccd3df570e9b043975859aad7ee501e5ab9
https://github.com/larakit/lk-validatebuilder/blob/6cee7ccd3df570e9b043975859aad7ee501e5ab9/src/ValidateBuilder.php#L1315-L1321
201,625
larakit/lk-validatebuilder
src/ValidateBuilder.php
ValidateBuilder.ruleRequiredWithoutAll
function ruleRequiredWithoutAll($anotherfields, $error_message = null) { if (is_array($anotherfields)) { $anotherfields = implode(',', $anotherfields); } return $this->_rule('required_without_all:' . $anotherfields, $error_message); }
php
function ruleRequiredWithoutAll($anotherfields, $error_message = null) { if (is_array($anotherfields)) { $anotherfields = implode(',', $anotherfields); } return $this->_rule('required_without_all:' . $anotherfields, $error_message); }
[ "function", "ruleRequiredWithoutAll", "(", "$", "anotherfields", ",", "$", "error_message", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "anotherfields", ")", ")", "{", "$", "anotherfields", "=", "implode", "(", "','", ",", "$", "anotherfields", ...
The field under validation must be present only when all of the other specified fields are not present. @param $anotherfields @param null $error_message @return ValidateBuilder @throws \Exception
[ "The", "field", "under", "validation", "must", "be", "present", "only", "when", "all", "of", "the", "other", "specified", "fields", "are", "not", "present", "." ]
6cee7ccd3df570e9b043975859aad7ee501e5ab9
https://github.com/larakit/lk-validatebuilder/blob/6cee7ccd3df570e9b043975859aad7ee501e5ab9/src/ValidateBuilder.php#L1342-L1348
201,626
LartTyler/PHP-DaybreakCommons
src/DaybreakStudios/Common/DateTime/AbstractDateTimeAwareComparator.php
AbstractDateTimeAwareComparator.copyAndNormalize
protected function copyAndNormalize(/* ... $args */) { if ($this->utcTimezone === null) $this->utcTimezone = new DateTimeZone('UTC'); $args = func_get_args(); foreach ($args as $i => $dt) if ($dt instanceof DateTime) { $dt = clone $dt; $dt->setTimezone($this->utcTimezone); $args[$i] ...
php
protected function copyAndNormalize(/* ... $args */) { if ($this->utcTimezone === null) $this->utcTimezone = new DateTimeZone('UTC'); $args = func_get_args(); foreach ($args as $i => $dt) if ($dt instanceof DateTime) { $dt = clone $dt; $dt->setTimezone($this->utcTimezone); $args[$i] ...
[ "protected", "function", "copyAndNormalize", "(", "/* ... $args */", ")", "{", "if", "(", "$", "this", "->", "utcTimezone", "===", "null", ")", "$", "this", "->", "utcTimezone", "=", "new", "DateTimeZone", "(", "'UTC'", ")", ";", "$", "args", "=", "func_ge...
Copies any number of DateTime objects and normalizes their timezones. @param DateTime $args,... a varargs list of DateTime objects @return array an array containing the cloned and normalized DateTime objects
[ "Copies", "any", "number", "of", "DateTime", "objects", "and", "normalizes", "their", "timezones", "." ]
db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d
https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/DateTime/AbstractDateTimeAwareComparator.php#L34-L51
201,627
AuronConsultingOSS/PhpConsoleLogger
src/Console.php
Console.log
public function log($level, $message, array $context = []) { // Do not allow users to supply nonsense on the log level if (array_key_exists($level, $this->logPrefixesPerLevel) === false) { throw new InvalidArgumentException('Console method not recognised'); } // Parse me...
php
public function log($level, $message, array $context = []) { // Do not allow users to supply nonsense on the log level if (array_key_exists($level, $this->logPrefixesPerLevel) === false) { throw new InvalidArgumentException('Console method not recognised'); } // Parse me...
[ "public", "function", "log", "(", "$", "level", ",", "$", "message", ",", "array", "$", "context", "=", "[", "]", ")", "{", "// Do not allow users to supply nonsense on the log level", "if", "(", "array_key_exists", "(", "$", "level", ",", "$", "this", "->", ...
Logs to an arbitrary log level. We only recognise info/notice/debug/warning/alert/error/emergency/critical levels, anything else will throw an InvalidArgumentException. Please provide log level via Psr\Log\LogLevel constants to ensure goodness. Message must be a string-able value. Context is optional and can contain...
[ "Logs", "to", "an", "arbitrary", "log", "level", "." ]
312fae19b9cf8dfa3237f9ca24d18b8da85043ef
https://github.com/AuronConsultingOSS/PhpConsoleLogger/blob/312fae19b9cf8dfa3237f9ca24d18b8da85043ef/src/Console.php#L63-L78
201,628
AuronConsultingOSS/PhpConsoleLogger
src/Console.php
Console.parseMessage
private function parseMessage($message) { $parsedMessage = null; /** * According to PSR-3 we can accept string-like values (eg stuff we can parse easily into a string, such as obviously * strings and numbers, and objects that can be cast to strings). */ switch (ge...
php
private function parseMessage($message) { $parsedMessage = null; /** * According to PSR-3 we can accept string-like values (eg stuff we can parse easily into a string, such as obviously * strings and numbers, and objects that can be cast to strings). */ switch (ge...
[ "private", "function", "parseMessage", "(", "$", "message", ")", "{", "$", "parsedMessage", "=", "null", ";", "/**\n * According to PSR-3 we can accept string-like values (eg stuff we can parse easily into a string, such as obviously\n * strings and numbers, and objects tha...
Parses the log message and returns as a useable string, or Psr\Log\InvalidArgumentException if non parseable. We only recognise info/notice/debug/warning/alert/error/emergency/critical levels, anything else will throw an InvalidArgumentException. @param mixed $message @return string @throws InvalidArgumentException...
[ "Parses", "the", "log", "message", "and", "returns", "as", "a", "useable", "string", "or", "Psr", "\\", "Log", "\\", "InvalidArgumentException", "if", "non", "parseable", "." ]
312fae19b9cf8dfa3237f9ca24d18b8da85043ef
https://github.com/AuronConsultingOSS/PhpConsoleLogger/blob/312fae19b9cf8dfa3237f9ca24d18b8da85043ef/src/Console.php#L94-L123
201,629
cubicmushroom/routing-annotations
src/Parser/DocumentationAnnotationParser.php
DocumentationAnnotationParser.parse
public function parse(array $classes) { $APIAnnotations = []; foreach ($classes as $class) { $reflectionClass = new \ReflectionClass($class); foreach ($reflectionClass->getMethods() as $reflectionMethod) { $annotations = $this->getReader()->getMethodAnnotatio...
php
public function parse(array $classes) { $APIAnnotations = []; foreach ($classes as $class) { $reflectionClass = new \ReflectionClass($class); foreach ($reflectionClass->getMethods() as $reflectionMethod) { $annotations = $this->getReader()->getMethodAnnotatio...
[ "public", "function", "parse", "(", "array", "$", "classes", ")", "{", "$", "APIAnnotations", "=", "[", "]", ";", "foreach", "(", "$", "classes", "as", "$", "class", ")", "{", "$", "reflectionClass", "=", "new", "\\", "ReflectionClass", "(", "$", "clas...
Parses the files provided by the SeekableIterator @param array $classes Array of classes to parse @return array
[ "Parses", "the", "files", "provided", "by", "the", "SeekableIterator" ]
e8ea0b8c55b7d4ca42baeca64302e8d8ae573408
https://github.com/cubicmushroom/routing-annotations/blob/e8ea0b8c55b7d4ca42baeca64302e8d8ae573408/src/Parser/DocumentationAnnotationParser.php#L60-L94
201,630
fridge-project/dbal
src/Fridge/DBAL/Query/Rewriter/AbstractQueryRewriter.php
AbstractQueryRewriter.extractType
protected static function extractType($type) { if (substr($type, -2) === Connection::PARAM_ARRAY) { return substr($type, 0, strlen($type) - 2); } return false; }
php
protected static function extractType($type) { if (substr($type, -2) === Connection::PARAM_ARRAY) { return substr($type, 0, strlen($type) - 2); } return false; }
[ "protected", "static", "function", "extractType", "(", "$", "type", ")", "{", "if", "(", "substr", "(", "$", "type", ",", "-", "2", ")", "===", "Connection", "::", "PARAM_ARRAY", ")", "{", "return", "substr", "(", "$", "type", ",", "0", ",", "strlen"...
Extracts the fridge type from the expanded type. @param string $type The type. @return string|boolean The fridge type or false if the type is not an expanded one.
[ "Extracts", "the", "fridge", "type", "from", "the", "expanded", "type", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Query/Rewriter/AbstractQueryRewriter.php#L30-L37
201,631
sourceboxio/sdk
src/Register/Register.php
Register.autoload
public static function autoload() { // Vendor path $dir_base = realpath(__DIR__ . '/../../../../'); $finder = new Finder(); $finder->files() ->ignoreVCS(true) ->ignoreDotFiles(false) ->name('service.yml') ->exclude('Tests') ...
php
public static function autoload() { // Vendor path $dir_base = realpath(__DIR__ . '/../../../../'); $finder = new Finder(); $finder->files() ->ignoreVCS(true) ->ignoreDotFiles(false) ->name('service.yml') ->exclude('Tests') ...
[ "public", "static", "function", "autoload", "(", ")", "{", "// Vendor path", "$", "dir_base", "=", "realpath", "(", "__DIR__", ".", "'/../../../../'", ")", ";", "$", "finder", "=", "new", "Finder", "(", ")", ";", "$", "finder", "->", "files", "(", ")", ...
Auto register services. @return void
[ "Auto", "register", "services", "." ]
e16e9e92580d48c2a348d119c2829a8d38528681
https://github.com/sourceboxio/sdk/blob/e16e9e92580d48c2a348d119c2829a8d38528681/src/Register/Register.php#L42-L59
201,632
sourceboxio/sdk
src/Register/Register.php
Register.autoloadFile
protected static function autoloadFile(SplFileInfo $file) { $yml = Yaml::parse(file_get_contents($file->getRealPath()), true); $service = Arr::get($yml, 'micro-service'); if (is_null($service)) { return; } sbox()->add(new MicroService($service, $yml)); }
php
protected static function autoloadFile(SplFileInfo $file) { $yml = Yaml::parse(file_get_contents($file->getRealPath()), true); $service = Arr::get($yml, 'micro-service'); if (is_null($service)) { return; } sbox()->add(new MicroService($service, $yml)); }
[ "protected", "static", "function", "autoloadFile", "(", "SplFileInfo", "$", "file", ")", "{", "$", "yml", "=", "Yaml", "::", "parse", "(", "file_get_contents", "(", "$", "file", "->", "getRealPath", "(", ")", ")", ",", "true", ")", ";", "$", "service", ...
Carregar arquivo. @param SplFileInfo $file @return void
[ "Carregar", "arquivo", "." ]
e16e9e92580d48c2a348d119c2829a8d38528681
https://github.com/sourceboxio/sdk/blob/e16e9e92580d48c2a348d119c2829a8d38528681/src/Register/Register.php#L66-L76
201,633
PenoaksDev/Milky-Framework
src/Milky/Pagination/Paginator.php
Paginator.checkForMorePages
protected function checkForMorePages() { $this->hasMore = count( $this->items ) > ( $this->perPage ); $this->items = $this->items->slice( 0, $this->perPage ); }
php
protected function checkForMorePages() { $this->hasMore = count( $this->items ) > ( $this->perPage ); $this->items = $this->items->slice( 0, $this->perPage ); }
[ "protected", "function", "checkForMorePages", "(", ")", "{", "$", "this", "->", "hasMore", "=", "count", "(", "$", "this", "->", "items", ")", ">", "(", "$", "this", "->", "perPage", ")", ";", "$", "this", "->", "items", "=", "$", "this", "->", "it...
Check for more pages. The last item will be sliced off. @return void
[ "Check", "for", "more", "pages", ".", "The", "last", "item", "will", "be", "sliced", "off", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Pagination/Paginator.php#L62-L67
201,634
OxfordInfoLabs/kinikit-core
src/Util/SerialisableArrayUtils.php
SerialisableArrayUtils.getMemberValueArrayForObjects
public static function getMemberValueArrayForObjects($member, $objects) { $returnValues = array(); foreach ($objects as $key => $value) { if (is_object($value)) { if ($value instanceof SerialisableObject) { $returnValues[$key] = $value->__getSerialisabl...
php
public static function getMemberValueArrayForObjects($member, $objects) { $returnValues = array(); foreach ($objects as $key => $value) { if (is_object($value)) { if ($value instanceof SerialisableObject) { $returnValues[$key] = $value->__getSerialisabl...
[ "public", "static", "function", "getMemberValueArrayForObjects", "(", "$", "member", ",", "$", "objects", ")", "{", "$", "returnValues", "=", "array", "(", ")", ";", "foreach", "(", "$", "objects", "as", "$", "key", "=>", "$", "value", ")", "{", "if", ...
Get an array of member values for a given member for the array of objects passed using the same indexing system as the passed objects. @static @param $member @param $objects
[ "Get", "an", "array", "of", "member", "values", "for", "a", "given", "member", "for", "the", "array", "of", "objects", "passed", "using", "the", "same", "indexing", "system", "as", "the", "passed", "objects", "." ]
edc1b2e6ffabd595c4c7d322279b3dd1e59ef359
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/SerialisableArrayUtils.php#L30-L47
201,635
OxfordInfoLabs/kinikit-core
src/Util/SerialisableArrayUtils.php
SerialisableArrayUtils.indexArrayOfObjectsByMember
public static function indexArrayOfObjectsByMember($member, $objects) { $returnValues = array(); foreach ($objects as $object) { if ($object instanceof SerialisableObject) { $returnValues[$object->__getSerialisablePropertyValue($member)] = $object; } else { ...
php
public static function indexArrayOfObjectsByMember($member, $objects) { $returnValues = array(); foreach ($objects as $object) { if ($object instanceof SerialisableObject) { $returnValues[$object->__getSerialisablePropertyValue($member)] = $object; } else { ...
[ "public", "static", "function", "indexArrayOfObjectsByMember", "(", "$", "member", ",", "$", "objects", ")", "{", "$", "returnValues", "=", "array", "(", ")", ";", "foreach", "(", "$", "objects", "as", "$", "object", ")", "{", "if", "(", "$", "object", ...
Index the array of passed objects by the supplied member, returning an associative array. @param $member @param $objects
[ "Index", "the", "array", "of", "passed", "objects", "by", "the", "supplied", "member", "returning", "an", "associative", "array", "." ]
edc1b2e6ffabd595c4c7d322279b3dd1e59ef359
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/SerialisableArrayUtils.php#L56-L70
201,636
OxfordInfoLabs/kinikit-core
src/Util/SerialisableArrayUtils.php
SerialisableArrayUtils.filterArrayOfObjectsByMember
public static function filterArrayOfObjectsByMember($member, $objects, $filterValue) { $filterValues = is_array($filterValue) ? $filterValue : array($filterValue); $filteredObjects = array(); foreach ($objects as $object) { if ($object instanceof SerialisableObject) { ...
php
public static function filterArrayOfObjectsByMember($member, $objects, $filterValue) { $filterValues = is_array($filterValue) ? $filterValue : array($filterValue); $filteredObjects = array(); foreach ($objects as $object) { if ($object instanceof SerialisableObject) { ...
[ "public", "static", "function", "filterArrayOfObjectsByMember", "(", "$", "member", ",", "$", "objects", ",", "$", "filterValue", ")", "{", "$", "filterValues", "=", "is_array", "(", "$", "filterValue", ")", "?", "$", "filterValue", ":", "array", "(", "$", ...
Filter an array of objects by a specified member. Perhaps in the future extend to multiple match types. @param $member @param $objects @param $filterValue
[ "Filter", "an", "array", "of", "objects", "by", "a", "specified", "member", ".", "Perhaps", "in", "the", "future", "extend", "to", "multiple", "match", "types", "." ]
edc1b2e6ffabd595c4c7d322279b3dd1e59ef359
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/SerialisableArrayUtils.php#L81-L102
201,637
OxfordInfoLabs/kinikit-core
src/Util/SerialisableArrayUtils.php
SerialisableArrayUtils.groupArrayOfObjectsByMember
public static function groupArrayOfObjectsByMember($member, $objects) { if (!is_array($member)) $member = array($member); $leafMember = array_pop($member); $groupedObjects = new AssociativeArray(); foreach ($objects as $object) { $rootNode = $groupedObjects;...
php
public static function groupArrayOfObjectsByMember($member, $objects) { if (!is_array($member)) $member = array($member); $leafMember = array_pop($member); $groupedObjects = new AssociativeArray(); foreach ($objects as $object) { $rootNode = $groupedObjects;...
[ "public", "static", "function", "groupArrayOfObjectsByMember", "(", "$", "member", ",", "$", "objects", ")", "{", "if", "(", "!", "is_array", "(", "$", "member", ")", ")", "$", "member", "=", "array", "(", "$", "member", ")", ";", "$", "leafMember", "=...
Group an array of objects by a given member. @param $member @param $objects
[ "Group", "an", "array", "of", "objects", "by", "a", "given", "member", "." ]
edc1b2e6ffabd595c4c7d322279b3dd1e59ef359
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/SerialisableArrayUtils.php#L111-L146
201,638
praxigento/mobi_mod_pv
Controller/Adminhtml/Transfers/Upload/Save.php
Save.saveFile
private function saveFile() { $dirMedia = $this->filesystem->getDirectoryWrite(ADirList::MEDIA); $dirTarget = $dirMedia->getAbsolutePath(self::MEDIA_SUBFOLDER); $fileId = self::FIELDSET . '[' . self::FIELD_CSV_FILE . ']'; // $fileId = self::FIELD_CSV_FILE; // $fileId = self::FI...
php
private function saveFile() { $dirMedia = $this->filesystem->getDirectoryWrite(ADirList::MEDIA); $dirTarget = $dirMedia->getAbsolutePath(self::MEDIA_SUBFOLDER); $fileId = self::FIELDSET . '[' . self::FIELD_CSV_FILE . ']'; // $fileId = self::FIELD_CSV_FILE; // $fileId = self::FI...
[ "private", "function", "saveFile", "(", ")", "{", "$", "dirMedia", "=", "$", "this", "->", "filesystem", "->", "getDirectoryWrite", "(", "ADirList", "::", "MEDIA", ")", ";", "$", "dirTarget", "=", "$", "dirMedia", "->", "getAbsolutePath", "(", "self", "::"...
Save uploading file to the 'media' folder @return array @throws \Magento\Framework\Exception\FileSystemException
[ "Save", "uploading", "file", "to", "the", "media", "folder" ]
d1540b7e94264527006e8b9fa68904a72a63928e
https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Controller/Adminhtml/Transfers/Upload/Save.php#L121-L136
201,639
t3v/t3v_core
Classes/Service/PageService.php
PageService.getBackendLayoutForPage
public function getBackendLayoutForPage(int $uid) { $rootLine = $this->pageRepository->getRootLine($uid); if ($rootLine) { $index = -1; foreach($rootLine as $page) { $index++; $backendLayout = $page['backend_layout']; $hasBackendLayout = false; ...
php
public function getBackendLayoutForPage(int $uid) { $rootLine = $this->pageRepository->getRootLine($uid); if ($rootLine) { $index = -1; foreach($rootLine as $page) { $index++; $backendLayout = $page['backend_layout']; $hasBackendLayout = false; ...
[ "public", "function", "getBackendLayoutForPage", "(", "int", "$", "uid", ")", "{", "$", "rootLine", "=", "$", "this", "->", "pageRepository", "->", "getRootLine", "(", "$", "uid", ")", ";", "if", "(", "$", "rootLine", ")", "{", "$", "index", "=", "-", ...
Gets the backend layout for a page. @param int $uid The UID of the page @return string|null The backend layout or null if no backend layout was found
[ "Gets", "the", "backend", "layout", "for", "a", "page", "." ]
8c04b7688cc2773f11fcc87fda3f7cd53d80a980
https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Service/PageService.php#L205-L244
201,640
ekyna/MediaBundle
Browser/Generator.php
Generator.generateThumbUrl
public function generateThumbUrl(MediaInterface $media) { $path = null; if ($media->getType() === MediaTypes::IMAGE) { $path = $this->cacheManager->getBrowserPath($media->getPath(), 'media_thumb'); } else { $path = $this->generateFileThumb($media); } ...
php
public function generateThumbUrl(MediaInterface $media) { $path = null; if ($media->getType() === MediaTypes::IMAGE) { $path = $this->cacheManager->getBrowserPath($media->getPath(), 'media_thumb'); } else { $path = $this->generateFileThumb($media); } ...
[ "public", "function", "generateThumbUrl", "(", "MediaInterface", "$", "media", ")", "{", "$", "path", "=", "null", ";", "if", "(", "$", "media", "->", "getType", "(", ")", "===", "MediaTypes", "::", "IMAGE", ")", "{", "$", "path", "=", "$", "this", "...
Generates a thumb for the given media. @param MediaInterface $media @return string
[ "Generates", "a", "thumb", "for", "the", "given", "media", "." ]
512cf86c801a130a9f17eba8b48d646d23acdbab
https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Browser/Generator.php#L89-L104
201,641
ekyna/MediaBundle
Browser/Generator.php
Generator.generateFrontUrl
public function generateFrontUrl(MediaInterface $media) { $path = null; if ($media->getType() === MediaTypes::IMAGE) { $path = $this->cacheManager->getBrowserPath($media->getPath(), 'media_front'); } elseif (in_array($media->getType(), [MediaTypes::VIDEO, MediaTypes::AUDIO, Medi...
php
public function generateFrontUrl(MediaInterface $media) { $path = null; if ($media->getType() === MediaTypes::IMAGE) { $path = $this->cacheManager->getBrowserPath($media->getPath(), 'media_front'); } elseif (in_array($media->getType(), [MediaTypes::VIDEO, MediaTypes::AUDIO, Medi...
[ "public", "function", "generateFrontUrl", "(", "MediaInterface", "$", "media", ")", "{", "$", "path", "=", "null", ";", "if", "(", "$", "media", "->", "getType", "(", ")", "===", "MediaTypes", "::", "IMAGE", ")", "{", "$", "path", "=", "$", "this", "...
Generates the default front url. @param MediaInterface $media @return string
[ "Generates", "the", "default", "front", "url", "." ]
512cf86c801a130a9f17eba8b48d646d23acdbab
https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Browser/Generator.php#L112-L125
201,642
ekyna/MediaBundle
Browser/Generator.php
Generator.generateFileThumb
private function generateFileThumb(MediaInterface $media) { $extension = $media->guessExtension(); $thumbPath = sprintf('/%s/%s.jpg', $this->thumbsDirectory, $extension); $destination = $this->webRootDirectory . $thumbPath; if (file_exists($destination)) { return $th...
php
private function generateFileThumb(MediaInterface $media) { $extension = $media->guessExtension(); $thumbPath = sprintf('/%s/%s.jpg', $this->thumbsDirectory, $extension); $destination = $this->webRootDirectory . $thumbPath; if (file_exists($destination)) { return $th...
[ "private", "function", "generateFileThumb", "(", "MediaInterface", "$", "media", ")", "{", "$", "extension", "=", "$", "media", "->", "guessExtension", "(", ")", ";", "$", "thumbPath", "=", "sprintf", "(", "'/%s/%s.jpg'", ",", "$", "this", "->", "thumbsDirec...
Generates thumb for non-image elements. @param MediaInterface $media @return null|string
[ "Generates", "thumb", "for", "non", "-", "image", "elements", "." ]
512cf86c801a130a9f17eba8b48d646d23acdbab
https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Browser/Generator.php#L133-L168
201,643
ekyna/MediaBundle
Browser/Generator.php
Generator.checkDir
private function checkDir($dir) { if (! $this->fs->exists($dir)) { $this->fs->mkdir($dir); } }
php
private function checkDir($dir) { if (! $this->fs->exists($dir)) { $this->fs->mkdir($dir); } }
[ "private", "function", "checkDir", "(", "$", "dir", ")", "{", "if", "(", "!", "$", "this", "->", "fs", "->", "exists", "(", "$", "dir", ")", ")", "{", "$", "this", "->", "fs", "->", "mkdir", "(", "$", "dir", ")", ";", "}", "}" ]
Creates the directory if it does not exists. @param $dir
[ "Creates", "the", "directory", "if", "it", "does", "not", "exists", "." ]
512cf86c801a130a9f17eba8b48d646d23acdbab
https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Browser/Generator.php#L195-L200
201,644
matthiasmoritz/cake-isbn
src/Controller/Component/IsbnComponent.php
IsbnComponent.splitIsbn
public function splitIsbn($isbn) { if (!$this->validateIsbn($isbn)) { return false; } $prefix = substr($isbn, 0,3); $groupnumber = $this->getGroupNumber($isbn); $pubnumber = $this->getPublisherNumber($isbn); $prenumbers = strle...
php
public function splitIsbn($isbn) { if (!$this->validateIsbn($isbn)) { return false; } $prefix = substr($isbn, 0,3); $groupnumber = $this->getGroupNumber($isbn); $pubnumber = $this->getPublisherNumber($isbn); $prenumbers = strle...
[ "public", "function", "splitIsbn", "(", "$", "isbn", ")", "{", "if", "(", "!", "$", "this", "->", "validateIsbn", "(", "$", "isbn", ")", ")", "{", "return", "false", ";", "}", "$", "prefix", "=", "substr", "(", "$", "isbn", ",", "0", ",", "3", ...
Splits a valid ISBN-13 Number in its components @param string $input The ISBN Numeber. @return array['bookland']['publisherNumber']['ArticleNumber']['Checksum'] @access public @throws NO ERROR HANDLING
[ "Splits", "a", "valid", "ISBN", "-", "13", "Number", "in", "its", "components" ]
aba4147bcc714bc1f6db057587f0372cd5b3bff1
https://github.com/matthiasmoritz/cake-isbn/blob/aba4147bcc714bc1f6db057587f0372cd5b3bff1/src/Controller/Component/IsbnComponent.php#L88-L101
201,645
matthiasmoritz/cake-isbn
src/Controller/Component/IsbnComponent.php
IsbnComponent.validateIsbn
public function validateIsbn($check) { $ean = strval($check); $code = substr($ean, 0, -1); $key = $this->calculateCheckdigit13($code); // in key steht die prüfziffer - an den code anhängen $code .= $key; if ($code == $ean) { return true; ...
php
public function validateIsbn($check) { $ean = strval($check); $code = substr($ean, 0, -1); $key = $this->calculateCheckdigit13($code); // in key steht die prüfziffer - an den code anhängen $code .= $key; if ($code == $ean) { return true; ...
[ "public", "function", "validateIsbn", "(", "$", "check", ")", "{", "$", "ean", "=", "strval", "(", "$", "check", ")", ";", "$", "code", "=", "substr", "(", "$", "ean", ",", "0", ",", "-", "1", ")", ";", "$", "key", "=", "$", "this", "->", "ca...
Validates an ISBN-13 Number @param string $input The ISBN Numeber. @returnbool
[ "Validates", "an", "ISBN", "-", "13", "Number" ]
aba4147bcc714bc1f6db057587f0372cd5b3bff1
https://github.com/matthiasmoritz/cake-isbn/blob/aba4147bcc714bc1f6db057587f0372cd5b3bff1/src/Controller/Component/IsbnComponent.php#L109-L124
201,646
rawphp/RawRequest
src/RawPHP/RawRequest/Request.php
Request.init
public function init( $config = [ ] ) { if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ) { $this->userAgent = $_SERVER[ 'HTTP_USER_AGENT' ]; } if ( isset( $_SERVER[ 'SERVER_NAME' ] ) ) { $this->server = $_SERVER[ 'SERVER_NAME' ]; } if ( is...
php
public function init( $config = [ ] ) { if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ) { $this->userAgent = $_SERVER[ 'HTTP_USER_AGENT' ]; } if ( isset( $_SERVER[ 'SERVER_NAME' ] ) ) { $this->server = $_SERVER[ 'SERVER_NAME' ]; } if ( is...
[ "public", "function", "init", "(", "$", "config", "=", "[", "]", ")", "{", "if", "(", "isset", "(", "$", "_SERVER", "[", "'HTTP_USER_AGENT'", "]", ")", ")", "{", "$", "this", "->", "userAgent", "=", "$", "_SERVER", "[", "'HTTP_USER_AGENT'", "]", ";",...
Initialises the request. @param array $config optional configuration array
[ "Initialises", "the", "request", "." ]
89b596f1fb035f1acd5fa89b58a6f4a3d56a5ffe
https://github.com/rawphp/RawRequest/blob/89b596f1fb035f1acd5fa89b58a6f4a3d56a5ffe/src/RawPHP/RawRequest/Request.php#L82-L144
201,647
rawphp/RawRequest
src/RawPHP/RawRequest/Request.php
Request.createUrl
public function createUrl( $route, $params = [ ], $absolute = FALSE ) { $url = $this->script . '/' . $route; if ( file_exists( TEST_LOCK_FILE ) ) { $url = $route; } if ( !empty( $params ) ) { foreach ( $params as $value ) { ...
php
public function createUrl( $route, $params = [ ], $absolute = FALSE ) { $url = $this->script . '/' . $route; if ( file_exists( TEST_LOCK_FILE ) ) { $url = $route; } if ( !empty( $params ) ) { foreach ( $params as $value ) { ...
[ "public", "function", "createUrl", "(", "$", "route", ",", "$", "params", "=", "[", "]", ",", "$", "absolute", "=", "FALSE", ")", "{", "$", "url", "=", "$", "this", "->", "script", ".", "'/'", ".", "$", "route", ";", "if", "(", "file_exists", "("...
Creates a http url. This method has a dependency on two defines 1. TEST_LOCK_FILE - test lock file, define it as '/path/to/site/root/test.lock' 2. BASE_URL - this is the base url of your application, e.g, http://rawphp.org @param string $route the route @param array $params list of parameters (in the correct or...
[ "Creates", "a", "http", "url", "." ]
89b596f1fb035f1acd5fa89b58a6f4a3d56a5ffe
https://github.com/rawphp/RawRequest/blob/89b596f1fb035f1acd5fa89b58a6f4a3d56a5ffe/src/RawPHP/RawRequest/Request.php#L359-L389
201,648
wb-crowdfusion/crowdfusion
system/core/classes/mvc/controllers/AbstractController.php
AbstractController.handleDatasource
public function handleDatasource($name, $method, array $preloadedData, array &$templateVariables) { $this->name = $name; $datasource = ActionUtils::createActionDatasource($name,$method); // set the variables for use $this->templateVars =& $templateVariables; $this->current...
php
public function handleDatasource($name, $method, array $preloadedData, array &$templateVariables) { $this->name = $name; $datasource = ActionUtils::createActionDatasource($name,$method); // set the variables for use $this->templateVars =& $templateVariables; $this->current...
[ "public", "function", "handleDatasource", "(", "$", "name", ",", "$", "method", ",", "array", "$", "preloadedData", ",", "array", "&", "$", "templateVariables", ")", "{", "$", "this", "->", "name", "=", "$", "name", ";", "$", "datasource", "=", "ActionUt...
this is used by the RenderModule when loading data from an element
[ "this", "is", "used", "by", "the", "RenderModule", "when", "loading", "data", "from", "an", "element" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/controllers/AbstractController.php#L208-L259
201,649
wb-crowdfusion/crowdfusion
system/core/classes/mvc/controllers/AbstractController.php
AbstractController.getTemplateVariable
protected function getTemplateVariable($name, $default = null) { return array_key_exists($name, $this->templateVars)?$this->templateVars[$name]:$default; }
php
protected function getTemplateVariable($name, $default = null) { return array_key_exists($name, $this->templateVars)?$this->templateVars[$name]:$default; }
[ "protected", "function", "getTemplateVariable", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "return", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "templateVars", ")", "?", "$", "this", "->", "templateVars", "[", "$", "...
Used in datasource methods @param string $name @param mixed $default @return mixed
[ "Used", "in", "datasource", "methods" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/controllers/AbstractController.php#L399-L402
201,650
wb-crowdfusion/crowdfusion
system/core/classes/mvc/controllers/AbstractController.php
AbstractController.getRequiredTemplateVariable
protected function getRequiredTemplateVariable($name) { if(!array_key_exists($name, $this->templateVars)) throw new ControllerException('Required template variable ['.$name.'] is missing'); return $this->templateVars[$name]; }
php
protected function getRequiredTemplateVariable($name) { if(!array_key_exists($name, $this->templateVars)) throw new ControllerException('Required template variable ['.$name.'] is missing'); return $this->templateVars[$name]; }
[ "protected", "function", "getRequiredTemplateVariable", "(", "$", "name", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "templateVars", ")", ")", "throw", "new", "ControllerException", "(", "'Required template variable ['"...
Used in datasource methods, throws ControllerException when value is missing @param $name @return mixed
[ "Used", "in", "datasource", "methods", "throws", "ControllerException", "when", "value", "is", "missing" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/controllers/AbstractController.php#L420-L426
201,651
bandama-framework/bandama-framework
src/foundation/session/Flash.php
Flash.get
public function get($type = 'success') { $key = self::BANDAMA_FLASH_KEY.'_'.$type; $flash = $this->session->get($key); $this->session->delete($key); return $flash; }
php
public function get($type = 'success') { $key = self::BANDAMA_FLASH_KEY.'_'.$type; $flash = $this->session->get($key); $this->session->delete($key); return $flash; }
[ "public", "function", "get", "(", "$", "type", "=", "'success'", ")", "{", "$", "key", "=", "self", "::", "BANDAMA_FLASH_KEY", ".", "'_'", ".", "$", "type", ";", "$", "flash", "=", "$", "this", "->", "session", "->", "get", "(", "$", "key", ")", ...
Get flash message @return mixed
[ "Get", "flash", "message" ]
234ed703baf9e31268941c9d5f6d5e004cc53066
https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/session/Flash.php#L62-L68
201,652
zenapply/php-peoplematter
src/PeopleMatter.php
PeopleMatter.getClient
public function getClient() { if (!$this->client instanceof Client) { $this->client = new Client([ "cookies" => true ]); } return $this->client; }
php
public function getClient() { if (!$this->client instanceof Client) { $this->client = new Client([ "cookies" => true ]); } return $this->client; }
[ "public", "function", "getClient", "(", ")", "{", "if", "(", "!", "$", "this", "->", "client", "instanceof", "Client", ")", "{", "$", "this", "->", "client", "=", "new", "Client", "(", "[", "\"cookies\"", "=>", "true", "]", ")", ";", "}", "return", ...
Returns the Client instance @return Client
[ "Returns", "the", "Client", "instance" ]
141e01f6b2e68741358995643e61c88864a4a165
https://github.com/zenapply/php-peoplematter/blob/141e01f6b2e68741358995643e61c88864a4a165/src/PeopleMatter.php#L264-L272
201,653
zenapply/php-peoplematter
src/PeopleMatter.php
PeopleMatter.request
protected function request($method, $url, $options = []) { $client = $this->getClient(); try { $response = $client->request($method, $url, $options); } catch (\GuzzleHttp\Exception\ClientException $e) { $response = $e->getResponse(); throw new PeopleMatter...
php
protected function request($method, $url, $options = []) { $client = $this->getClient(); try { $response = $client->request($method, $url, $options); } catch (\GuzzleHttp\Exception\ClientException $e) { $response = $e->getResponse(); throw new PeopleMatter...
[ "protected", "function", "request", "(", "$", "method", ",", "$", "url", ",", "$", "options", "=", "[", "]", ")", "{", "$", "client", "=", "$", "this", "->", "getClient", "(", ")", ";", "try", "{", "$", "response", "=", "$", "client", "->", "requ...
Executes a request to the PeopleMatter API @param string $method The request type @param string $url The url to request @param array $options An array of options for the request @return array The response as an array
[ "Executes", "a", "request", "to", "the", "PeopleMatter", "API" ]
141e01f6b2e68741358995643e61c88864a4a165
https://github.com/zenapply/php-peoplematter/blob/141e01f6b2e68741358995643e61c88864a4a165/src/PeopleMatter.php#L281-L303
201,654
makinacorpus/drupal-apubsub
src/Backend/AbstractDrupalCursor.php
AbstractDrupalCursor.applyOperator
final protected function applyOperator(\SelectQueryInterface $query, $statement, $value) { // Check if $value contains an operator (i.e. if is associative array) if (is_array($value) && !Misc::isIndexed($value)) { // First key will be the operator $keys = array_keys($val...
php
final protected function applyOperator(\SelectQueryInterface $query, $statement, $value) { // Check if $value contains an operator (i.e. if is associative array) if (is_array($value) && !Misc::isIndexed($value)) { // First key will be the operator $keys = array_keys($val...
[ "final", "protected", "function", "applyOperator", "(", "\\", "SelectQueryInterface", "$", "query", ",", "$", "statement", ",", "$", "value", ")", "{", "// Check if $value contains an operator (i.e. if is associative array)", "if", "(", "is_array", "(", "$", "value", ...
Apply the operator onto the query @param \SelectQueryInterface $query @param string $statement @param string $value
[ "Apply", "the", "operator", "onto", "the", "query" ]
534fbecf67c880996ae02210c0bfdb3e0d3699b6
https://github.com/makinacorpus/drupal-apubsub/blob/534fbecf67c880996ae02210c0bfdb3e0d3699b6/src/Backend/AbstractDrupalCursor.php#L163-L200
201,655
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.attach
public function attach( Base $entity, &$restingPlace = null ) { if( !$this->makeableSafetyCheck() ) { return null; } // check type if( !is_a( $entity, $this->entityClass ) ) { throw new EntityNotCompatibleWithRepositoryException( $entity, $this ); } ...
php
public function attach( Base $entity, &$restingPlace = null ) { if( !$this->makeableSafetyCheck() ) { return null; } // check type if( !is_a( $entity, $this->entityClass ) ) { throw new EntityNotCompatibleWithRepositoryException( $entity, $this ); } ...
[ "public", "function", "attach", "(", "Base", "$", "entity", ",", "&", "$", "restingPlace", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "makeableSafetyCheck", "(", ")", ")", "{", "return", "null", ";", "}", "// check type", "if", "(", "!...
Add a entity into the multiton array @param Entity\Base @param mixed If successful attachment the location of the new attachment @return bool. Successful attachment?
[ "Add", "a", "entity", "into", "the", "multiton", "array" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L61-L100
201,656
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.isAttached
public function isAttached( Base $entity ) { return false !== array_search( $entity, $this->instancesPersisted, true ) || false !== array_search( $entity, $this->instancesUnpersisted, true ); }
php
public function isAttached( Base $entity ) { return false !== array_search( $entity, $this->instancesPersisted, true ) || false !== array_search( $entity, $this->instancesUnpersisted, true ); }
[ "public", "function", "isAttached", "(", "Base", "$", "entity", ")", "{", "return", "false", "!==", "array_search", "(", "$", "entity", ",", "$", "this", "->", "instancesPersisted", ",", "true", ")", "||", "false", "!==", "array_search", "(", "$", "entity"...
Is in multiton store. @return bool
[ "Is", "in", "multiton", "store", "." ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L106-L110
201,657
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.detach
public function detach( Base $entity, &$detachedFrom = null ) { $detachedFrom = null; foreach( array( 'Persisted', 'Unpersisted') as $type ) { $cache = "instances{$type}"; $cache =& $this->$cache; if( false !== $key = array_search( $entity, $cache, true ) ) { ...
php
public function detach( Base $entity, &$detachedFrom = null ) { $detachedFrom = null; foreach( array( 'Persisted', 'Unpersisted') as $type ) { $cache = "instances{$type}"; $cache =& $this->$cache; if( false !== $key = array_search( $entity, $cache, true ) ) { ...
[ "public", "function", "detach", "(", "Base", "$", "entity", ",", "&", "$", "detachedFrom", "=", "null", ")", "{", "$", "detachedFrom", "=", "null", ";", "foreach", "(", "array", "(", "'Persisted'", ",", "'Unpersisted'", ")", "as", "$", "type", ")", "{"...
Detach a entity from the multiton @param Entity\Base @return bool Successful detachement?
[ "Detach", "a", "entity", "from", "the", "multiton" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L117-L139
201,658
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.rekey
public function rekey( Base $entity ) { if( false !== $key = array_search( $entity, $this->instancesPersisted, true ) ) { $newKey = $entity->keyGet( $entity ); if( isset( $this->instancesPersisted[$newKey] ) and $entity !== $this->instancesPersisted[$newKey] ) { th...
php
public function rekey( Base $entity ) { if( false !== $key = array_search( $entity, $this->instancesPersisted, true ) ) { $newKey = $entity->keyGet( $entity ); if( isset( $this->instancesPersisted[$newKey] ) and $entity !== $this->instancesPersisted[$newKey] ) { th...
[ "public", "function", "rekey", "(", "Base", "$", "entity", ")", "{", "if", "(", "false", "!==", "$", "key", "=", "array_search", "(", "$", "entity", ",", "$", "this", "->", "instancesPersisted", ",", "true", ")", ")", "{", "$", "newKey", "=", "$", ...
A entity's key has changed. If it is in the repository this'll need rekeying @param Base $entity
[ "A", "entity", "s", "key", "has", "changed", ".", "If", "it", "is", "in", "the", "repository", "this", "ll", "need", "rekeying" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L145-L164
201,659
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.find
public function find( $key, $disableLateLoading = null, $cache = true ) { // $disableLateLoading default value management if( !is_bool( $disableLateLoading ) ) { $disableLateLoading = false; } // have we switched off the multiton? if( !$cache ) { ret...
php
public function find( $key, $disableLateLoading = null, $cache = true ) { // $disableLateLoading default value management if( !is_bool( $disableLateLoading ) ) { $disableLateLoading = false; } // have we switched off the multiton? if( !$cache ) { ret...
[ "public", "function", "find", "(", "$", "key", ",", "$", "disableLateLoading", "=", "null", ",", "$", "cache", "=", "true", ")", "{", "// $disableLateLoading default value management", "if", "(", "!", "is_bool", "(", "$", "disableLateLoading", ")", ")", "{", ...
Multiton. Fuck yeah! @param $key scalar. This key will be used to key the multiton array and instance the multiton. @param bool $disableLateLoading @param bool $cache default false. Is is now possible to create a object that doesn't exist in the multion.
[ "Multiton", ".", "Fuck", "yeah!" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L173-L219
201,660
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.make
public function make( array $data = null ) { $obj = parent::make( $data ); $this->instancesUnpersisted[] = $obj; return $obj; }
php
public function make( array $data = null ) { $obj = parent::make( $data ); $this->instancesUnpersisted[] = $obj; return $obj; }
[ "public", "function", "make", "(", "array", "$", "data", "=", "null", ")", "{", "$", "obj", "=", "parent", "::", "make", "(", "$", "data", ")", ";", "$", "this", "->", "instancesUnpersisted", "[", "]", "=", "$", "obj", ";", "return", "$", "obj", ...
Make a new entity @inheritDoc()
[ "Make", "a", "new", "entity" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L338-L343
201,661
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.initByData
public function initByData( array $data = null ) { if( !$data ) { return null; } // table inheritance - ghetto? /* if( isset( $data['tableoid'] ) ) { if( $data['tableoid'] != static::OID ) { $repo = Repository::init( $data['tableoid']...
php
public function initByData( array $data = null ) { if( !$data ) { return null; } // table inheritance - ghetto? /* if( isset( $data['tableoid'] ) ) { if( $data['tableoid'] != static::OID ) { $repo = Repository::init( $data['tableoid']...
[ "public", "function", "initByData", "(", "array", "$", "data", "=", "null", ")", "{", "if", "(", "!", "$", "data", ")", "{", "return", "null", ";", "}", "// table inheritance - ghetto?", "/*\n if( isset( $data['tableoid'] ) ) {\n if( $data['tableoid'] ...
Entry point for objects where you've got the data array and you wish to instantiate a object and add to the cache. @param array $data @return Bond\Entity
[ "Entry", "point", "for", "objects", "where", "you", "ve", "got", "the", "data", "array", "and", "you", "wish", "to", "instantiate", "a", "object", "and", "add", "to", "the", "cache", "." ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L352-L390
201,662
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.isCached
public function isCached( Base $entity, $source = self::PERSISTED ) { switch( $source ) { case self::PERSISTED: return false !== array_search( $entity, $this->instancesPersisted, true ); case self::UNPERSISTED: return false !== array_search( $entity, $...
php
public function isCached( Base $entity, $source = self::PERSISTED ) { switch( $source ) { case self::PERSISTED: return false !== array_search( $entity, $this->instancesPersisted, true ); case self::UNPERSISTED: return false !== array_search( $entity, $...
[ "public", "function", "isCached", "(", "Base", "$", "entity", ",", "$", "source", "=", "self", "::", "PERSISTED", ")", "{", "switch", "(", "$", "source", ")", "{", "case", "self", "::", "PERSISTED", ":", "return", "false", "!==", "array_search", "(", "...
Is this object in the multiton cache @return bool;
[ "Is", "this", "object", "in", "the", "multiton", "cache" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L490-L501
201,663
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.cacheSize
public function cacheSize( $type = self::PERSISTED ) { switch( $type ) { case self::PERSISTED: return count( $this->instancesPersisted ); case self::UNPERSISTED: return count( $this->instancesUnpersisted ); case self::ALL: r...
php
public function cacheSize( $type = self::PERSISTED ) { switch( $type ) { case self::PERSISTED: return count( $this->instancesPersisted ); case self::UNPERSISTED: return count( $this->instancesUnpersisted ); case self::ALL: r...
[ "public", "function", "cacheSize", "(", "$", "type", "=", "self", "::", "PERSISTED", ")", "{", "switch", "(", "$", "type", ")", "{", "case", "self", "::", "PERSISTED", ":", "return", "count", "(", "$", "this", "->", "instancesPersisted", ")", ";", "cas...
Returns the number of cached items @return int Number of instances stored
[ "Returns", "the", "number", "of", "cached", "items" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L507-L518
201,664
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.cacheInvalidate
public function cacheInvalidate( $type = self::ALL ) { switch( $type ) { case self::PERSISTED: $return = count( $this->instancesPersisted ); $this->instancesPersisted = array(); return $return; case self::UNPERSISTED: $r...
php
public function cacheInvalidate( $type = self::ALL ) { switch( $type ) { case self::PERSISTED: $return = count( $this->instancesPersisted ); $this->instancesPersisted = array(); return $return; case self::UNPERSISTED: $r...
[ "public", "function", "cacheInvalidate", "(", "$", "type", "=", "self", "::", "ALL", ")", "{", "switch", "(", "$", "type", ")", "{", "case", "self", "::", "PERSISTED", ":", "$", "return", "=", "count", "(", "$", "this", "->", "instancesPersisted", ")",...
Invalidate cache. Returns multiton to it's vanilla state. Required for unit testing.
[ "Invalidate", "cache", ".", "Returns", "multiton", "to", "it", "s", "vanilla", "state", ".", "Required", "for", "unit", "testing", "." ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L523-L541
201,665
squareproton/Bond
src/Bond/Repository/Multiton.php
Multiton.garbageCollect
public function garbageCollect( $keyOrObject = null ) { // we're going to be doing the $this->instancesPersisted_max_allowed check first if( $keyOrObject == null ) { // auto garbage collection is disabled. if( !is_int( $this->instancesMaxAllowed ) ) { return...
php
public function garbageCollect( $keyOrObject = null ) { // we're going to be doing the $this->instancesPersisted_max_allowed check first if( $keyOrObject == null ) { // auto garbage collection is disabled. if( !is_int( $this->instancesMaxAllowed ) ) { return...
[ "public", "function", "garbageCollect", "(", "$", "keyOrObject", "=", "null", ")", "{", "// we're going to be doing the $this->instancesPersisted_max_allowed check first", "if", "(", "$", "keyOrObject", "==", "null", ")", "{", "// auto garbage collection is disabled.", "if", ...
Removes a object from the multiton if 1. You pass its `key` (ie, the key that you would have used to instantiate it with get() 2. You pass it the object (includes objects in $this->instancesUnpersisted 3. You don't pass anything and there are > $this->instancesPersisted max_allowed persisted instances of this object i...
[ "Removes", "a", "object", "from", "the", "multiton", "if" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Repository/Multiton.php#L586-L652
201,666
ZendExperts/phpids
lib/IDS/Log/Email.php
IDS_Log_Email.isSpamAttempt
protected function isSpamAttempt() { /* * loop through all files in the tmp directory and * delete garbage files */ $dir = $this->tmp_path; $numPrefixChars = strlen($this->file_prefix); $files = scandir($dir); foreach ($files as $file) { i...
php
protected function isSpamAttempt() { /* * loop through all files in the tmp directory and * delete garbage files */ $dir = $this->tmp_path; $numPrefixChars = strlen($this->file_prefix); $files = scandir($dir); foreach ($files as $file) { i...
[ "protected", "function", "isSpamAttempt", "(", ")", "{", "/*\n * loop through all files in the tmp directory and\n * delete garbage files\n */", "$", "dir", "=", "$", "this", "->", "tmp_path", ";", "$", "numPrefixChars", "=", "strlen", "(", "$", "this",...
Detects spam attempts To avoid mail spam through this logging class this function is used to detect such attempts based on the alert frequency. @return boolean
[ "Detects", "spam", "attempts" ]
f30df04eea47b94d056e2ae9ec8fea1c626f1c03
https://github.com/ZendExperts/phpids/blob/f30df04eea47b94d056e2ae9ec8fea1c626f1c03/lib/IDS/Log/Email.php#L211-L257
201,667
ZendExperts/phpids
lib/IDS/Log/Email.php
IDS_Log_Email.execute
public function execute(IDS_Report $data) { if ($this->safemode) { if ($this->isSpamAttempt()) { return false; } } /* * In case the data has been modified before it might * be necessary to convert it to string since it's pretty ...
php
public function execute(IDS_Report $data) { if ($this->safemode) { if ($this->isSpamAttempt()) { return false; } } /* * In case the data has been modified before it might * be necessary to convert it to string since it's pretty ...
[ "public", "function", "execute", "(", "IDS_Report", "$", "data", ")", "{", "if", "(", "$", "this", "->", "safemode", ")", "{", "if", "(", "$", "this", "->", "isSpamAttempt", "(", ")", ")", "{", "return", "false", ";", "}", "}", "/*\n * In case t...
Sends the report to registered recipients @param object $data IDS_Report instance @throws Exception if data is no string @return boolean
[ "Sends", "the", "report", "to", "registered", "recipients" ]
f30df04eea47b94d056e2ae9ec8fea1c626f1c03
https://github.com/ZendExperts/phpids/blob/f30df04eea47b94d056e2ae9ec8fea1c626f1c03/lib/IDS/Log/Email.php#L308-L365
201,668
horntell/php-sdk
src/Horntell/Card.php
Card.toProfile
public function toProfile($uid, $card) { $card['canvas'] = isset($card['canvas']) ? $card['canvas'] : self::DEFAULT_CANVAS; return $this->request->send('POST', "/profiles/$uid/cards", $card); }
php
public function toProfile($uid, $card) { $card['canvas'] = isset($card['canvas']) ? $card['canvas'] : self::DEFAULT_CANVAS; return $this->request->send('POST', "/profiles/$uid/cards", $card); }
[ "public", "function", "toProfile", "(", "$", "uid", ",", "$", "card", ")", "{", "$", "card", "[", "'canvas'", "]", "=", "isset", "(", "$", "card", "[", "'canvas'", "]", ")", "?", "$", "card", "[", "'canvas'", "]", ":", "self", "::", "DEFAULT_CANVAS...
Sends a card to a profile @param string $uid @param array $card @return Horntell\Http\Response
[ "Sends", "a", "card", "to", "a", "profile" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/src/Horntell/Card.php#L29-L34
201,669
horntell/php-sdk
src/Horntell/Card.php
Card.toProfiles
public function toProfiles($profiles, $card) { $card = array_merge(['profile_uids' => $profiles], $card); $card['canvas'] = isset($card['canvas']) ? $card['canvas'] : self::DEFAULT_CANVAS; return $this->request->send('POST', "/profiles/cards", $card); }
php
public function toProfiles($profiles, $card) { $card = array_merge(['profile_uids' => $profiles], $card); $card['canvas'] = isset($card['canvas']) ? $card['canvas'] : self::DEFAULT_CANVAS; return $this->request->send('POST', "/profiles/cards", $card); }
[ "public", "function", "toProfiles", "(", "$", "profiles", ",", "$", "card", ")", "{", "$", "card", "=", "array_merge", "(", "[", "'profile_uids'", "=>", "$", "profiles", "]", ",", "$", "card", ")", ";", "$", "card", "[", "'canvas'", "]", "=", "isset"...
Sends a card to a multiple profiles @param array $card @return Horntell\Http\Response
[ "Sends", "a", "card", "to", "a", "multiple", "profiles" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/src/Horntell/Card.php#L42-L49
201,670
horntell/php-sdk
src/Horntell/Card.php
Card.toChannels
public function toChannels($channels, $card) { $card = array_merge(['channel_uids' => $channels], $card); $card['canvas'] = isset($card['canvas']) ? $card['canvas'] : self::DEFAULT_CANVAS; return $this->request->send('POST', "/channels/cards", $card); }
php
public function toChannels($channels, $card) { $card = array_merge(['channel_uids' => $channels], $card); $card['canvas'] = isset($card['canvas']) ? $card['canvas'] : self::DEFAULT_CANVAS; return $this->request->send('POST', "/channels/cards", $card); }
[ "public", "function", "toChannels", "(", "$", "channels", ",", "$", "card", ")", "{", "$", "card", "=", "array_merge", "(", "[", "'channel_uids'", "=>", "$", "channels", "]", ",", "$", "card", ")", ";", "$", "card", "[", "'canvas'", "]", "=", "isset"...
Sends a card to a multiple channels @param array $card @return Horntell\Http\Response
[ "Sends", "a", "card", "to", "a", "multiple", "channels" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/src/Horntell/Card.php#L72-L79
201,671
swaros/golib
src/Types/ValueSet.php
ValueSet.applyData
public function applyData($applyEntrie = NULL, $full = true){ if (is_array($applyEntrie)){ if ($full) { $this->values = $applyEntrie; } else { $this->values = array_replace($this->values, $applyEntrie); } }elseif (is_string($applyEntri...
php
public function applyData($applyEntrie = NULL, $full = true){ if (is_array($applyEntrie)){ if ($full) { $this->values = $applyEntrie; } else { $this->values = array_replace($this->values, $applyEntrie); } }elseif (is_string($applyEntri...
[ "public", "function", "applyData", "(", "$", "applyEntrie", "=", "NULL", ",", "$", "full", "=", "true", ")", "{", "if", "(", "is_array", "(", "$", "applyEntrie", ")", ")", "{", "if", "(", "$", "full", ")", "{", "$", "this", "->", "values", "=", "...
apply content via string or array @param array/string $applyEntrie is an array or and seperated string @param boolean $full if true the whole set will be overwritten.on flase just the fisrt entries @throws \InvalidArgumentException
[ "apply", "content", "via", "string", "or", "array" ]
9e75c8fb36de7c09b01a6c1c0d27c45f02fed567
https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Types/ValueSet.php#L38-L56
201,672
swaros/golib
src/Types/ValueSet.php
ValueSet.checkCount
private function checkCount(){ $cnt = (int) $this->getMaxEntries(); if ($cnt !== NULL && count($this->values) !== $cnt){ trigger_error("Wrong count of Elements. Expected are $cnt. But right now there are ". count($this->values)); } }
php
private function checkCount(){ $cnt = (int) $this->getMaxEntries(); if ($cnt !== NULL && count($this->values) !== $cnt){ trigger_error("Wrong count of Elements. Expected are $cnt. But right now there are ". count($this->values)); } }
[ "private", "function", "checkCount", "(", ")", "{", "$", "cnt", "=", "(", "int", ")", "$", "this", "->", "getMaxEntries", "(", ")", ";", "if", "(", "$", "cnt", "!==", "NULL", "&&", "count", "(", "$", "this", "->", "values", ")", "!==", "$", "cnt"...
checks if the expected count is given triggers an error if getMaxEntries Returns a number and this number is not equal to the count of elements.
[ "checks", "if", "the", "expected", "count", "is", "given", "triggers", "an", "error", "if", "getMaxEntries", "Returns", "a", "number", "and", "this", "number", "is", "not", "equal", "to", "the", "count", "of", "elements", "." ]
9e75c8fb36de7c09b01a6c1c0d27c45f02fed567
https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Types/ValueSet.php#L63-L69
201,673
taylornetwork/make-html
src/MakeHTML.php
MakeHTML.getHTMLGeneratorInstance
public function getHTMLGeneratorInstance() { if (!isset($this->HTMLGenerator) || !$this->HTMLGenerator instanceof HTMLGenerator) { $this->HTMLGenerator = new HTMLGenerator(); $this->HTMLConfig($this->HTMLGenerator); } return $this->HTMLGenerator; }
php
public function getHTMLGeneratorInstance() { if (!isset($this->HTMLGenerator) || !$this->HTMLGenerator instanceof HTMLGenerator) { $this->HTMLGenerator = new HTMLGenerator(); $this->HTMLConfig($this->HTMLGenerator); } return $this->HTMLGenerator; }
[ "public", "function", "getHTMLGeneratorInstance", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "HTMLGenerator", ")", "||", "!", "$", "this", "->", "HTMLGenerator", "instanceof", "HTMLGenerator", ")", "{", "$", "this", "->", "HTMLGenerator"...
Get the generator instance, or create one. @return HTMLGenerator
[ "Get", "the", "generator", "instance", "or", "create", "one", "." ]
216308d5ba8c9d2412dc787fb6db1a837c20b820
https://github.com/taylornetwork/make-html/blob/216308d5ba8c9d2412dc787fb6db1a837c20b820/src/MakeHTML.php#L41-L49
201,674
rawphp/RawConsole
src/RawPHP/RawConsole/Option.php
Option.isLongCode
public static function isLongCode( $arg ) { $retVal = ( strlen( $arg ) > 2 ) && ( '-' === $arg[ 0 ] && '-' === $arg[ 1 ] ); if ( 2 === strlen( $arg ) ) { return $retVal; } if ( ( !is_bool( $arg ) && !Util::validIndex( 2, $arg ) ) || '-' === $arg[...
php
public static function isLongCode( $arg ) { $retVal = ( strlen( $arg ) > 2 ) && ( '-' === $arg[ 0 ] && '-' === $arg[ 1 ] ); if ( 2 === strlen( $arg ) ) { return $retVal; } if ( ( !is_bool( $arg ) && !Util::validIndex( 2, $arg ) ) || '-' === $arg[...
[ "public", "static", "function", "isLongCode", "(", "$", "arg", ")", "{", "$", "retVal", "=", "(", "strlen", "(", "$", "arg", ")", ">", "2", ")", "&&", "(", "'-'", "===", "$", "arg", "[", "0", "]", "&&", "'-'", "===", "$", "arg", "[", "1", "]"...
Checks if the argument is a long code. @param string $arg the argument @return bool TRUE if long code, else FALSE @throws CommandException if the argument is malformed
[ "Checks", "if", "the", "argument", "is", "a", "long", "code", "." ]
602bedd10f24962305a7ac1979ed326852f4224a
https://github.com/rawphp/RawConsole/blob/602bedd10f24962305a7ac1979ed326852f4224a/src/RawPHP/RawConsole/Option.php#L107-L122
201,675
rawphp/RawConsole
src/RawPHP/RawConsole/Option.php
Option.setRequiredValue
public static function setRequiredValue( Option &$option, $arg ) { if ( self::isShortCode( $arg ) || self::isLongCode( $arg ) ) { throw new CommandException( 'Missing argument for option --' . $option->longCode ); } else { if ( is_string( $arg ) ) ...
php
public static function setRequiredValue( Option &$option, $arg ) { if ( self::isShortCode( $arg ) || self::isLongCode( $arg ) ) { throw new CommandException( 'Missing argument for option --' . $option->longCode ); } else { if ( is_string( $arg ) ) ...
[ "public", "static", "function", "setRequiredValue", "(", "Option", "&", "$", "option", ",", "$", "arg", ")", "{", "if", "(", "self", "::", "isShortCode", "(", "$", "arg", ")", "||", "self", "::", "isLongCode", "(", "$", "arg", ")", ")", "{", "throw",...
Sets the required argument. @param Option $option the option to set to @param mixed $arg the argument @throws CommandException if argument is missing
[ "Sets", "the", "required", "argument", "." ]
602bedd10f24962305a7ac1979ed326852f4224a
https://github.com/rawphp/RawConsole/blob/602bedd10f24962305a7ac1979ed326852f4224a/src/RawPHP/RawConsole/Option.php#L132-L147
201,676
rawphp/RawConsole
src/RawPHP/RawConsole/Option.php
Option.setOptionalValue
public static function setOptionalValue( Option &$option, $arg ) { if ( !self::isShortCode( $arg ) && !self::isLongCode( $arg ) ) { if ( is_bool( $arg ) ) { $option->value = ( bool )$arg; } elseif ( is_string( $arg ) ) { ...
php
public static function setOptionalValue( Option &$option, $arg ) { if ( !self::isShortCode( $arg ) && !self::isLongCode( $arg ) ) { if ( is_bool( $arg ) ) { $option->value = ( bool )$arg; } elseif ( is_string( $arg ) ) { ...
[ "public", "static", "function", "setOptionalValue", "(", "Option", "&", "$", "option", ",", "$", "arg", ")", "{", "if", "(", "!", "self", "::", "isShortCode", "(", "$", "arg", ")", "&&", "!", "self", "::", "isLongCode", "(", "$", "arg", ")", ")", "...
Sets an optional argument if available. @param Option $option the option to set to @param mixed $arg the argument
[ "Sets", "an", "optional", "argument", "if", "available", "." ]
602bedd10f24962305a7ac1979ed326852f4224a
https://github.com/rawphp/RawConsole/blob/602bedd10f24962305a7ac1979ed326852f4224a/src/RawPHP/RawConsole/Option.php#L155-L170
201,677
battis/simplecache
src/SimpleCache.php
SimpleCache.setTableName
public function setTableName($table) { if ($this->sql) { if ($this->validateToken($table)) { $this->table = $table; return true; } else { throw new SimpleCache_Exception("`$table` is not a valid table name"); } } ...
php
public function setTableName($table) { if ($this->sql) { if ($this->validateToken($table)) { $this->table = $table; return true; } else { throw new SimpleCache_Exception("`$table` is not a valid table name"); } } ...
[ "public", "function", "setTableName", "(", "$", "table", ")", "{", "if", "(", "$", "this", "->", "sql", ")", "{", "if", "(", "$", "this", "->", "validateToken", "(", "$", "table", ")", ")", "{", "$", "this", "->", "table", "=", "$", "table", ";",...
Set cache table name @param string $table @return boolean Returns `TRUE` on success, `FALSE` on failure
[ "Set", "cache", "table", "name" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/SimpleCache.php#L135-L146
201,678
battis/simplecache
src/SimpleCache.php
SimpleCache.setKeyName
public function setKeyName($key) { if ($this->sql) { if ($this->validateToken($key)) { $this->key = $key; return true; } else { throw new SimpleCache_Exception("`$key` is not a valid field name"); } } return ...
php
public function setKeyName($key) { if ($this->sql) { if ($this->validateToken($key)) { $this->key = $key; return true; } else { throw new SimpleCache_Exception("`$key` is not a valid field name"); } } return ...
[ "public", "function", "setKeyName", "(", "$", "key", ")", "{", "if", "(", "$", "this", "->", "sql", ")", "{", "if", "(", "$", "this", "->", "validateToken", "(", "$", "key", ")", ")", "{", "$", "this", "->", "key", "=", "$", "key", ";", "return...
Set cache key field name @param string $key @return boolean Returns `TRUE` on success, `FALSE` on failure
[ "Set", "cache", "key", "field", "name" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/SimpleCache.php#L165-L176
201,679
battis/simplecache
src/SimpleCache.php
SimpleCache.setCacheName
public function setCacheName($cache) { if ($this->sql) { if ($this->validateToken($cache)) { $this->cache = $cache; return true; } else { throw new SimpleCache_Exception("`$cache` is not a valid field name"); } } ...
php
public function setCacheName($cache) { if ($this->sql) { if ($this->validateToken($cache)) { $this->cache = $cache; return true; } else { throw new SimpleCache_Exception("`$cache` is not a valid field name"); } } ...
[ "public", "function", "setCacheName", "(", "$", "cache", ")", "{", "if", "(", "$", "this", "->", "sql", ")", "{", "if", "(", "$", "this", "->", "validateToken", "(", "$", "cache", ")", ")", "{", "$", "this", "->", "cache", "=", "$", "cache", ";",...
Set cache storage field name @param string $cache @return boolean Returns `TRUE` on success, `FALSE` on failure
[ "Set", "cache", "storage", "field", "name" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/SimpleCache.php#L195-L206
201,680
battis/simplecache
src/SimpleCache.php
SimpleCache.buildCache
public function buildCache($table = null, $key = null, $cache = null) { if ($this->sql && ($table === null || $this->setTableName($table)) && ($key === null || $this->setKeyName($key)) && ($cache === null || $this->setCacheName($cache))) { if ($this->sql->quer...
php
public function buildCache($table = null, $key = null, $cache = null) { if ($this->sql && ($table === null || $this->setTableName($table)) && ($key === null || $this->setKeyName($key)) && ($cache === null || $this->setCacheName($cache))) { if ($this->sql->quer...
[ "public", "function", "buildCache", "(", "$", "table", "=", "null", ",", "$", "key", "=", "null", ",", "$", "cache", "=", "null", ")", "{", "if", "(", "$", "this", "->", "sql", "&&", "(", "$", "table", "===", "null", "||", "$", "this", "->", "s...
Create cache table in database @param string $table (Optional) Cache table name @param string $key (Optional) Cache key field name @param string $cache (Optional) Cache storage field name @return boolean Returns `TRUE` on success, `FALSE` on failure
[ "Create", "cache", "table", "in", "database" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/SimpleCache.php#L269-L299
201,681
battis/simplecache
src/SimpleCache.php
SimpleCache.getCache
public function getCache($key) { if ($this->sqlInitialized()) { if ($this->sql) { $_key = $this->sql->real_escape_string($key); if ($this->lifetime == self::IMMORTAL_LIFETIME) { if ($response = $this->sql->query(" SELECT...
php
public function getCache($key) { if ($this->sqlInitialized()) { if ($this->sql) { $_key = $this->sql->real_escape_string($key); if ($this->lifetime == self::IMMORTAL_LIFETIME) { if ($response = $this->sql->query(" SELECT...
[ "public", "function", "getCache", "(", "$", "key", ")", "{", "if", "(", "$", "this", "->", "sqlInitialized", "(", ")", ")", "{", "if", "(", "$", "this", "->", "sql", ")", "{", "$", "_key", "=", "$", "this", "->", "sql", "->", "real_escape_string", ...
Get available cached data @param string $key @return mixed|boolean Returns the cached data or `FALSE` if no data cached
[ "Get", "available", "cached", "data" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/SimpleCache.php#L308-L348
201,682
battis/simplecache
src/SimpleCache.php
SimpleCache.getExpirationTimestamp
protected function getExpirationTimestamp($lifetimeInSeconds = false) { if ($lifetimeInSeconds === false) { $lifetimeInSeconds = $this->lifetime; } if ($lifetimeInSeconds === self::IMMORTAL_LIFETIME) { return false; } else { return date(self::MYSQL...
php
protected function getExpirationTimestamp($lifetimeInSeconds = false) { if ($lifetimeInSeconds === false) { $lifetimeInSeconds = $this->lifetime; } if ($lifetimeInSeconds === self::IMMORTAL_LIFETIME) { return false; } else { return date(self::MYSQL...
[ "protected", "function", "getExpirationTimestamp", "(", "$", "lifetimeInSeconds", "=", "false", ")", "{", "if", "(", "$", "lifetimeInSeconds", "===", "false", ")", "{", "$", "lifetimeInSeconds", "=", "$", "this", "->", "lifetime", ";", "}", "if", "(", "$", ...
Calculate the expiration timestamp @param integer|false $lifetimeInSeconds (Optional, defaults to `FALSE`) @return string|false Either a MySQL timestamp for the expiration date or `FALSE` if the lifetime was set to `IMMORTAL_LIFETIME`
[ "Calculate", "the", "expiration", "timestamp" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/SimpleCache.php#L358-L368
201,683
battis/simplecache
src/SimpleCache.php
SimpleCache.purgeExpired
public function purgeExpired() { if ($this->sqlInitialized()) { if ($this->sql) { if ($this->sql->query(" DELETE FROM `{$this->table}` WHERE `expire` < NOW() ")) { return true...
php
public function purgeExpired() { if ($this->sqlInitialized()) { if ($this->sql) { if ($this->sql->query(" DELETE FROM `{$this->table}` WHERE `expire` < NOW() ")) { return true...
[ "public", "function", "purgeExpired", "(", ")", "{", "if", "(", "$", "this", "->", "sqlInitialized", "(", ")", ")", "{", "if", "(", "$", "this", "->", "sql", ")", "{", "if", "(", "$", "this", "->", "sql", "->", "query", "(", "\"\n ...
Purge expired cache data @return boolean Returns `TRUE` on success, `FALSE` on failure @see setLifetime() setLifetime()
[ "Purge", "expired", "cache", "data" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/SimpleCache.php#L377-L392
201,684
battis/simplecache
src/SimpleCache.php
SimpleCache.setCache
public function setCache($key, $data, $lifetimeInSeconds = false) { if ($this->sqlInitialized()) { if ($this->sql) { /* escape query data */ $_key = $this->sql->real_escape_string($key); $_data = $this->sql->real_escape_string(serialize($data)); ...
php
public function setCache($key, $data, $lifetimeInSeconds = false) { if ($this->sqlInitialized()) { if ($this->sql) { /* escape query data */ $_key = $this->sql->real_escape_string($key); $_data = $this->sql->real_escape_string(serialize($data)); ...
[ "public", "function", "setCache", "(", "$", "key", ",", "$", "data", ",", "$", "lifetimeInSeconds", "=", "false", ")", "{", "if", "(", "$", "this", "->", "sqlInitialized", "(", ")", ")", "{", "if", "(", "$", "this", "->", "sql", ")", "{", "/* escap...
Store data in cache @param string $key @param mixed $data Must be serializable @param int|false $lifetimeInSeconds (Optional) @return boolean Returns `TRUE` on success, `FALSE` on failure @see setLifetime() setLifetime()
[ "Store", "data", "in", "cache" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/SimpleCache.php#L405-L460
201,685
battis/simplecache
src/SimpleCache.php
SimpleCache.getCacheTimestamp
public function getCacheTimestamp($key) { if ($this->sqlInitialized()) { $_key = $this->sql->real_escape_string($key); if ($response = $this->sql->query(" SELECT * FROM `{$this->table}` WHERE `{$this->key...
php
public function getCacheTimestamp($key) { if ($this->sqlInitialized()) { $_key = $this->sql->real_escape_string($key); if ($response = $this->sql->query(" SELECT * FROM `{$this->table}` WHERE `{$this->key...
[ "public", "function", "getCacheTimestamp", "(", "$", "key", ")", "{", "if", "(", "$", "this", "->", "sqlInitialized", "(", ")", ")", "{", "$", "_key", "=", "$", "this", "->", "sql", "->", "real_escape_string", "(", "$", "key", ")", ";", "if", "(", ...
Get the timestamp of the cached data @param string $key @return \DateTime|boolean Returns `FALSE` on invalid key
[ "Get", "the", "timestamp", "of", "the", "cached", "data" ]
edda1bee5994fcc2a7b4a10e868d161d8dcddf3b
https://github.com/battis/simplecache/blob/edda1bee5994fcc2a7b4a10e868d161d8dcddf3b/src/SimpleCache.php#L492-L508
201,686
miguelibero/meinhof
src/Meinhof/Assetic/FormulaLoaderManager.php
FormulaLoaderManager.setLoaders
protected function setLoaders(array $loaders) { $this->loaders = array(); foreach ($loaders as $type=>$loader) { if (!$loader instanceof FormulaLoaderInterface) { throw new \InvalidArgumentException("Not a valid formula loader with key '${type}'."); } ...
php
protected function setLoaders(array $loaders) { $this->loaders = array(); foreach ($loaders as $type=>$loader) { if (!$loader instanceof FormulaLoaderInterface) { throw new \InvalidArgumentException("Not a valid formula loader with key '${type}'."); } ...
[ "protected", "function", "setLoaders", "(", "array", "$", "loaders", ")", "{", "$", "this", "->", "loaders", "=", "array", "(", ")", ";", "foreach", "(", "$", "loaders", "as", "$", "type", "=>", "$", "loader", ")", "{", "if", "(", "!", "$", "loader...
Adds a list of loaders @param array $loaders list of loaders, the type should be the array key
[ "Adds", "a", "list", "of", "loaders" ]
3a090f08485dc0da3e27463cf349dba374201072
https://github.com/miguelibero/meinhof/blob/3a090f08485dc0da3e27463cf349dba374201072/src/Meinhof/Assetic/FormulaLoaderManager.php#L30-L39
201,687
ciims/ciims-modules-api
controllers/DefaultController.php
DefaultController.actionJsonProxyPost
public function actionJsonProxyPost() { $url = Cii::get($_POST, 'url', false); if ($url === false) throw new CHttpException(400, Yii::t('Api.index', 'Missing $_POST[url] parameter')); $hash = md5($url); $response = Yii::app()->cache->get('CiiMS::API::Proxy::'.$hash); if ($response == false) { $cur...
php
public function actionJsonProxyPost() { $url = Cii::get($_POST, 'url', false); if ($url === false) throw new CHttpException(400, Yii::t('Api.index', 'Missing $_POST[url] parameter')); $hash = md5($url); $response = Yii::app()->cache->get('CiiMS::API::Proxy::'.$hash); if ($response == false) { $cur...
[ "public", "function", "actionJsonProxyPost", "(", ")", "{", "$", "url", "=", "Cii", "::", "get", "(", "$", "_POST", ",", "'url'", ",", "false", ")", ";", "if", "(", "$", "url", "===", "false", ")", "throw", "new", "CHttpException", "(", "400", ",", ...
Global proxy for CiiMS to support JavaScript endpoints that either don't have proper CORS headers or SSL This endpoint will only process JSON, and will cache data for 10 minutes. @return mixed
[ "Global", "proxy", "for", "CiiMS", "to", "support", "JavaScript", "endpoints", "that", "either", "don", "t", "have", "proper", "CORS", "headers", "or", "SSL", "This", "endpoint", "will", "only", "process", "JSON", "and", "will", "cache", "data", "for", "10",...
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/DefaultController.php#L39-L63
201,688
staticka/staticka
src/Website.php
Website.compile
public function compile($output) { file_exists($output) || mkdir($output); $this->clear((string) $output); $this->output = (string) $output; foreach ((array) $this->pages as $page) { $folder = $this->folder($output, $page->uris()); $html = (string) $this->...
php
public function compile($output) { file_exists($output) || mkdir($output); $this->clear((string) $output); $this->output = (string) $output; foreach ((array) $this->pages as $page) { $folder = $this->folder($output, $page->uris()); $html = (string) $this->...
[ "public", "function", "compile", "(", "$", "output", ")", "{", "file_exists", "(", "$", "output", ")", "||", "mkdir", "(", "$", "output", ")", ";", "$", "this", "->", "clear", "(", "(", "string", ")", "$", "output", ")", ";", "$", "this", "->", "...
Compiles the specified pages into HTML output. @param string $output @return self
[ "Compiles", "the", "specified", "pages", "into", "HTML", "output", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Website.php#L70-L89
201,689
staticka/staticka
src/Website.php
Website.transfer
public function transfer($source, $path = null) { $path = $path === null ? $this->output : $path; $path = $this->realpath($path); $source = (string) $this->realpath($source); $directory = new \RecursiveDirectoryIterator($source, 4096); $iterator = new \RecursiveIteratorIt...
php
public function transfer($source, $path = null) { $path = $path === null ? $this->output : $path; $path = $this->realpath($path); $source = (string) $this->realpath($source); $directory = new \RecursiveDirectoryIterator($source, 4096); $iterator = new \RecursiveIteratorIt...
[ "public", "function", "transfer", "(", "$", "source", ",", "$", "path", "=", "null", ")", "{", "$", "path", "=", "$", "path", "===", "null", "?", "$", "this", "->", "output", ":", "$", "path", ";", "$", "path", "=", "$", "this", "->", "realpath",...
Transfers files from a directory into another path. @param string $source @param string|null $path @return void
[ "Transfers", "files", "from", "a", "directory", "into", "another", "path", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Website.php#L168-L185
201,690
staticka/staticka
src/Website.php
Website.clear
protected function clear($path) { $directory = new \RecursiveDirectoryIterator($path, 4096); $iterator = new \RecursiveIteratorIterator($directory, 2); foreach ($iterator as $file) { $git = strpos($file->getRealPath(), '.git') !== false; $path = (string) $file->get...
php
protected function clear($path) { $directory = new \RecursiveDirectoryIterator($path, 4096); $iterator = new \RecursiveIteratorIterator($directory, 2); foreach ($iterator as $file) { $git = strpos($file->getRealPath(), '.git') !== false; $path = (string) $file->get...
[ "protected", "function", "clear", "(", "$", "path", ")", "{", "$", "directory", "=", "new", "\\", "RecursiveDirectoryIterator", "(", "$", "path", ",", "4096", ")", ";", "$", "iterator", "=", "new", "\\", "RecursiveIteratorIterator", "(", "$", "directory", ...
Removes the files recursively from the specified directory. @param string $path @return void
[ "Removes", "the", "files", "recursively", "from", "the", "specified", "directory", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Website.php#L193-L206
201,691
staticka/staticka
src/Website.php
Website.folder
protected function folder($output, array $uris) { $folder = (string) ''; foreach ((array) $uris as $uri) { $directory = $output . '/' . (string) $folder; file_exists($directory) ?: mkdir($directory); $folder === $uri ?: $folder .= '/' . $uri; } ...
php
protected function folder($output, array $uris) { $folder = (string) ''; foreach ((array) $uris as $uri) { $directory = $output . '/' . (string) $folder; file_exists($directory) ?: mkdir($directory); $folder === $uri ?: $folder .= '/' . $uri; } ...
[ "protected", "function", "folder", "(", "$", "output", ",", "array", "$", "uris", ")", "{", "$", "folder", "=", "(", "string", ")", "''", ";", "foreach", "(", "(", "array", ")", "$", "uris", "as", "$", "uri", ")", "{", "$", "directory", "=", "$",...
Returns the whole folder path based from specified URIs. Also creates the specified folder if it doesn't exists. @param string $output @param array $uris @return string
[ "Returns", "the", "whole", "folder", "path", "based", "from", "specified", "URIs", ".", "Also", "creates", "the", "specified", "folder", "if", "it", "doesn", "t", "exists", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Website.php#L216-L229
201,692
staticka/staticka
src/Website.php
Website.html
protected function html(Page $page) { $html = $this->content->make($content = $page->content()); if (($name = $page->layout()) !== null) { $data = array_merge($this->helpers(), (array) $page->data()); $layout = new Layout($this->renderer, $this, $data); $html =...
php
protected function html(Page $page) { $html = $this->content->make($content = $page->content()); if (($name = $page->layout()) !== null) { $data = array_merge($this->helpers(), (array) $page->data()); $layout = new Layout($this->renderer, $this, $data); $html =...
[ "protected", "function", "html", "(", "Page", "$", "page", ")", "{", "$", "html", "=", "$", "this", "->", "content", "->", "make", "(", "$", "content", "=", "$", "page", "->", "content", "(", ")", ")", ";", "if", "(", "(", "$", "name", "=", "$"...
Converts the specified page into HTML. @param \Staticka\Page $page @return string
[ "Converts", "the", "specified", "page", "into", "HTML", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Website.php#L237-L254
201,693
staticka/staticka
src/Website.php
Website.realpath
protected function realpath($folder) { $separator = (string) DIRECTORY_SEPARATOR; $search = array('\\', '/', (string) '\\\\'); $path = str_replace($search, $separator, $folder); file_exists($path) || mkdir((string) $path); $exists = in_array(substr($path, -1), $search); ...
php
protected function realpath($folder) { $separator = (string) DIRECTORY_SEPARATOR; $search = array('\\', '/', (string) '\\\\'); $path = str_replace($search, $separator, $folder); file_exists($path) || mkdir((string) $path); $exists = in_array(substr($path, -1), $search); ...
[ "protected", "function", "realpath", "(", "$", "folder", ")", "{", "$", "separator", "=", "(", "string", ")", "DIRECTORY_SEPARATOR", ";", "$", "search", "=", "array", "(", "'\\\\'", ",", "'/'", ",", "(", "string", ")", "'\\\\\\\\'", ")", ";", "$", "pat...
Replaces the slashes with the DIRECTORY_SEPARATOR. Also creates the directory if it doesn't exists. @param string $folder @return string
[ "Replaces", "the", "slashes", "with", "the", "DIRECTORY_SEPARATOR", ".", "Also", "creates", "the", "directory", "if", "it", "doesn", "t", "exists", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Website.php#L263-L276
201,694
RhubarbPHP/Scaffold.BackgroundTasks
docs/examples/Basic/SlowTask.php
SlowTask.execute
public function execute(callable $statusCallback) { for($this->iterations = 0; $this->iterations < 100; $this->iterations++){ usleep(100000); $statusCallback(new TaskStatus($this->iterations, "Busy bee...")); } }
php
public function execute(callable $statusCallback) { for($this->iterations = 0; $this->iterations < 100; $this->iterations++){ usleep(100000); $statusCallback(new TaskStatus($this->iterations, "Busy bee...")); } }
[ "public", "function", "execute", "(", "callable", "$", "statusCallback", ")", "{", "for", "(", "$", "this", "->", "iterations", "=", "0", ";", "$", "this", "->", "iterations", "<", "100", ";", "$", "this", "->", "iterations", "++", ")", "{", "usleep", ...
Executes the long running code. @param callable $statusCallback A callback providing the task with a means to report progress. A TaskStatus object should be passed. @return void
[ "Executes", "the", "long", "running", "code", "." ]
92a5feab27599288e8bf39deb522588115838904
https://github.com/RhubarbPHP/Scaffold.BackgroundTasks/blob/92a5feab27599288e8bf39deb522588115838904/docs/examples/Basic/SlowTask.php#L17-L24
201,695
SergioMadness/pwf-helpers
src/StringHelpers.php
StringHelpers.str2url
public static function str2url($str) { $str = self::rus2translit($str); $str = strtolower($str); $str = preg_replace('~[^-a-z0-9_]+~u', '-', $str); $str = trim($str, "-"); return $str; }
php
public static function str2url($str) { $str = self::rus2translit($str); $str = strtolower($str); $str = preg_replace('~[^-a-z0-9_]+~u', '-', $str); $str = trim($str, "-"); return $str; }
[ "public", "static", "function", "str2url", "(", "$", "str", ")", "{", "$", "str", "=", "self", "::", "rus2translit", "(", "$", "str", ")", ";", "$", "str", "=", "strtolower", "(", "$", "str", ")", ";", "$", "str", "=", "preg_replace", "(", "'~[^-a-...
String to url @param string $str @return string
[ "String", "to", "url" ]
d6cd44807c120356d60618cb08f237841c35e293
https://github.com/SergioMadness/pwf-helpers/blob/d6cd44807c120356d60618cb08f237841c35e293/src/StringHelpers.php#L89-L96
201,696
fulgurio/LightCMSBundle
Form/Handler/AdminPageHandler.php
AdminPageHandler.addSuffixNumber
protected function addSuffixNumber($slug, Page $page, $number = 0) { $slugTmp = $number > 0 ? $slug . $this->slugSuffixSeparator . $number : $slug; $parentFullpath = $page->getParent()->getFullpath(); $foundedPage = $this->doctrine->getRepository('FulgurioLightCMSBundle:Page')->findOneBy(arr...
php
protected function addSuffixNumber($slug, Page $page, $number = 0) { $slugTmp = $number > 0 ? $slug . $this->slugSuffixSeparator . $number : $slug; $parentFullpath = $page->getParent()->getFullpath(); $foundedPage = $this->doctrine->getRepository('FulgurioLightCMSBundle:Page')->findOneBy(arr...
[ "protected", "function", "addSuffixNumber", "(", "$", "slug", ",", "Page", "$", "page", ",", "$", "number", "=", "0", ")", "{", "$", "slugTmp", "=", "$", "number", ">", "0", "?", "$", "slug", ".", "$", "this", "->", "slugSuffixSeparator", ".", "$", ...
Add suffix number if page exists @param string $slug @param Page $page @param number $number @return string
[ "Add", "suffix", "number", "if", "page", "exists" ]
66319af52b97b6552b7c391ee370538263f42d10
https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Form/Handler/AdminPageHandler.php#L87-L99
201,697
fulgurio/LightCMSBundle
Form/Handler/AdminPageHandler.php
AdminPageHandler.makeFullpath
public function makeFullpath(Page $page) { if ($page->getParent() === NULL) { $page->setFullpath(''); $page->setSlug(''); } else { $parentFullpath = $page->getParent()->getFullpath(); $slug = $this->addSuffixNumber($page->getSlu...
php
public function makeFullpath(Page $page) { if ($page->getParent() === NULL) { $page->setFullpath(''); $page->setSlug(''); } else { $parentFullpath = $page->getParent()->getFullpath(); $slug = $this->addSuffixNumber($page->getSlu...
[ "public", "function", "makeFullpath", "(", "Page", "$", "page", ")", "{", "if", "(", "$", "page", "->", "getParent", "(", ")", "===", "NULL", ")", "{", "$", "page", "->", "setFullpath", "(", "''", ")", ";", "$", "page", "->", "setSlug", "(", "''", ...
Init page full path and check if it doesn't already exist @param Page $page
[ "Init", "page", "full", "path", "and", "check", "if", "it", "doesn", "t", "already", "exist" ]
66319af52b97b6552b7c391ee370538263f42d10
https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Form/Handler/AdminPageHandler.php#L106-L128
201,698
fulgurio/LightCMSBundle
Form/Handler/AdminPageHandler.php
AdminPageHandler.updatePageMenuPosition
private function updatePageMenuPosition(Page $page) { $pageMenuRepository = $this->doctrine->getRepository('FulgurioLightCMSBundle:PageMenu'); $em = $this->doctrine->getManager(); $data = $this->request->get('page'); if (isset($data['availableMenu'])) { if (!is_nu...
php
private function updatePageMenuPosition(Page $page) { $pageMenuRepository = $this->doctrine->getRepository('FulgurioLightCMSBundle:PageMenu'); $em = $this->doctrine->getManager(); $data = $this->request->get('page'); if (isset($data['availableMenu'])) { if (!is_nu...
[ "private", "function", "updatePageMenuPosition", "(", "Page", "$", "page", ")", "{", "$", "pageMenuRepository", "=", "$", "this", "->", "doctrine", "->", "getRepository", "(", "'FulgurioLightCMSBundle:PageMenu'", ")", ";", "$", "em", "=", "$", "this", "->", "d...
Update page menu position @param Page $page
[ "Update", "page", "menu", "position" ]
66319af52b97b6552b7c391ee370538263f42d10
https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Form/Handler/AdminPageHandler.php#L154-L200
201,699
fulgurio/LightCMSBundle
Form/Handler/AdminPageHandler.php
AdminPageHandler.initMetaEntity
final public function initMetaEntity(Page $page, $metaName, $metaValue) { $this->initPageMetas($page); if (isset($this->pageMetas[$metaName])) { $entity = $this->pageMetas[$metaName]; } else { $entity = new PageMeta(); $entity->setP...
php
final public function initMetaEntity(Page $page, $metaName, $metaValue) { $this->initPageMetas($page); if (isset($this->pageMetas[$metaName])) { $entity = $this->pageMetas[$metaName]; } else { $entity = new PageMeta(); $entity->setP...
[ "final", "public", "function", "initMetaEntity", "(", "Page", "$", "page", ",", "$", "metaName", ",", "$", "metaValue", ")", "{", "$", "this", "->", "initPageMetas", "(", "$", "page", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "pageMetas", ...
Add or update a PageMeta entity, and return it for save @param Page $page @param string $metaName @param string $metaValue @return \Fulgurio\LightCMSBundle\Entity\PageMeta
[ "Add", "or", "update", "a", "PageMeta", "entity", "and", "return", "it", "for", "save" ]
66319af52b97b6552b7c391ee370538263f42d10
https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Form/Handler/AdminPageHandler.php#L210-L225