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
25,900
craig-mcmahon/google-helper
src/GoogleHelper/Apps/EmailHelper.php
EmailHelper.setSendAsAlias
public function setSendAsAlias($domain, $user, $name, $address, $replyTo = null, $makeDefault = false) { $url = self::BASE_URL . "{$domain}/{$user}/sendas"; $request = <<<XML <?xml version="1.0" encoding="utf-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google...
php
public function setSendAsAlias($domain, $user, $name, $address, $replyTo = null, $makeDefault = false) { $url = self::BASE_URL . "{$domain}/{$user}/sendas"; $request = <<<XML <?xml version="1.0" encoding="utf-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google...
[ "public", "function", "setSendAsAlias", "(", "$", "domain", ",", "$", "user", ",", "$", "name", ",", "$", "address", ",", "$", "replyTo", "=", "null", ",", "$", "makeDefault", "=", "false", ")", "{", "$", "url", "=", "self", "::", "BASE_URL", ".", ...
Add a Send-as Alias @param string $domain @param string $user @param string $name @param string $address @param string|null $replyTo @param bool $makeDefault @return bool Success
[ "Add", "a", "Send", "-", "as", "Alias" ]
6b877efd7c9827555ecac65ee01e337849db6611
https://github.com/craig-mcmahon/google-helper/blob/6b877efd7c9827555ecac65ee01e337849db6611/src/GoogleHelper/Apps/EmailHelper.php#L71-L95
25,901
shampeak/GraceServer
src/Cache/Cache.php
Cache.setAdapter
public function setAdapter(\Desarrolla2\Cache\Adapter\AdapterInterface $adapter) { return $this->_instance->setAdapter($adapter); }
php
public function setAdapter(\Desarrolla2\Cache\Adapter\AdapterInterface $adapter) { return $this->_instance->setAdapter($adapter); }
[ "public", "function", "setAdapter", "(", "\\", "Desarrolla2", "\\", "Cache", "\\", "Adapter", "\\", "AdapterInterface", "$", "adapter", ")", "{", "return", "$", "this", "->", "_instance", "->", "setAdapter", "(", "$", "adapter", ")", ";", "}" ]
Set Adapter interface @param \Desarrolla2\Cache\Adapter\AdapterInterface $adapter
[ "Set", "Adapter", "interface" ]
e69891de3daae7d228c803c06213eb248fc88594
https://github.com/shampeak/GraceServer/blob/e69891de3daae7d228c803c06213eb248fc88594/src/Cache/Cache.php#L84-L87
25,902
nochso/ORM2
src/DBA/DBA.php
DBA.getLog
public static function getLog($empty = false) { $log = self::$log; if ($empty) { self::emptyLog(); } return $log; }
php
public static function getLog($empty = false) { $log = self::$log; if ($empty) { self::emptyLog(); } return $log; }
[ "public", "static", "function", "getLog", "(", "$", "empty", "=", "false", ")", "{", "$", "log", "=", "self", "::", "$", "log", ";", "if", "(", "$", "empty", ")", "{", "self", "::", "emptyLog", "(", ")", ";", "}", "return", "$", "log", ";", "}"...
Returns all log entries and optionally removes them @param bool $empty @return LogEntry[]
[ "Returns", "all", "log", "entries", "and", "optionally", "removes", "them" ]
89f9a5c61ad5f575fbdd52990171b52d54f8bfbc
https://github.com/nochso/ORM2/blob/89f9a5c61ad5f575fbdd52990171b52d54f8bfbc/src/DBA/DBA.php#L116-L123
25,903
JumpGateio/Core
src/JumpGate/Core/Abstracts/Seeder.php
Seeder.truncate
protected function truncate($table) { if ($this->db->connection()->getConfig('driver') === 'mysql') { $this->db->statement('SET FOREIGN_KEY_CHECKS=0;'); $this->db->table($table)->truncate(); $this->db->statement('SET FOREIGN_KEY_CHECKS=1;'); } }
php
protected function truncate($table) { if ($this->db->connection()->getConfig('driver') === 'mysql') { $this->db->statement('SET FOREIGN_KEY_CHECKS=0;'); $this->db->table($table)->truncate(); $this->db->statement('SET FOREIGN_KEY_CHECKS=1;'); } }
[ "protected", "function", "truncate", "(", "$", "table", ")", "{", "if", "(", "$", "this", "->", "db", "->", "connection", "(", ")", "->", "getConfig", "(", "'driver'", ")", "===", "'mysql'", ")", "{", "$", "this", "->", "db", "->", "statement", "(", ...
Truncate the existing table of all records. @param string $table
[ "Truncate", "the", "existing", "table", "of", "all", "records", "." ]
485b5cf03b3072267bffbee428b81e48d407d6b6
https://github.com/JumpGateio/Core/blob/485b5cf03b3072267bffbee428b81e48d407d6b6/src/JumpGate/Core/Abstracts/Seeder.php#L22-L29
25,904
praxigento/mobi_mod_downline
Ui/DataProvider/Grid/Transaction/Query.php
Query.getQueryItems
protected function getQueryItems() { /* this is primary query builder, not extender */ $result = parent::getQueryItems(); /* define tables aliases for internal usage (in this method) */ $asAccCred = self::AS_ACC_CREDIT; $asAccDeb = self::AS_ACC_DEBIT; $asDwnlCred = s...
php
protected function getQueryItems() { /* this is primary query builder, not extender */ $result = parent::getQueryItems(); /* define tables aliases for internal usage (in this method) */ $asAccCred = self::AS_ACC_CREDIT; $asAccDeb = self::AS_ACC_DEBIT; $asDwnlCred = s...
[ "protected", "function", "getQueryItems", "(", ")", "{", "/* this is primary query builder, not extender */", "$", "result", "=", "parent", "::", "getQueryItems", "(", ")", ";", "/* define tables aliases for internal usage (in this method) */", "$", "asAccCred", "=", "self", ...
SELECT ... FROM `prxgt_acc_transaction` AS `pat` LEFT JOIN `prxgt_acc_account` AS `paa_db` ON paa_db.id = pat.debit_acc_id LEFT JOIN `customer_entity` AS `ce_db` ON ce_db.entity_id = paa_db.customer_id LEFT JOIN `prxgt_acc_account` AS `paa_cr` ON paa_cr.id = pat.credit_acc_id LEFT JOIN `customer_entity` AS `ce_cr` ON c...
[ "SELECT", "...", "FROM", "prxgt_acc_transaction", "AS", "pat", "LEFT", "JOIN", "prxgt_acc_account", "AS", "paa_db", "ON", "paa_db", ".", "id", "=", "pat", ".", "debit_acc_id", "LEFT", "JOIN", "customer_entity", "AS", "ce_db", "ON", "ce_db", ".", "entity_id", "...
0f3c276dfff1aa029f9fd205ccfc56f207a2e75b
https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Ui/DataProvider/Grid/Transaction/Query.php#L66-L97
25,905
vperyod/vperyod.session-handler
src/SessionHandler.php
SessionHandler.newSession
protected function newSession(Request $request) { $factory = $this->sessionFactory; $cookie = $request->getCookieParams(); return $factory->newInstance($cookie); }
php
protected function newSession(Request $request) { $factory = $this->sessionFactory; $cookie = $request->getCookieParams(); return $factory->newInstance($cookie); }
[ "protected", "function", "newSession", "(", "Request", "$", "request", ")", "{", "$", "factory", "=", "$", "this", "->", "sessionFactory", ";", "$", "cookie", "=", "$", "request", "->", "getCookieParams", "(", ")", ";", "return", "$", "factory", "->", "n...
Create new session @param Request $request PSR7 Request @return Session\Session @access protected
[ "Create", "new", "session" ]
61a607be009296b69bdb328ed3a26940e1b925bb
https://github.com/vperyod/vperyod.session-handler/blob/61a607be009296b69bdb328ed3a26940e1b925bb/src/SessionHandler.php#L87-L92
25,906
MatiasNAmendola/slimpower-slim
src/Libs/Net.php
Net.getLocalIP
public static function getLocalIP() { $s = &$_SERVER; $ipAddress = $s['REMOTE_ADDR']; if (array_key_exists('HTTP_X_FORWARDED_FOR', $s)) { $temp = explode(',', $s['HTTP_X_FORWARDED_FOR']); $ipAddress = array_pop($temp); } $result = $ipAddress == '::1' ? ...
php
public static function getLocalIP() { $s = &$_SERVER; $ipAddress = $s['REMOTE_ADDR']; if (array_key_exists('HTTP_X_FORWARDED_FOR', $s)) { $temp = explode(',', $s['HTTP_X_FORWARDED_FOR']); $ipAddress = array_pop($temp); } $result = $ipAddress == '::1' ? ...
[ "public", "static", "function", "getLocalIP", "(", ")", "{", "$", "s", "=", "&", "$", "_SERVER", ";", "$", "ipAddress", "=", "$", "s", "[", "'REMOTE_ADDR'", "]", ";", "if", "(", "array_key_exists", "(", "'HTTP_X_FORWARDED_FOR'", ",", "$", "s", ")", ")"...
Get local IP @return string
[ "Get", "local", "IP" ]
c78ebbd4124d75ec82fe19b6dd62504da097fd15
https://github.com/MatiasNAmendola/slimpower-slim/blob/c78ebbd4124d75ec82fe19b6dd62504da097fd15/src/Libs/Net.php#L40-L53
25,907
MatiasNAmendola/slimpower-slim
src/Libs/Net.php
Net.isSecure
public static function isSecure() { $s = &$_SERVER; $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false; return $ssl; }
php
public static function isSecure() { $s = &$_SERVER; $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false; return $ssl; }
[ "public", "static", "function", "isSecure", "(", ")", "{", "$", "s", "=", "&", "$", "_SERVER", ";", "$", "ssl", "=", "(", "!", "empty", "(", "$", "s", "[", "'HTTPS'", "]", ")", "&&", "$", "s", "[", "'HTTPS'", "]", "==", "'on'", ")", "?", "tru...
Evaluate the Safety Scope of Application. @return boolean
[ "Evaluate", "the", "Safety", "Scope", "of", "Application", "." ]
c78ebbd4124d75ec82fe19b6dd62504da097fd15
https://github.com/MatiasNAmendola/slimpower-slim/blob/c78ebbd4124d75ec82fe19b6dd62504da097fd15/src/Libs/Net.php#L94-L98
25,908
MatiasNAmendola/slimpower-slim
src/Libs/Net.php
Net.getBasicPath
public static function getBasicPath() { $s = &$_SERVER; $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false; $sp = strtolower($s['SERVER_PROTOCOL']); $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : ''); $port = $s['SERVER_PORT']; $port = ((!$...
php
public static function getBasicPath() { $s = &$_SERVER; $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false; $sp = strtolower($s['SERVER_PROTOCOL']); $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : ''); $port = $s['SERVER_PORT']; $port = ((!$...
[ "public", "static", "function", "getBasicPath", "(", ")", "{", "$", "s", "=", "&", "$", "_SERVER", ";", "$", "ssl", "=", "(", "!", "empty", "(", "$", "s", "[", "'HTTPS'", "]", ")", "&&", "$", "s", "[", "'HTTPS'", "]", "==", "'on'", ")", "?", ...
Get basic path @return string URL
[ "Get", "basic", "path" ]
c78ebbd4124d75ec82fe19b6dd62504da097fd15
https://github.com/MatiasNAmendola/slimpower-slim/blob/c78ebbd4124d75ec82fe19b6dd62504da097fd15/src/Libs/Net.php#L104-L115
25,909
itcreator/custom-cmf
Module/System/src/Cmf/System/Application.php
Application.killWww
public function killWww() { $host = $_SERVER['SERVER_NAME']; if (stripos($host, 'www.') === 0) { $host = substr_replace($host, '', 0, 4); $uri = $_SERVER['REQUEST_URI']; header("HTTP/1.1 301 Moved Permanently"); if ('/' == $uri[0]) { h...
php
public function killWww() { $host = $_SERVER['SERVER_NAME']; if (stripos($host, 'www.') === 0) { $host = substr_replace($host, '', 0, 4); $uri = $_SERVER['REQUEST_URI']; header("HTTP/1.1 301 Moved Permanently"); if ('/' == $uri[0]) { h...
[ "public", "function", "killWww", "(", ")", "{", "$", "host", "=", "$", "_SERVER", "[", "'SERVER_NAME'", "]", ";", "if", "(", "stripos", "(", "$", "host", ",", "'www.'", ")", "===", "0", ")", "{", "$", "host", "=", "substr_replace", "(", "$", "host"...
Redirect from www.hostname to hostname @return Application
[ "Redirect", "from", "www", ".", "hostname", "to", "hostname" ]
42fc0535dfa0f641856f06673f6ab596b2020c40
https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/System/src/Cmf/System/Application.php#L67-L85
25,910
PenoaksDev/Milky-Framework
src/Milky/Binding/UniversalBuilder.php
UniversalBuilder.resolve
public static function resolve( $key ) { if ( strpos( $key, '\\' ) !== false ) return static::resolveClass( $key ); $key = explode( '.', $key ); if ( $resolver = static::getResolver( $key[0] ) ) return $resolver->resolve( $key[0], implode( '.', array_slice( $key, 1 ) ) ); return null; }
php
public static function resolve( $key ) { if ( strpos( $key, '\\' ) !== false ) return static::resolveClass( $key ); $key = explode( '.', $key ); if ( $resolver = static::getResolver( $key[0] ) ) return $resolver->resolve( $key[0], implode( '.', array_slice( $key, 1 ) ) ); return null; }
[ "public", "static", "function", "resolve", "(", "$", "key", ")", "{", "if", "(", "strpos", "(", "$", "key", ",", "'\\\\'", ")", "!==", "false", ")", "return", "static", "::", "resolveClass", "(", "$", "key", ")", ";", "$", "key", "=", "explode", "(...
Attempts to locate a instance or value from the registered resolvers. @param $key @return mixed|null|object
[ "Attempts", "to", "locate", "a", "instance", "or", "value", "from", "the", "registered", "resolvers", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Binding/UniversalBuilder.php#L132-L143
25,911
PenoaksDev/Milky-Framework
src/Milky/Binding/UniversalBuilder.php
UniversalBuilder.resolveClass
public static function resolveClass( $class, $buildOnFailure = false, $parameters = [] ) { if ( !is_string( $class ) ) throw new ResolverException( "Class must be a string" ); if ( $class == Framework::class ) return Framework::fw(); if ( $class == Configuration::class ) return Framework::config(); i...
php
public static function resolveClass( $class, $buildOnFailure = false, $parameters = [] ) { if ( !is_string( $class ) ) throw new ResolverException( "Class must be a string" ); if ( $class == Framework::class ) return Framework::fw(); if ( $class == Configuration::class ) return Framework::config(); i...
[ "public", "static", "function", "resolveClass", "(", "$", "class", ",", "$", "buildOnFailure", "=", "false", ",", "$", "parameters", "=", "[", "]", ")", "{", "if", "(", "!", "is_string", "(", "$", "class", ")", ")", "throw", "new", "ResolverException", ...
Attempts to locate a class within the registered resolvers. Optionally will build the class on failure. @param string $class @param bool $buildOnFailure @param array $parameters @return mixed|null|object
[ "Attempts", "to", "locate", "a", "class", "within", "the", "registered", "resolvers", ".", "Optionally", "will", "build", "the", "class", "on", "failure", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Binding/UniversalBuilder.php#L154-L176
25,912
PenoaksDev/Milky-Framework
src/Milky/Binding/UniversalBuilder.php
UniversalBuilder.buildClass
public static function buildClass( $class, array $parameters = [] ) { if ( !is_string( $class ) ) throw new BindingException( "Class must be a string" ); if ( static::building( $class ) ) throw new BindingException( "The class [" . $class . "] is already being built." ); static::$buildStack[] = $class; ...
php
public static function buildClass( $class, array $parameters = [] ) { if ( !is_string( $class ) ) throw new BindingException( "Class must be a string" ); if ( static::building( $class ) ) throw new BindingException( "The class [" . $class . "] is already being built." ); static::$buildStack[] = $class; ...
[ "public", "static", "function", "buildClass", "(", "$", "class", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "if", "(", "!", "is_string", "(", "$", "class", ")", ")", "throw", "new", "BindingException", "(", "\"Class must be a string\"", ")",...
Attempts to construct a class @param string $class @param array $parameters @return object @throws BindingException
[ "Attempts", "to", "construct", "a", "class" ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Binding/UniversalBuilder.php#L187-L235
25,913
Dhii/callback-abstract
src/NormalizeMethodCallableCapableTrait.php
NormalizeMethodCallableCapableTrait._normalizeMethodCallable
protected function _normalizeMethodCallable($callable) { if (is_object($callable) && is_callable($callable)) { return array($callable, '__invoke'); } $amtPartsRequired = 2; // Number of parts required for a valid callable $origCallable = $callable; // Preserving the ...
php
protected function _normalizeMethodCallable($callable) { if (is_object($callable) && is_callable($callable)) { return array($callable, '__invoke'); } $amtPartsRequired = 2; // Number of parts required for a valid callable $origCallable = $callable; // Preserving the ...
[ "protected", "function", "_normalizeMethodCallable", "(", "$", "callable", ")", "{", "if", "(", "is_object", "(", "$", "callable", ")", "&&", "is_callable", "(", "$", "callable", ")", ")", "{", "return", "array", "(", "$", "callable", ",", "'__invoke'", ")...
Normalizes a method representation into a format recognizable by PHP as callable. This does not guarantee that the callable will actually be invocable at this time; only that it looks like something that can be invoked. See the second argument of {@see is_callable()). @since [*next-version*] @param string|Stringable...
[ "Normalizes", "a", "method", "representation", "into", "a", "format", "recognizable", "by", "PHP", "as", "callable", "." ]
43ed4e99fc6ccdaf46a25d06da482a2fba8d9b19
https://github.com/Dhii/callback-abstract/blob/43ed4e99fc6ccdaf46a25d06da482a2fba8d9b19/src/NormalizeMethodCallableCapableTrait.php#L34-L73
25,914
shgysk8zer0/core_api
traits/ajax_dom.php
AJAX_DOM.open
final public function open( $url = null, array $paramaters = array(), $replace = false, $name = '_blank' ) { $specs = [ 'height' => 500, // The height of the window. Min. value is 100 'width' => 500, // The width of the window. Min. value is 100 'top' ...
php
final public function open( $url = null, array $paramaters = array(), $replace = false, $name = '_blank' ) { $specs = [ 'height' => 500, // The height of the window. Min. value is 100 'width' => 500, // The width of the window. Min. value is 100 'top' ...
[ "final", "public", "function", "open", "(", "$", "url", "=", "null", ",", "array", "$", "paramaters", "=", "array", "(", ")", ",", "$", "replace", "=", "false", ",", "$", "name", "=", "'_blank'", ")", "{", "$", "specs", "=", "[", "'height'", "=>", ...
Open a popup using JavaScript @param string $url Specifies the URL of the page to open @param array $paramaters See comments on $specs @param bool $replace Creates a new entry or replaces the current entry in the history list @param string $name Specifies the target attribute or the name of the ...
[ "Open", "a", "popup", "using", "JavaScript" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/ajax_dom.php#L476-L505
25,915
shgysk8zer0/core_api
traits/ajax_dom.php
AJAX_DOM.animate
final public function animate($sel, Array $keyframes, Array $opts) { if (! array_key_exists('animate', $this->response)) { $this->response['animate'] = []; } $this->response['animate'][$sel] = ['keyframes' => $keyframes, 'opts' => $opts]; return $this; }
php
final public function animate($sel, Array $keyframes, Array $opts) { if (! array_key_exists('animate', $this->response)) { $this->response['animate'] = []; } $this->response['animate'][$sel] = ['keyframes' => $keyframes, 'opts' => $opts]; return $this; }
[ "final", "public", "function", "animate", "(", "$", "sel", ",", "Array", "$", "keyframes", ",", "Array", "$", "opts", ")", "{", "if", "(", "!", "array_key_exists", "(", "'animate'", ",", "$", "this", "->", "response", ")", ")", "{", "$", "this", "->"...
Add animations using `Element.animate` @param String $sel Passed to `document.querySelectorAll` @param Array $keyframes Array of keyframes / steps in animation @param array $opts Array of options, such as duration @return self @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Keyf...
[ "Add", "animations", "using", "Element", ".", "animate" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/ajax_dom.php#L653-L660
25,916
shgysk8zer0/core_api
traits/ajax_dom.php
AJAX_DOM.consoleSetter
final protected function consoleSetter( $method = 'log', array $value = array() ) { if (array_key_exists($method, $this->response)) { if (! is_array($this->response[$method])) { $this->response[$method] = [$this->response[$method]]; } $this->response[$method][] = count($value) === 1 ? current($valu...
php
final protected function consoleSetter( $method = 'log', array $value = array() ) { if (array_key_exists($method, $this->response)) { if (! is_array($this->response[$method])) { $this->response[$method] = [$this->response[$method]]; } $this->response[$method][] = count($value) === 1 ? current($valu...
[ "final", "protected", "function", "consoleSetter", "(", "$", "method", "=", "'log'", ",", "array", "$", "value", "=", "array", "(", ")", ")", "{", "if", "(", "array_key_exists", "(", "$", "method", ",", "$", "this", "->", "response", ")", ")", "{", "...
Private method for setting console values which can contain one or more values. I.E., log could take a singe argument and then be called again later. For console methods, set here to make it easier to call multiple times. @param string $method Console method to be setting @param array $value Value to be setting or a...
[ "Private", "method", "for", "setting", "console", "values", "which", "can", "contain", "one", "or", "more", "values", ".", "I", ".", "E", ".", "log", "could", "take", "a", "singe", "argument", "and", "then", "be", "called", "again", "later", ".", "For", ...
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/ajax_dom.php#L720-L734
25,917
Revys/revy
src/App/RoutesBase.php
RoutesBase.withLanguage
public static function withLanguage(\Closure $callback, $config = []) { if (\App::runningUnitTests()) { $locale = \App::getLocale(); } else { $locale = request()->segment(1); } if (strlen($locale) <= 2) { Route::group(['prefix' => $locale, 'middle...
php
public static function withLanguage(\Closure $callback, $config = []) { if (\App::runningUnitTests()) { $locale = \App::getLocale(); } else { $locale = request()->segment(1); } if (strlen($locale) <= 2) { Route::group(['prefix' => $locale, 'middle...
[ "public", "static", "function", "withLanguage", "(", "\\", "Closure", "$", "callback", ",", "$", "config", "=", "[", "]", ")", "{", "if", "(", "\\", "App", "::", "runningUnitTests", "(", ")", ")", "{", "$", "locale", "=", "\\", "App", "::", "getLocal...
Wraps routes with language prefix @param \Closure $callback @param array $config
[ "Wraps", "routes", "with", "language", "prefix" ]
b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1
https://github.com/Revys/revy/blob/b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1/src/App/RoutesBase.php#L36-L49
25,918
kapitchi/KapitchiEntity
src/KapitchiEntity/Mapper/EntityDbAdapterMapper.php
EntityDbAdapterMapper.getIdentifier
protected function getIdentifier($object) { $property = new ReflectionProperty(get_class($object), $this->getPrimaryKey()); $property->setAccessible(true); return $property->getValue($object); }
php
protected function getIdentifier($object) { $property = new ReflectionProperty(get_class($object), $this->getPrimaryKey()); $property->setAccessible(true); return $property->getValue($object); }
[ "protected", "function", "getIdentifier", "(", "$", "object", ")", "{", "$", "property", "=", "new", "ReflectionProperty", "(", "get_class", "(", "$", "object", ")", ",", "$", "this", "->", "getPrimaryKey", "(", ")", ")", ";", "$", "property", "->", "set...
check if object has already an identifier @param object $object @return mixed
[ "check", "if", "object", "has", "already", "an", "identifier" ]
69deaeb41d9133422a20ad6f64f0743d66cea8fd
https://github.com/kapitchi/KapitchiEntity/blob/69deaeb41d9133422a20ad6f64f0743d66cea8fd/src/KapitchiEntity/Mapper/EntityDbAdapterMapper.php#L99-L104
25,919
theopera/framework
src/Component/Mail/Mailer.php
Mailer.send
public function send(MailMessage $message) { $this->headers->add(new Header('From', $message->getFrom())); $this->mailer->send($message, $this->headers); }
php
public function send(MailMessage $message) { $this->headers->add(new Header('From', $message->getFrom())); $this->mailer->send($message, $this->headers); }
[ "public", "function", "send", "(", "MailMessage", "$", "message", ")", "{", "$", "this", "->", "headers", "->", "add", "(", "new", "Header", "(", "'From'", ",", "$", "message", "->", "getFrom", "(", ")", ")", ")", ";", "$", "this", "->", "mailer", ...
Tries to deliver the mail @param \Opera\Component\Mail\MailMessage $message @throws MailException
[ "Tries", "to", "deliver", "the", "mail" ]
fa6165d3891a310faa580c81dee49a63c150c711
https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/Mail/Mailer.php#L52-L57
25,920
theopera/framework
src/Component/Mail/Mailer.php
Mailer.parseAttachments
private function parseAttachments(array $files, string $message, string $contentType, string $hash) : string { $result = []; // The original message $result[] = '--body-mixed-' . $hash; $result[] = new Header('Content-Type', $contentType); $result[] = ''; $result[] =...
php
private function parseAttachments(array $files, string $message, string $contentType, string $hash) : string { $result = []; // The original message $result[] = '--body-mixed-' . $hash; $result[] = new Header('Content-Type', $contentType); $result[] = ''; $result[] =...
[ "private", "function", "parseAttachments", "(", "array", "$", "files", ",", "string", "$", "message", ",", "string", "$", "contentType", ",", "string", "$", "hash", ")", ":", "string", "{", "$", "result", "=", "[", "]", ";", "// The original message", "$",...
This will return a message body with the attachments in basecode64 encoding also the original message will be included @param SplFileObject[] $files @param string $message @param string $contentType @param string $hash @return string
[ "This", "will", "return", "a", "message", "body", "with", "the", "attachments", "in", "basecode64", "encoding", "also", "the", "original", "message", "will", "be", "included" ]
fa6165d3891a310faa580c81dee49a63c150c711
https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/Mail/Mailer.php#L70-L97
25,921
romm/configuration_object
Classes/Validation/ValidatorResolver.php
ValidatorResolver.addMixedTypeValidators
protected function addMixedTypeValidators($targetClassName, GenericObjectValidator $validator) { foreach ($this->reflectionService->getClassPropertyNames($targetClassName) as $property) { /* * If the property already is already bound to an object validator, * there is n...
php
protected function addMixedTypeValidators($targetClassName, GenericObjectValidator $validator) { foreach ($this->reflectionService->getClassPropertyNames($targetClassName) as $property) { /* * If the property already is already bound to an object validator, * there is n...
[ "protected", "function", "addMixedTypeValidators", "(", "$", "targetClassName", ",", "GenericObjectValidator", "$", "validator", ")", "{", "foreach", "(", "$", "this", "->", "reflectionService", "->", "getClassPropertyNames", "(", "$", "targetClassName", ")", "as", ...
This function will list the properties of the given class, and filter on the ones that do not have a validator assigned yet. @param string $targetClassName @param GenericObjectValidator $validator
[ "This", "function", "will", "list", "the", "properties", "of", "the", "given", "class", "and", "filter", "on", "the", "ones", "that", "do", "not", "have", "a", "validator", "assigned", "yet", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Validation/ValidatorResolver.php#L118-L140
25,922
romm/configuration_object
Classes/Validation/ValidatorResolver.php
ValidatorResolver.propertyIsMixedType
protected function propertyIsMixedType($className, $property) { $mixedType = false; $propertySchema = $this->reflectionService->getClassSchema($className)->getProperty($property); if ($this->classIsMixedType($propertySchema['type'])) { $mixedType = true; } else { ...
php
protected function propertyIsMixedType($className, $property) { $mixedType = false; $propertySchema = $this->reflectionService->getClassSchema($className)->getProperty($property); if ($this->classIsMixedType($propertySchema['type'])) { $mixedType = true; } else { ...
[ "protected", "function", "propertyIsMixedType", "(", "$", "className", ",", "$", "property", ")", "{", "$", "mixedType", "=", "false", ";", "$", "propertySchema", "=", "$", "this", "->", "reflectionService", "->", "getClassSchema", "(", "$", "className", ")", ...
Checks if the given property is a mixed type. First, we check if the type of the property is a class that implements the interface `MixedTypesInterface`. If not, we check if the property has the annotation `@mixedTypesResolver` with a class name that implements the interface `MixedTypesInterface`. If one was found, ...
[ "Checks", "if", "the", "given", "property", "is", "a", "mixed", "type", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Validation/ValidatorResolver.php#L184-L204
25,923
Programie/PHPCurl
src/main/php/com/selfcoders/phpcurl/Curl.php
Curl.getHeaderContent
public function getHeaderContent() { if (!$this->headerFileHandle) { return null; } fseek($this->headerFileHandle, 0); $lines = array(); while ($line = trim(fgets($this->headerFileHandle), "\n\r")) { $lines[] = $line; } return $lines...
php
public function getHeaderContent() { if (!$this->headerFileHandle) { return null; } fseek($this->headerFileHandle, 0); $lines = array(); while ($line = trim(fgets($this->headerFileHandle), "\n\r")) { $lines[] = $line; } return $lines...
[ "public", "function", "getHeaderContent", "(", ")", "{", "if", "(", "!", "$", "this", "->", "headerFileHandle", ")", "{", "return", "null", ";", "}", "fseek", "(", "$", "this", "->", "headerFileHandle", ",", "0", ")", ";", "$", "lines", "=", "array", ...
Get the content of the header output if enabled with enabledHeaderOutput. @return array|null The header output or null if header output was not enabled
[ "Get", "the", "content", "of", "the", "header", "output", "if", "enabled", "with", "enabledHeaderOutput", "." ]
54ef8bba19e87654906f74b14646c1f322ea7241
https://github.com/Programie/PHPCurl/blob/54ef8bba19e87654906f74b14646c1f322ea7241/src/main/php/com/selfcoders/phpcurl/Curl.php#L146-L160
25,924
Programie/PHPCurl
src/main/php/com/selfcoders/phpcurl/Curl.php
Curl.getVerboseContent
public function getVerboseContent() { if (!$this->verboseFileHandle) { return null; } fseek($this->verboseFileHandle, 0); $lines = array(); while ($line = trim(fgets($this->verboseFileHandle), "\n\r")) { $lines[] = $line; } return $l...
php
public function getVerboseContent() { if (!$this->verboseFileHandle) { return null; } fseek($this->verboseFileHandle, 0); $lines = array(); while ($line = trim(fgets($this->verboseFileHandle), "\n\r")) { $lines[] = $line; } return $l...
[ "public", "function", "getVerboseContent", "(", ")", "{", "if", "(", "!", "$", "this", "->", "verboseFileHandle", ")", "{", "return", "null", ";", "}", "fseek", "(", "$", "this", "->", "verboseFileHandle", ",", "0", ")", ";", "$", "lines", "=", "array"...
Get the content of the verbose output if enabled with enableVerboseOutput. @return array|null The verbose output or null if verbose mode was not enabled
[ "Get", "the", "content", "of", "the", "verbose", "output", "if", "enabled", "with", "enableVerboseOutput", "." ]
54ef8bba19e87654906f74b14646c1f322ea7241
https://github.com/Programie/PHPCurl/blob/54ef8bba19e87654906f74b14646c1f322ea7241/src/main/php/com/selfcoders/phpcurl/Curl.php#L167-L181
25,925
Programie/PHPCurl
src/main/php/com/selfcoders/phpcurl/Curl.php
Curl.enableVerboseOutput
public function enableVerboseOutput() { $this->verboseFileHandle = tmpfile(); $this->setOpt(CURLOPT_VERBOSE, true); $this->setOpt(CURLOPT_STDERR, $this->verboseFileHandle); }
php
public function enableVerboseOutput() { $this->verboseFileHandle = tmpfile(); $this->setOpt(CURLOPT_VERBOSE, true); $this->setOpt(CURLOPT_STDERR, $this->verboseFileHandle); }
[ "public", "function", "enableVerboseOutput", "(", ")", "{", "$", "this", "->", "verboseFileHandle", "=", "tmpfile", "(", ")", ";", "$", "this", "->", "setOpt", "(", "CURLOPT_VERBOSE", ",", "true", ")", ";", "$", "this", "->", "setOpt", "(", "CURLOPT_STDERR...
Set all future requests of this instance to verbose mode. The content of the verbose output can be retrieved later using getVerboseContent.
[ "Set", "all", "future", "requests", "of", "this", "instance", "to", "verbose", "mode", "." ]
54ef8bba19e87654906f74b14646c1f322ea7241
https://github.com/Programie/PHPCurl/blob/54ef8bba19e87654906f74b14646c1f322ea7241/src/main/php/com/selfcoders/phpcurl/Curl.php#L278-L283
25,926
native5/native5-sdk-client-php
src/Native5/Identity/SecurityUtils.php
SecurityUtils.getSubject
public static function getSubject() { $logger = $GLOBALS['logger']; $app = $GLOBALS['app']; $subject = $app->getSubject(); $logger->debug('Subject authentication status = '.$subject->isAuthenticated()); if ($subject === null) { $subject = Subject::createBuild...
php
public static function getSubject() { $logger = $GLOBALS['logger']; $app = $GLOBALS['app']; $subject = $app->getSubject(); $logger->debug('Subject authentication status = '.$subject->isAuthenticated()); if ($subject === null) { $subject = Subject::createBuild...
[ "public", "static", "function", "getSubject", "(", ")", "{", "$", "logger", "=", "$", "GLOBALS", "[", "'logger'", "]", ";", "$", "app", "=", "$", "GLOBALS", "[", "'app'", "]", ";", "$", "subject", "=", "$", "app", "->", "getSubject", "(", ")", ";",...
getSubject Convienience method to retrieve the subject. Subject is always retrieved from applicationContext. If no subject is found, then a new subject is created with default properties. @static @access public @return void
[ "getSubject", "Convienience", "method", "to", "retrieve", "the", "subject", ".", "Subject", "is", "always", "retrieved", "from", "applicationContext", ".", "If", "no", "subject", "is", "found", "then", "a", "new", "subject", "is", "created", "with", "default", ...
e1f598cf27654d81bb5facace1990b737242a2f9
https://github.com/native5/native5-sdk-client-php/blob/e1f598cf27654d81bb5facace1990b737242a2f9/src/Native5/Identity/SecurityUtils.php#L83-L96
25,927
Finesse/QueryScribe
src/Query.php
Query.table
public function table($table, string $alias = null): self { $table = $this->checkStringValue('Argument $table', $table); $this->table = $table; $this->tableAlias = $alias; return $this; }
php
public function table($table, string $alias = null): self { $table = $this->checkStringValue('Argument $table', $table); $this->table = $table; $this->tableAlias = $alias; return $this; }
[ "public", "function", "table", "(", "$", "table", ",", "string", "$", "alias", "=", "null", ")", ":", "self", "{", "$", "table", "=", "$", "this", "->", "checkStringValue", "(", "'Argument $table'", ",", "$", "table", ")", ";", "$", "this", "->", "ta...
Sets the target table. @param string|\Closure|self|StatementInterface $table Not prefixed table name without quotes @param string|null $alias Table alias. Warning! Alias is not allowed in insert, update and delete queries in some of the DBMSs. @return $this @throws InvalidArgumentException @throws InvalidReturnValueEx...
[ "Sets", "the", "target", "table", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Query.php#L81-L88
25,928
Finesse/QueryScribe
src/Query.php
Query.getTableIdentifier
public function getTableIdentifier() { if ($this->tableAlias !== null) { return $this->tableAlias; } if (is_string($this->table)) { return $this->table; } return null; }
php
public function getTableIdentifier() { if ($this->tableAlias !== null) { return $this->tableAlias; } if (is_string($this->table)) { return $this->table; } return null; }
[ "public", "function", "getTableIdentifier", "(", ")", "{", "if", "(", "$", "this", "->", "tableAlias", "!==", "null", ")", "{", "return", "$", "this", "->", "tableAlias", ";", "}", "if", "(", "is_string", "(", "$", "this", "->", "table", ")", ")", "{...
Returns the identifier which the target table can be appealed to. @return string|null Alias or table name. Null if the target table has no string name.
[ "Returns", "the", "identifier", "which", "the", "target", "table", "can", "be", "appealed", "to", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Query.php#L95-L104
25,929
Finesse/QueryScribe
src/Query.php
Query.addUpdate
public function addUpdate(array $values): self { foreach ($values as $column => $value) { if (!is_string($column)) { return $this->handleException(InvalidArgumentException::create( 'Argument $values indexes', $column, ['...
php
public function addUpdate(array $values): self { foreach ($values as $column => $value) { if (!is_string($column)) { return $this->handleException(InvalidArgumentException::create( 'Argument $values indexes', $column, ['...
[ "public", "function", "addUpdate", "(", "array", "$", "values", ")", ":", "self", "{", "foreach", "(", "$", "values", "as", "$", "column", "=>", "$", "value", ")", "{", "if", "(", "!", "is_string", "(", "$", "column", ")", ")", "{", "return", "$", ...
Adds values that should be updated @param mixed[]|\Closure[]|self[]|StatementInterface[] $values Fields to update. The indexes are the columns names, the values are the values. @return $this @throws InvalidArgumentException @throws InvalidReturnValueException
[ "Adds", "values", "that", "should", "be", "updated" ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Query.php#L115-L131
25,930
Finesse/QueryScribe
src/Query.php
Query.makeEmptyCopy
public function makeEmptyCopy(): self { $query = $this->constructEmptyCopy(); $query->setClosureResolver($this->closureResolver); return $query; }
php
public function makeEmptyCopy(): self { $query = $this->constructEmptyCopy(); $query->setClosureResolver($this->closureResolver); return $query; }
[ "public", "function", "makeEmptyCopy", "(", ")", ":", "self", "{", "$", "query", "=", "$", "this", "->", "constructEmptyCopy", "(", ")", ";", "$", "query", "->", "setClosureResolver", "(", "$", "this", "->", "closureResolver", ")", ";", "return", "$", "q...
Makes an empty self copy with dependencies. @return static
[ "Makes", "an", "empty", "self", "copy", "with", "dependencies", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Query.php#L179-L184
25,931
Finesse/QueryScribe
src/Query.php
Query.makeCopyForCriteriaGroup
public function makeCopyForCriteriaGroup(): self { $query = $this->makeEmptyCopy(); $query->table = $this->table; $query->tableAlias = $this->tableAlias; return $query; }
php
public function makeCopyForCriteriaGroup(): self { $query = $this->makeEmptyCopy(); $query->table = $this->table; $query->tableAlias = $this->tableAlias; return $query; }
[ "public", "function", "makeCopyForCriteriaGroup", "(", ")", ":", "self", "{", "$", "query", "=", "$", "this", "->", "makeEmptyCopy", "(", ")", ";", "$", "query", "->", "table", "=", "$", "this", "->", "table", ";", "$", "query", "->", "tableAlias", "="...
Makes a self copy with dependencies for passing to a criteria group callback. @return static
[ "Makes", "a", "self", "copy", "with", "dependencies", "for", "passing", "to", "a", "criteria", "group", "callback", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Query.php#L201-L207
25,932
Finesse/QueryScribe
src/Query.php
Query.apply
public function apply(callable $transform): self { $result = $transform($this) ?? $this; if ($result instanceof self) { return $result; } return $this->handleException(InvalidReturnValueException::create( 'The transform function return value', $r...
php
public function apply(callable $transform): self { $result = $transform($this) ?? $this; if ($result instanceof self) { return $result; } return $this->handleException(InvalidReturnValueException::create( 'The transform function return value', $r...
[ "public", "function", "apply", "(", "callable", "$", "transform", ")", ":", "self", "{", "$", "result", "=", "$", "transform", "(", "$", "this", ")", "??", "$", "this", ";", "if", "(", "$", "result", "instanceof", "self", ")", "{", "return", "$", "...
Modifies this query by passing it through a transform function. Warning! In contrast to the other methods, this method can both change this object and return a new object. The returned query is the only query guaranteed to be a proper result query. @param callable $transform The function. It recieves this query objec...
[ "Modifies", "this", "query", "by", "passing", "it", "through", "a", "transform", "function", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Query.php#L220-L233
25,933
Finesse/QueryScribe
src/Query.php
Query.checkStringValue
protected function checkStringValue(string $name, $value) { if ( !is_string($value) && !($value instanceof \Closure) && !($value instanceof self) && !($value instanceof StatementInterface) ) { return $this->handleException(InvalidArgumentEx...
php
protected function checkStringValue(string $name, $value) { if ( !is_string($value) && !($value instanceof \Closure) && !($value instanceof self) && !($value instanceof StatementInterface) ) { return $this->handleException(InvalidArgumentEx...
[ "protected", "function", "checkStringValue", "(", "string", "$", "name", ",", "$", "value", ")", "{", "if", "(", "!", "is_string", "(", "$", "value", ")", "&&", "!", "(", "$", "value", "instanceof", "\\", "Closure", ")", "&&", "!", "(", "$", "value",...
Check that value is suitable for being a "string or subquery" property of a query. Retrieves the closure subquery. @param string $name Value name @param string|\Closure|self|StatementInterface $value @return string|self|StatementInterface @throws InvalidArgumentException @throws InvalidReturnValueException
[ "Check", "that", "value", "is", "suitable", "for", "being", "a", "string", "or", "subquery", "property", "of", "a", "query", ".", "Retrieves", "the", "closure", "subquery", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Query.php#L256-L276
25,934
Finesse/QueryScribe
src/Query.php
Query.checkIntOrNullValue
protected function checkIntOrNullValue(string $name, $value) { if ( $value !== null && !is_numeric($value) && !($value instanceof \Closure) && !($value instanceof self) && !($value instanceof StatementInterface) ) { return $this...
php
protected function checkIntOrNullValue(string $name, $value) { if ( $value !== null && !is_numeric($value) && !($value instanceof \Closure) && !($value instanceof self) && !($value instanceof StatementInterface) ) { return $this...
[ "protected", "function", "checkIntOrNullValue", "(", "string", "$", "name", ",", "$", "value", ")", "{", "if", "(", "$", "value", "!==", "null", "&&", "!", "is_numeric", "(", "$", "value", ")", "&&", "!", "(", "$", "value", "instanceof", "\\", "Closure...
Check that value is suitable for being a "int or null or subquery" property of a query. Retrieves the closure subquery. @param string $name Value name @param int|\Closure|self|StatementInterface|null $value @return int|self|StatementInterface|null @throws InvalidArgumentException @throws InvalidReturnValueException
[ "Check", "that", "value", "is", "suitable", "for", "being", "a", "int", "or", "null", "or", "subquery", "property", "of", "a", "query", ".", "Retrieves", "the", "closure", "subquery", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Query.php#L288-L311
25,935
Finesse/QueryScribe
src/Query.php
Query.checkScalarOrNullValue
protected function checkScalarOrNullValue(string $name, $value) { if ( $value !== null && !is_scalar($value) && !($value instanceof \Closure) && !($value instanceof self) && !($value instanceof StatementInterface) ) { return $th...
php
protected function checkScalarOrNullValue(string $name, $value) { if ( $value !== null && !is_scalar($value) && !($value instanceof \Closure) && !($value instanceof self) && !($value instanceof StatementInterface) ) { return $th...
[ "protected", "function", "checkScalarOrNullValue", "(", "string", "$", "name", ",", "$", "value", ")", "{", "if", "(", "$", "value", "!==", "null", "&&", "!", "is_scalar", "(", "$", "value", ")", "&&", "!", "(", "$", "value", "instanceof", "\\", "Closu...
Check that value is suitable for being a "scalar or null or subquery" property of a query. Retrieves the closure subquery. @param string $name Value name @param mixed|\Closure|self|StatementInterface|null $value @return mixed|self|StatementInterface|null @throws InvalidArgumentException @throws InvalidReturnValueExcep...
[ "Check", "that", "value", "is", "suitable", "for", "being", "a", "scalar", "or", "null", "or", "subquery", "property", "of", "a", "query", ".", "Retrieves", "the", "closure", "subquery", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Query.php#L323-L344
25,936
Finesse/QueryScribe
src/Query.php
Query.checkSubQueryValue
protected function checkSubQueryValue(string $name, $value) { if ( !($value instanceof \Closure) && !($value instanceof self) && !($value instanceof StatementInterface) ) { return $this->handleException(InvalidArgumentException::create( ...
php
protected function checkSubQueryValue(string $name, $value) { if ( !($value instanceof \Closure) && !($value instanceof self) && !($value instanceof StatementInterface) ) { return $this->handleException(InvalidArgumentException::create( ...
[ "protected", "function", "checkSubQueryValue", "(", "string", "$", "name", ",", "$", "value", ")", "{", "if", "(", "!", "(", "$", "value", "instanceof", "\\", "Closure", ")", "&&", "!", "(", "$", "value", "instanceof", "self", ")", "&&", "!", "(", "$...
Check that value is suitable for being a subquery property of a query. Retrieves the closure subquery. @param string $name Value name @param \Closure|self|StatementInterface $value @return self|StatementInterface @throws InvalidArgumentException @throws InvalidReturnValueException
[ "Check", "that", "value", "is", "suitable", "for", "being", "a", "subquery", "property", "of", "a", "query", ".", "Retrieves", "the", "closure", "subquery", "." ]
4edba721e37693780d142229b3ecb0cd4004c7a5
https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Query.php#L355-L374
25,937
Dhii/callback-abstract
src/CreateReflectionForCallableCapableTrait.php
CreateReflectionForCallableCapableTrait._createReflectionForCallable
protected function _createReflectionForCallable($callable) { $callable = $this->_normalizeCallable($callable); // String or closure means function if (is_string($callable) || ($callable instanceof Closure)) { return $this->_createReflectionFunction($callable); } ...
php
protected function _createReflectionForCallable($callable) { $callable = $this->_normalizeCallable($callable); // String or closure means function if (is_string($callable) || ($callable instanceof Closure)) { return $this->_createReflectionFunction($callable); } ...
[ "protected", "function", "_createReflectionForCallable", "(", "$", "callable", ")", "{", "$", "callable", "=", "$", "this", "->", "_normalizeCallable", "(", "$", "callable", ")", ";", "// String or closure means function", "if", "(", "is_string", "(", "$", "callab...
Creates a reflection for the given callable. @since [*next-version*] @param callable|Stringable|array $callable The callable, or an object that represents a function FQN, or a callable-like array where the method is stringable. @throws InvalidArgumentException If the callable type is invalid. @throws OutOfRangeExcep...
[ "Creates", "a", "reflection", "for", "the", "given", "callable", "." ]
43ed4e99fc6ccdaf46a25d06da482a2fba8d9b19
https://github.com/Dhii/callback-abstract/blob/43ed4e99fc6ccdaf46a25d06da482a2fba8d9b19/src/CreateReflectionForCallableCapableTrait.php#L34-L49
25,938
horntell/php-sdk
lib/guzzle/GuzzleHttp/Subscriber/Mock.php
Mock.addMultiple
public function addMultiple(array $items) { foreach ($items as $item) { if ($item instanceof RequestException) { $this->addException($item); } else { $this->addResponse($item); } } }
php
public function addMultiple(array $items) { foreach ($items as $item) { if ($item instanceof RequestException) { $this->addException($item); } else { $this->addResponse($item); } } }
[ "public", "function", "addMultiple", "(", "array", "$", "items", ")", "{", "foreach", "(", "$", "items", "as", "$", "item", ")", "{", "if", "(", "$", "item", "instanceof", "RequestException", ")", "{", "$", "this", "->", "addException", "(", "$", "item...
Add multiple items to the queue @param array $items Items to add
[ "Add", "multiple", "items", "to", "the", "queue" ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Subscriber/Mock.php#L125-L134
25,939
zetta-code/doctrine-util
src/Common/DebugSql.php
DebugSql.getParamsArray
private static function getParamsArray($paramObj) { $parameters = array(); foreach ($paramObj as $val) { /* @var $val \Doctrine\ORM\Query\Parameter */ $parameters[$val->getName()] = $val->getValue(); } return $parameters; }
php
private static function getParamsArray($paramObj) { $parameters = array(); foreach ($paramObj as $val) { /* @var $val \Doctrine\ORM\Query\Parameter */ $parameters[$val->getName()] = $val->getValue(); } return $parameters; }
[ "private", "static", "function", "getParamsArray", "(", "$", "paramObj", ")", "{", "$", "parameters", "=", "array", "(", ")", ";", "foreach", "(", "$", "paramObj", "as", "$", "val", ")", "{", "/* @var $val \\Doctrine\\ORM\\Query\\Parameter */", "$", "parameters"...
Get query params list @param ArrayCollection $paramObj @return array
[ "Get", "query", "params", "list" ]
40cf1d12c89001f85e68c7508d1b86fa1b90f00c
https://github.com/zetta-code/doctrine-util/blob/40cf1d12c89001f85e68c7508d1b86fa1b90f00c/src/Common/DebugSql.php#L26-L35
25,940
zetta-code/doctrine-util
src/Common/DebugSql.php
DebugSql.getFullSQL
public static function getFullSQL($query) { $sql = $query->getSql(); $paramsList = self::getListParamsByDql($query->getDql()); $paramsArr = self::getParamsArray($query->getParameters()); $fullSql = ''; for ($i = 0; $i < strlen($sql); $i++) { if ($sql[$i] == '?') {...
php
public static function getFullSQL($query) { $sql = $query->getSql(); $paramsList = self::getListParamsByDql($query->getDql()); $paramsArr = self::getParamsArray($query->getParameters()); $fullSql = ''; for ($i = 0; $i < strlen($sql); $i++) { if ($sql[$i] == '?') {...
[ "public", "static", "function", "getFullSQL", "(", "$", "query", ")", "{", "$", "sql", "=", "$", "query", "->", "getSql", "(", ")", ";", "$", "paramsList", "=", "self", "::", "getListParamsByDql", "(", "$", "query", "->", "getDql", "(", ")", ")", ";"...
Get SQL from query @param \Doctrine\ORM\Query $query @return string
[ "Get", "SQL", "from", "query" ]
40cf1d12c89001f85e68c7508d1b86fa1b90f00c
https://github.com/zetta-code/doctrine-util/blob/40cf1d12c89001f85e68c7508d1b86fa1b90f00c/src/Common/DebugSql.php#L43-L86
25,941
koolkode/config
src/YamlConfigurationLoader.php
YamlConfigurationLoader.loadSource
protected function loadSource(\SplFileInfo $source, array $params = []) { $cfg = @file_get_contents($source->getPathname()); if($cfg === false) { throw new \RuntimeException(sprintf('Configuration source not found: "%s"', $source->getPathname())); } $replacements = []; foreach($params as $k => $v)...
php
protected function loadSource(\SplFileInfo $source, array $params = []) { $cfg = @file_get_contents($source->getPathname()); if($cfg === false) { throw new \RuntimeException(sprintf('Configuration source not found: "%s"', $source->getPathname())); } $replacements = []; foreach($params as $k => $v)...
[ "protected", "function", "loadSource", "(", "\\", "SplFileInfo", "$", "source", ",", "array", "$", "params", "=", "[", "]", ")", "{", "$", "cfg", "=", "@", "file_get_contents", "(", "$", "source", "->", "getPathname", "(", ")", ")", ";", "if", "(", "...
Loads the contents of the given file and replaces %-delimited placeholders with the given values. @param \SplFileInfo $source @param array<string, mixed> $params @return string @throws \RuntimeException When the file could not be accessed.
[ "Loads", "the", "contents", "of", "the", "given", "file", "and", "replaces", "%", "-", "delimited", "placeholders", "with", "the", "given", "values", "." ]
ad97d80f6e4ae5f8925839488abf2d9bfcb6d7f6
https://github.com/koolkode/config/blob/ad97d80f6e4ae5f8925839488abf2d9bfcb6d7f6/src/YamlConfigurationLoader.php#L49-L66
25,942
SetBased/php-abc-language-resolver-core
src/CoreLanguageResolver.php
CoreLanguageResolver.resolveLanId
private function resolveLanId(): void { $codes = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? null); // If HTTP_ACCEPT_LANGUAGE is not set or empty return the default language. if (empty($codes)) $this->lanIdDefault; $map = Abc::$babel->getInternalLanguageMap(); // Try to find the language ...
php
private function resolveLanId(): void { $codes = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? null); // If HTTP_ACCEPT_LANGUAGE is not set or empty return the default language. if (empty($codes)) $this->lanIdDefault; $map = Abc::$babel->getInternalLanguageMap(); // Try to find the language ...
[ "private", "function", "resolveLanId", "(", ")", ":", "void", "{", "$", "codes", "=", "explode", "(", "','", ",", "$", "_SERVER", "[", "'HTTP_ACCEPT_LANGUAGE'", "]", "??", "null", ")", ";", "// If HTTP_ACCEPT_LANGUAGE is not set or empty return the default language.",...
Resolves the ID of the language in which the response must be drafted.
[ "Resolves", "the", "ID", "of", "the", "language", "in", "which", "the", "response", "must", "be", "drafted", "." ]
122b76d75c89caa4b6ef2bcbae260eddd5c3d33a
https://github.com/SetBased/php-abc-language-resolver-core/blob/122b76d75c89caa4b6ef2bcbae260eddd5c3d33a/src/CoreLanguageResolver.php#L55-L97
25,943
praxigento/mobi_mod_downline
Plugin/Magento/Quote/Model/Quote.php
Quote.aroundGetCustomerGroupId
public function aroundGetCustomerGroupId( \Magento\Quote\Model\Quote $subject, \Closure $proceed ) { /* call parent to get group ID and to process other around-plugins */ $result = $proceed(); if ($result == \Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID) { ...
php
public function aroundGetCustomerGroupId( \Magento\Quote\Model\Quote $subject, \Closure $proceed ) { /* call parent to get group ID and to process other around-plugins */ $result = $proceed(); if ($result == \Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID) { ...
[ "public", "function", "aroundGetCustomerGroupId", "(", "\\", "Magento", "\\", "Quote", "\\", "Model", "\\", "Quote", "$", "subject", ",", "\\", "Closure", "$", "proceed", ")", "{", "/* call parent to get group ID and to process other around-plugins */", "$", "result", ...
Replace NOT_LOGGED_IN group for referral customers. @param \Magento\Quote\Model\Quote $subject @param \Closure $proceed @return int|mixed
[ "Replace", "NOT_LOGGED_IN", "group", "for", "referral", "customers", "." ]
0f3c276dfff1aa029f9fd205ccfc56f207a2e75b
https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Plugin/Magento/Quote/Model/Quote.php#L35-L50
25,944
Mandarin-Medien/MMCmfRoutingBundle
EventListener/AutoNodeRouteUpdateListener.php
AutoNodeRouteUpdateListener.prePersist
public function prePersist(LifecycleEventArgs $args) { // update child routes $entity = $args->getEntity(); if ( $entity instanceof RoutableNodeInterface && $entity->hasAutoNodeRouteGeneration() ) { $routeManager = $this->container->get('mm_cmf_routing.n...
php
public function prePersist(LifecycleEventArgs $args) { // update child routes $entity = $args->getEntity(); if ( $entity instanceof RoutableNodeInterface && $entity->hasAutoNodeRouteGeneration() ) { $routeManager = $this->container->get('mm_cmf_routing.n...
[ "public", "function", "prePersist", "(", "LifecycleEventArgs", "$", "args", ")", "{", "// update child routes", "$", "entity", "=", "$", "args", "->", "getEntity", "(", ")", ";", "if", "(", "$", "entity", "instanceof", "RoutableNodeInterface", "&&", "$", "enti...
prePersist Event whenever a new Node is created, also create automatically a new NodeRoute @param LifecycleEventArgs $args
[ "prePersist", "Event", "whenever", "a", "new", "Node", "is", "created", "also", "create", "automatically", "a", "new", "NodeRoute" ]
7db1b03f5e120bd473486c0be6ab76c6146cd2d0
https://github.com/Mandarin-Medien/MMCmfRoutingBundle/blob/7db1b03f5e120bd473486c0be6ab76c6146cd2d0/EventListener/AutoNodeRouteUpdateListener.php#L41-L55
25,945
Mandarin-Medien/MMCmfRoutingBundle
EventListener/AutoNodeRouteUpdateListener.php
AutoNodeRouteUpdateListener.onFlush
public function onFlush(OnFlushEventArgs $args) { $unit = $args->getEntityManager()->getUnitOfWork(); $routeManager = $this->container->get('mm_cmf_routing.node_route_manager'); foreach($unit->getScheduledEntityUpdates() as $entity) { if( $entity instanceof RoutableNodeInt...
php
public function onFlush(OnFlushEventArgs $args) { $unit = $args->getEntityManager()->getUnitOfWork(); $routeManager = $this->container->get('mm_cmf_routing.node_route_manager'); foreach($unit->getScheduledEntityUpdates() as $entity) { if( $entity instanceof RoutableNodeInt...
[ "public", "function", "onFlush", "(", "OnFlushEventArgs", "$", "args", ")", "{", "$", "unit", "=", "$", "args", "->", "getEntityManager", "(", ")", "->", "getUnitOfWork", "(", ")", ";", "$", "routeManager", "=", "$", "this", "->", "container", "->", "get...
onFlush Event for persisting all NodeRoutes that needs an update @param OnFlushEventArgs $args
[ "onFlush", "Event", "for", "persisting", "all", "NodeRoutes", "that", "needs", "an", "update" ]
7db1b03f5e120bd473486c0be6ab76c6146cd2d0
https://github.com/Mandarin-Medien/MMCmfRoutingBundle/blob/7db1b03f5e120bd473486c0be6ab76c6146cd2d0/EventListener/AutoNodeRouteUpdateListener.php#L63-L106
25,946
TuumPHP/View
src/Renderer.php
Renderer.block
public function block($file, $data = []) { $block = clone($this); $block->layout_file = null; return $block->doRender($file, $data); }
php
public function block($file, $data = []) { $block = clone($this); $block->layout_file = null; return $block->doRender($file, $data); }
[ "public", "function", "block", "(", "$", "file", ",", "$", "data", "=", "[", "]", ")", "{", "$", "block", "=", "clone", "(", "$", "this", ")", ";", "$", "block", "->", "layout_file", "=", "null", ";", "return", "$", "block", "->", "doRender", "("...
render a block, without default layout. @param string $file @param array $data @return string
[ "render", "a", "block", "without", "default", "layout", "." ]
b82b20d7b8ee66b2bdbe4eb0d95fabd9bafe4b21
https://github.com/TuumPHP/View/blob/b82b20d7b8ee66b2bdbe4eb0d95fabd9bafe4b21/src/Renderer.php#L157-L162
25,947
OliverMonneke/pennePHP
src/Time/DateTime.php
DateTime.add
public function add($string) { $this->timestamp = $this->getTimestamp() + $this->evaluateDateString($string); return $this; }
php
public function add($string) { $this->timestamp = $this->getTimestamp() + $this->evaluateDateString($string); return $this; }
[ "public", "function", "add", "(", "$", "string", ")", "{", "$", "this", "->", "timestamp", "=", "$", "this", "->", "getTimestamp", "(", ")", "+", "$", "this", "->", "evaluateDateString", "(", "$", "string", ")", ";", "return", "$", "this", ";", "}" ]
Add a specific period @param string $string The period to add @return DateTime
[ "Add", "a", "specific", "period" ]
dd0de7944685a3f1947157e1254fc54b55ff9942
https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Time/DateTime.php#L94-L99
25,948
OliverMonneke/pennePHP
src/Time/DateTime.php
DateTime.sub
public function sub($string) { $this->timestamp = $this->getTimestamp() - $this->evaluateDateString($string); return $this; }
php
public function sub($string) { $this->timestamp = $this->getTimestamp() - $this->evaluateDateString($string); return $this; }
[ "public", "function", "sub", "(", "$", "string", ")", "{", "$", "this", "->", "timestamp", "=", "$", "this", "->", "getTimestamp", "(", ")", "-", "$", "this", "->", "evaluateDateString", "(", "$", "string", ")", ";", "return", "$", "this", ";", "}" ]
Subtract a specific period @param string $string The period @return DateTime
[ "Subtract", "a", "specific", "period" ]
dd0de7944685a3f1947157e1254fc54b55ff9942
https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Time/DateTime.php#L108-L113
25,949
OliverMonneke/pennePHP
src/Time/DateTime.php
DateTime.evaluateDateString
protected function evaluateDateString($string) { $seconds = 1; $matches = []; preg_match('/^([0-9]*)([s|M|h|d|m|y])$/', $string, $matches); switch ($matches[2]) { case 's': $seconds = $matches[1]; break; case 'M': ...
php
protected function evaluateDateString($string) { $seconds = 1; $matches = []; preg_match('/^([0-9]*)([s|M|h|d|m|y])$/', $string, $matches); switch ($matches[2]) { case 's': $seconds = $matches[1]; break; case 'M': ...
[ "protected", "function", "evaluateDateString", "(", "$", "string", ")", "{", "$", "seconds", "=", "1", ";", "$", "matches", "=", "[", "]", ";", "preg_match", "(", "'/^([0-9]*)([s|M|h|d|m|y])$/'", ",", "$", "string", ",", "$", "matches", ")", ";", "switch",...
Convert string to seconds @param string $string The string @return int
[ "Convert", "string", "to", "seconds" ]
dd0de7944685a3f1947157e1254fc54b55ff9942
https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Time/DateTime.php#L122-L150
25,950
eliasis-framework/wp-plugin-rating
src/controller/class-main.php
Main.get_plugin_rating
public function get_plugin_rating( $slug, $ratings = null ) { $ratings = $ratings ?: [ 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 1, ]; $plugins_url = Component::WP_Plugin_Rating()->getOption( 'url', 'wp-plugins' ); $url = $plugins_url . $slug . '/reviews/#new-post'; $data['plugin-url-rev...
php
public function get_plugin_rating( $slug, $ratings = null ) { $ratings = $ratings ?: [ 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 1, ]; $plugins_url = Component::WP_Plugin_Rating()->getOption( 'url', 'wp-plugins' ); $url = $plugins_url . $slug . '/reviews/#new-post'; $data['plugin-url-rev...
[ "public", "function", "get_plugin_rating", "(", "$", "slug", ",", "$", "ratings", "=", "null", ")", "{", "$", "ratings", "=", "$", "ratings", "?", ":", "[", "1", "=>", "0", ",", "2", "=>", "0", ",", "3", "=>", "0", ",", "4", "=>", "0", ",", "...
Get plugin Rating. @param string $slug → WordPress plugin slug. @param array $ratings → default ratings if plugin not exists.
[ "Get", "plugin", "Rating", "." ]
6fbdb0d5f83357d1de0c6796936c023cbdd33d4e
https://github.com/eliasis-framework/wp-plugin-rating/blob/6fbdb0d5f83357d1de0c6796936c023cbdd33d4e/src/controller/class-main.php#L30-L68
25,951
eliasis-framework/wp-plugin-rating
src/controller/class-main.php
Main.prepare_stars
protected function prepare_stars( $rating ) { $stars = []; $full_star = (int) floor( $rating ); $half_star = ( ( $rating - $full_star ) > 0 ) ? true : false; for ( $i = 0; $i < $full_star; $i++ ) { $stars[] = 'filled'; } if ( $half_star ) { $stars[] = 'half'; } for ( $i = 0; $i < ( 5 - $fu...
php
protected function prepare_stars( $rating ) { $stars = []; $full_star = (int) floor( $rating ); $half_star = ( ( $rating - $full_star ) > 0 ) ? true : false; for ( $i = 0; $i < $full_star; $i++ ) { $stars[] = 'filled'; } if ( $half_star ) { $stars[] = 'half'; } for ( $i = 0; $i < ( 5 - $fu...
[ "protected", "function", "prepare_stars", "(", "$", "rating", ")", "{", "$", "stars", "=", "[", "]", ";", "$", "full_star", "=", "(", "int", ")", "floor", "(", "$", "rating", ")", ";", "$", "half_star", "=", "(", "(", "$", "rating", "-", "$", "fu...
Prepare states for each star. @param float|int $rating → plugin rating. @return array $rating → state for the five stars
[ "Prepare", "states", "for", "each", "star", "." ]
6fbdb0d5f83357d1de0c6796936c023cbdd33d4e
https://github.com/eliasis-framework/wp-plugin-rating/blob/6fbdb0d5f83357d1de0c6796936c023cbdd33d4e/src/controller/class-main.php#L77-L96
25,952
eliasis-framework/wp-plugin-rating
src/controller/class-main.php
Main.render
protected function render( $data ) { $template = Component::WP_Plugin_Rating()->getOption( 'path', 'template' ); $this->view->renderizate( $template, 'component', $data ); }
php
protected function render( $data ) { $template = Component::WP_Plugin_Rating()->getOption( 'path', 'template' ); $this->view->renderizate( $template, 'component', $data ); }
[ "protected", "function", "render", "(", "$", "data", ")", "{", "$", "template", "=", "Component", "::", "WP_Plugin_Rating", "(", ")", "->", "getOption", "(", "'path'", ",", "'template'", ")", ";", "$", "this", "->", "view", "->", "renderizate", "(", "$",...
Renderizate admin page. @param array $data → data to render in the view.
[ "Renderizate", "admin", "page", "." ]
6fbdb0d5f83357d1de0c6796936c023cbdd33d4e
https://github.com/eliasis-framework/wp-plugin-rating/blob/6fbdb0d5f83357d1de0c6796936c023cbdd33d4e/src/controller/class-main.php#L103-L108
25,953
ivopetkov/data-object
src/DataListToArrayTrait.php
DataListToArrayTrait.toArray
public function toArray(): array { $this->internalDataListUpdate(); // Copied from DataObjectToArrayTrait. Do not modify here !!! $toArray = function($object) use (&$toArray) { $result = []; $vars = get_object_vars($object); foreach ($vars as $name => $va...
php
public function toArray(): array { $this->internalDataListUpdate(); // Copied from DataObjectToArrayTrait. Do not modify here !!! $toArray = function($object) use (&$toArray) { $result = []; $vars = get_object_vars($object); foreach ($vars as $name => $va...
[ "public", "function", "toArray", "(", ")", ":", "array", "{", "$", "this", "->", "internalDataListUpdate", "(", ")", ";", "// Copied from DataObjectToArrayTrait. Do not modify here !!!", "$", "toArray", "=", "function", "(", "$", "object", ")", "use", "(", "&", ...
Returns the list data converted as an array. @return array The list data converted as an array. @throws \InvalidArgumentException
[ "Returns", "the", "list", "data", "converted", "as", "an", "array", "." ]
024039017fd9e6e3aca6edbad79aaf45764b8991
https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListToArrayTrait.php#L24-L81
25,954
rrolt/activehelper
src/Digithis/Activehelper/Activehelper.php
Activehelper.link
public function link($routes, $url, $value = '', $attributes = array('class' => 'active')) { if(empty($value)) { $value = $url; } $output = '<a href="'.$url.'"'; if($this->is($routes)) { $output.= $this->putAttributes($attributes); } $output.= '>'.$value.'</a>'; return $outp...
php
public function link($routes, $url, $value = '', $attributes = array('class' => 'active')) { if(empty($value)) { $value = $url; } $output = '<a href="'.$url.'"'; if($this->is($routes)) { $output.= $this->putAttributes($attributes); } $output.= '>'.$value.'</a>'; return $outp...
[ "public", "function", "link", "(", "$", "routes", ",", "$", "url", ",", "$", "value", "=", "''", ",", "$", "attributes", "=", "array", "(", "'class'", "=>", "'active'", ")", ")", "{", "if", "(", "empty", "(", "$", "value", ")", ")", "{", "$", "...
Generate link with active state. @param array $routes @param string $url @param string $value @param array $attributes @return string
[ "Generate", "link", "with", "active", "state", "." ]
eb29ef0aee8944a391be2b886579effb648e4909
https://github.com/rrolt/activehelper/blob/eb29ef0aee8944a391be2b886579effb648e4909/src/Digithis/Activehelper/Activehelper.php#L38-L55
25,955
rrolt/activehelper
src/Digithis/Activehelper/Activehelper.php
Activehelper.is
public function is() { $this->routes = array(); foreach(func_get_args() as $param) { if(!is_array($param)) { $this->routes[] = $param; continue; } foreach ($param as $p) { $this->routes[] = $p; } } $this->request = Request::path(); $this->parseRoutes(...
php
public function is() { $this->routes = array(); foreach(func_get_args() as $param) { if(!is_array($param)) { $this->routes[] = $param; continue; } foreach ($param as $p) { $this->routes[] = $p; } } $this->request = Request::path(); $this->parseRoutes(...
[ "public", "function", "is", "(", ")", "{", "$", "this", "->", "routes", "=", "array", "(", ")", ";", "foreach", "(", "func_get_args", "(", ")", "as", "$", "param", ")", "{", "if", "(", "!", "is_array", "(", "$", "param", ")", ")", "{", "$", "th...
Get current state. @return boolean
[ "Get", "current", "state", "." ]
eb29ef0aee8944a391be2b886579effb648e4909
https://github.com/rrolt/activehelper/blob/eb29ef0aee8944a391be2b886579effb648e4909/src/Digithis/Activehelper/Activehelper.php#L62-L103
25,956
rrolt/activehelper
src/Digithis/Activehelper/Activehelper.php
Activehelper.parseRoutes
private function parseRoutes() { $this->bad_routes = array(); foreach($this->routes as $r => $route) { if (strpos($route, 'not:') !== false) { $bad_route = substr($route, strpos($route, "not:")+4); $this->bad_routes[] = $bad_route; unset($this->routes[$r]); } } }
php
private function parseRoutes() { $this->bad_routes = array(); foreach($this->routes as $r => $route) { if (strpos($route, 'not:') !== false) { $bad_route = substr($route, strpos($route, "not:")+4); $this->bad_routes[] = $bad_route; unset($this->routes[$r]); } } }
[ "private", "function", "parseRoutes", "(", ")", "{", "$", "this", "->", "bad_routes", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "routes", "as", "$", "r", "=>", "$", "route", ")", "{", "if", "(", "strpos", "(", "$", "route", ...
Separate routes in clean routes and excluded routes. @param array $route @return void
[ "Separate", "routes", "in", "clean", "routes", "and", "excluded", "routes", "." ]
eb29ef0aee8944a391be2b886579effb648e4909
https://github.com/rrolt/activehelper/blob/eb29ef0aee8944a391be2b886579effb648e4909/src/Digithis/Activehelper/Activehelper.php#L126-L141
25,957
rrolt/activehelper
src/Digithis/Activehelper/Activehelper.php
Activehelper.putAttributes
private function putAttributes($attributes) { $output = ''; foreach($attributes as $attribute => $value) { $output.= ' '.$attribute. '="'.$value.'"'; } return $output; }
php
private function putAttributes($attributes) { $output = ''; foreach($attributes as $attribute => $value) { $output.= ' '.$attribute. '="'.$value.'"'; } return $output; }
[ "private", "function", "putAttributes", "(", "$", "attributes", ")", "{", "$", "output", "=", "''", ";", "foreach", "(", "$", "attributes", "as", "$", "attribute", "=>", "$", "value", ")", "{", "$", "output", ".=", "' '", ".", "$", "attribute", ".", ...
Attributes to string. @param array $attributes @return string
[ "Attributes", "to", "string", "." ]
eb29ef0aee8944a391be2b886579effb648e4909
https://github.com/rrolt/activehelper/blob/eb29ef0aee8944a391be2b886579effb648e4909/src/Digithis/Activehelper/Activehelper.php#L149-L159
25,958
Vectrex/vxPHP
src/File/FilesystemFile.php
FilesystemFile.getMimetype
public function getMimetype($force = false) { if(!isset($this->mimetype) || $force) { $this->mimetype = MimeTypeGetter::get($this->folder->getPath() . $this->filename); } return $this->mimetype; }
php
public function getMimetype($force = false) { if(!isset($this->mimetype) || $force) { $this->mimetype = MimeTypeGetter::get($this->folder->getPath() . $this->filename); } return $this->mimetype; }
[ "public", "function", "getMimetype", "(", "$", "force", "=", "false", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "mimetype", ")", "||", "$", "force", ")", "{", "$", "this", "->", "mimetype", "=", "MimeTypeGetter", "::", "get", "(", ...
retrieve mime type requires MimeTypeGetter @param bool $force forces re-read of mime type
[ "retrieve", "mime", "type", "requires", "MimeTypeGetter" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFile.php#L102-L109
25,959
Vectrex/vxPHP
src/File/FilesystemFile.php
FilesystemFile.move
public function move(FilesystemFolder $destination) { // already in destination folder, nothing to do if($destination !== $this->folder) { $oldpath = $this->folder->getPath() . $this->filename; $newpath = $destination->getPath() . $this->filename; if(@rename($oldpath, $newpath)) { $this->clearCac...
php
public function move(FilesystemFolder $destination) { // already in destination folder, nothing to do if($destination !== $this->folder) { $oldpath = $this->folder->getPath() . $this->filename; $newpath = $destination->getPath() . $this->filename; if(@rename($oldpath, $newpath)) { $this->clearCac...
[ "public", "function", "move", "(", "FilesystemFolder", "$", "destination", ")", "{", "// already in destination folder, nothing to do", "if", "(", "$", "destination", "!==", "$", "this", "->", "folder", ")", "{", "$", "oldpath", "=", "$", "this", "->", "folder",...
move file into new folder, orphaned cache entries are deleted, new cache entries are not generated @param FilesystemFolder $destination @return \vxPHP\File\FilesystemFile @throws FilesystemFileException
[ "move", "file", "into", "new", "folder", "orphaned", "cache", "entries", "are", "deleted", "new", "cache", "entries", "are", "not", "generated" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFile.php#L220-L257
25,960
Vectrex/vxPHP
src/File/FilesystemFile.php
FilesystemFile.renameCacheEntries
protected function renameCacheEntries($to) { if(($cachePath = $this->folder->getCachePath(TRUE))) { $di = new \DirectoryIterator($cachePath); foreach($di as $fileinfo) { $filename = $fileinfo->getFilename(); if( $fileinfo->isDot() || !$fileinfo->isFile() || strpos($filename, $this->filena...
php
protected function renameCacheEntries($to) { if(($cachePath = $this->folder->getCachePath(TRUE))) { $di = new \DirectoryIterator($cachePath); foreach($di as $fileinfo) { $filename = $fileinfo->getFilename(); if( $fileinfo->isDot() || !$fileinfo->isFile() || strpos($filename, $this->filena...
[ "protected", "function", "renameCacheEntries", "(", "$", "to", ")", "{", "if", "(", "(", "$", "cachePath", "=", "$", "this", "->", "folder", "->", "getCachePath", "(", "TRUE", ")", ")", ")", "{", "$", "di", "=", "new", "\\", "DirectoryIterator", "(", ...
updates names of cache entries @param string $to new filename
[ "updates", "names", "of", "cache", "entries" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFile.php#L264-L285
25,961
Vectrex/vxPHP
src/File/FilesystemFile.php
FilesystemFile.delete
public function delete() { if(@unlink($this->getPath())) { $this->deleteCacheEntries(); self::unsetInstance($this->getPath()); } else { throw new FilesystemFileException("Delete of file '{$this->getPath()}' failed.", FilesystemFileException::FILE_DELETE_FAILED); } }
php
public function delete() { if(@unlink($this->getPath())) { $this->deleteCacheEntries(); self::unsetInstance($this->getPath()); } else { throw new FilesystemFileException("Delete of file '{$this->getPath()}' failed.", FilesystemFileException::FILE_DELETE_FAILED); } }
[ "public", "function", "delete", "(", ")", "{", "if", "(", "@", "unlink", "(", "$", "this", "->", "getPath", "(", ")", ")", ")", "{", "$", "this", "->", "deleteCacheEntries", "(", ")", ";", "self", "::", "unsetInstance", "(", "$", "this", "->", "get...
deletes file and removes instance from lookup array @throws FilesystemFileException
[ "deletes", "file", "and", "removes", "instance", "from", "lookup", "array" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFile.php#L291-L301
25,962
Vectrex/vxPHP
src/File/FilesystemFile.php
FilesystemFile.deleteCacheEntries
protected function deleteCacheEntries() { if(($cachePath = $this->folder->getCachePath(TRUE))) { $di = new \DirectoryIterator($cachePath); foreach($di as $fileinfo) { if( $fileinfo->isDot() || !$fileinfo->isFile() || strpos($fileinfo->getFilename(), $this->filename) !== 0 ) { continue;...
php
protected function deleteCacheEntries() { if(($cachePath = $this->folder->getCachePath(TRUE))) { $di = new \DirectoryIterator($cachePath); foreach($di as $fileinfo) { if( $fileinfo->isDot() || !$fileinfo->isFile() || strpos($fileinfo->getFilename(), $this->filename) !== 0 ) { continue;...
[ "protected", "function", "deleteCacheEntries", "(", ")", "{", "if", "(", "(", "$", "cachePath", "=", "$", "this", "->", "folder", "->", "getCachePath", "(", "TRUE", ")", ")", ")", "{", "$", "di", "=", "new", "\\", "DirectoryIterator", "(", "$", "cacheP...
cleans up cache entries associated with "original" file
[ "cleans", "up", "cache", "entries", "associated", "with", "original", "file" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFile.php#L307-L324
25,963
Vectrex/vxPHP
src/File/FilesystemFile.php
FilesystemFile.getCacheInfo
public function getCacheInfo() { if(($cachePath = $this->folder->getCachePath(TRUE))) { $size = 0; $count = 0; $di = new \DirectoryIterator($cachePath); foreach($di as $fileinfo) { if( $fileinfo->isDot() || !$fileinfo->isFile() || strpos($fileinfo->getFilename(), $this->filename) !== 0 ...
php
public function getCacheInfo() { if(($cachePath = $this->folder->getCachePath(TRUE))) { $size = 0; $count = 0; $di = new \DirectoryIterator($cachePath); foreach($di as $fileinfo) { if( $fileinfo->isDot() || !$fileinfo->isFile() || strpos($fileinfo->getFilename(), $this->filename) !== 0 ...
[ "public", "function", "getCacheInfo", "(", ")", "{", "if", "(", "(", "$", "cachePath", "=", "$", "this", "->", "folder", "->", "getCachePath", "(", "TRUE", ")", ")", ")", "{", "$", "size", "=", "0", ";", "$", "count", "=", "0", ";", "$", "di", ...
retrieve information about cached files @return array information
[ "retrieve", "information", "about", "cached", "files" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFile.php#L339-L360
25,964
Vectrex/vxPHP
src/File/FilesystemFile.php
FilesystemFile.getFilesystemFilesInFolder
public static function getFilesystemFilesInFolder(FilesystemFolder $folder) { $files = []; $glob = glob($folder->getPath() . '*', GLOB_NOSORT); if($glob !== FALSE) { foreach($glob as $f) { if(!is_dir($f)) { if(!isset(self::$instances[$f])) { self::$instances[$f] = new self(basename($f), $fo...
php
public static function getFilesystemFilesInFolder(FilesystemFolder $folder) { $files = []; $glob = glob($folder->getPath() . '*', GLOB_NOSORT); if($glob !== FALSE) { foreach($glob as $f) { if(!is_dir($f)) { if(!isset(self::$instances[$f])) { self::$instances[$f] = new self(basename($f), $fo...
[ "public", "static", "function", "getFilesystemFilesInFolder", "(", "FilesystemFolder", "$", "folder", ")", "{", "$", "files", "=", "[", "]", ";", "$", "glob", "=", "glob", "(", "$", "folder", "->", "getPath", "(", ")", ".", "'*'", ",", "GLOB_NOSORT", ")"...
return all filesystem files instances within a certain folder @param FilesystemFolder $folder @return Array filesystem files
[ "return", "all", "filesystem", "files", "instances", "within", "a", "certain", "folder" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFile.php#L368-L389
25,965
squareproton/Bond
src/Bond/Pg/Result.php
Result.setFetchOptions
public function setFetchOptions( $fetchOptions ) { // set fetchOptions if( $fetchOptions === null ) { return $this->fetchOptions; } if( !is_integer($fetchOptions) ) { throw new BadTypeException( $fetchOptions, 'int' ); } $fetchOptions += $fe...
php
public function setFetchOptions( $fetchOptions ) { // set fetchOptions if( $fetchOptions === null ) { return $this->fetchOptions; } if( !is_integer($fetchOptions) ) { throw new BadTypeException( $fetchOptions, 'int' ); } $fetchOptions += $fe...
[ "public", "function", "setFetchOptions", "(", "$", "fetchOptions", ")", "{", "// set fetchOptions", "if", "(", "$", "fetchOptions", "===", "null", ")", "{", "return", "$", "this", "->", "fetchOptions", ";", "}", "if", "(", "!", "is_integer", "(", "$", "fet...
Set the result fetchOptions @param int Bitmask @return Bond\Pg\Resource
[ "Set", "the", "result", "fetchOptions" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Result.php#L155-L181
25,966
squareproton/Bond
src/Bond/Pg/Result.php
Result.buildFetchCallback
private function buildFetchCallback( $fetchOptions, $flatten ) { $original = $this->fetchOptions & ( self::TYPE_DETECT | self::TYPE_AGNOSTIC | self::FLATTEN_IF_POSSIBLE | self::FLATTEN_PREVENT | self::STYLE_ASSOC | self::STYLE_NUM ); $new = $fetchOptions & ( self::TYPE_DETECT | self::TYPE_AGNOSTIC ...
php
private function buildFetchCallback( $fetchOptions, $flatten ) { $original = $this->fetchOptions & ( self::TYPE_DETECT | self::TYPE_AGNOSTIC | self::FLATTEN_IF_POSSIBLE | self::FLATTEN_PREVENT | self::STYLE_ASSOC | self::STYLE_NUM ); $new = $fetchOptions & ( self::TYPE_DETECT | self::TYPE_AGNOSTIC ...
[ "private", "function", "buildFetchCallback", "(", "$", "fetchOptions", ",", "$", "flatten", ")", "{", "$", "original", "=", "$", "this", "->", "fetchOptions", "&", "(", "self", "::", "TYPE_DETECT", "|", "self", "::", "TYPE_AGNOSTIC", "|", "self", "::", "FL...
Build a row processing callback based on the TYPE_DETECT and row flattening @param bool $flatten @return Callable
[ "Build", "a", "row", "processing", "callback", "based", "on", "the", "TYPE_DETECT", "and", "row", "flattening" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Result.php#L188-L249
25,967
squareproton/Bond
src/Bond/Pg/Result.php
Result.getFetchOptions
public function getFetchOptions( &$humanReadable = null ) { // aid to result fetching debugging // get fetch options in a human readable format if( func_num_args() ) { $humanReadable = []; $refl = new \ReflectionClass( __CLASS__ ); foreach( $refl->getConst...
php
public function getFetchOptions( &$humanReadable = null ) { // aid to result fetching debugging // get fetch options in a human readable format if( func_num_args() ) { $humanReadable = []; $refl = new \ReflectionClass( __CLASS__ ); foreach( $refl->getConst...
[ "public", "function", "getFetchOptions", "(", "&", "$", "humanReadable", "=", "null", ")", "{", "// aid to result fetching debugging", "// get fetch options in a human readable format", "if", "(", "func_num_args", "(", ")", ")", "{", "$", "humanReadable", "=", "[", "]...
Return the bitmask @return
[ "Return", "the", "bitmask" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Result.php#L255-L269
25,968
squareproton/Bond
src/Bond/Pg/Result.php
Result.fetch
public function fetch( $options = null, $keyResultsByColumn = null ) { $this->setFetchOptions( $options ); // caching if( $this->fetchOptions & self::CACHE ) { // get a cache key for the passed options (we only care about those options that will modify the returned result) ...
php
public function fetch( $options = null, $keyResultsByColumn = null ) { $this->setFetchOptions( $options ); // caching if( $this->fetchOptions & self::CACHE ) { // get a cache key for the passed options (we only care about those options that will modify the returned result) ...
[ "public", "function", "fetch", "(", "$", "options", "=", "null", ",", "$", "keyResultsByColumn", "=", "null", ")", "{", "$", "this", "->", "setFetchOptions", "(", "$", "options", ")", ";", "// caching", "if", "(", "$", "this", "->", "fetchOptions", "&", ...
Here be the magic! @param int Bitmask of the options @param mixed The column name we want our output to be keyed by @return mixed
[ "Here", "be", "the", "magic!" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Result.php#L277-L344
25,969
squareproton/Bond
src/Bond/Pg/Result.php
Result.getFieldTypeCallbacks
public function getFieldTypeCallbacks() { $types = array(); $numFields = $this->numFields(); for( $i = 0; $i < $numFields; $i++ ) { $types[pg_field_name( $this->resource, $i )] = TypeConversionFactory::get( pg_field_type( $this->resource, $i ), $t...
php
public function getFieldTypeCallbacks() { $types = array(); $numFields = $this->numFields(); for( $i = 0; $i < $numFields; $i++ ) { $types[pg_field_name( $this->resource, $i )] = TypeConversionFactory::get( pg_field_type( $this->resource, $i ), $t...
[ "public", "function", "getFieldTypeCallbacks", "(", ")", "{", "$", "types", "=", "array", "(", ")", ";", "$", "numFields", "=", "$", "this", "->", "numFields", "(", ")", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "numFields", "...
Return a array of php callbacks to be applied to a result set @param array $types
[ "Return", "a", "array", "of", "php", "callbacks", "to", "be", "applied", "to", "a", "result", "set" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Result.php#L350-L363
25,970
linpax/microphp-framework
src/cli/CliResolver.php
CliResolver.getOption
public function getOption($char = '', $name = '', $required = null) { if (!$char && !$name) { return false; } if ($char && (1 < strlen($char) || 1 !== preg_match('/^\w$/', $char))) { return false; } if ($name && (1 !== preg_match('/^\w+$/', $name))) { ...
php
public function getOption($char = '', $name = '', $required = null) { if (!$char && !$name) { return false; } if ($char && (1 < strlen($char) || 1 !== preg_match('/^\w$/', $char))) { return false; } if ($name && (1 !== preg_match('/^\w+$/', $name))) { ...
[ "public", "function", "getOption", "(", "$", "char", "=", "''", ",", "$", "name", "=", "''", ",", "$", "required", "=", "null", ")", "{", "if", "(", "!", "$", "char", "&&", "!", "$", "name", ")", "{", "return", "false", ";", "}", "if", "(", "...
Get arguments from command line @access public @param string $char -a .. -z option char @param string $name --optionName_string @param bool|null $required Required value? @return mixed
[ "Get", "arguments", "from", "command", "line" ]
11f3370f3f64c516cce9b84ecd8276c6e9ae8df9
https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/cli/CliResolver.php#L58-L81
25,971
stubbles/stubbles-streams
src/main/php/filter/FilteredOutputStream.php
FilteredOutputStream.writeLines
public function writeLines(array $bytes): int { $bytesWritten = 0; foreach ($bytes as $line) { $bytesWritten += $this->writeLine($line); } return $bytesWritten; }
php
public function writeLines(array $bytes): int { $bytesWritten = 0; foreach ($bytes as $line) { $bytesWritten += $this->writeLine($line); } return $bytesWritten; }
[ "public", "function", "writeLines", "(", "array", "$", "bytes", ")", ":", "int", "{", "$", "bytesWritten", "=", "0", ";", "foreach", "(", "$", "bytes", "as", "$", "line", ")", "{", "$", "bytesWritten", "+=", "$", "this", "->", "writeLine", "(", "$", ...
writes given bytes and appends a line break after each one @param string[] $bytes @return int amount of written bytes @since 3.2.0
[ "writes", "given", "bytes", "and", "appends", "a", "line", "break", "after", "each", "one" ]
99b0dace5fcf71584d1456b4b5408017b896bdf5
https://github.com/stubbles/stubbles-streams/blob/99b0dace5fcf71584d1456b4b5408017b896bdf5/src/main/php/filter/FilteredOutputStream.php#L79-L87
25,972
gplcart/export
controllers/Settings.php
Settings.setDataEditSettings
protected function setDataEditSettings() { $header = $this->getData('settings.header'); if (is_array($header)) { $string = ''; foreach ($header as $key => $value) { $string .= "$key $value" . PHP_EOL; } $this->setData('settings.heade...
php
protected function setDataEditSettings() { $header = $this->getData('settings.header'); if (is_array($header)) { $string = ''; foreach ($header as $key => $value) { $string .= "$key $value" . PHP_EOL; } $this->setData('settings.heade...
[ "protected", "function", "setDataEditSettings", "(", ")", "{", "$", "header", "=", "$", "this", "->", "getData", "(", "'settings.header'", ")", ";", "if", "(", "is_array", "(", "$", "header", ")", ")", "{", "$", "string", "=", "''", ";", "foreach", "("...
Prepare data before rendering
[ "Prepare", "data", "before", "rendering" ]
b4d93c7a2bd6653f12231fb30d36601ea00fc926
https://github.com/gplcart/export/blob/b4d93c7a2bd6653f12231fb30d36601ea00fc926/controllers/Settings.php#L37-L50
25,973
gplcart/export
controllers/Settings.php
Settings.validateHeaderSettings
protected function validateHeaderSettings() { $errors = $header = array(); $lines = gplcart_string_explode_multiline($this->getSubmitted('header', '')); foreach ($lines as $pos => $line) { $pos++; $data = array_filter(array_map('trim', explode(' ', $line, 2))); ...
php
protected function validateHeaderSettings() { $errors = $header = array(); $lines = gplcart_string_explode_multiline($this->getSubmitted('header', '')); foreach ($lines as $pos => $line) { $pos++; $data = array_filter(array_map('trim', explode(' ', $line, 2))); ...
[ "protected", "function", "validateHeaderSettings", "(", ")", "{", "$", "errors", "=", "$", "header", "=", "array", "(", ")", ";", "$", "lines", "=", "gplcart_string_explode_multiline", "(", "$", "this", "->", "getSubmitted", "(", "'header'", ",", "''", ")", ...
Validate header mapping
[ "Validate", "header", "mapping" ]
b4d93c7a2bd6653f12231fb30d36601ea00fc926
https://github.com/gplcart/export/blob/b4d93c7a2bd6653f12231fb30d36601ea00fc926/controllers/Settings.php#L113-L144
25,974
sndsgd/http
src/http/request/BodyDecoder.php
BodyDecoder.addDecoder
public static function addDecoder(string $class, string ...$contentTypes) { $interface = decoder\DecoderInterface::class; if (!is_subclass_of($class, $interface)) { throw new \InvalidArgumentException( "invalid value provided for 'class'; ". "expecting the...
php
public static function addDecoder(string $class, string ...$contentTypes) { $interface = decoder\DecoderInterface::class; if (!is_subclass_of($class, $interface)) { throw new \InvalidArgumentException( "invalid value provided for 'class'; ". "expecting the...
[ "public", "static", "function", "addDecoder", "(", "string", "$", "class", ",", "string", "...", "$", "contentTypes", ")", "{", "$", "interface", "=", "decoder", "\\", "DecoderInterface", "::", "class", ";", "if", "(", "!", "is_subclass_of", "(", "$", "cla...
Replace existing decoders, or add additional decoders @param string $class The nme of the decoder class @param string ...$contentTypes The content types the decoder can handle
[ "Replace", "existing", "decoders", "or", "add", "additional", "decoders" ]
e7f82010a66c6d3241a24ea82baf4593130c723b
https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/request/BodyDecoder.php#L27-L40
25,975
sndsgd/http
src/http/request/BodyDecoder.php
BodyDecoder.getDecoder
protected function getDecoder( string $stream, string $contentType, int $contentLength, decoder\DecoderOptions $options ) { $type = \sndsgd\Str::before($contentType, ";"); if (!isset(static::$decoders[$type])) { throw new exception\BadRequestException(...
php
protected function getDecoder( string $stream, string $contentType, int $contentLength, decoder\DecoderOptions $options ) { $type = \sndsgd\Str::before($contentType, ";"); if (!isset(static::$decoders[$type])) { throw new exception\BadRequestException(...
[ "protected", "function", "getDecoder", "(", "string", "$", "stream", ",", "string", "$", "contentType", ",", "int", "$", "contentLength", ",", "decoder", "\\", "DecoderOptions", "$", "options", ")", "{", "$", "type", "=", "\\", "sndsgd", "\\", "Str", "::",...
Stubbable method for creating a decoder instance @param string $stream @param string $contentType @param int $contentLength @param \sndsgd\http\data\DecoderOptions $options @return \sndsgd\http\data\decoder\DecoderInterface @throws \sndsgd\http\exception\BadRequestException
[ "Stubbable", "method", "for", "creating", "a", "decoder", "instance" ]
e7f82010a66c6d3241a24ea82baf4593130c723b
https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/request/BodyDecoder.php#L81-L98
25,976
ezra-obiwale/dSCore
src/Form/Filterer.php
Filterer.checkMessage
private function checkMessage($defMsg, array $options) { if (is_array($options) && isset($options['message'])) return $options['message'] ? $options['message'] : null; return $defMsg; }
php
private function checkMessage($defMsg, array $options) { if (is_array($options) && isset($options['message'])) return $options['message'] ? $options['message'] : null; return $defMsg; }
[ "private", "function", "checkMessage", "(", "$", "defMsg", ",", "array", "$", "options", ")", "{", "if", "(", "is_array", "(", "$", "options", ")", "&&", "isset", "(", "$", "options", "[", "'message'", "]", ")", ")", "return", "$", "options", "[", "'...
Checks if a custom message exists or returns the default @param string $defMsg Default message of the filter @param array $options Element filter Options @return string
[ "Checks", "if", "a", "custom", "message", "exists", "or", "returns", "the", "default" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Filterer.php#L75-L80
25,977
ezra-obiwale/dSCore
src/Form/Filterer.php
Filterer.required
public function required($options) { if ((is_array($options) || (!is_array($options) && $options))) { if ((is_array($this->elementData) && (empty($this->elementData) || (empty($this->elementData[0]) && count($this->elementData) === 1))) || (!is_array($this->elementData) && trim($...
php
public function required($options) { if ((is_array($options) || (!is_array($options) && $options))) { if ((is_array($this->elementData) && (empty($this->elementData) || (empty($this->elementData[0]) && count($this->elementData) === 1))) || (!is_array($this->elementData) && trim($...
[ "public", "function", "required", "(", "$", "options", ")", "{", "if", "(", "(", "is_array", "(", "$", "options", ")", "||", "(", "!", "is_array", "(", "$", "options", ")", "&&", "$", "options", ")", ")", ")", "{", "if", "(", "(", "is_array", "("...
Makes an element required @param string $name Name of the element to filter @param boolean|string|array $options Boolean indicates required or not. String indicates required with custom message. Array indicates required and has options @return boolean
[ "Makes", "an", "element", "required" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Filterer.php#L90-L105
25,978
ezra-obiwale/dSCore
src/Form/Filterer.php
Filterer.match
public function match(array $options) { if (isset($options['element'])) { if (isset($this->data[$options['element']])) { if ($this->elementData == $this->data[$options['element']]) { return true; } } else { return true; ...
php
public function match(array $options) { if (isset($options['element'])) { if (isset($this->data[$options['element']])) { if ($this->elementData == $this->data[$options['element']]) { return true; } } else { return true; ...
[ "public", "function", "match", "(", "array", "$", "options", ")", "{", "if", "(", "isset", "(", "$", "options", "[", "'element'", "]", ")", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "data", "[", "$", "options", "[", "'element'", "]", ...
Checks if the value of the element matches the given option @param string $name Name of the element to filter @param array $options Keys may include [message] @return boolean @throws \Exception
[ "Checks", "if", "the", "value", "of", "the", "element", "matches", "the", "given", "option" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Filterer.php#L114-L131
25,979
ezra-obiwale/dSCore
src/Form/Filterer.php
Filterer.email
public function email(array $options) { if (empty($this->elementData) || filter_var($this->elementData, FILTER_VALIDATE_EMAIL)) { $this->elementData = filter_var($this->elementData, FILTER_SANITIZE_EMAIL); return true; } $this->addError($this->checkMessage('Invalid email...
php
public function email(array $options) { if (empty($this->elementData) || filter_var($this->elementData, FILTER_VALIDATE_EMAIL)) { $this->elementData = filter_var($this->elementData, FILTER_SANITIZE_EMAIL); return true; } $this->addError($this->checkMessage('Invalid email...
[ "public", "function", "email", "(", "array", "$", "options", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "elementData", ")", "||", "filter_var", "(", "$", "this", "->", "elementData", ",", "FILTER_VALIDATE_EMAIL", ")", ")", "{", "$", "this", ...
Checks if the value of the element is a valid email address @param string $name Name of the element to filter @param array $options Keys may include [message] @return boolean
[ "Checks", "if", "the", "value", "of", "the", "element", "is", "a", "valid", "email", "address" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Filterer.php#L165-L173
25,980
ezra-obiwale/dSCore
src/Form/Filterer.php
Filterer.url
public function url(array $options) { if (empty($this->elementData) || filter_var($this->elementData, FILTER_VALIDATE_URL)) { $this->elementData = filter_var($this->elementData, FILTER_SANITIZE_URL); return true; } $this->addError($this->checkMessage('Value is not a vali...
php
public function url(array $options) { if (empty($this->elementData) || filter_var($this->elementData, FILTER_VALIDATE_URL)) { $this->elementData = filter_var($this->elementData, FILTER_SANITIZE_URL); return true; } $this->addError($this->checkMessage('Value is not a vali...
[ "public", "function", "url", "(", "array", "$", "options", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "elementData", ")", "||", "filter_var", "(", "$", "this", "->", "elementData", ",", "FILTER_VALIDATE_URL", ")", ")", "{", "$", "this", "->"...
Checks if the values of the element is a valid url @param string $name Name of the element to filter @param array $options Keys may include [message] @return boolean
[ "Checks", "if", "the", "values", "of", "the", "element", "is", "a", "valid", "url" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Filterer.php#L181-L189
25,981
ezra-obiwale/dSCore
src/Form/Filterer.php
Filterer.alpha
public function alpha(array $options) { if (!$options['regex']) $options['regex'] = ($options['acceptSpace']) ? '/[^a-zA-Z\s]/' : '/[^a-zA-Z]/'; if (!preg_match($options['regex'], $this->elementData)) return true; $this->addError($this->checkMessage('Value can only conta...
php
public function alpha(array $options) { if (!$options['regex']) $options['regex'] = ($options['acceptSpace']) ? '/[^a-zA-Z\s]/' : '/[^a-zA-Z]/'; if (!preg_match($options['regex'], $this->elementData)) return true; $this->addError($this->checkMessage('Value can only conta...
[ "public", "function", "alpha", "(", "array", "$", "options", ")", "{", "if", "(", "!", "$", "options", "[", "'regex'", "]", ")", "$", "options", "[", "'regex'", "]", "=", "(", "$", "options", "[", "'acceptSpace'", "]", ")", "?", "'/[^a-zA-Z\\s]/'", "...
Checks if the contents of the element are all alphabets @param string $name Name of the element to filter @param array $options Keys may include [message] @return boolean
[ "Checks", "if", "the", "contents", "of", "the", "element", "are", "all", "alphabets" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Filterer.php#L197-L205
25,982
ezra-obiwale/dSCore
src/Form/Filterer.php
Filterer.decimal
public function decimal(array $options) { if (ctype_digit($this->elementData)) return true; $this->addError($this->checkMessage('Value can only contain numbers and a dot', $options)); return false; }
php
public function decimal(array $options) { if (ctype_digit($this->elementData)) return true; $this->addError($this->checkMessage('Value can only contain numbers and a dot', $options)); return false; }
[ "public", "function", "decimal", "(", "array", "$", "options", ")", "{", "if", "(", "ctype_digit", "(", "$", "this", "->", "elementData", ")", ")", "return", "true", ";", "$", "this", "->", "addError", "(", "$", "this", "->", "checkMessage", "(", "'Val...
Checks if the content of the element is decimal @param string $name Name of the element to filter @param array $options Keys may include [message] @return boolean
[ "Checks", "if", "the", "content", "of", "the", "element", "is", "decimal" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Filterer.php#L229-L235
25,983
ezra-obiwale/dSCore
src/Form/Filterer.php
Filterer.greaterThan
public function greaterThan(array $options) { if (isset($options['element'])) { if (isset($this->data[$options['element']])) { $than = ' "' . $this->cleanElement($options['element']) . '"'; if ($this->elementData > $this->data[$options['element']] || (empty($this->ele...
php
public function greaterThan(array $options) { if (isset($options['element'])) { if (isset($this->data[$options['element']])) { $than = ' "' . $this->cleanElement($options['element']) . '"'; if ($this->elementData > $this->data[$options['element']] || (empty($this->ele...
[ "public", "function", "greaterThan", "(", "array", "$", "options", ")", "{", "if", "(", "isset", "(", "$", "options", "[", "'element'", "]", ")", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "data", "[", "$", "options", "[", "'element'", "...
Checks if the value of the element is greater than the given value @param string $name Name of the element to filter @param array $options Keys may include [message] @return boolean
[ "Checks", "if", "the", "value", "of", "the", "element", "is", "greater", "than", "the", "given", "value" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Filterer.php#L258-L275
25,984
ezra-obiwale/dSCore
src/Form/Filterer.php
Filterer.lessThan
public function lessThan(array $options) { if (isset($options['element'])) { if (isset($this->data[$options['element']])) { $than = ' "' . $this->cleanElement($options['element']) . '"'; if ($this->elementData < $this->data[$options['element']]) { ...
php
public function lessThan(array $options) { if (isset($options['element'])) { if (isset($this->data[$options['element']])) { $than = ' "' . $this->cleanElement($options['element']) . '"'; if ($this->elementData < $this->data[$options['element']]) { ...
[ "public", "function", "lessThan", "(", "array", "$", "options", ")", "{", "if", "(", "isset", "(", "$", "options", "[", "'element'", "]", ")", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "data", "[", "$", "options", "[", "'element'", "]",...
Checks if the value of the element is less than the given value @param string $name Name of the element to filter @param array $options Keys may include [message] @return boolean
[ "Checks", "if", "the", "value", "of", "the", "element", "is", "less", "than", "the", "given", "value" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Filterer.php#L283-L300
25,985
ezra-obiwale/dSCore
src/Form/Filterer.php
Filterer.minLength
public function minLength(array $options) { if ($options['value'] && strlen($this->elementData) >= $options['value']) return true; $this->addError($this->checkMessage('Length must not be less than ' . $options['value'], $options)); return false; }
php
public function minLength(array $options) { if ($options['value'] && strlen($this->elementData) >= $options['value']) return true; $this->addError($this->checkMessage('Length must not be less than ' . $options['value'], $options)); return false; }
[ "public", "function", "minLength", "(", "array", "$", "options", ")", "{", "if", "(", "$", "options", "[", "'value'", "]", "&&", "strlen", "(", "$", "this", "->", "elementData", ")", ">=", "$", "options", "[", "'value'", "]", ")", "return", "true", "...
Checks if the length of the value of the element is not less than the required length @param string $name Name of the element to filter @param array $options Keys may include [message] @return boolean
[ "Checks", "if", "the", "length", "of", "the", "value", "of", "the", "element", "is", "not", "less", "than", "the", "required", "length" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/Filterer.php#L308-L314
25,986
CodeBlastr/queue
src/Shell/QueueShell.php
QueueShell.main
public function main() { $this->out('CodeBlastr Queue Plugin:'); $this->hr(); $this->out('Usage:'); $this->out(' cake CodeBlastr.Queue help'); $this->out(' -> Display this Help message'); // $this->out(' cake Queue.Queue add <taskname>'); // $this->out(' -> Tr...
php
public function main() { $this->out('CodeBlastr Queue Plugin:'); $this->hr(); $this->out('Usage:'); $this->out(' cake CodeBlastr.Queue help'); $this->out(' -> Display this Help message'); // $this->out(' cake Queue.Queue add <taskname>'); // $this->out(' -> Tr...
[ "public", "function", "main", "(", ")", "{", "$", "this", "->", "out", "(", "'CodeBlastr Queue Plugin:'", ")", ";", "$", "this", "->", "hr", "(", ")", ";", "$", "this", "->", "out", "(", "'Usage:'", ")", ";", "$", "this", "->", "out", "(", "'\tcake...
Output some basic usage Info. @return void
[ "Output", "some", "basic", "usage", "Info", "." ]
8bc37c429406cce1b99c2c9e9dc1a83ad2b0b435
https://github.com/CodeBlastr/queue/blob/8bc37c429406cce1b99c2c9e9dc1a83ad2b0b435/src/Shell/QueueShell.php#L52-L74
25,987
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/GdImage.php
GdImage.dispose
public final function dispose() { if ( $this->disposed ) { return; } if ( \is_resource( $this->r ) ) { \imagedestroy( $this->r ); } $this->r = null; $this->size = null; $this->colors = []; $this->mimeType = null; $thi...
php
public final function dispose() { if ( $this->disposed ) { return; } if ( \is_resource( $this->r ) ) { \imagedestroy( $this->r ); } $this->r = null; $this->size = null; $this->colors = []; $this->mimeType = null; $thi...
[ "public", "final", "function", "dispose", "(", ")", "{", "if", "(", "$", "this", "->", "disposed", ")", "{", "return", ";", "}", "if", "(", "\\", "is_resource", "(", "$", "this", "->", "r", ")", ")", "{", "\\", "imagedestroy", "(", "$", "this", "...
Disposes the current image resource.
[ "Disposes", "the", "current", "image", "resource", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/GdImage.php#L77-L97
25,988
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/GdImage.php
GdImage.output
public final function output( int $quality = 60, string $filename = null ) { \header( 'Expires: 0' ); \header( 'Cache-Control: private' ); \header( 'Pragma: cache' ); if ( empty( $filename ) ) { $filename = \basename( $this->_file ); } else { $filen...
php
public final function output( int $quality = 60, string $filename = null ) { \header( 'Expires: 0' ); \header( 'Cache-Control: private' ); \header( 'Pragma: cache' ); if ( empty( $filename ) ) { $filename = \basename( $this->_file ); } else { $filen...
[ "public", "final", "function", "output", "(", "int", "$", "quality", "=", "60", ",", "string", "$", "filename", "=", "null", ")", "{", "\\", "header", "(", "'Expires: 0'", ")", ";", "\\", "header", "(", "'Cache-Control: private'", ")", ";", "\\", "header...
Outputs the current image, including all required HTTP headers and exit the script. @param integer $quality Image quality if it is an JPEG image. (1-100) @param string $filename Output image file name for HTTP headers.
[ "Outputs", "the", "current", "image", "including", "all", "required", "HTTP", "headers", "and", "exit", "the", "script", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/GdImage.php#L244-L297
25,989
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/GdImage.php
GdImage.negate
public final function negate( bool $internal = false ) : GdImage { if ( ! $internal ) { $clon = clone $this; return $clon->negate( true ); } $w = $this->getWidth(); $h = $this->getHeight(); $im = \imagecreatetruecolor( $w, $h ); for ( $y = 0; $y < $h; ++...
php
public final function negate( bool $internal = false ) : GdImage { if ( ! $internal ) { $clon = clone $this; return $clon->negate( true ); } $w = $this->getWidth(); $h = $this->getHeight(); $im = \imagecreatetruecolor( $w, $h ); for ( $y = 0; $y < $h; ++...
[ "public", "final", "function", "negate", "(", "bool", "$", "internal", "=", "false", ")", ":", "GdImage", "{", "if", "(", "!", "$", "internal", ")", "{", "$", "clon", "=", "clone", "$", "this", ";", "return", "$", "clon", "->", "negate", "(", "true...
Creates a negative of current image. @param boolean $internal Do not create a new instance? @return \Beluga\Drawing\Image\GdImage
[ "Creates", "a", "negative", "of", "current", "image", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/GdImage.php#L377-L413
25,990
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/GdImage.php
GdImage.cropRect
public final function cropRect( Rectangle $rect, bool $internal = true ) : IImage { $thumb = \imagecreatetruecolor( $rect->size->getWidth(), $rect->size->getHeight() ); if ( $this->mimeType == 'image/gif' || $this->mimeType == 'image/png') { \imagealphablending( $thumb, false ); ...
php
public final function cropRect( Rectangle $rect, bool $internal = true ) : IImage { $thumb = \imagecreatetruecolor( $rect->size->getWidth(), $rect->size->getHeight() ); if ( $this->mimeType == 'image/gif' || $this->mimeType == 'image/png') { \imagealphablending( $thumb, false ); ...
[ "public", "final", "function", "cropRect", "(", "Rectangle", "$", "rect", ",", "bool", "$", "internal", "=", "true", ")", ":", "IImage", "{", "$", "thumb", "=", "\\", "imagecreatetruecolor", "(", "$", "rect", "->", "size", "->", "getWidth", "(", ")", "...
Crop the defined image part and returns the current or new image instance. @param \Beluga\Drawing\Rectangle $rect @param boolean $internal Do not create a new instance? @return \Beluga\Drawing\Image\IImage
[ "Crop", "the", "defined", "image", "part", "and", "returns", "the", "current", "or", "new", "image", "instance", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/GdImage.php#L640-L680
25,991
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/GdImage.php
GdImage.contract
public final function contract( int $percent, bool $internal = true ) : IImage { if ( $percent < 1 || $percent >= 100 ) { throw new ArgumentError( 'percent', $percent, 'Drawing.Image', 'Image dimension contraction must produce a smaller, non...
php
public final function contract( int $percent, bool $internal = true ) : IImage { if ( $percent < 1 || $percent >= 100 ) { throw new ArgumentError( 'percent', $percent, 'Drawing.Image', 'Image dimension contraction must produce a smaller, non...
[ "public", "final", "function", "contract", "(", "int", "$", "percent", ",", "bool", "$", "internal", "=", "true", ")", ":", "IImage", "{", "if", "(", "$", "percent", "<", "1", "||", "$", "percent", ">=", "100", ")", "{", "throw", "new", "ArgumentErro...
Reduce the original image size by the specified percentage value. @param int $percent The percentage value. @param bool $internal Do not create a new instance? @return \Beluga\Drawing\Image\IImage @throws \Beluga\ArgumentError If $percent is lower than 1 oder greater than 99.
[ "Reduce", "the", "original", "image", "size", "by", "the", "specified", "percentage", "value", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/GdImage.php#L735-L789
25,992
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/GdImage.php
GdImage.contractToMaxSize
public final function contractToMaxSize( Size $maxsize, bool $internal = true ) : IImage { if ( $maxsize->getWidth() >= $this->size->getWidth() && $maxsize->getHeight() >= $this->size->getHeight() ) { return $this->returnSelf( $internal ); } $newSize = new Size( $...
php
public final function contractToMaxSize( Size $maxsize, bool $internal = true ) : IImage { if ( $maxsize->getWidth() >= $this->size->getWidth() && $maxsize->getHeight() >= $this->size->getHeight() ) { return $this->returnSelf( $internal ); } $newSize = new Size( $...
[ "public", "final", "function", "contractToMaxSize", "(", "Size", "$", "maxsize", ",", "bool", "$", "internal", "=", "true", ")", ":", "IImage", "{", "if", "(", "$", "maxsize", "->", "getWidth", "(", ")", ">=", "$", "this", "->", "size", "->", "getWidth...
Reduce the original image size by holding the image size proportion, to fit best the declared maximum size. @param \Beluga\Drawing\Size $maxsize @param bool $internal Do not create a new instance? @return \Beluga\Drawing\Image\IImage @throws \Beluga\ArgumentError If $maxsize is empty. or bigger than current image
[ "Reduce", "the", "original", "image", "size", "by", "holding", "the", "image", "size", "proportion", "to", "fit", "best", "the", "declared", "maximum", "size", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/GdImage.php#L800-L815
25,993
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/GdImage.php
GdImage.drawSingleBorder
public final function drawSingleBorder( $borderColor, bool $internal = true ) : IImage { $borderColor = $this->getGdColorObject( $borderColor, 'bordercolor' ); if ( $internal ) { \imagerectangle( $this->r, 1, 1, $this->getWidth() - 2, $this->getHeight() - 2, $borderColor->getGdVal...
php
public final function drawSingleBorder( $borderColor, bool $internal = true ) : IImage { $borderColor = $this->getGdColorObject( $borderColor, 'bordercolor' ); if ( $internal ) { \imagerectangle( $this->r, 1, 1, $this->getWidth() - 2, $this->getHeight() - 2, $borderColor->getGdVal...
[ "public", "final", "function", "drawSingleBorder", "(", "$", "borderColor", ",", "bool", "$", "internal", "=", "true", ")", ":", "IImage", "{", "$", "borderColor", "=", "$", "this", "->", "getGdColorObject", "(", "$", "borderColor", ",", "'bordercolor'", ")"...
Draws a single border with defined color around the image. @param string|array|\Beluga\Drawing\ColorGD|\Beluga\Drawing\Color $borderColor @param bool $internal Do not create a new instance? @return \Beluga\Drawing\Image\IImage
[ "Draws", "a", "single", "border", "with", "defined", "color", "around", "the", "image", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/GdImage.php#L1121-L1141
25,994
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/GdImage.php
GdImage.drawDoubleBorder
public final function drawDoubleBorder( $innerBorderColor, $outerBorderColor, bool $internal = true) : IImage { $innerBorderColor = $this->getGdColorObject( $innerBorderColor, 'bordercolor' ); $outerBorderColor = $this->getGdColorObject( $outerBorderColor, 'outerbordercolor' ); if ( $internal...
php
public final function drawDoubleBorder( $innerBorderColor, $outerBorderColor, bool $internal = true) : IImage { $innerBorderColor = $this->getGdColorObject( $innerBorderColor, 'bordercolor' ); $outerBorderColor = $this->getGdColorObject( $outerBorderColor, 'outerbordercolor' ); if ( $internal...
[ "public", "final", "function", "drawDoubleBorder", "(", "$", "innerBorderColor", ",", "$", "outerBorderColor", ",", "bool", "$", "internal", "=", "true", ")", ":", "IImage", "{", "$", "innerBorderColor", "=", "$", "this", "->", "getGdColorObject", "(", "$", ...
Draws a double border with defined colors around the image. @param string|array|\Beluga\Drawing\ColorGD|\Beluga\Drawing\Color $innerBorderColor @param string|array|\Beluga\Drawing\ColorGD|\Beluga\Drawing\Color $outerBorderColor @param bool $internal Do not creat...
[ "Draws", "a", "double", "border", "with", "defined", "colors", "around", "the", "image", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/GdImage.php#L1151-L1166
25,995
SagittariusX/Beluga.Drawing
src/Beluga/Drawing/Image/GdImage.php
GdImage.drawText
public final function drawText( string $text, $font, $fontSize, $color, Point $point, bool $internal = true ) : IImage { $color = $this->getGdColorObject( $color, 'textcolor' ); if ( ! empty( $font ) && \file_exists( $font ) ) { if ( $internal ) { \imaget...
php
public final function drawText( string $text, $font, $fontSize, $color, Point $point, bool $internal = true ) : IImage { $color = $this->getGdColorObject( $color, 'textcolor' ); if ( ! empty( $font ) && \file_exists( $font ) ) { if ( $internal ) { \imaget...
[ "public", "final", "function", "drawText", "(", "string", "$", "text", ",", "$", "font", ",", "$", "fontSize", ",", "$", "color", ",", "Point", "$", "point", ",", "bool", "$", "internal", "=", "true", ")", ":", "IImage", "{", "$", "color", "=", "$"...
Draws a text at declared position into current image. @param string $text The text that should be drawn. @param string $font The font that should be used. For example: For GdImage you can define here the path of the *.ttf font file or NULL. If you define null the parameter $fontSize declares the size + f...
[ "Draws", "a", "text", "at", "declared", "position", "into", "current", "image", "." ]
9c82874cf4ec68cb0af78757b65f19783540004a
https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Image/GdImage.php#L1187-L1217
25,996
net-tools/core
src/Containers/PersistentCache.php
PersistentCache.commit
public function commit() { if ( $this->_initialized && $this->_dirty ) { $this->_saveCache(); $this->_dirty = false; } }
php
public function commit() { if ( $this->_initialized && $this->_dirty ) { $this->_saveCache(); $this->_dirty = false; } }
[ "public", "function", "commit", "(", ")", "{", "if", "(", "$", "this", "->", "_initialized", "&&", "$", "this", "->", "_dirty", ")", "{", "$", "this", "->", "_saveCache", "(", ")", ";", "$", "this", "->", "_dirty", "=", "false", ";", "}", "}" ]
Commit cache content updates to storage
[ "Commit", "cache", "content", "updates", "to", "storage" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Containers/PersistentCache.php#L157-L164
25,997
k3ssen/BaseAdminBundle
Controller/CrudController.php
CrudController.redirectToRoute
protected function redirectToRoute(string $route, $parameters = [], int $status = 302): RedirectResponse { return $this->redirect($this->generateUrl($route, $parameters), $status); }
php
protected function redirectToRoute(string $route, $parameters = [], int $status = 302): RedirectResponse { return $this->redirect($this->generateUrl($route, $parameters), $status); }
[ "protected", "function", "redirectToRoute", "(", "string", "$", "route", ",", "$", "parameters", "=", "[", "]", ",", "int", "$", "status", "=", "302", ")", ":", "RedirectResponse", "{", "return", "$", "this", "->", "redirect", "(", "$", "this", "->", "...
Returns a RedirectResponse to the given route with the given parameters. Overwrites Controller-trait to allow parameters as object as well.
[ "Returns", "a", "RedirectResponse", "to", "the", "given", "route", "with", "the", "given", "parameters", ".", "Overwrites", "Controller", "-", "trait", "to", "allow", "parameters", "as", "object", "as", "well", "." ]
d0af699b097f48d92883713eafd36ee9069460bb
https://github.com/k3ssen/BaseAdminBundle/blob/d0af699b097f48d92883713eafd36ee9069460bb/Controller/CrudController.php#L36-L39
25,998
k3ssen/BaseAdminBundle
Controller/CrudController.php
CrudController.isDeletable
protected function isDeletable($object): bool { $em = $this->getEntityManager(); $em->beginTransaction(); try { // if an object is softdeleteable, then set 'deletedAt' first, so that a 'hard-delete' will be attempted. if ($object instanceof SoftDeleteableInterface) { ...
php
protected function isDeletable($object): bool { $em = $this->getEntityManager(); $em->beginTransaction(); try { // if an object is softdeleteable, then set 'deletedAt' first, so that a 'hard-delete' will be attempted. if ($object instanceof SoftDeleteableInterface) { ...
[ "protected", "function", "isDeletable", "(", "$", "object", ")", ":", "bool", "{", "$", "em", "=", "$", "this", "->", "getEntityManager", "(", ")", ";", "$", "em", "->", "beginTransaction", "(", ")", ";", "try", "{", "// if an object is softdeleteable, then ...
Tries to delete an object without actually deleting it. Returns false if ForeignKeyConstraintViolationException would be thrown; true otherwise.
[ "Tries", "to", "delete", "an", "object", "without", "actually", "deleting", "it", ".", "Returns", "false", "if", "ForeignKeyConstraintViolationException", "would", "be", "thrown", ";", "true", "otherwise", "." ]
d0af699b097f48d92883713eafd36ee9069460bb
https://github.com/k3ssen/BaseAdminBundle/blob/d0af699b097f48d92883713eafd36ee9069460bb/Controller/CrudController.php#L111-L128
25,999
rutger-speksnijder/restphp
src/RestPHP/Configuration.php
Configuration.createFromFile
public function createFromFile($file) { // Check if the file exists if (!$file || !file_exists($file)) { throw new \Exception("Configuration file \"{$file}\" could not be found."); } // Include the file while suppressing warnings // - so we can check if we could ...
php
public function createFromFile($file) { // Check if the file exists if (!$file || !file_exists($file)) { throw new \Exception("Configuration file \"{$file}\" could not be found."); } // Include the file while suppressing warnings // - so we can check if we could ...
[ "public", "function", "createFromFile", "(", "$", "file", ")", "{", "// Check if the file exists", "if", "(", "!", "$", "file", "||", "!", "file_exists", "(", "$", "file", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "\"Configuration file \\\"{$file}...
Creates a configuration object by loading the parameters from a file. This file has to be a PHP file returning an array with the parameters. @param string $file The path to the file. @throws Exception Throws an exception if the file can't be found. @throws Exception Throws an exception if the file could not be includ...
[ "Creates", "a", "configuration", "object", "by", "loading", "the", "parameters", "from", "a", "file", ".", "This", "file", "has", "to", "be", "a", "PHP", "file", "returning", "an", "array", "with", "the", "parameters", "." ]
326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d
https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/Configuration.php#L123-L148