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
22,500
42mate/towel
src/Towel/Controller/User.php
User.logoutAction
public function logoutAction() { if ($this->isAuthenticated()) { $this->session()->set('user', null); } $this->setMessage('success', 'Bye Bye !'); return $this->redirect('/'); }
php
public function logoutAction() { if ($this->isAuthenticated()) { $this->session()->set('user', null); } $this->setMessage('success', 'Bye Bye !'); return $this->redirect('/'); }
[ "public", "function", "logoutAction", "(", ")", "{", "if", "(", "$", "this", "->", "isAuthenticated", "(", ")", ")", "{", "$", "this", "->", "session", "(", ")", "->", "set", "(", "'user'", ",", "null", ")", ";", "}", "$", "this", "->", "setMessage...
Handles the logout actions. @return \Symfony\Component\HttpFoundation\RedirectResponse
[ "Handles", "the", "logout", "actions", "." ]
5316c3075fc844e8a5cbae113712b26556227dff
https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/User.php#L67-L75
22,501
42mate/towel
src/Towel/Controller/User.php
User.registerAction
public function registerAction($request) { $modelUser = new ModelUser(); $data = $request->get('data'); $error = false; if ($this->isAuthenticated()) { $this->setMessage('error', 'You are logged in'); $error = true; } if (!filter_var($data['m...
php
public function registerAction($request) { $modelUser = new ModelUser(); $data = $request->get('data'); $error = false; if ($this->isAuthenticated()) { $this->setMessage('error', 'You are logged in'); $error = true; } if (!filter_var($data['m...
[ "public", "function", "registerAction", "(", "$", "request", ")", "{", "$", "modelUser", "=", "new", "ModelUser", "(", ")", ";", "$", "data", "=", "$", "request", "->", "get", "(", "'data'", ")", ";", "$", "error", "=", "false", ";", "if", "(", "$"...
Shows register form. @param $request @return string|\Symfony\Component\HttpFoundation\RedirectResponse
[ "Shows", "register", "form", "." ]
5316c3075fc844e8a5cbae113712b26556227dff
https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/User.php#L94-L150
22,502
42mate/towel
src/Towel/Controller/User.php
User.recoverAction
public function recoverAction($request) { $data = $request->get('data'); $modelUser = new ModelUser; if ($this->isAuthenticated()) { $this->setMessage('error', 'Your are already authenticated.'); return $this->redirect('/'); } if (!filter_var($data['...
php
public function recoverAction($request) { $data = $request->get('data'); $modelUser = new ModelUser; if ($this->isAuthenticated()) { $this->setMessage('error', 'Your are already authenticated.'); return $this->redirect('/'); } if (!filter_var($data['...
[ "public", "function", "recoverAction", "(", "$", "request", ")", "{", "$", "data", "=", "$", "request", "->", "get", "(", "'data'", ")", ";", "$", "modelUser", "=", "new", "ModelUser", ";", "if", "(", "$", "this", "->", "isAuthenticated", "(", ")", "...
Handles the recover action. @param $request @return string|\Symfony\Component\HttpFoundation\RedirectResponse
[ "Handles", "the", "recover", "action", "." ]
5316c3075fc844e8a5cbae113712b26556227dff
https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/User.php#L169-L197
22,503
buse974/JRpc
src/JRpc/Json/Server/Server.php
Server.initializeClass
public function initializeClass() { if (!isset($this->options['services']) || !is_array($this->options['services'])) { return; } if ($this->getPersistence() && $this->getCache() !== null && ($definition = $this->getCache()->getItem('jrpc-definition')) !== null && ($servi...
php
public function initializeClass() { if (!isset($this->options['services']) || !is_array($this->options['services'])) { return; } if ($this->getPersistence() && $this->getCache() !== null && ($definition = $this->getCache()->getItem('jrpc-definition')) !== null && ($servi...
[ "public", "function", "initializeClass", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "options", "[", "'services'", "]", ")", "||", "!", "is_array", "(", "$", "this", "->", "options", "[", "'services'", "]", ")", ")", "{", "return"...
Initialize all class.
[ "Initialize", "all", "class", "." ]
c6100a5984d20a1ea00c43d41d3a022f2878b17f
https://github.com/buse974/JRpc/blob/c6100a5984d20a1ea00c43d41d3a022f2878b17f/src/JRpc/Json/Server/Server.php#L125-L146
22,504
buse974/JRpc
src/JRpc/Json/Server/Server.php
Server.getPersistence
public function getPersistence() { if (null === $this->persistence) { $this->persistence = (isset($this->options['persistence']) && $this->options['persistence'] == true); } return $this->persistence; }
php
public function getPersistence() { if (null === $this->persistence) { $this->persistence = (isset($this->options['persistence']) && $this->options['persistence'] == true); } return $this->persistence; }
[ "public", "function", "getPersistence", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "persistence", ")", "{", "$", "this", "->", "persistence", "=", "(", "isset", "(", "$", "this", "->", "options", "[", "'persistence'", "]", ")", "&&", ...
Check persistance. @return bool
[ "Check", "persistance", "." ]
c6100a5984d20a1ea00c43d41d3a022f2878b17f
https://github.com/buse974/JRpc/blob/c6100a5984d20a1ea00c43d41d3a022f2878b17f/src/JRpc/Json/Server/Server.php#L296-L303
22,505
buse974/JRpc
src/JRpc/Json/Server/Server.php
Server.getCache
public function getCache() { if (null === $this->cache) { if (isset($this->options['cache']) && is_string($this->options['cache'])) { $this->cache = $this->container->get($this->options['cache']); } } return $this->cache; }
php
public function getCache() { if (null === $this->cache) { if (isset($this->options['cache']) && is_string($this->options['cache'])) { $this->cache = $this->container->get($this->options['cache']); } } return $this->cache; }
[ "public", "function", "getCache", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "cache", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "options", "[", "'cache'", "]", ")", "&&", "is_string", "(", "$", "this", "->", "options", ...
Get Storage if define in config. @return \Zend\Cache\Storage\StorageInterface|null
[ "Get", "Storage", "if", "define", "in", "config", "." ]
c6100a5984d20a1ea00c43d41d3a022f2878b17f
https://github.com/buse974/JRpc/blob/c6100a5984d20a1ea00c43d41d3a022f2878b17f/src/JRpc/Json/Server/Server.php#L310-L319
22,506
buse974/JRpc
src/JRpc/Json/Server/Server.php
Server.setEventManager
public function setEventManager(\Zend\EventManager\EventManagerInterface $events) { $this->events = $events; $this->events->setIdentifiers([__CLASS__,get_called_class()]); return $this; }
php
public function setEventManager(\Zend\EventManager\EventManagerInterface $events) { $this->events = $events; $this->events->setIdentifiers([__CLASS__,get_called_class()]); return $this; }
[ "public", "function", "setEventManager", "(", "\\", "Zend", "\\", "EventManager", "\\", "EventManagerInterface", "$", "events", ")", "{", "$", "this", "->", "events", "=", "$", "events", ";", "$", "this", "->", "events", "->", "setIdentifiers", "(", "[", "...
Inject an EventManager instance. @param \Zend\EventManager\EventManagerInterface $eventManager
[ "Inject", "an", "EventManager", "instance", "." ]
c6100a5984d20a1ea00c43d41d3a022f2878b17f
https://github.com/buse974/JRpc/blob/c6100a5984d20a1ea00c43d41d3a022f2878b17f/src/JRpc/Json/Server/Server.php#L326-L332
22,507
rhosocial/yii2-user
User.php
User.getCacheTag
public function getCacheTag() { return $this->cacheTagPrefix . ($this->isAttributeChanged($this->idAttribute) ? $this->getOldAttribute($this->idAttribute) : $this->getID()); }
php
public function getCacheTag() { return $this->cacheTagPrefix . ($this->isAttributeChanged($this->idAttribute) ? $this->getOldAttribute($this->idAttribute) : $this->getID()); }
[ "public", "function", "getCacheTag", "(", ")", "{", "return", "$", "this", "->", "cacheTagPrefix", ".", "(", "$", "this", "->", "isAttributeChanged", "(", "$", "this", "->", "idAttribute", ")", "?", "$", "this", "->", "getOldAttribute", "(", "$", "this", ...
Get cache tag. The cache tag ends with the user ID, but after the user ID is modified, the old ID will prevail. @return string
[ "Get", "cache", "tag", ".", "The", "cache", "tag", "ends", "with", "the", "user", "ID", "but", "after", "the", "user", "ID", "is", "modified", "the", "old", "ID", "will", "prevail", "." ]
96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc
https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/User.php#L199-L203
22,508
zicht/z
src/Zicht/Tool/Configuration/ConfigurationLoader.php
ConfigurationLoader.fromEnv
public static function fromEnv($configFilename, Version $version) { if (null === $configFilename) { $configFilename = getenv('ZFILE') ? getenv('ZFILE') : 'z.yml'; } return new self( $configFilename, new PathDefaultFileLocator('ZPATH', array(getcwd(), gete...
php
public static function fromEnv($configFilename, Version $version) { if (null === $configFilename) { $configFilename = getenv('ZFILE') ? getenv('ZFILE') : 'z.yml'; } return new self( $configFilename, new PathDefaultFileLocator('ZPATH', array(getcwd(), gete...
[ "public", "static", "function", "fromEnv", "(", "$", "configFilename", ",", "Version", "$", "version", ")", "{", "if", "(", "null", "===", "$", "configFilename", ")", "{", "$", "configFilename", "=", "getenv", "(", "'ZFILE'", ")", "?", "getenv", "(", "'Z...
Create the configuration loader based the current shell environment variables. @param string $configFilename @param Version $version @return ConfigurationLoader @codeCoverageIgnore
[ "Create", "the", "configuration", "loader", "based", "the", "current", "shell", "environment", "variables", "." ]
6a1731dad20b018555a96b726a61d4bf8ec8c886
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Configuration/ConfigurationLoader.php#L29-L46
22,509
zicht/z
src/Zicht/Tool/Configuration/ConfigurationLoader.php
ConfigurationLoader.processConfiguration
public function processConfiguration() { Debug::enterScope('config'); Debug::enterScope('load'); try { $zfiles = (array)$this->configLocator->locate($this->configFilename, null, false); } catch (\InvalidArgumentException $e) { $zfiles = array(); } ...
php
public function processConfiguration() { Debug::enterScope('config'); Debug::enterScope('load'); try { $zfiles = (array)$this->configLocator->locate($this->configFilename, null, false); } catch (\InvalidArgumentException $e) { $zfiles = array(); } ...
[ "public", "function", "processConfiguration", "(", ")", "{", "Debug", "::", "enterScope", "(", "'config'", ")", ";", "Debug", "::", "enterScope", "(", "'load'", ")", ";", "try", "{", "$", "zfiles", "=", "(", "array", ")", "$", "this", "->", "configLocato...
Processes the configuration contents @return array @throws \UnexpectedValueException
[ "Processes", "the", "configuration", "contents" ]
6a1731dad20b018555a96b726a61d4bf8ec8c886
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Configuration/ConfigurationLoader.php#L89-L121
22,510
zicht/z
src/Zicht/Tool/Configuration/ConfigurationLoader.php
ConfigurationLoader.loadPlugin
protected function loadPlugin($name, $file) { require_once $file; $className = sprintf('Zicht\Tool\Plugin\%s\Plugin', ucfirst(basename($name))); $class = new \ReflectionClass($className); if (!$class->implementsInterface('Zicht\Tool\PluginInterface')) { throw new \Une...
php
protected function loadPlugin($name, $file) { require_once $file; $className = sprintf('Zicht\Tool\Plugin\%s\Plugin', ucfirst(basename($name))); $class = new \ReflectionClass($className); if (!$class->implementsInterface('Zicht\Tool\PluginInterface')) { throw new \Une...
[ "protected", "function", "loadPlugin", "(", "$", "name", ",", "$", "file", ")", "{", "require_once", "$", "file", ";", "$", "className", "=", "sprintf", "(", "'Zicht\\Tool\\Plugin\\%s\\Plugin'", ",", "ucfirst", "(", "basename", "(", "$", "name", ")", ")", ...
Load the specified plugin instance. @param string $name @param string $file @return void @throws \UnexpectedValueException
[ "Load", "the", "specified", "plugin", "instance", "." ]
6a1731dad20b018555a96b726a61d4bf8ec8c886
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Configuration/ConfigurationLoader.php#L133-L142
22,511
Erdiko/core
src/Layout.php
Layout.getTemplateFile
public function getTemplateFile($filename, $data) { $data['getRegion'] = function($name) { return $this->getRegion($name); }; // This is for mustache compatibility // Push the data into regions and then pass a pointer to this class to the layout // $this->setRegion...
php
public function getTemplateFile($filename, $data) { $data['getRegion'] = function($name) { return $this->getRegion($name); }; // This is for mustache compatibility // Push the data into regions and then pass a pointer to this class to the layout // $this->setRegion...
[ "public", "function", "getTemplateFile", "(", "$", "filename", ",", "$", "data", ")", "{", "$", "data", "[", "'getRegion'", "]", "=", "function", "(", "$", "name", ")", "{", "return", "$", "this", "->", "getRegion", "(", "$", "name", ")", ";", "}", ...
Get template file @param string $filename @param mixed $data Typically a string, Container object or other object @return string @todo array merge regions with data
[ "Get", "template", "file" ]
c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Layout.php#L73-L82
22,512
Erdiko/core
src/Layout.php
Layout.getRegion
public function getRegion($name) { if(array_key_exists($name, $this->_regions)) { $html = (is_subclass_of($this->_regions[$name], 'erdiko\core\Container')) ? $this->_regions[$name]->toHtml() : $this->_regions[$name]; } else { throw new \Exception("Template reg...
php
public function getRegion($name) { if(array_key_exists($name, $this->_regions)) { $html = (is_subclass_of($this->_regions[$name], 'erdiko\core\Container')) ? $this->_regions[$name]->toHtml() : $this->_regions[$name]; } else { throw new \Exception("Template reg...
[ "public", "function", "getRegion", "(", "$", "name", ")", "{", "if", "(", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "_regions", ")", ")", "{", "$", "html", "=", "(", "is_subclass_of", "(", "$", "this", "->", "_regions", "[", "$", ...
get rendered region @param string $name @return mixed $content, typically a string, Container object or other object
[ "get", "rendered", "region" ]
c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Layout.php#L169-L179
22,513
juskiewicz/Geolocation
src/Geolocation.php
Geolocation.getAddresses
public function getAddresses(CoordinatesInterface $coordinates) : AddressCollection { $url = $this->coordinatesQuery($coordinates); $json = $this->fetchUrl($url); // convert google data to address collection $results = []; foreach ($json->results as $result) { $a...
php
public function getAddresses(CoordinatesInterface $coordinates) : AddressCollection { $url = $this->coordinatesQuery($coordinates); $json = $this->fetchUrl($url); // convert google data to address collection $results = []; foreach ($json->results as $result) { $a...
[ "public", "function", "getAddresses", "(", "CoordinatesInterface", "$", "coordinates", ")", ":", "AddressCollection", "{", "$", "url", "=", "$", "this", "->", "coordinatesQuery", "(", "$", "coordinates", ")", ";", "$", "json", "=", "$", "this", "->", "fetchU...
Get possible addresses using CoordinatesInterface @param CoordinatesInterface $coordinates @return AddressCollection
[ "Get", "possible", "addresses", "using", "CoordinatesInterface" ]
5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d
https://github.com/juskiewicz/Geolocation/blob/5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d/src/Geolocation.php#L69-L83
22,514
juskiewicz/Geolocation
src/Geolocation.php
Geolocation.getCoordinatesByObject
public function getCoordinatesByObject(AddressInterface $address) : CoordinatesInterface { $url = $this->addressQuery($address->getFormattedAddress()); $json = $this->fetchUrl($url); // convert google data to coordinates $coordinates = CoordinatesBuild::create($json->results[0]); ...
php
public function getCoordinatesByObject(AddressInterface $address) : CoordinatesInterface { $url = $this->addressQuery($address->getFormattedAddress()); $json = $this->fetchUrl($url); // convert google data to coordinates $coordinates = CoordinatesBuild::create($json->results[0]); ...
[ "public", "function", "getCoordinatesByObject", "(", "AddressInterface", "$", "address", ")", ":", "CoordinatesInterface", "{", "$", "url", "=", "$", "this", "->", "addressQuery", "(", "$", "address", "->", "getFormattedAddress", "(", ")", ")", ";", "$", "json...
Get coordinates using AddressInterface @param AddressInterface $address @return CoordinatesInterface
[ "Get", "coordinates", "using", "AddressInterface" ]
5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d
https://github.com/juskiewicz/Geolocation/blob/5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d/src/Geolocation.php#L91-L100
22,515
juskiewicz/Geolocation
src/Geolocation.php
Geolocation.getCoordinatesByString
public function getCoordinatesByString(string $address) : CoordinatesInterface { $url = $this->addressQuery($address); $json = $this->fetchUrl($url); // convert google data to coordinates $coordinates = CoordinatesBuild::create($json->results[0]); return $coordinates; }
php
public function getCoordinatesByString(string $address) : CoordinatesInterface { $url = $this->addressQuery($address); $json = $this->fetchUrl($url); // convert google data to coordinates $coordinates = CoordinatesBuild::create($json->results[0]); return $coordinates; }
[ "public", "function", "getCoordinatesByString", "(", "string", "$", "address", ")", ":", "CoordinatesInterface", "{", "$", "url", "=", "$", "this", "->", "addressQuery", "(", "$", "address", ")", ";", "$", "json", "=", "$", "this", "->", "fetchUrl", "(", ...
Get coordinates using string @param string $address @return CoordinatesInterface
[ "Get", "coordinates", "using", "string" ]
5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d
https://github.com/juskiewicz/Geolocation/blob/5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d/src/Geolocation.php#L108-L117
22,516
juskiewicz/Geolocation
src/Geolocation.php
Geolocation.coordinatesQuery
private function coordinatesQuery(CoordinatesInterface $coordinates) : string { $url = sprintf(self::API_COORDINATES_URL_SSL, $coordinates->getLatitude(), $coordinates->getLongitude()); $url = $this->buildQuery($url, $this->apiKey, $this->locale, $this->region); return $url; }
php
private function coordinatesQuery(CoordinatesInterface $coordinates) : string { $url = sprintf(self::API_COORDINATES_URL_SSL, $coordinates->getLatitude(), $coordinates->getLongitude()); $url = $this->buildQuery($url, $this->apiKey, $this->locale, $this->region); return $url; }
[ "private", "function", "coordinatesQuery", "(", "CoordinatesInterface", "$", "coordinates", ")", ":", "string", "{", "$", "url", "=", "sprintf", "(", "self", "::", "API_COORDINATES_URL_SSL", ",", "$", "coordinates", "->", "getLatitude", "(", ")", ",", "$", "co...
Build coordinates query @param CoordinatesInterface $coordinates @return string
[ "Build", "coordinates", "query" ]
5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d
https://github.com/juskiewicz/Geolocation/blob/5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d/src/Geolocation.php#L125-L131
22,517
juskiewicz/Geolocation
src/Geolocation.php
Geolocation.addressQuery
private function addressQuery(string $formattedAddress) : string { $url = sprintf(self::API_ADDRESS_URL_SSL, rawurlencode($formattedAddress)); $url = $this->buildQuery($url, $this->apiKey, $this->locale, $this->region); return $url; }
php
private function addressQuery(string $formattedAddress) : string { $url = sprintf(self::API_ADDRESS_URL_SSL, rawurlencode($formattedAddress)); $url = $this->buildQuery($url, $this->apiKey, $this->locale, $this->region); return $url; }
[ "private", "function", "addressQuery", "(", "string", "$", "formattedAddress", ")", ":", "string", "{", "$", "url", "=", "sprintf", "(", "self", "::", "API_ADDRESS_URL_SSL", ",", "rawurlencode", "(", "$", "formattedAddress", ")", ")", ";", "$", "url", "=", ...
Build address query @param string $formattedAddress @return string
[ "Build", "address", "query" ]
5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d
https://github.com/juskiewicz/Geolocation/blob/5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d/src/Geolocation.php#L139-L145
22,518
juskiewicz/Geolocation
src/Geolocation.php
Geolocation.buildQuery
private function buildQuery(string $url, string $apiKey, string $locale = null, string $region = null) : string { if (null !== $apiKey) { $url = sprintf('%s&key=%s', $url, $apiKey); } if (null !== $locale) { $url = sprintf('%s&language=%s', $url, $locale); } ...
php
private function buildQuery(string $url, string $apiKey, string $locale = null, string $region = null) : string { if (null !== $apiKey) { $url = sprintf('%s&key=%s', $url, $apiKey); } if (null !== $locale) { $url = sprintf('%s&language=%s', $url, $locale); } ...
[ "private", "function", "buildQuery", "(", "string", "$", "url", ",", "string", "$", "apiKey", ",", "string", "$", "locale", "=", "null", ",", "string", "$", "region", "=", "null", ")", ":", "string", "{", "if", "(", "null", "!==", "$", "apiKey", ")",...
build query with extra params @param string $url @param string $locale @param string $region @param string $apiKey @return string
[ "build", "query", "with", "extra", "params" ]
5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d
https://github.com/juskiewicz/Geolocation/blob/5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d/src/Geolocation.php#L157-L170
22,519
wenbinye/PhalconX
src/Validation/Validation.php
Validation.validate
public function validate($model, $validators = null) { if (isset($validators) && is_array($validators)) { $validation = $this->validateArray($model, $validators); } else { $validation = $this->validateModel($model); } if ($validation) { $errors = $...
php
public function validate($model, $validators = null) { if (isset($validators) && is_array($validators)) { $validation = $this->validateArray($model, $validators); } else { $validation = $this->validateModel($model); } if ($validation) { $errors = $...
[ "public", "function", "validate", "(", "$", "model", ",", "$", "validators", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "validators", ")", "&&", "is_array", "(", "$", "validators", ")", ")", "{", "$", "validation", "=", "$", "this", "->", ...
Validate model object @param object|array $model @param array $validators @throws ValidationException
[ "Validate", "model", "object" ]
0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Validation/Validation.php#L66-L79
22,520
wenbinye/PhalconX
src/Validation/Validation.php
Validation.createForm
public function createForm($model, $formClass = null) { if (is_string($model)) { return $this->createFormInternal($model, new $model, $formClass); } else { return $this->createFormInternal(get_class($model), $model, $formClass); } }
php
public function createForm($model, $formClass = null) { if (is_string($model)) { return $this->createFormInternal($model, new $model, $formClass); } else { return $this->createFormInternal(get_class($model), $model, $formClass); } }
[ "public", "function", "createForm", "(", "$", "model", ",", "$", "formClass", "=", "null", ")", "{", "if", "(", "is_string", "(", "$", "model", ")", ")", "{", "return", "$", "this", "->", "createFormInternal", "(", "$", "model", ",", "new", "$", "mod...
Create form object @param string|object $model model class or object @param string $formClass form class, default use Phalcon\Forms\Form @return Phalcon\Forms\Form
[ "Create", "form", "object" ]
0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Validation/Validation.php#L88-L95
22,521
wenbinye/PhalconX
src/Validation/Validation.php
Validation.getLabels
private function getLabels($annotations) { $it = $this->getAnnotations()->filter($annotations) ->is(Label::class) ->onProperties(); $labels = []; foreach ($it as $annotation) { $labels[$annotation->getPropertyName()] = $annotation->value; } ...
php
private function getLabels($annotations) { $it = $this->getAnnotations()->filter($annotations) ->is(Label::class) ->onProperties(); $labels = []; foreach ($it as $annotation) { $labels[$annotation->getPropertyName()] = $annotation->value; } ...
[ "private", "function", "getLabels", "(", "$", "annotations", ")", "{", "$", "it", "=", "$", "this", "->", "getAnnotations", "(", ")", "->", "filter", "(", "$", "annotations", ")", "->", "is", "(", "Label", "::", "class", ")", "->", "onProperties", "(",...
Gets property labels @return array
[ "Gets", "property", "labels" ]
0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Validation/Validation.php#L131-L141
22,522
wenbinye/PhalconX
src/Validation/Validation.php
Validation.getValidators
private function getValidators($annotations, $class) { $validators = []; $it = $this->getAnnotations()->filter($annotations) ->is(ValidatorInterface::class) ->onProperties(); foreach ($it as $annotation) { $property = $annotation->getPropertyName(); ...
php
private function getValidators($annotations, $class) { $validators = []; $it = $this->getAnnotations()->filter($annotations) ->is(ValidatorInterface::class) ->onProperties(); foreach ($it as $annotation) { $property = $annotation->getPropertyName(); ...
[ "private", "function", "getValidators", "(", "$", "annotations", ",", "$", "class", ")", "{", "$", "validators", "=", "[", "]", ";", "$", "it", "=", "$", "this", "->", "getAnnotations", "(", ")", "->", "filter", "(", "$", "annotations", ")", "->", "i...
Gets all validators @return array
[ "Gets", "all", "validators" ]
0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Validation/Validation.php#L177-L197
22,523
wenbinye/PhalconX
src/Validation/Validation.php
Validation.getElements
private function getElements($annotations, $formClass) { $labels = $this->getLabels($annotations); $reflection = new \ReflectionClass($formClass); $defaultValues = $reflection->getDefaultProperties(); $elements = []; $it = $this->getAnnotations()->filter($annotations) ...
php
private function getElements($annotations, $formClass) { $labels = $this->getLabels($annotations); $reflection = new \ReflectionClass($formClass); $defaultValues = $reflection->getDefaultProperties(); $elements = []; $it = $this->getAnnotations()->filter($annotations) ...
[ "private", "function", "getElements", "(", "$", "annotations", ",", "$", "formClass", ")", "{", "$", "labels", "=", "$", "this", "->", "getLabels", "(", "$", "annotations", ")", ";", "$", "reflection", "=", "new", "\\", "ReflectionClass", "(", "$", "form...
Gets all form elements @return array key is property, value is Phalcon\Form\Element object
[ "Gets", "all", "form", "elements" ]
0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Validation/Validation.php#L204-L234
22,524
gedex/php-janrain-api
lib/Janrain/Api/Capture/Settings.php
Settings.getSingle
public function getSingle($key, $forClientId = null) { $params = array('key' => $key); if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/get', $params); }
php
public function getSingle($key, $forClientId = null) { $params = array('key' => $key); if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/get', $params); }
[ "public", "function", "getSingle", "(", "$", "key", ",", "$", "forClientId", "=", "null", ")", "{", "$", "params", "=", "array", "(", "'key'", "=>", "$", "key", ")", ";", "if", "(", "$", "forClientId", ")", "{", "$", "params", "[", "'for_client_id'",...
Get the value associated with a key for a particular `client_id`. If the key has not value for that client, then return the key's default value for the application, or if they key has not default value, then return null. @param string $key The key whose value you want to retrieve. To find out the values available, use...
[ "Get", "the", "value", "associated", "with", "a", "key", "for", "a", "particular", "client_id", ".", "If", "the", "key", "has", "not", "value", "for", "that", "client", "then", "return", "the", "key", "s", "default", "value", "for", "the", "application", ...
6283f68454e0ad5211ac620f1d337df38cd49597
https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Capture/Settings.php#L23-L32
22,525
gedex/php-janrain-api
lib/Janrain/Api/Capture/Settings.php
Settings.items
public function items($forClientId = null) { $params = array(); if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/items', $params); }
php
public function items($forClientId = null) { $params = array(); if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/items', $params); }
[ "public", "function", "items", "(", "$", "forClientId", "=", "null", ")", "{", "$", "params", "=", "array", "(", ")", ";", "if", "(", "$", "forClientId", ")", "{", "$", "params", "[", "'for_client_id'", "]", "=", "$", "forClientId", ";", "}", "return...
Get all settings for a particular client, including those from the application- wide default settings. If a key is defined in both the client and application settings, only the client-specific value is returned. @param string $forClientId The client identifier whose settings will be retrieved. If you do not enter a va...
[ "Get", "all", "settings", "for", "a", "particular", "client", "including", "those", "from", "the", "application", "-", "wide", "default", "settings", ".", "If", "a", "key", "is", "defined", "in", "both", "the", "client", "and", "application", "settings", "on...
6283f68454e0ad5211ac620f1d337df38cd49597
https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Capture/Settings.php#L70-L78
22,526
gedex/php-janrain-api
lib/Janrain/Api/Capture/Settings.php
Settings.keys
public function keys($forClientId = null) { $params = array(); if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/keys', $params); }
php
public function keys($forClientId = null) { $params = array(); if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/keys', $params); }
[ "public", "function", "keys", "(", "$", "forClientId", "=", "null", ")", "{", "$", "params", "=", "array", "(", ")", ";", "if", "(", "$", "forClientId", ")", "{", "$", "params", "[", "'for_client_id'", "]", "=", "$", "forClientId", ";", "}", "return"...
Get all keys for a particular client, including those from the application- wide default settings. Returns an array of the keys. @param string $forClientId The client identifier whose setting will be modified. If you do not enter a value for this parameter, it defaults to the value of the `client_id`, that is, you are...
[ "Get", "all", "keys", "for", "a", "particular", "client", "including", "those", "from", "the", "application", "-", "wide", "default", "settings", ".", "Returns", "an", "array", "of", "the", "keys", "." ]
6283f68454e0ad5211ac620f1d337df38cd49597
https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Capture/Settings.php#L90-L98
22,527
gedex/php-janrain-api
lib/Janrain/Api/Capture/Settings.php
Settings.set
public function set($key, $value, $forClientId = null) { $params = array('key' => $key, 'value' => $value); if (is_array($value)) { $params['value'] = json_encode($value); } if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/set', $params); }
php
public function set($key, $value, $forClientId = null) { $params = array('key' => $key, 'value' => $value); if (is_array($value)) { $params['value'] = json_encode($value); } if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/set', $params); }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ",", "$", "forClientId", "=", "null", ")", "{", "$", "params", "=", "array", "(", "'key'", "=>", "$", "key", ",", "'value'", "=>", "$", "value", ")", ";", "if", "(", "is_array", "("...
Assign a key-value pair for a particular `client_id`. If the key does not exist, it will be created. If they key already exists, this call overwrites the existing value. Returns a boolean that indicates whether the key already existed. True indicates the key has been overwritten. False indicates that a new key has bee...
[ "Assign", "a", "key", "-", "value", "pair", "for", "a", "particular", "client_id", ".", "If", "the", "key", "does", "not", "exist", "it", "will", "be", "created", ".", "If", "they", "key", "already", "exists", "this", "call", "overwrites", "the", "existi...
6283f68454e0ad5211ac620f1d337df38cd49597
https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Capture/Settings.php#L121-L133
22,528
gedex/php-janrain-api
lib/Janrain/Api/Capture/Settings.php
Settings.setMulti
public function setMulti(array $items, $forClientId = null) { $params = array('items' => json_encode($items)); if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/set_multi', $params); }
php
public function setMulti(array $items, $forClientId = null) { $params = array('items' => json_encode($items)); if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/set_multi', $params); }
[ "public", "function", "setMulti", "(", "array", "$", "items", ",", "$", "forClientId", "=", "null", ")", "{", "$", "params", "=", "array", "(", "'items'", "=>", "json_encode", "(", "$", "items", ")", ")", ";", "if", "(", "$", "forClientId", ")", "{",...
Assign multiple settings for a particular `client_id`. Returns a JSON object in which each key is mapped to a boolean that indicates whether the key already existed. True indicates that a previous key did exist and has been overwritten. False indicates that there were no previous key and a new key has been created. Doe...
[ "Assign", "multiple", "settings", "for", "a", "particular", "client_id", ".", "Returns", "a", "JSON", "object", "in", "which", "each", "key", "is", "mapped", "to", "a", "boolean", "that", "indicates", "whether", "the", "key", "already", "existed", ".", "True...
6283f68454e0ad5211ac620f1d337df38cd49597
https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Capture/Settings.php#L151-L160
22,529
gedex/php-janrain-api
lib/Janrain/Api/Capture/Settings.php
Settings.setDefault
public function setDefault($key, $value) { $params = array('key' => $key, 'value' => $value); if (is_array($value)) { $params['value'] = json_encode($value); } return $this->post('settings/set_default', $params); }
php
public function setDefault($key, $value) { $params = array('key' => $key, 'value' => $value); if (is_array($value)) { $params['value'] = json_encode($value); } return $this->post('settings/set_default', $params); }
[ "public", "function", "setDefault", "(", "$", "key", ",", "$", "value", ")", "{", "$", "params", "=", "array", "(", "'key'", "=>", "$", "key", ",", "'value'", "=>", "$", "value", ")", ";", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", ...
Set the application-wide default value for a key. This will create a new key with a default value, if the key does not yet exist in the application. If the key does exist, the value will be overwritten. Returns a boolean that indicates whether the key already existed. "True" indicates the key has been overwritten. "Fa...
[ "Set", "the", "application", "-", "wide", "default", "value", "for", "a", "key", ".", "This", "will", "create", "a", "new", "key", "with", "a", "default", "value", "if", "the", "key", "does", "not", "yet", "exist", "in", "the", "application", ".", "If"...
6283f68454e0ad5211ac620f1d337df38cd49597
https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Capture/Settings.php#L187-L195
22,530
gedex/php-janrain-api
lib/Janrain/Api/Capture/Settings.php
Settings.delete
public function delete($key, $forClientId = null) { $params = array('key' => $key); if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/delete', $params); }
php
public function delete($key, $forClientId = null) { $params = array('key' => $key); if ($forClientId) { $params['for_client_id'] = $forClientId; } return $this->post('settings/delete', $params); }
[ "public", "function", "delete", "(", "$", "key", ",", "$", "forClientId", "=", "null", ")", "{", "$", "params", "=", "array", "(", "'key'", "=>", "$", "key", ")", ";", "if", "(", "$", "forClientId", ")", "{", "$", "params", "[", "'for_client_id'", ...
Delete a key from the settings for a particular client. Returns a boolean indicating whether the key existed. This does not modify the application- wide default value for a key. @param string $key The key to delete from the client settings. To find out the values available, use the 'settings/keys' API call first. @pa...
[ "Delete", "a", "key", "from", "the", "settings", "for", "a", "particular", "client", ".", "Returns", "a", "boolean", "indicating", "whether", "the", "key", "existed", ".", "This", "does", "not", "modify", "the", "application", "-", "wide", "default", "value"...
6283f68454e0ad5211ac620f1d337df38cd49597
https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Capture/Settings.php#L212-L221
22,531
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Translation/src/backends/ts_backend.php
ezcTranslationTsBackend.setOptions
public function setOptions( $options ) { if ( is_array( $options ) ) { $this->options->merge( $options ); } else if ( $options instanceof ezcTranslationTsBackendOptions ) { $this->options = $options; } else { thr...
php
public function setOptions( $options ) { if ( is_array( $options ) ) { $this->options->merge( $options ); } else if ( $options instanceof ezcTranslationTsBackendOptions ) { $this->options = $options; } else { thr...
[ "public", "function", "setOptions", "(", "$", "options", ")", "{", "if", "(", "is_array", "(", "$", "options", ")", ")", "{", "$", "this", "->", "options", "->", "merge", "(", "$", "options", ")", ";", "}", "else", "if", "(", "$", "options", "insta...
Set new options. This method allows you to change the options of the translation backend. @param ezcTranslationTsBackendOptions $options The options to set. @throws ezcBaseSettingNotFoundException If you tried to set a non-existent option value. @throws ezcBaseSettingValueException If the value is not valid for the d...
[ "Set", "new", "options", ".", "This", "method", "allows", "you", "to", "change", "the", "options", "of", "the", "translation", "backend", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Translation/src/backends/ts_backend.php#L162-L176
22,532
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Translation/src/backends/ts_backend.php
ezcTranslationTsBackend.deinitWriter
public function deinitWriter() { if ( is_null( $this->dom ) ) { throw new ezcTranslationWriterNotInitializedException(); } $filename = $this->buildTranslationFileName( $this->writeLocale ); $this->dom->save( $filename ); }
php
public function deinitWriter() { if ( is_null( $this->dom ) ) { throw new ezcTranslationWriterNotInitializedException(); } $filename = $this->buildTranslationFileName( $this->writeLocale ); $this->dom->save( $filename ); }
[ "public", "function", "deinitWriter", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "dom", ")", ")", "{", "throw", "new", "ezcTranslationWriterNotInitializedException", "(", ")", ";", "}", "$", "filename", "=", "$", "this", "->", "buildTrans...
Deinitializes the writer @return void
[ "Deinitializes", "the", "writer" ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Translation/src/backends/ts_backend.php#L524-L532
22,533
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Translation/src/backends/ts_backend.php
ezcTranslationTsBackend.next
public function next() { if ( is_null( $this->xmlParser ) ) { throw new ezcTranslationReaderNotInitializedException(); } $valid = $this->xmlParser->valid(); if ( $valid ) { $newContext = array( trim( $this->xmlParser->getChildren()->name), arr...
php
public function next() { if ( is_null( $this->xmlParser ) ) { throw new ezcTranslationReaderNotInitializedException(); } $valid = $this->xmlParser->valid(); if ( $valid ) { $newContext = array( trim( $this->xmlParser->getChildren()->name), arr...
[ "public", "function", "next", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "xmlParser", ")", ")", "{", "throw", "new", "ezcTranslationReaderNotInitializedException", "(", ")", ";", "}", "$", "valid", "=", "$", "this", "->", "xmlParser", "...
Advanced to the next context. This method parses a little bit more of the XML file to be able to return the next context. If no more contexts are available it sets the $currentContext member variable to null, so that the valid() method can pick this up. If there are more contexts available it reads the context from ...
[ "Advanced", "to", "the", "next", "context", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Translation/src/backends/ts_backend.php#L548-L577
22,534
GreenCape/joomla-cli
src/GreenCape/JoomlaCLI/Driver/Factory.php
DriverFactory.create
public function create($basePath) { $parts = explode('.', $this->loadVersion($basePath)->getShortVersion()); while (!empty($parts)) { $version = implode('Dot', $parts); $classname = __NAMESPACE__ . '\\Joomla' . $version . 'Driver'; if (class_exists($classname)) { return new $classname; } ar...
php
public function create($basePath) { $parts = explode('.', $this->loadVersion($basePath)->getShortVersion()); while (!empty($parts)) { $version = implode('Dot', $parts); $classname = __NAMESPACE__ . '\\Joomla' . $version . 'Driver'; if (class_exists($classname)) { return new $classname; } ar...
[ "public", "function", "create", "(", "$", "basePath", ")", "{", "$", "parts", "=", "explode", "(", "'.'", ",", "$", "this", "->", "loadVersion", "(", "$", "basePath", ")", "->", "getShortVersion", "(", ")", ")", ";", "while", "(", "!", "empty", "(", ...
Create a version specific driver to Joomla @param string $basePath The Joomla base path (same as JPATH_BASE within Joomla) @return JoomlaDriver @throws \RuntimeException
[ "Create", "a", "version", "specific", "driver", "to", "Joomla" ]
74a6940f27b1f66c99330d4f9e2c5ac314cdd369
https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Driver/Factory.php#L52-L66
22,535
GreenCape/joomla-cli
src/GreenCape/JoomlaCLI/Driver/Factory.php
DriverFactory.loadVersion
private function loadVersion($basePath) { static $locations = array( '/libraries/cms/version/version.php', '/libraries/joomla/version.php', ); define('_JEXEC', 1); foreach ($locations as $location) { if (file_exists($basePath . $location)) { $code = file_get_contents($basePath . $location);...
php
private function loadVersion($basePath) { static $locations = array( '/libraries/cms/version/version.php', '/libraries/joomla/version.php', ); define('_JEXEC', 1); foreach ($locations as $location) { if (file_exists($basePath . $location)) { $code = file_get_contents($basePath . $location);...
[ "private", "function", "loadVersion", "(", "$", "basePath", ")", "{", "static", "$", "locations", "=", "array", "(", "'/libraries/cms/version/version.php'", ",", "'/libraries/joomla/version.php'", ",", ")", ";", "define", "(", "'_JEXEC'", ",", "1", ")", ";", "fo...
Load the Joomla version @param string $basePath The Joomla base path (same as JPATH_BASE within Joomla) @return \JVersion @throws \RuntimeException
[ "Load", "the", "Joomla", "version" ]
74a6940f27b1f66c99330d4f9e2c5ac314cdd369
https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Driver/Factory.php#L77-L98
22,536
nblum/silverstripe-flexible-content
code/ContentElement.php
ContentElement.getSiblings
public function getSiblings($active = '1') { $stage = \Nblum\FlexibleContent\FlexibleContentVersionedDataObject::get_live_stage(); $results = \Nblum\FlexibleContent\FlexibleContentVersionedDataObject::get_by_stage( \ContentElement::class, $stage , [ 'A...
php
public function getSiblings($active = '1') { $stage = \Nblum\FlexibleContent\FlexibleContentVersionedDataObject::get_live_stage(); $results = \Nblum\FlexibleContent\FlexibleContentVersionedDataObject::get_by_stage( \ContentElement::class, $stage , [ 'A...
[ "public", "function", "getSiblings", "(", "$", "active", "=", "'1'", ")", "{", "$", "stage", "=", "\\", "Nblum", "\\", "FlexibleContent", "\\", "FlexibleContentVersionedDataObject", "::", "get_live_stage", "(", ")", ";", "$", "results", "=", "\\", "Nblum", "...
returns all content element of the same page @param string $active @return DataList
[ "returns", "all", "content", "element", "of", "the", "same", "page" ]
e20a06ee98b7f884965a951653d98af11eb6bc67
https://github.com/nblum/silverstripe-flexible-content/blob/e20a06ee98b7f884965a951653d98af11eb6bc67/code/ContentElement.php#L255-L268
22,537
neyaoz/laravel-view-control
src/ViewControl/ViewControlServiceProvider.php
ViewControlServiceProvider.bindInstancesInContainer
protected function bindInstancesInContainer() { $this->app->instance("view-control.path", $this->path()); $this->app->instance("view-control.path.base", $this->basePath()); }
php
protected function bindInstancesInContainer() { $this->app->instance("view-control.path", $this->path()); $this->app->instance("view-control.path.base", $this->basePath()); }
[ "protected", "function", "bindInstancesInContainer", "(", ")", "{", "$", "this", "->", "app", "->", "instance", "(", "\"view-control.path\"", ",", "$", "this", "->", "path", "(", ")", ")", ";", "$", "this", "->", "app", "->", "instance", "(", "\"view-contr...
Bind all of the instances in the container. @return void
[ "Bind", "all", "of", "the", "instances", "in", "the", "container", "." ]
2f49777a5cd81223cd36da2ef4385ccd036a4b1e
https://github.com/neyaoz/laravel-view-control/blob/2f49777a5cd81223cd36da2ef4385ccd036a4b1e/src/ViewControl/ViewControlServiceProvider.php#L42-L46
22,538
neyaoz/laravel-view-control
src/ViewControl/ViewControlServiceProvider.php
ViewControlServiceProvider.basePath
public function basePath($path = '') { return $this->getFilesystem()->dirname($this->path()) . ($path ? DIRECTORY_SEPARATOR . $path : $path); }
php
public function basePath($path = '') { return $this->getFilesystem()->dirname($this->path()) . ($path ? DIRECTORY_SEPARATOR . $path : $path); }
[ "public", "function", "basePath", "(", "$", "path", "=", "''", ")", "{", "return", "$", "this", "->", "getFilesystem", "(", ")", "->", "dirname", "(", "$", "this", "->", "path", "(", ")", ")", ".", "(", "$", "path", "?", "DIRECTORY_SEPARATOR", ".", ...
Get the base path of the plugin installation. @param string $path @return string
[ "Get", "the", "base", "path", "of", "the", "plugin", "installation", "." ]
2f49777a5cd81223cd36da2ef4385ccd036a4b1e
https://github.com/neyaoz/laravel-view-control/blob/2f49777a5cd81223cd36da2ef4385ccd036a4b1e/src/ViewControl/ViewControlServiceProvider.php#L123-L126
22,539
ajant/SimpleArrayLibrary
src/Categories/Counters.php
Counters.countMaxDepth
public static function countMaxDepth(array $array) { $maxDepth = 1; foreach ($array as $element) { $depth = 1; if (is_array($element)) { $depth += self::countMaxDepth($element); } if ($depth > $maxDepth) $maxDepth = $depth; } ...
php
public static function countMaxDepth(array $array) { $maxDepth = 1; foreach ($array as $element) { $depth = 1; if (is_array($element)) { $depth += self::countMaxDepth($element); } if ($depth > $maxDepth) $maxDepth = $depth; } ...
[ "public", "static", "function", "countMaxDepth", "(", "array", "$", "array", ")", "{", "$", "maxDepth", "=", "1", ";", "foreach", "(", "$", "array", "as", "$", "element", ")", "{", "$", "depth", "=", "1", ";", "if", "(", "is_array", "(", "$", "elem...
Counts maximum array depth recursively @param array $array @return int
[ "Counts", "maximum", "array", "depth", "recursively" ]
374877c0f20a22a914eb3680eb1cf39e424071be
https://github.com/ajant/SimpleArrayLibrary/blob/374877c0f20a22a914eb3680eb1cf39e424071be/src/Categories/Counters.php#L16-L28
22,540
ajant/SimpleArrayLibrary
src/Categories/Counters.php
Counters.countMaxDepthIterative
public static function countMaxDepthIterative(array $array) { $copy = $array; $maxDepth = 1; foreach ($copy as $element) { $depth = 1; while (!empty($element)) { if (is_array($element)) { ++$depth; $tmp = ar...
php
public static function countMaxDepthIterative(array $array) { $copy = $array; $maxDepth = 1; foreach ($copy as $element) { $depth = 1; while (!empty($element)) { if (is_array($element)) { ++$depth; $tmp = ar...
[ "public", "static", "function", "countMaxDepthIterative", "(", "array", "$", "array", ")", "{", "$", "copy", "=", "$", "array", ";", "$", "maxDepth", "=", "1", ";", "foreach", "(", "$", "copy", "as", "$", "element", ")", "{", "$", "depth", "=", "1", ...
Counts maximum array depth iteratively @param array $array @return int
[ "Counts", "maximum", "array", "depth", "iteratively" ]
374877c0f20a22a914eb3680eb1cf39e424071be
https://github.com/ajant/SimpleArrayLibrary/blob/374877c0f20a22a914eb3680eb1cf39e424071be/src/Categories/Counters.php#L37-L61
22,541
ajant/SimpleArrayLibrary
src/Categories/Counters.php
Counters.countMinDepth
public static function countMinDepth($potentialArray, $depth = 0) { // validation, must be positive int or 0 if (!self::isLogicallyCastableToInt($depth)) { throw new InvalidArgumentException('Depth parameter must be non-negative integer'); } if ($depth < 0) { ...
php
public static function countMinDepth($potentialArray, $depth = 0) { // validation, must be positive int or 0 if (!self::isLogicallyCastableToInt($depth)) { throw new InvalidArgumentException('Depth parameter must be non-negative integer'); } if ($depth < 0) { ...
[ "public", "static", "function", "countMinDepth", "(", "$", "potentialArray", ",", "$", "depth", "=", "0", ")", "{", "// validation, must be positive int or 0", "if", "(", "!", "self", "::", "isLogicallyCastableToInt", "(", "$", "depth", ")", ")", "{", "throw", ...
Counts maximum array depth @param mixed $potentialArray @param int $depth @return int @throws InvalidArgumentException
[ "Counts", "maximum", "array", "depth" ]
374877c0f20a22a914eb3680eb1cf39e424071be
https://github.com/ajant/SimpleArrayLibrary/blob/374877c0f20a22a914eb3680eb1cf39e424071be/src/Categories/Counters.php#L72-L93
22,542
oroinc/OroLayoutComponent
HierarchyIterator.php
HierarchyIterator.getParent
public function getParent() { $depth = $this->iterator->getDepth(); return $depth === 0 ? $this->id : $this->iterator->getSubIterator($depth - 1)->key(); }
php
public function getParent() { $depth = $this->iterator->getDepth(); return $depth === 0 ? $this->id : $this->iterator->getSubIterator($depth - 1)->key(); }
[ "public", "function", "getParent", "(", ")", "{", "$", "depth", "=", "$", "this", "->", "iterator", "->", "getDepth", "(", ")", ";", "return", "$", "depth", "===", "0", "?", "$", "this", "->", "id", ":", "$", "this", "->", "iterator", "->", "getSub...
Return the parent element @return mixed
[ "Return", "the", "parent", "element" ]
682a96672393d81c63728e47c4a4c3618c515be0
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/HierarchyIterator.php#L36-L43
22,543
BugBuster1701/contao-botdetection-bundle
src/Resources/contao/classes/Referrer/ProviderCommunication.php
ProviderCommunication.loadProviderFiles
public function loadProviderFiles() { //debug $this->logMessage('ProviderCommunication::loadProviderFile: START','botdetection_debug'); $lastWeek = time() - (7 * 24 * 60 * 60); if (false === $this->allowUrlOpen) { $this->logMessage('ProviderCommunication::loadProviderFi...
php
public function loadProviderFiles() { //debug $this->logMessage('ProviderCommunication::loadProviderFile: START','botdetection_debug'); $lastWeek = time() - (7 * 24 * 60 * 60); if (false === $this->allowUrlOpen) { $this->logMessage('ProviderCommunication::loadProviderFi...
[ "public", "function", "loadProviderFiles", "(", ")", "{", "//debug $this->logMessage('ProviderCommunication::loadProviderFile: START','botdetection_debug');", "$", "lastWeek", "=", "time", "(", ")", "-", "(", "7", "*", "24", "*", "60", "*", "60", ")", ";", "if", "("...
Load Referrer Provider Files if - provider files to old
[ "Load", "Referrer", "Provider", "Files", "if", "-", "provider", "files", "to", "old" ]
50c964acc354aa9116fae0e509cd7d075bd52f55
https://github.com/BugBuster1701/contao-botdetection-bundle/blob/50c964acc354aa9116fae0e509cd7d075bd52f55/src/Resources/contao/classes/Referrer/ProviderCommunication.php#L98-L124
22,544
BOOKEEN/opds-parser
src/Business/OpdsParserBusiness.php
OpdsParserBusiness.parse
private function parse(\SimpleXMLElement $xmldata) { if (!isset($xmldata->title)) { throw new OpdsParserNoTitleException(); } if ($xmldata->getName() === 'entry') { return $this->parseEntry($xmldata); } return $this->parseFeed($xmldata); }
php
private function parse(\SimpleXMLElement $xmldata) { if (!isset($xmldata->title)) { throw new OpdsParserNoTitleException(); } if ($xmldata->getName() === 'entry') { return $this->parseEntry($xmldata); } return $this->parseFeed($xmldata); }
[ "private", "function", "parse", "(", "\\", "SimpleXMLElement", "$", "xmldata", ")", "{", "if", "(", "!", "isset", "(", "$", "xmldata", "->", "title", ")", ")", "{", "throw", "new", "OpdsParserNoTitleException", "(", ")", ";", "}", "if", "(", "$", "xmld...
Parse an OPDS flux. @param \SimpleXMLElement $xmldata @return Feed|Publication @throws OpdsParserNoTitleException
[ "Parse", "an", "OPDS", "flux", "." ]
b9ef065210e81ee63b029e37c6943c6fa8c74cef
https://github.com/BOOKEEN/opds-parser/blob/b9ef065210e81ee63b029e37c6943c6fa8c74cef/src/Business/OpdsParserBusiness.php#L93-L106
22,545
BOOKEEN/opds-parser
src/Business/OpdsParserBusiness.php
OpdsParserBusiness.parsePagination
private function parsePagination(\SimpleXMLElement $xmldata) { $pagination = new Pagination(); $paginated = false; foreach ($xmldata->children('opensearch', true) as $key => $value) { switch ($key) { case 'totalResults': $pagination->setNumber...
php
private function parsePagination(\SimpleXMLElement $xmldata) { $pagination = new Pagination(); $paginated = false; foreach ($xmldata->children('opensearch', true) as $key => $value) { switch ($key) { case 'totalResults': $pagination->setNumber...
[ "private", "function", "parsePagination", "(", "\\", "SimpleXMLElement", "$", "xmldata", ")", "{", "$", "pagination", "=", "new", "Pagination", "(", ")", ";", "$", "paginated", "=", "false", ";", "foreach", "(", "$", "xmldata", "->", "children", "(", "'ope...
Met en forme la pagination si elle existe @param \SimpleXMLElement $xmldata @return Pagination|null null si elle n'existe pas
[ "Met", "en", "forme", "la", "pagination", "si", "elle", "existe" ]
b9ef065210e81ee63b029e37c6943c6fa8c74cef
https://github.com/BOOKEEN/opds-parser/blob/b9ef065210e81ee63b029e37c6943c6fa8c74cef/src/Business/OpdsParserBusiness.php#L115-L134
22,546
mridang/magazine
lib/magento/Archive/Abstract.php
Mage_Archive_Abstract._writeFile
protected function _writeFile($destination, $data) { $destination = trim($destination); if(false === file_put_contents($destination, $data)) { throw new Mage_Exception("Can't write to file: " . $destination); } return true; }
php
protected function _writeFile($destination, $data) { $destination = trim($destination); if(false === file_put_contents($destination, $data)) { throw new Mage_Exception("Can't write to file: " . $destination); } return true; }
[ "protected", "function", "_writeFile", "(", "$", "destination", ",", "$", "data", ")", "{", "$", "destination", "=", "trim", "(", "$", "destination", ")", ";", "if", "(", "false", "===", "file_put_contents", "(", "$", "destination", ",", "$", "data", ")"...
Write data to file. If file can't be opened - throw exception @param string $destination @param string $data @return boolean @throws Mage_Exception
[ "Write", "data", "to", "file", ".", "If", "file", "can", "t", "be", "opened", "-", "throw", "exception" ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Abstract.php#L44-L51
22,547
mridang/magazine
lib/magento/Archive/Abstract.php
Mage_Archive_Abstract._readFile
protected function _readFile($source) { $data = ''; if (is_file($source) && is_readable($source)) { $data = @file_get_contents($source); if ($data === false) { throw new Mage_Exception("Can't get contents from: " . $source); } } ret...
php
protected function _readFile($source) { $data = ''; if (is_file($source) && is_readable($source)) { $data = @file_get_contents($source); if ($data === false) { throw new Mage_Exception("Can't get contents from: " . $source); } } ret...
[ "protected", "function", "_readFile", "(", "$", "source", ")", "{", "$", "data", "=", "''", ";", "if", "(", "is_file", "(", "$", "source", ")", "&&", "is_readable", "(", "$", "source", ")", ")", "{", "$", "data", "=", "@", "file_get_contents", "(", ...
Read data from file. If file can't be opened, throw to exception. @param string $source @return string @throws Mage_Exception
[ "Read", "data", "from", "file", ".", "If", "file", "can", "t", "be", "opened", "throw", "to", "exception", "." ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Abstract.php#L60-L70
22,548
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._initWriter
protected function _initWriter() { $this->_writer = new Mage_Archive_Helper_File($this->_destinationFilePath); $this->_writer->open('w'); return $this; }
php
protected function _initWriter() { $this->_writer = new Mage_Archive_Helper_File($this->_destinationFilePath); $this->_writer->open('w'); return $this; }
[ "protected", "function", "_initWriter", "(", ")", "{", "$", "this", "->", "_writer", "=", "new", "Mage_Archive_Helper_File", "(", "$", "this", "->", "_destinationFilePath", ")", ";", "$", "this", "->", "_writer", "->", "open", "(", "'w'", ")", ";", "return...
Initialize tarball writer @return Mage_Archive_Tar
[ "Initialize", "tarball", "writer" ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L91-L97
22,549
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._destroyWriter
protected function _destroyWriter() { if ($this->_writer instanceof Mage_Archive_Helper_File) { $this->_writer->close(); $this->_writer = null; } return $this; }
php
protected function _destroyWriter() { if ($this->_writer instanceof Mage_Archive_Helper_File) { $this->_writer->close(); $this->_writer = null; } return $this; }
[ "protected", "function", "_destroyWriter", "(", ")", "{", "if", "(", "$", "this", "->", "_writer", "instanceof", "Mage_Archive_Helper_File", ")", "{", "$", "this", "->", "_writer", "->", "close", "(", ")", ";", "$", "this", "->", "_writer", "=", "null", ...
Destroy tarball writer @return Mage_Archive_Tar
[ "Destroy", "tarball", "writer" ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L119-L127
22,550
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._initReader
protected function _initReader() { $this->_reader = new Mage_Archive_Helper_File($this->_getCurrentFile()); $this->_reader->open('r'); return $this; }
php
protected function _initReader() { $this->_reader = new Mage_Archive_Helper_File($this->_getCurrentFile()); $this->_reader->open('r'); return $this; }
[ "protected", "function", "_initReader", "(", ")", "{", "$", "this", "->", "_reader", "=", "new", "Mage_Archive_Helper_File", "(", "$", "this", "->", "_getCurrentFile", "(", ")", ")", ";", "$", "this", "->", "_reader", "->", "open", "(", "'r'", ")", ";", ...
Initialize tarball reader @return Mage_Archive_Tar
[ "Initialize", "tarball", "reader" ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L148-L154
22,551
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._destroyReader
protected function _destroyReader() { if ($this->_reader instanceof Mage_Archive_Helper_File) { $this->_reader->close(); $this->_reader = null; } return $this; }
php
protected function _destroyReader() { if ($this->_reader instanceof Mage_Archive_Helper_File) { $this->_reader->close(); $this->_reader = null; } return $this; }
[ "protected", "function", "_destroyReader", "(", ")", "{", "if", "(", "$", "this", "->", "_reader", "instanceof", "Mage_Archive_Helper_File", ")", "{", "$", "this", "->", "_reader", "->", "close", "(", ")", ";", "$", "this", "->", "_reader", "=", "null", ...
Destroy tarball reader @return Mage_Archive_Tar
[ "Destroy", "tarball", "reader" ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L161-L169
22,552
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._setCurrentFile
protected function _setCurrentFile($file) { $this->_currentFile = $file .((!is_link($file) && is_dir($file) && substr($file, -1) != DS) ? DS : ''); return $this; }
php
protected function _setCurrentFile($file) { $this->_currentFile = $file .((!is_link($file) && is_dir($file) && substr($file, -1) != DS) ? DS : ''); return $this; }
[ "protected", "function", "_setCurrentFile", "(", "$", "file", ")", "{", "$", "this", "->", "_currentFile", "=", "$", "file", ".", "(", "(", "!", "is_link", "(", "$", "file", ")", "&&", "is_dir", "(", "$", "file", ")", "&&", "substr", "(", "$", "fil...
Set file which is packing. @param string $file @return Mage_Archive_Tar
[ "Set", "file", "which", "is", "packing", "." ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L203-L207
22,553
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._setCurrentPath
protected function _setCurrentPath($path) { if ($this->_skipRoot && is_dir($path)) { $this->_currentPath = $path.(substr($path, -1)!=DS?DS:''); } else { $this->_currentPath = dirname($path) . DS; } return $this; }
php
protected function _setCurrentPath($path) { if ($this->_skipRoot && is_dir($path)) { $this->_currentPath = $path.(substr($path, -1)!=DS?DS:''); } else { $this->_currentPath = dirname($path) . DS; } return $this; }
[ "protected", "function", "_setCurrentPath", "(", "$", "path", ")", "{", "if", "(", "$", "this", "->", "_skipRoot", "&&", "is_dir", "(", "$", "path", ")", ")", "{", "$", "this", "->", "_currentPath", "=", "$", "path", ".", "(", "substr", "(", "$", "...
Set path to file which is packing. @param string $path @return Mage_Archive_Tar
[ "Set", "path", "to", "file", "which", "is", "packing", "." ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L237-L245
22,554
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._packToTar
protected function _packToTar($skipRoot=false) { $file = $this->_getCurrentFile(); $header = ''; $data = ''; if (!$skipRoot) { $header = $this->_composeHeader(); $data = $this->_readFile($file); $data = str_pad($data, floor(((is_dir($file) ? 0 : fi...
php
protected function _packToTar($skipRoot=false) { $file = $this->_getCurrentFile(); $header = ''; $data = ''; if (!$skipRoot) { $header = $this->_composeHeader(); $data = $this->_readFile($file); $data = str_pad($data, floor(((is_dir($file) ? 0 : fi...
[ "protected", "function", "_packToTar", "(", "$", "skipRoot", "=", "false", ")", "{", "$", "file", "=", "$", "this", "->", "_getCurrentFile", "(", ")", ";", "$", "header", "=", "''", ";", "$", "data", "=", "''", ";", "if", "(", "!", "$", "skipRoot",...
Walk through directory and add to tar file or directory. Result is packed string on TAR format. @deprecated after 1.7.0.0 @param boolean $skipRoot @return string
[ "Walk", "through", "directory", "and", "add", "to", "tar", "file", "or", "directory", ".", "Result", "is", "packed", "string", "on", "TAR", "format", "." ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L265-L290
22,555
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._createTar
protected function _createTar($skipRoot = false, $finalize = false) { if (!$skipRoot) { $this->_packAndWriteCurrentFile(); } $file = $this->_getCurrentFile(); if (is_dir($file)) { $dirFiles = scandir($file); if (false === $dirFiles) { ...
php
protected function _createTar($skipRoot = false, $finalize = false) { if (!$skipRoot) { $this->_packAndWriteCurrentFile(); } $file = $this->_getCurrentFile(); if (is_dir($file)) { $dirFiles = scandir($file); if (false === $dirFiles) { ...
[ "protected", "function", "_createTar", "(", "$", "skipRoot", "=", "false", ",", "$", "finalize", "=", "false", ")", "{", "if", "(", "!", "$", "skipRoot", ")", "{", "$", "this", "->", "_packAndWriteCurrentFile", "(", ")", ";", "}", "$", "file", "=", "...
Recursively walk through file tree and create tarball @param boolean $skipRoot @param boolean $finalize @throws Mage_Exception
[ "Recursively", "walk", "through", "file", "tree", "and", "create", "tarball" ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L299-L325
22,556
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._packAndWriteCurrentFile
protected function _packAndWriteCurrentFile() { $archiveWriter = $this->_getWriter(); $archiveWriter->write($this->_composeHeader()); $currentFile = $this->_getCurrentFile(); $fileSize = 0; if (is_file($currentFile) && !is_link($currentFile)) { $fileReader = ne...
php
protected function _packAndWriteCurrentFile() { $archiveWriter = $this->_getWriter(); $archiveWriter->write($this->_composeHeader()); $currentFile = $this->_getCurrentFile(); $fileSize = 0; if (is_file($currentFile) && !is_link($currentFile)) { $fileReader = ne...
[ "protected", "function", "_packAndWriteCurrentFile", "(", ")", "{", "$", "archiveWriter", "=", "$", "this", "->", "_getWriter", "(", ")", ";", "$", "archiveWriter", "->", "write", "(", "$", "this", "->", "_composeHeader", "(", ")", ")", ";", "$", "currentF...
Write current file to tarball
[ "Write", "current", "file", "to", "tarball" ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L330-L354
22,557
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._unpackCurrentTar
protected function _unpackCurrentTar($destination) { $archiveReader = $this->_getReader(); $list = array(); while (!$archiveReader->eof()) { $header = $this->_extractFileHeader(); if (!$header) { continue; } $currentFile = $d...
php
protected function _unpackCurrentTar($destination) { $archiveReader = $this->_getReader(); $list = array(); while (!$archiveReader->eof()) { $header = $this->_extractFileHeader(); if (!$header) { continue; } $currentFile = $d...
[ "protected", "function", "_unpackCurrentTar", "(", "$", "destination", ")", "{", "$", "archiveReader", "=", "$", "this", "->", "_getReader", "(", ")", ";", "$", "list", "=", "array", "(", ")", ";", "while", "(", "!", "$", "archiveReader", "->", "eof", ...
Read TAR string from file, and unpacked it. Create files and directories information about discribed in the string. @param string $destination path to file is unpacked @return array list of files @throws Mage_Exception
[ "Read", "TAR", "string", "from", "file", "and", "unpacked", "it", ".", "Create", "files", "and", "directories", "information", "about", "discribed", "in", "the", "string", "." ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L425-L471
22,558
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._parseHeader
protected function _parseHeader(&$pointer) { $firstLine = fread($pointer, 512); if (strlen($firstLine)<512){ return false; } $fmt = self::_getFormatParseHeader(); $header = unpack ($fmt, $firstLine); $header['mode']=$header['mode']+0; $header['u...
php
protected function _parseHeader(&$pointer) { $firstLine = fread($pointer, 512); if (strlen($firstLine)<512){ return false; } $fmt = self::_getFormatParseHeader(); $header = unpack ($fmt, $firstLine); $header['mode']=$header['mode']+0; $header['u...
[ "protected", "function", "_parseHeader", "(", "&", "$", "pointer", ")", "{", "$", "firstLine", "=", "fread", "(", "$", "pointer", ",", "512", ")", ";", "if", "(", "strlen", "(", "$", "firstLine", ")", "<", "512", ")", "{", "return", "false", ";", "...
Get header from TAR string and unpacked it by format. @deprecated after 1.7.0.0 @param resource $pointer @return string
[ "Get", "header", "from", "TAR", "string", "and", "unpacked", "it", "by", "format", "." ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L480-L527
22,559
mridang/magazine
lib/magento/Archive/Tar.php
Mage_Archive_Tar._extractFileHeader
protected function _extractFileHeader() { $archiveReader = $this->_getReader(); $headerBlock = $archiveReader->read(self::TAR_BLOCK_SIZE); if (strlen($headerBlock) < self::TAR_BLOCK_SIZE) { return false; } $header = unpack(self::_getFormatParseHeader(), $header...
php
protected function _extractFileHeader() { $archiveReader = $this->_getReader(); $headerBlock = $archiveReader->read(self::TAR_BLOCK_SIZE); if (strlen($headerBlock) < self::TAR_BLOCK_SIZE) { return false; } $header = unpack(self::_getFormatParseHeader(), $header...
[ "protected", "function", "_extractFileHeader", "(", ")", "{", "$", "archiveReader", "=", "$", "this", "->", "_getReader", "(", ")", ";", "$", "headerBlock", "=", "$", "archiveReader", "->", "read", "(", "self", "::", "TAR_BLOCK_SIZE", ")", ";", "if", "(", ...
Read and decode file header information from tarball @return array|boolean
[ "Read", "and", "decode", "file", "header", "information", "from", "tarball" ]
5b3cfecc472c61fde6af63efe62690a30a267a04
https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Tar.php#L534-L583
22,560
madkom/regex
src/Grepper.php
Grepper.grep
public function grep(array $subjects, int $flags = 0) : array { $result = preg_grep($this->pattern->getPattern() . $this->modifier, $subjects, $flags); if (($errno = preg_last_error()) !== PREG_NO_ERROR) { $message = array_flip(get_defined_constants(true)['pcre'])[$errno]; s...
php
public function grep(array $subjects, int $flags = 0) : array { $result = preg_grep($this->pattern->getPattern() . $this->modifier, $subjects, $flags); if (($errno = preg_last_error()) !== PREG_NO_ERROR) { $message = array_flip(get_defined_constants(true)['pcre'])[$errno]; s...
[ "public", "function", "grep", "(", "array", "$", "subjects", ",", "int", "$", "flags", "=", "0", ")", ":", "array", "{", "$", "result", "=", "preg_grep", "(", "$", "this", "->", "pattern", "->", "getPattern", "(", ")", ".", "$", "this", "->", "modi...
Retrieve grepped subjects array @param array $subjects @param int $flags @return array @throws BacktrackLimitException @throws BadUtf8Exception @throws BadUtf8OffsetException @throws InternalException @throws JitStackLimitException @throws RecursionLimitException
[ "Retrieve", "grepped", "subjects", "array" ]
798c1124805b130b1110ee6e8dcc9a88d8aaffa8
https://github.com/madkom/regex/blob/798c1124805b130b1110ee6e8dcc9a88d8aaffa8/src/Grepper.php#L56-L79
22,561
andromeda-framework/doctrine
src/Doctrine/Console/Commands/SchemaDropCommand.php
SchemaDropCommand.executeSchemaCommand
protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadata, SymfonyStyle $ui) { $merger = new MetadataMerger(); $metadata = $merger->merge($metadata); return parent::executeSchemaCommand($input, $output, $schemaTool, $metadata, $ui); }
php
protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadata, SymfonyStyle $ui) { $merger = new MetadataMerger(); $metadata = $merger->merge($metadata); return parent::executeSchemaCommand($input, $output, $schemaTool, $metadata, $ui); }
[ "protected", "function", "executeSchemaCommand", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ",", "SchemaTool", "$", "schemaTool", ",", "array", "$", "metadata", ",", "SymfonyStyle", "$", "ui", ")", "{", "$", "merger", "=", "new...
Executes the Drop command. @param InputInterface $input @param OutputInterface $output @param SchemaTool $schemaTool @param ClassMetadata[] $metadata @param SymfonyStyle $ui @return int|NULL 0 or NULL if everything went fine, or an error code
[ "Executes", "the", "Drop", "command", "." ]
46924d91c09e0b9fbe5764518cbad70e467ffad4
https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/Console/Commands/SchemaDropCommand.php#L49-L56
22,562
jaxon-php/jaxon-jquery
src/SelectorTrait.php
SelectorTrait.jQuery
public function jQuery(string $sSelector, string $sContext = '') { return $this->getResponse()->plugin('jquery')->element($sSelector, $sContext); }
php
public function jQuery(string $sSelector, string $sContext = '') { return $this->getResponse()->plugin('jquery')->element($sSelector, $sContext); }
[ "public", "function", "jQuery", "(", "string", "$", "sSelector", ",", "string", "$", "sContext", "=", "''", ")", "{", "return", "$", "this", "->", "getResponse", "(", ")", "->", "plugin", "(", "'jquery'", ")", "->", "element", "(", "$", "sSelector", ",...
Create a JQuery Element with a given selector, and link it to the response attribute. @param string $sSelector The jQuery selector @param string $sContext A context associated to the selector @return Jaxon\JQuery\Dom\Element
[ "Create", "a", "JQuery", "Element", "with", "a", "given", "selector", "and", "link", "it", "to", "the", "response", "attribute", "." ]
90766a8ea8a4124a3f110e96b316370f71762380
https://github.com/jaxon-php/jaxon-jquery/blob/90766a8ea8a4124a3f110e96b316370f71762380/src/SelectorTrait.php#L22-L25
22,563
aalfiann/json-class-php
src/JSONHelper.php
JSONHelper.debug_decode
public function debug_decode($json,$assoc=false,$depth=512,$options=0){ $test = json_decode($json,$assoc,$depth,$options); if (!empty($test)) $json = $test; $data = $this->errorMessage(json_last_error(),$json); return json_encode($data,JSON_PRETTY_PRINT); }
php
public function debug_decode($json,$assoc=false,$depth=512,$options=0){ $test = json_decode($json,$assoc,$depth,$options); if (!empty($test)) $json = $test; $data = $this->errorMessage(json_last_error(),$json); return json_encode($data,JSON_PRETTY_PRINT); }
[ "public", "function", "debug_decode", "(", "$", "json", ",", "$", "assoc", "=", "false", ",", "$", "depth", "=", "512", ",", "$", "options", "=", "0", ")", "{", "$", "test", "=", "json_decode", "(", "$", "json", ",", "$", "assoc", ",", "$", "dept...
Debugger to test json decode @param json is the json string @return json string
[ "Debugger", "to", "test", "json", "decode" ]
524be94b162031946137ea1b729ba390d83dc41e
https://github.com/aalfiann/json-class-php/blob/524be94b162031946137ea1b729ba390d83dc41e/src/JSONHelper.php#L42-L47
22,564
aalfiann/json-class-php
src/JSONHelper.php
JSONHelper.fixControlChar
public function fixControlChar($string){ //Sanitize hidden control chars for ($i = 0; $i <= 9; ++$i) { $string = str_replace(chr($i), "", $string); } for ($i = 11; $i <= 12; ++$i) { $string = str_replace(chr($i), "", $string); } for ($i = 14; $i <= 31; ++$i) { $string = str_replace(ch...
php
public function fixControlChar($string){ //Sanitize hidden control chars for ($i = 0; $i <= 9; ++$i) { $string = str_replace(chr($i), "", $string); } for ($i = 11; $i <= 12; ++$i) { $string = str_replace(chr($i), "", $string); } for ($i = 14; $i <= 31; ++$i) { $string = str_replace(ch...
[ "public", "function", "fixControlChar", "(", "$", "string", ")", "{", "//Sanitize hidden control chars", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<=", "9", ";", "++", "$", "i", ")", "{", "$", "string", "=", "str_replace", "(", "chr", "(", "$",...
Most common fixed hidden control char in json string which made json decode fails. @param string is the string or json string @return string
[ "Most", "common", "fixed", "hidden", "control", "char", "in", "json", "string", "which", "made", "json", "decode", "fails", "." ]
524be94b162031946137ea1b729ba390d83dc41e
https://github.com/aalfiann/json-class-php/blob/524be94b162031946137ea1b729ba390d83dc41e/src/JSONHelper.php#L220-L239
22,565
aalfiann/json-class-php
src/JSONHelper.php
JSONHelper.modifyJsonStringInArray
public function modifyJsonStringInArray($data,$jsonfield,$setnewfield=""){ if (is_array($data)){ if (count($data) == count($data, COUNT_RECURSIVE)) { foreach($data as $value){ if(!empty($setnewfield)){ if (is_array($jsonfield)){ for ($i=0;$i<count($jsonfield);$i++){ if (isset($...
php
public function modifyJsonStringInArray($data,$jsonfield,$setnewfield=""){ if (is_array($data)){ if (count($data) == count($data, COUNT_RECURSIVE)) { foreach($data as $value){ if(!empty($setnewfield)){ if (is_array($jsonfield)){ for ($i=0;$i<count($jsonfield);$i++){ if (isset($...
[ "public", "function", "modifyJsonStringInArray", "(", "$", "data", ",", "$", "jsonfield", ",", "$", "setnewfield", "=", "\"\"", ")", "{", "if", "(", "is_array", "(", "$", "data", ")", ")", "{", "if", "(", "count", "(", "$", "data", ")", "==", "count"...
Modify json data string in some field array to be nice json data structure Note: - When you put json into database, then you load it with using PDO:fetch() or PDO::fetchAll() it will be served as string inside some field array. - So this function is make you easier to modify the json string to become nice json data st...
[ "Modify", "json", "data", "string", "in", "some", "field", "array", "to", "be", "nice", "json", "data", "structure" ]
524be94b162031946137ea1b729ba390d83dc41e
https://github.com/aalfiann/json-class-php/blob/524be94b162031946137ea1b729ba390d83dc41e/src/JSONHelper.php#L254-L295
22,566
aalfiann/json-class-php
src/JSONHelper.php
JSONHelper.minify
public function minify($json){ $tokenizer = "/\"|(\/\*)|(\*\/)|(\/\/)|\n|\r/"; $in_string = false; $in_multiline_comment = false; $in_singleline_comment = false; $tmp; $tmp2; $new_str = array(); $ns = 0; $from = 0; $lc; $rc; $lastIndex = 0; while (preg_match($tokenizer,$json,$tmp,PREG_OFFSET_CAPTURE,$...
php
public function minify($json){ $tokenizer = "/\"|(\/\*)|(\*\/)|(\/\/)|\n|\r/"; $in_string = false; $in_multiline_comment = false; $in_singleline_comment = false; $tmp; $tmp2; $new_str = array(); $ns = 0; $from = 0; $lc; $rc; $lastIndex = 0; while (preg_match($tokenizer,$json,$tmp,PREG_OFFSET_CAPTURE,$...
[ "public", "function", "minify", "(", "$", "json", ")", "{", "$", "tokenizer", "=", "\"/\\\"|(\\/\\*)|(\\*\\/)|(\\/\\/)|\\n|\\r/\"", ";", "$", "in_string", "=", "false", ";", "$", "in_multiline_comment", "=", "false", ";", "$", "in_singleline_comment", "=", "false"...
Minify the json string @param json is the json string @return string
[ "Minify", "the", "json", "string" ]
524be94b162031946137ea1b729ba390d83dc41e
https://github.com/aalfiann/json-class-php/blob/524be94b162031946137ea1b729ba390d83dc41e/src/JSONHelper.php#L326-L366
22,567
pvsaintpe/yii2-grid
widgets/GridView.php
GridView.renderPageSummary
public function renderPageSummary() { $content = parent::renderPageSummary(); if ($this->showCustomPageSummary) { if (!$content) { $content = "<tfoot></tfoot>"; } if ($this->beforeSummary) { foreach ($this->beforeSummary...
php
public function renderPageSummary() { $content = parent::renderPageSummary(); if ($this->showCustomPageSummary) { if (!$content) { $content = "<tfoot></tfoot>"; } if ($this->beforeSummary) { foreach ($this->beforeSummary...
[ "public", "function", "renderPageSummary", "(", ")", "{", "$", "content", "=", "parent", "::", "renderPageSummary", "(", ")", ";", "if", "(", "$", "this", "->", "showCustomPageSummary", ")", "{", "if", "(", "!", "$", "content", ")", "{", "$", "content", ...
Custom renders the table page summary. @return string the rendering result. @throws \yii\base\InvalidConfigException
[ "Custom", "renders", "the", "table", "page", "summary", "." ]
8c91a1737412070775dc3fbee6a89384a67ca2cf
https://github.com/pvsaintpe/yii2-grid/blob/8c91a1737412070775dc3fbee6a89384a67ca2cf/widgets/GridView.php#L151-L186
22,568
nicolasbeauvais/botscout-client
src/BotScout.php
BotScout.multi
public function multi(string $name = null, string $mail = null, string $ip = null) { return $this->makeRequest('multi', compact('name', 'mail', 'ip')); }
php
public function multi(string $name = null, string $mail = null, string $ip = null) { return $this->makeRequest('multi', compact('name', 'mail', 'ip')); }
[ "public", "function", "multi", "(", "string", "$", "name", "=", "null", ",", "string", "$", "mail", "=", "null", ",", "string", "$", "ip", "=", "null", ")", "{", "return", "$", "this", "->", "makeRequest", "(", "'multi'", ",", "compact", "(", "'name'...
Test matches all parameters at once. @param string $name @param string $mail @param string $ip @return BotScoutResponse
[ "Test", "matches", "all", "parameters", "at", "once", "." ]
bcc3f607998f02d79fd150f1ffd719c414262e86
https://github.com/nicolasbeauvais/botscout-client/blob/bcc3f607998f02d79fd150f1ffd719c414262e86/src/BotScout.php#L34-L37
22,569
ekuiter/feature-php
FeaturePhp/File/LogFile.php
LogFile.getContent
public function getContent() { $content = ""; $maxLen = 0; foreach ($this->logs as $log) if ($log[0]) { $name = $log[0]->getFeature()->getName(); $maxLen = strlen($name) > $maxLen ? strlen($name) : $maxLen; } foreach ($thi...
php
public function getContent() { $content = ""; $maxLen = 0; foreach ($this->logs as $log) if ($log[0]) { $name = $log[0]->getFeature()->getName(); $maxLen = strlen($name) > $maxLen ? strlen($name) : $maxLen; } foreach ($thi...
[ "public", "function", "getContent", "(", ")", "{", "$", "content", "=", "\"\"", ";", "$", "maxLen", "=", "0", ";", "foreach", "(", "$", "this", "->", "logs", "as", "$", "log", ")", "if", "(", "$", "log", "[", "0", "]", ")", "{", "$", "name", ...
Returns the log file's content. Tabular output is generated. @return TextFileContent
[ "Returns", "the", "log", "file", "s", "content", ".", "Tabular", "output", "is", "generated", "." ]
daf4a59098802fedcfd1f1a1d07847fcf2fea7bf
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/File/LogFile.php#L44-L58
22,570
hametuha/wpametu
src/WPametu/Tool/BatchProcessor.php
BatchProcessor.render_screen
public function render_screen(){ $this->register_batches(); ?> <div class="wrap"> <h2><?php $this->_e('Do Batch Actions') ?></h2> <?php if( $this->batches ): ?> <form id="batch-form" method="post" action="<?= admin_url('admin-ajax.php') ?>"> <input type="hidden" name="action" value="wpametu_batch"> ...
php
public function render_screen(){ $this->register_batches(); ?> <div class="wrap"> <h2><?php $this->_e('Do Batch Actions') ?></h2> <?php if( $this->batches ): ?> <form id="batch-form" method="post" action="<?= admin_url('admin-ajax.php') ?>"> <input type="hidden" name="action" value="wpametu_batch"> ...
[ "public", "function", "render_screen", "(", ")", "{", "$", "this", "->", "register_batches", "(", ")", ";", "?>\n\t\t<div class=\"wrap\">\n\t\t\t<h2><?php", "$", "this", "->", "_e", "(", "'Do Batch Actions'", ")", "?></h2>\n\t\t\t<?php", "if", "(", "$", "this", "-...
Render Admin screen
[ "Render", "Admin", "screen" ]
0939373800815a8396291143d2a57967340da5aa
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Tool/BatchProcessor.php#L67-L122
22,571
hametuha/wpametu
src/WPametu/Tool/BatchProcessor.php
BatchProcessor.register_batches
protected function register_batches(){ static $batch_registered = false; if( !$batch_registered ){ // Register Batches /** @var AutoLoader $auto_loader */ $auto_loader = AutoLoader::get_instance(); $root = $auto_loader->namespace_root; $namespace = $auto_loader->namespace; if( $namespace && $root ...
php
protected function register_batches(){ static $batch_registered = false; if( !$batch_registered ){ // Register Batches /** @var AutoLoader $auto_loader */ $auto_loader = AutoLoader::get_instance(); $root = $auto_loader->namespace_root; $namespace = $auto_loader->namespace; if( $namespace && $root ...
[ "protected", "function", "register_batches", "(", ")", "{", "static", "$", "batch_registered", "=", "false", ";", "if", "(", "!", "$", "batch_registered", ")", "{", "// Register Batches", "/** @var AutoLoader $auto_loader */", "$", "auto_loader", "=", "AutoLoader", ...
Register Batch classes
[ "Register", "Batch", "classes" ]
0939373800815a8396291143d2a57967340da5aa
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Tool/BatchProcessor.php#L144-L165
22,572
OpenBuildings/monetary
src/OpenBuildings/Monetary/CURL.php
CURL.request
public function request(array $curl_options) { $curl = $this->_init($curl_options); $response = $this->_execute($curl); // Execute response if ($response === FALSE) { $this->_handle_error($curl); return FALSE; } $this->_close($curl); return $response; }
php
public function request(array $curl_options) { $curl = $this->_init($curl_options); $response = $this->_execute($curl); // Execute response if ($response === FALSE) { $this->_handle_error($curl); return FALSE; } $this->_close($curl); return $response; }
[ "public", "function", "request", "(", "array", "$", "curl_options", ")", "{", "$", "curl", "=", "$", "this", "->", "_init", "(", "$", "curl_options", ")", ";", "$", "response", "=", "$", "this", "->", "_execute", "(", "$", "curl", ")", ";", "// Execu...
Perform a cURL request @param array $curl_options @return string response of the request @throws Exception_Source If the remote returns an error.
[ "Perform", "a", "cURL", "request" ]
f7831ab055eaba7105f3f3530506b96de7fedd29
https://github.com/OpenBuildings/monetary/blob/f7831ab055eaba7105f3f3530506b96de7fedd29/src/OpenBuildings/Monetary/CURL.php#L18-L34
22,573
OpenBuildings/monetary
src/OpenBuildings/Monetary/CURL.php
CURL._init
protected function _init(array $curl_options) { $options = array( CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_FOLLOWLOCATION => TRUE, CURLOPT_MAXREDIRS => 10 ); $options += $curl_options; $curl = curl_init(); curl_setopt_arr...
php
protected function _init(array $curl_options) { $options = array( CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_FOLLOWLOCATION => TRUE, CURLOPT_MAXREDIRS => 10 ); $options += $curl_options; $curl = curl_init(); curl_setopt_arr...
[ "protected", "function", "_init", "(", "array", "$", "curl_options", ")", "{", "$", "options", "=", "array", "(", "CURLOPT_SSL_VERIFYPEER", "=>", "FALSE", ",", "CURLOPT_SSL_VERIFYHOST", "=>", "FALSE", ",", "CURLOPT_RETURNTRANSFER", "=>", "TRUE", ",", "CURLOPT_FOLL...
Initializes a cURL resource and set options @param array $curl_options @return resource cURL resource @codeCoverageIgnore
[ "Initializes", "a", "cURL", "resource", "and", "set", "options" ]
f7831ab055eaba7105f3f3530506b96de7fedd29
https://github.com/OpenBuildings/monetary/blob/f7831ab055eaba7105f3f3530506b96de7fedd29/src/OpenBuildings/Monetary/CURL.php#L42-L59
22,574
OpenBuildings/monetary
src/OpenBuildings/Monetary/CURL.php
CURL._handle_error
protected function _handle_error($curl) { // Get the error code and message $code = curl_errno($curl); $error = curl_error($curl); $this->_close($curl); throw new Exception_Source( 'Fetching :source_name data failed: :error (:code)', 'remote', array( ':error' => $error, ':code' => $code ...
php
protected function _handle_error($curl) { // Get the error code and message $code = curl_errno($curl); $error = curl_error($curl); $this->_close($curl); throw new Exception_Source( 'Fetching :source_name data failed: :error (:code)', 'remote', array( ':error' => $error, ':code' => $code ...
[ "protected", "function", "_handle_error", "(", "$", "curl", ")", "{", "// Get the error code and message", "$", "code", "=", "curl_errno", "(", "$", "curl", ")", ";", "$", "error", "=", "curl_error", "(", "$", "curl", ")", ";", "$", "this", "->", "_close",...
Handle cURL errors @param resource $curl cURL resource with an error @throws Exception_Source with the error message and error code
[ "Handle", "cURL", "errors" ]
f7831ab055eaba7105f3f3530506b96de7fedd29
https://github.com/OpenBuildings/monetary/blob/f7831ab055eaba7105f3f3530506b96de7fedd29/src/OpenBuildings/Monetary/CURL.php#L86-L102
22,575
sergmoro1/yii2-lookup
src/models/Property.php
Property.getValues
public static function getValues($name, $index = 'code') { if($property_id = self::getId($name)) { $a = []; foreach(Lookup::find() ->select(['position', 'name']) ->where(['property_id' => $property_id]) ->orderBy($index)->all() as $item) $a[$item->$index] = $item->name; return $a; } else ...
php
public static function getValues($name, $index = 'code') { if($property_id = self::getId($name)) { $a = []; foreach(Lookup::find() ->select(['position', 'name']) ->where(['property_id' => $property_id]) ->orderBy($index)->all() as $item) $a[$item->$index] = $item->name; return $a; } else ...
[ "public", "static", "function", "getValues", "(", "$", "name", ",", "$", "index", "=", "'code'", ")", "{", "if", "(", "$", "property_id", "=", "self", "::", "getId", "(", "$", "name", ")", ")", "{", "$", "a", "=", "[", "]", ";", "foreach", "(", ...
Get all property values as array with Code or Position as index. @params string property name @params string code or position @return array
[ "Get", "all", "property", "values", "as", "array", "with", "Code", "or", "Position", "as", "index", "." ]
deff08a2612b3c54d313a6c60a74fcaae1193b21
https://github.com/sergmoro1/yii2-lookup/blob/deff08a2612b3c54d313a6c60a74fcaae1193b21/src/models/Property.php#L45-L56
22,576
technote-space/wordpress-plugin-base
src/traits/cron.php
Cron.set_cron_event
private function set_cron_event() { $interval = $this->get_interval(); if ( $interval > 0 ) { if ( ! wp_next_scheduled( $this->get_hook_name() ) ) { if ( $this->is_running_cron_process() ) { return; } wp_schedule_single_event( time() + $interval, $this->get_hook_name() ); } } }
php
private function set_cron_event() { $interval = $this->get_interval(); if ( $interval > 0 ) { if ( ! wp_next_scheduled( $this->get_hook_name() ) ) { if ( $this->is_running_cron_process() ) { return; } wp_schedule_single_event( time() + $interval, $this->get_hook_name() ); } } }
[ "private", "function", "set_cron_event", "(", ")", "{", "$", "interval", "=", "$", "this", "->", "get_interval", "(", ")", ";", "if", "(", "$", "interval", ">", "0", ")", "{", "if", "(", "!", "wp_next_scheduled", "(", "$", "this", "->", "get_hook_name"...
set cron event
[ "set", "cron", "event" ]
02cfcba358432a2539af07a69d9db00ff7c14eac
https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/cron.php#L43-L53
22,577
SporkCode/Spork
src/Validator/AuthAdapter.php
AuthAdapter.isValid
public function isValid($value, array $context = null) { $context = (array) $context; if (!array_key_exists($this->identity, $context) || empty($context[$this->identity])) { // $this->error(self::IDENTITY_EMPTY); return false; } if (!array_key_ex...
php
public function isValid($value, array $context = null) { $context = (array) $context; if (!array_key_exists($this->identity, $context) || empty($context[$this->identity])) { // $this->error(self::IDENTITY_EMPTY); return false; } if (!array_key_ex...
[ "public", "function", "isValid", "(", "$", "value", ",", "array", "$", "context", "=", "null", ")", "{", "$", "context", "=", "(", "array", ")", "$", "context", ";", "if", "(", "!", "array_key_exists", "(", "$", "this", "->", "identity", ",", "$", ...
Test if authentication is valid @see \Zend\Validator\ValidatorInterface::isValid() @param mixed $value @param array $context @return boolean
[ "Test", "if", "authentication", "is", "valid" ]
7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Validator/AuthAdapter.php#L150-L176
22,578
antaresproject/notifications
src/Model/NotificationContents.php
NotificationContents.fires
protected function fires() { $className = isset($this->notification->classname) ? snake_case(class_basename($this->notification->classname)) : false; if (! $className) { return []; } $before = event('notifications:' . $className . '.render.before'); $after = ev...
php
protected function fires() { $className = isset($this->notification->classname) ? snake_case(class_basename($this->notification->classname)) : false; if (! $className) { return []; } $before = event('notifications:' . $className . '.render.before'); $after = ev...
[ "protected", "function", "fires", "(", ")", "{", "$", "className", "=", "isset", "(", "$", "this", "->", "notification", "->", "classname", ")", "?", "snake_case", "(", "class_basename", "(", "$", "this", "->", "notification", "->", "classname", ")", ")", ...
fires events for notification template @return array
[ "fires", "events", "for", "notification", "template" ]
60de743477b7e9cbb51de66da5fd9461adc9dd8a
https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Model/NotificationContents.php#L88-L103
22,579
antaresproject/notifications
src/Model/NotificationContents.php
NotificationContents.save
public function save(array $options = array()) { $fired = $this->fires(); $content = count($fired) ? str_replace([$fired['before'], $fired['after']], '', $this->content) : $this->content; $this->setAttribute('content', $content); $this->attributes['content']...
php
public function save(array $options = array()) { $fired = $this->fires(); $content = count($fired) ? str_replace([$fired['before'], $fired['after']], '', $this->content) : $this->content; $this->setAttribute('content', $content); $this->attributes['content']...
[ "public", "function", "save", "(", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "fired", "=", "$", "this", "->", "fires", "(", ")", ";", "$", "content", "=", "count", "(", "$", "fired", ")", "?", "str_replace", "(", "[", "$", ...
saves notification content without data from fired events @param array $options
[ "saves", "notification", "content", "without", "data", "from", "fired", "events" ]
60de743477b7e9cbb51de66da5fd9461adc9dd8a
https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Model/NotificationContents.php#L133-L144
22,580
kenphp/ken
src/Utils/ArrayDot.php
ArrayDot.get
public function get($key, $defaultValue = null) { $keys = explode('.', $key); $config = $this->_arr; foreach ($keys as $value) { if (is_array($config)) { if (array_key_exists($value, $config)) { $config = $config[$value]; } els...
php
public function get($key, $defaultValue = null) { $keys = explode('.', $key); $config = $this->_arr; foreach ($keys as $value) { if (is_array($config)) { if (array_key_exists($value, $config)) { $config = $config[$value]; } els...
[ "public", "function", "get", "(", "$", "key", ",", "$", "defaultValue", "=", "null", ")", "{", "$", "keys", "=", "explode", "(", "'.'", ",", "$", "key", ")", ";", "$", "config", "=", "$", "this", "->", "_arr", ";", "foreach", "(", "$", "keys", ...
Gets config value based on key. To access a sub-array you can use a dot separated key. For example, given this configuration array : array( 'basePath' => 'somepath', 'params' => array( 'somekey' => 'value of key' ) ); To access the value of 'somekey', you can call the method like this : echo $config->get('params.so...
[ "Gets", "config", "value", "based", "on", "key", "." ]
c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb
https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Utils/ArrayDot.php#L58-L76
22,581
kenphp/ken
src/Utils/ArrayDot.php
ArrayDot.set
public function set($key, $value) { $keys = explode('.', $key); $config = &$this->_arr; foreach ($keys as $val) { $config = &$config[$val]; } $config = $value; }
php
public function set($key, $value) { $keys = explode('.', $key); $config = &$this->_arr; foreach ($keys as $val) { $config = &$config[$val]; } $config = $value; }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ")", "{", "$", "keys", "=", "explode", "(", "'.'", ",", "$", "key", ")", ";", "$", "config", "=", "&", "$", "this", "->", "_arr", ";", "foreach", "(", "$", "keys", "as", "$", "v...
Sets config value based on key. To set a sub-array configuration, you can use a dot separated key. For example, given this configuration array : array( 'basePath' => 'somepath', 'params' => array( 'somekey' => 'value of key' ) ); To set the value of 'somekey' to 'another value of key', you can call the method like t...
[ "Sets", "config", "value", "based", "on", "key", "." ]
c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb
https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Utils/ArrayDot.php#L98-L108
22,582
kenphp/ken
src/Utils/ArrayDot.php
ArrayDot.remove
public function remove($key) { $keys = explode('.', $key); $cKeys = count($keys); $config = &$this->_arr; for ($i = 0; $i < $cKeys; ++$i) { if ($i === ($cKeys - 1)) { unset($config[$keys[$i]]); } elseif (is_array($config)) { ...
php
public function remove($key) { $keys = explode('.', $key); $cKeys = count($keys); $config = &$this->_arr; for ($i = 0; $i < $cKeys; ++$i) { if ($i === ($cKeys - 1)) { unset($config[$keys[$i]]); } elseif (is_array($config)) { ...
[ "public", "function", "remove", "(", "$", "key", ")", "{", "$", "keys", "=", "explode", "(", "'.'", ",", "$", "key", ")", ";", "$", "cKeys", "=", "count", "(", "$", "keys", ")", ";", "$", "config", "=", "&", "$", "this", "->", "_arr", ";", "f...
Removes config value based on key. To unset a sub-array configuration, you can use a dot separated key. For example, given this configuration array : array( 'basePath' => 'somepath', 'params' => array( 'somekey' => 'value of key' ) ); To unset the value of 'somekey', you can call the method like this : $config->uns...
[ "Removes", "config", "value", "based", "on", "key", "." ]
c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb
https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Utils/ArrayDot.php#L129-L146
22,583
kenphp/ken
src/Utils/ArrayDot.php
ArrayDot.has
public function has($key) { $keys = explode('.', $key); $cKeys = count($keys); $config = $this->_arr; for ($i = 0; $i < $cKeys; ++$i) { if (is_array($config)) { if (array_key_exists($keys[$i], $config)) { $config = $config[$keys[$i]]; ...
php
public function has($key) { $keys = explode('.', $key); $cKeys = count($keys); $config = $this->_arr; for ($i = 0; $i < $cKeys; ++$i) { if (is_array($config)) { if (array_key_exists($keys[$i], $config)) { $config = $config[$keys[$i]]; ...
[ "public", "function", "has", "(", "$", "key", ")", "{", "$", "keys", "=", "explode", "(", "'.'", ",", "$", "key", ")", ";", "$", "cKeys", "=", "count", "(", "$", "keys", ")", ";", "$", "config", "=", "$", "this", "->", "_arr", ";", "for", "("...
Checks whether config has a certain key. @param string $key Dot-separated string of key @return bool
[ "Checks", "whether", "config", "has", "a", "certain", "key", "." ]
c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb
https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Utils/ArrayDot.php#L155-L174
22,584
nabab/bbn
src/bbn/file/pdf.php
pdf.add_fonts
public function add_fonts(array $fonts){ if ( !\defined('BBN_LIB_PATH') ){ die('You must define BBN_LIB_PATH!'); } if ( !is_dir(BBN_LIB_PATH . 'mpdf/mpdf/ttfonts/') ){ die("You don't have the mpdf/mpdf/ttfonts directory."); } foreach ($fonts as $f => $fs) { // add to available font...
php
public function add_fonts(array $fonts){ if ( !\defined('BBN_LIB_PATH') ){ die('You must define BBN_LIB_PATH!'); } if ( !is_dir(BBN_LIB_PATH . 'mpdf/mpdf/ttfonts/') ){ die("You don't have the mpdf/mpdf/ttfonts directory."); } foreach ($fonts as $f => $fs) { // add to available font...
[ "public", "function", "add_fonts", "(", "array", "$", "fonts", ")", "{", "if", "(", "!", "\\", "defined", "(", "'BBN_LIB_PATH'", ")", ")", "{", "die", "(", "'You must define BBN_LIB_PATH!'", ")", ";", "}", "if", "(", "!", "is_dir", "(", "BBN_LIB_PATH", "...
Adds custom fonts $pdf->add_fonts([ 'dawningofanewday' => [ 'R' => BBN_DATA_PATH.'files/DawningofaNewDay.ttf' ] ]); @param array $fonts
[ "Adds", "custom", "fonts" ]
439fea2faa0de22fdaae2611833bab8061f40c37
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/pdf.php#L239-L270
22,585
cirrusidentity/simplesamlphp-test-utils
src/SanityChecker.php
SanityChecker.confirmAspectMockConfigured
static public function confirmAspectMockConfigured() { // Ensure mocks are configured for SSP classes $httpDouble = test::double('SimpleSAML\Utils\HTTP', [ 'getAcceptLanguage' => ['some-lang'] ]); if ( ['some-lang'] !== \SimpleSAML\Utils\HTTP::getAcceptLanguage()) { ...
php
static public function confirmAspectMockConfigured() { // Ensure mocks are configured for SSP classes $httpDouble = test::double('SimpleSAML\Utils\HTTP', [ 'getAcceptLanguage' => ['some-lang'] ]); if ( ['some-lang'] !== \SimpleSAML\Utils\HTTP::getAcceptLanguage()) { ...
[ "static", "public", "function", "confirmAspectMockConfigured", "(", ")", "{", "// Ensure mocks are configured for SSP classes", "$", "httpDouble", "=", "test", "::", "double", "(", "'SimpleSAML\\Utils\\HTTP'", ",", "[", "'getAcceptLanguage'", "=>", "[", "'some-lang'", "]"...
Checks that AspectMock is configured and can override HTTP Util methods @return \AspectMock\Proxy\ClassProxy|\AspectMock\Proxy\InstanceProxy|\AspectMock\Proxy\Verifier @throws \Exception
[ "Checks", "that", "AspectMock", "is", "configured", "and", "can", "override", "HTTP", "Util", "methods" ]
79150efb8bca89c180b604dc1d6194f819ebe2b2
https://github.com/cirrusidentity/simplesamlphp-test-utils/blob/79150efb8bca89c180b604dc1d6194f819ebe2b2/src/SanityChecker.php#L18-L30
22,586
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/handlers/mssql.php
ezcDbHandlerMssql.setupConnection
private function setupConnection() { $requiredMode = $this->options->quoteIdentifier; if ( $requiredMode == ezcDbMssqlOptions::QUOTES_GUESS ) { $result = parent::query( "SELECT sessionproperty('QUOTED_IDENTIFIER')" ); $rows = $result->fetchAll(); $mode = (...
php
private function setupConnection() { $requiredMode = $this->options->quoteIdentifier; if ( $requiredMode == ezcDbMssqlOptions::QUOTES_GUESS ) { $result = parent::query( "SELECT sessionproperty('QUOTED_IDENTIFIER')" ); $rows = $result->fetchAll(); $mode = (...
[ "private", "function", "setupConnection", "(", ")", "{", "$", "requiredMode", "=", "$", "this", "->", "options", "->", "quoteIdentifier", ";", "if", "(", "$", "requiredMode", "==", "ezcDbMssqlOptions", "::", "QUOTES_GUESS", ")", "{", "$", "result", "=", "par...
Sets up opened connection according to options.
[ "Sets", "up", "opened", "connection", "according", "to", "options", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/handlers/mssql.php#L92-L119
22,587
Eresus/EresusCMS
src/core/framework/core/3rdparty/dwoo/Dwoo/Loader.php
Dwoo_Loader.rebuildClassPathCache
protected function rebuildClassPathCache($path, $cacheFile) { if ($cacheFile!==false) { $tmp = $this->classPath; $this->classPath = array(); } // iterates over all files/folders $list = glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*'); if (is_array($list)) { foreach ($list as $f)...
php
protected function rebuildClassPathCache($path, $cacheFile) { if ($cacheFile!==false) { $tmp = $this->classPath; $this->classPath = array(); } // iterates over all files/folders $list = glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*'); if (is_array($list)) { foreach ($list as $f)...
[ "protected", "function", "rebuildClassPathCache", "(", "$", "path", ",", "$", "cacheFile", ")", "{", "if", "(", "$", "cacheFile", "!==", "false", ")", "{", "$", "tmp", "=", "$", "this", "->", "classPath", ";", "$", "this", "->", "classPath", "=", "arra...
rebuilds class paths, scans the given directory recursively and saves all paths in the given file @param string $path the plugin path to scan @param string $cacheFile the file where to store the plugin paths cache, it will be overwritten
[ "rebuilds", "class", "paths", "scans", "the", "given", "directory", "recursively", "and", "saves", "all", "paths", "in", "the", "given", "file" ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Loader.php#L66-L92
22,588
Eresus/EresusCMS
src/core/framework/core/3rdparty/dwoo/Dwoo/Loader.php
Dwoo_Loader.loadPlugin
public function loadPlugin($class, $forceRehash = true) { // a new class was added or the include failed so we rebuild the cache if (!isset($this->classPath[$class]) || !(include $this->classPath[$class])) { if ($forceRehash) { $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir . 'classpath....
php
public function loadPlugin($class, $forceRehash = true) { // a new class was added or the include failed so we rebuild the cache if (!isset($this->classPath[$class]) || !(include $this->classPath[$class])) { if ($forceRehash) { $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir . 'classpath....
[ "public", "function", "loadPlugin", "(", "$", "class", ",", "$", "forceRehash", "=", "true", ")", "{", "// a new class was added or the include failed so we rebuild the cache", "if", "(", "!", "isset", "(", "$", "this", "->", "classPath", "[", "$", "class", "]", ...
loads a plugin file @param string $class the plugin name, without the Dwoo_Plugin_ prefix @param bool $forceRehash if true, the class path caches will be rebuilt if the plugin is not found, in case it has just been added, defaults to true
[ "loads", "a", "plugin", "file" ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Loader.php#L100-L118
22,589
ekuiter/feature-php
FeaturePhp/File/TemplateFile.php
TemplateFile.render
public static function render($source, $rules = array(), $directory = null) { if (!$directory) $directory = getcwd(); return self::fromSpecification( fphp\Specification\TemplateSpecification::fromArrayAndSettings( array( "source" => $s...
php
public static function render($source, $rules = array(), $directory = null) { if (!$directory) $directory = getcwd(); return self::fromSpecification( fphp\Specification\TemplateSpecification::fromArrayAndSettings( array( "source" => $s...
[ "public", "static", "function", "render", "(", "$", "source", ",", "$", "rules", "=", "array", "(", ")", ",", "$", "directory", "=", "null", ")", "{", "if", "(", "!", "$", "directory", ")", "$", "directory", "=", "getcwd", "(", ")", ";", "return", ...
A quick way to directly render a template file with some replacement rules. @param string $source @param array[] $rules @param string $directory @return string
[ "A", "quick", "way", "to", "directly", "render", "a", "template", "file", "with", "some", "replacement", "rules", "." ]
daf4a59098802fedcfd1f1a1d07847fcf2fea7bf
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/File/TemplateFile.php#L52-L63
22,590
ekuiter/feature-php
FeaturePhp/File/TemplateFile.php
TemplateFile.getContent
public function getContent() { $content = file_get_contents($this->fileSource); foreach ($this->rules as $rule) $content = $rule->apply($content); return new TextFileContent($content); }
php
public function getContent() { $content = file_get_contents($this->fileSource); foreach ($this->rules as $rule) $content = $rule->apply($content); return new TextFileContent($content); }
[ "public", "function", "getContent", "(", ")", "{", "$", "content", "=", "file_get_contents", "(", "$", "this", "->", "fileSource", ")", ";", "foreach", "(", "$", "this", "->", "rules", "as", "$", "rule", ")", "$", "content", "=", "$", "rule", "->", "...
Returns the template file's content. The content consists of the file content with every rule applied. @return TextFileContent
[ "Returns", "the", "template", "file", "s", "content", ".", "The", "content", "consists", "of", "the", "file", "content", "with", "every", "rule", "applied", "." ]
daf4a59098802fedcfd1f1a1d07847fcf2fea7bf
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/File/TemplateFile.php#L100-L105
22,591
Smile-SA/EzUICronBundle
Controller/CronsController.php
CronsController.listAction
public function listAction() { $this->performAccessChecks(); $crons = $this->cronService->getCrons(); return $this->render('SmileEzUICronBundle:cron:tab/crons/list.html.twig', [ 'datas' => $crons ]); }
php
public function listAction() { $this->performAccessChecks(); $crons = $this->cronService->getCrons(); return $this->render('SmileEzUICronBundle:cron:tab/crons/list.html.twig', [ 'datas' => $crons ]); }
[ "public", "function", "listAction", "(", ")", "{", "$", "this", "->", "performAccessChecks", "(", ")", ";", "$", "crons", "=", "$", "this", "->", "cronService", "->", "getCrons", "(", ")", ";", "return", "$", "this", "->", "render", "(", "'SmileEzUICronB...
List crons definition @return Response
[ "List", "crons", "definition" ]
c62fc6a3ab0b39e3f911742d9affe4aade90cf66
https://github.com/Smile-SA/EzUICronBundle/blob/c62fc6a3ab0b39e3f911742d9affe4aade90cf66/Controller/CronsController.php#L44-L53
22,592
Smile-SA/EzUICronBundle
Controller/CronsController.php
CronsController.editAction
public function editAction(Request $request, $type, $alias) { $this->performAccessChecks(); $value = $request->get('value'); $response = new Response(); try { $this->cronService->updateCron($alias, $type, $value); $response->setStatusCode( 2...
php
public function editAction(Request $request, $type, $alias) { $this->performAccessChecks(); $value = $request->get('value'); $response = new Response(); try { $this->cronService->updateCron($alias, $type, $value); $response->setStatusCode( 2...
[ "public", "function", "editAction", "(", "Request", "$", "request", ",", "$", "type", ",", "$", "alias", ")", "{", "$", "this", "->", "performAccessChecks", "(", ")", ";", "$", "value", "=", "$", "request", "->", "get", "(", "'value'", ")", ";", "$",...
Edition cron definition @param Request $request @param string $type cron property identifier @param string $alias cron alias identifier @return Response
[ "Edition", "cron", "definition" ]
c62fc6a3ab0b39e3f911742d9affe4aade90cf66
https://github.com/Smile-SA/EzUICronBundle/blob/c62fc6a3ab0b39e3f911742d9affe4aade90cf66/Controller/CronsController.php#L63-L84
22,593
codezero-be/laravel-localizer
src/Localizer.php
Localizer.detect
public function detect() { foreach ($this->detectors as $detector) { $locales = (array) $this->getInstance($detector)->detect(); foreach ($locales as $locale) { if ($this->isSupportedLocale($locale)) { return $locale; } ...
php
public function detect() { foreach ($this->detectors as $detector) { $locales = (array) $this->getInstance($detector)->detect(); foreach ($locales as $locale) { if ($this->isSupportedLocale($locale)) { return $locale; } ...
[ "public", "function", "detect", "(", ")", "{", "foreach", "(", "$", "this", "->", "detectors", "as", "$", "detector", ")", "{", "$", "locales", "=", "(", "array", ")", "$", "this", "->", "getInstance", "(", "$", "detector", ")", "->", "detect", "(", ...
Detect any supported locale and return the first match. @return string|false
[ "Detect", "any", "supported", "locale", "and", "return", "the", "first", "match", "." ]
812692796a73bd38fc205404d8ef90df5bfa0d83
https://github.com/codezero-be/laravel-localizer/blob/812692796a73bd38fc205404d8ef90df5bfa0d83/src/Localizer.php#L49-L62
22,594
josh-taylor/migrations-generator
src/Generator.php
Generator.tables
public function tables() { $schema = $this->db->connection() ->getDoctrineConnection() ->getSchemaManager(); $tables = $schema->listTableNames(); foreach ($tables as $table) { $columns = $this->describer->describe($table); yield compact('tab...
php
public function tables() { $schema = $this->db->connection() ->getDoctrineConnection() ->getSchemaManager(); $tables = $schema->listTableNames(); foreach ($tables as $table) { $columns = $this->describer->describe($table); yield compact('tab...
[ "public", "function", "tables", "(", ")", "{", "$", "schema", "=", "$", "this", "->", "db", "->", "connection", "(", ")", "->", "getDoctrineConnection", "(", ")", "->", "getSchemaManager", "(", ")", ";", "$", "tables", "=", "$", "schema", "->", "listTa...
Return a description for each table. @return \Generator
[ "Return", "a", "description", "for", "each", "table", "." ]
bb6edc78773d11491881f12265a658bf058cb218
https://github.com/josh-taylor/migrations-generator/blob/bb6edc78773d11491881f12265a658bf058cb218/src/Generator.php#L36-L49
22,595
inhere/php-librarys
src/Utils/LiteLogger.php
LiteLogger.flush
public function flush() { if ($this->recordSize === 0) { return; } $str = ''; foreach ($this->records as $record) { $str .= $this->recordFormat($record); } $this->clear(); $this->write($str); }
php
public function flush() { if ($this->recordSize === 0) { return; } $str = ''; foreach ($this->records as $record) { $str .= $this->recordFormat($record); } $this->clear(); $this->write($str); }
[ "public", "function", "flush", "(", ")", "{", "if", "(", "$", "this", "->", "recordSize", "===", "0", ")", "{", "return", ";", "}", "$", "str", "=", "''", ";", "foreach", "(", "$", "this", "->", "records", "as", "$", "record", ")", "{", "$", "s...
flush data to file. @throws \Inhere\Exceptions\FileSystemException
[ "flush", "data", "to", "file", "." ]
e6ca598685469794f310e3ab0e2bc19519cd0ae6
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Utils/LiteLogger.php#L330-L343
22,596
inhere/php-librarys
src/Utils/LiteLogger.php
LiteLogger.getLogPath
public function getLogPath() { if (!$this->basePath) { throw new \InvalidArgumentException('The property basePath is required.'); } return $this->getBasePath() . '/' . ($this->subFolder ? $this->subFolder . '/' : ''); }
php
public function getLogPath() { if (!$this->basePath) { throw new \InvalidArgumentException('The property basePath is required.'); } return $this->getBasePath() . '/' . ($this->subFolder ? $this->subFolder . '/' : ''); }
[ "public", "function", "getLogPath", "(", ")", "{", "if", "(", "!", "$", "this", "->", "basePath", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'The property basePath is required.'", ")", ";", "}", "return", "$", "this", "->", "getBasePath"...
get log path @return string @throws \InvalidArgumentException
[ "get", "log", "path" ]
e6ca598685469794f310e3ab0e2bc19519cd0ae6
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Utils/LiteLogger.php#L449-L456
22,597
AbuseIO/parser-ipechelon
src/Ipechelon.php
Ipechelon.saveIncident
private function saveIncident($report_xml) { if (!empty($report_xml) && $report_xml = simplexml_load_string($report_xml)) { $this->feedName = 'default'; // If feed is known and enabled, validate data and save report if ($this->isKnownFeed() && $this->isEnabledFeed()) { ...
php
private function saveIncident($report_xml) { if (!empty($report_xml) && $report_xml = simplexml_load_string($report_xml)) { $this->feedName = 'default'; // If feed is known and enabled, validate data and save report if ($this->isKnownFeed() && $this->isEnabledFeed()) { ...
[ "private", "function", "saveIncident", "(", "$", "report_xml", ")", "{", "if", "(", "!", "empty", "(", "$", "report_xml", ")", "&&", "$", "report_xml", "=", "simplexml_load_string", "(", "$", "report_xml", ")", ")", "{", "$", "this", "->", "feedName", "=...
Uses the XML to create incidents @param string $report_xml
[ "Uses", "the", "XML", "to", "create", "incidents" ]
41154a5aa88f7762db0941edca95363fac9f6886
https://github.com/AbuseIO/parser-ipechelon/blob/41154a5aa88f7762db0941edca95363fac9f6886/src/Ipechelon.php#L77-L104
22,598
phpgears/dto
src/PayloadBehaviour.php
PayloadBehaviour.setPayload
private function setPayload(array $parameters): void { $this->payload = []; foreach ($parameters as $parameter => $value) { $this->setPayloadParameter($parameter, $value); } }
php
private function setPayload(array $parameters): void { $this->payload = []; foreach ($parameters as $parameter => $value) { $this->setPayloadParameter($parameter, $value); } }
[ "private", "function", "setPayload", "(", "array", "$", "parameters", ")", ":", "void", "{", "$", "this", "->", "payload", "=", "[", "]", ";", "foreach", "(", "$", "parameters", "as", "$", "parameter", "=>", "$", "value", ")", "{", "$", "this", "->",...
Set payload. @param array<string, mixed> $parameters
[ "Set", "payload", "." ]
404b2cdea108538b55caa261c29280062dd0e3db
https://github.com/phpgears/dto/blob/404b2cdea108538b55caa261c29280062dd0e3db/src/PayloadBehaviour.php#L34-L41
22,599
shipmile/shipmile-api-php
lib/Shipmile/HttpClient/AuthHandler.php
AuthHandler.getAuthType
public function getAuthType() { if (isset($this->auth['username']) && isset($this->auth['password'])) { return self::HTTP_PASSWORD; } if (isset($this->auth['client_id']) && isset($this->auth['client_secret'])) { return self::URL_SECRET; } if (isset(...
php
public function getAuthType() { if (isset($this->auth['username']) && isset($this->auth['password'])) { return self::HTTP_PASSWORD; } if (isset($this->auth['client_id']) && isset($this->auth['client_secret'])) { return self::URL_SECRET; } if (isset(...
[ "public", "function", "getAuthType", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "auth", "[", "'username'", "]", ")", "&&", "isset", "(", "$", "this", "->", "auth", "[", "'password'", "]", ")", ")", "{", "return", "self", "::", "HTTP...
Calculating the Authentication Type
[ "Calculating", "the", "Authentication", "Type" ]
b8272613b3a27f0f27e8722cbee277e41e9dfe59
https://github.com/shipmile/shipmile-api-php/blob/b8272613b3a27f0f27e8722cbee277e41e9dfe59/lib/Shipmile/HttpClient/AuthHandler.php#L27-L43