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
230,400
Webiny/Framework
src/Webiny/Component/ServiceManager/ServiceManager.php
ServiceManager.getServicesByTag
public function getServicesByTag($tag, $forceType = null) { $services = []; foreach ($this->taggedServices->key($tag, [], true) as $serviceName) { $service = $this->getService($serviceName); if (!$this->isNull($forceType) && !$this->isInstanceOf($service, $forceType)) { ...
php
public function getServicesByTag($tag, $forceType = null) { $services = []; foreach ($this->taggedServices->key($tag, [], true) as $serviceName) { $service = $this->getService($serviceName); if (!$this->isNull($forceType) && !$this->isInstanceOf($service, $forceType)) { ...
[ "public", "function", "getServicesByTag", "(", "$", "tag", ",", "$", "forceType", "=", "null", ")", "{", "$", "services", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "taggedServices", "->", "key", "(", "$", "tag", ",", "[", "]", ",", "tr...
Get multiple services by tag @param string $tag Tag to use for services filter @param null|string $forceType (Optional) Return only services which are instances of $forceType @return array
[ "Get", "multiple", "services", "by", "tag" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ServiceManager/ServiceManager.php#L71-L83
230,401
Webiny/Framework
src/Webiny/Component/ServiceManager/ServiceManager.php
ServiceManager.registerService
public function registerService($serviceName, ConfigObject $config, $overwrite = false) { /** * Check if service instance already exists */ if ($this->registeredServices->keyExists($serviceName) && !$overwrite) { throw new ServiceManagerException(ServiceManagerException...
php
public function registerService($serviceName, ConfigObject $config, $overwrite = false) { /** * Check if service instance already exists */ if ($this->registeredServices->keyExists($serviceName) && !$overwrite) { throw new ServiceManagerException(ServiceManagerException...
[ "public", "function", "registerService", "(", "$", "serviceName", ",", "ConfigObject", "$", "config", ",", "$", "overwrite", "=", "false", ")", "{", "/**\n * Check if service instance already exists\n */", "if", "(", "$", "this", "->", "registeredService...
Register service using given config @param string $serviceName @param ConfigObject $config @param bool $overwrite Overwrite service if it has been registered before (Default: false) @throws ServiceManagerException @return $this
[ "Register", "service", "using", "given", "config" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ServiceManager/ServiceManager.php#L96-L120
230,402
Webiny/Framework
src/Webiny/Component/ServiceManager/ServiceManager.php
ServiceManager.registerServices
public function registerServices($serviceGroup, ConfigObject $config, $overwrite = false) { foreach ($config as $serviceKey => $serviceConfig) { $this->registerService($serviceGroup . '.' . $serviceKey, $serviceConfig, $overwrite); } }
php
public function registerServices($serviceGroup, ConfigObject $config, $overwrite = false) { foreach ($config as $serviceKey => $serviceConfig) { $this->registerService($serviceGroup . '.' . $serviceKey, $serviceConfig, $overwrite); } }
[ "public", "function", "registerServices", "(", "$", "serviceGroup", ",", "ConfigObject", "$", "config", ",", "$", "overwrite", "=", "false", ")", "{", "foreach", "(", "$", "config", "as", "$", "serviceKey", "=>", "$", "serviceConfig", ")", "{", "$", "this"...
Register given services under given service group @param string $serviceGroup @param ConfigObject $config @param bool $overwrite Overwrite service if it has been registered before (Default: false)
[ "Register", "given", "services", "under", "given", "service", "group" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ServiceManager/ServiceManager.php#L129-L134
230,403
Webiny/Framework
src/Webiny/Component/ServiceManager/ServiceManager.php
ServiceManager.registerParameters
public function registerParameters($parameters = []) { foreach ($parameters as $name => $value) { $this->registerParameter($name, $value); } return $this; }
php
public function registerParameters($parameters = []) { foreach ($parameters as $name => $value) { $this->registerParameter($name, $value); } return $this; }
[ "public", "function", "registerParameters", "(", "$", "parameters", "=", "[", "]", ")", "{", "foreach", "(", "$", "parameters", "as", "$", "name", "=>", "$", "value", ")", "{", "$", "this", "->", "registerParameter", "(", "$", "name", ",", "$", "value"...
Register multiple parameters for use in service configs @param ArrayObject|array $parameters Array of key => value parameter names and values @return $this
[ "Register", "multiple", "parameters", "for", "use", "in", "service", "configs" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ServiceManager/ServiceManager.php#L158-L165
230,404
Webiny/Framework
src/Webiny/Component/ServiceManager/ServiceManager.php
ServiceManager.getServiceConfig
public function getServiceConfig($serviceName) { if (!$this->registeredServices->keyExists($serviceName)) { throw new ServiceManagerException(ServiceManagerException::SERVICE_DEFINITION_NOT_FOUND, [$serviceName]); } return $this->registeredServices[$serviceName]; }
php
public function getServiceConfig($serviceName) { if (!$this->registeredServices->keyExists($serviceName)) { throw new ServiceManagerException(ServiceManagerException::SERVICE_DEFINITION_NOT_FOUND, [$serviceName]); } return $this->registeredServices[$serviceName]; }
[ "public", "function", "getServiceConfig", "(", "$", "serviceName", ")", "{", "if", "(", "!", "$", "this", "->", "registeredServices", "->", "keyExists", "(", "$", "serviceName", ")", ")", "{", "throw", "new", "ServiceManagerException", "(", "ServiceManagerExcept...
Get registered service config @param $serviceName @throws ServiceManagerException @return ConfigObject
[ "Get", "registered", "service", "config" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ServiceManager/ServiceManager.php#L175-L182
230,405
Webiny/Framework
src/Webiny/Component/ServiceManager/ServiceManager.php
ServiceManager.instantiateService
private function instantiateService($serviceName) { // Make sure service is registered if (!$this->registeredServices->keyExists($serviceName)) { throw new ServiceManagerException(ServiceManagerException::SERVICE_DEFINITION_NOT_FOUND, [$serviceName]); } // Get service co...
php
private function instantiateService($serviceName) { // Make sure service is registered if (!$this->registeredServices->keyExists($serviceName)) { throw new ServiceManagerException(ServiceManagerException::SERVICE_DEFINITION_NOT_FOUND, [$serviceName]); } // Get service co...
[ "private", "function", "instantiateService", "(", "$", "serviceName", ")", "{", "// Make sure service is registered", "if", "(", "!", "$", "this", "->", "registeredServices", "->", "keyExists", "(", "$", "serviceName", ")", ")", "{", "throw", "new", "ServiceManage...
Instantiate service using given service name @param string $serviceName @return object @throws ServiceManagerException
[ "Instantiate", "service", "using", "given", "service", "name" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ServiceManager/ServiceManager.php#L205-L245
230,406
themsaid/katana-core
src/PostBuilder.php
PostBuilder.build
public function build() { $this->filesystem->put( sprintf('/%s/_blog/%s', KATANA_CONTENT_DIR, $this->nameFile()), $this->buildTemplate() ); }
php
public function build() { $this->filesystem->put( sprintf('/%s/_blog/%s', KATANA_CONTENT_DIR, $this->nameFile()), $this->buildTemplate() ); }
[ "public", "function", "build", "(", ")", "{", "$", "this", "->", "filesystem", "->", "put", "(", "sprintf", "(", "'/%s/_blog/%s'", ",", "KATANA_CONTENT_DIR", ",", "$", "this", "->", "nameFile", "(", ")", ")", ",", "$", "this", "->", "buildTemplate", "(",...
Build the template view post. @return void
[ "Build", "the", "template", "view", "post", "." ]
897c1adb6863d5145f1f104cbc8c9200cd98c3fb
https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/PostBuilder.php#L55-L64
230,407
themsaid/katana-core
src/PostBuilder.php
PostBuilder.buildTemplate
public function buildTemplate() { return ($this->template)? "--- \rview::extends: _includes.blog_post_base \rview::yields: post_body \rpageTitle: ".$this->title." \rpost::title: ".$this->title." \rpost::date: ".date('F d, Y')." ...
php
public function buildTemplate() { return ($this->template)? "--- \rview::extends: _includes.blog_post_base \rview::yields: post_body \rpageTitle: ".$this->title." \rpost::title: ".$this->title." \rpost::date: ".date('F d, Y')." ...
[ "public", "function", "buildTemplate", "(", ")", "{", "return", "(", "$", "this", "->", "template", ")", "?", "\"---\n \\rview::extends: _includes.blog_post_base\n \\rview::yields: post_body\n \\rpageTitle: \"", ".", "$", "this", "->", "title", ...
Return the default template of the new post @return string
[ "Return", "the", "default", "template", "of", "the", "new", "post" ]
897c1adb6863d5145f1f104cbc8c9200cd98c3fb
https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/PostBuilder.php#L71-L95
230,408
themsaid/katana-core
src/PostBuilder.php
PostBuilder.nameFile
public function nameFile() { $slug = strtolower(trim($this->title)); $slug = preg_replace('/[^a-z0-9-]/', '-', $slug); $slug = preg_replace('/-+/', "-", $slug); $extension = ($this->template)? "md": "blade.php"; return sprintf('%s-%s-.%s', date('Y-m-d'), $slug, $extens...
php
public function nameFile() { $slug = strtolower(trim($this->title)); $slug = preg_replace('/[^a-z0-9-]/', '-', $slug); $slug = preg_replace('/-+/', "-", $slug); $extension = ($this->template)? "md": "blade.php"; return sprintf('%s-%s-.%s', date('Y-m-d'), $slug, $extens...
[ "public", "function", "nameFile", "(", ")", "{", "$", "slug", "=", "strtolower", "(", "trim", "(", "$", "this", "->", "title", ")", ")", ";", "$", "slug", "=", "preg_replace", "(", "'/[^a-z0-9-]/'", ",", "'-'", ",", "$", "slug", ")", ";", "$", "slu...
Return the name file of the post @return string
[ "Return", "the", "name", "file", "of", "the", "post" ]
897c1adb6863d5145f1f104cbc8c9200cd98c3fb
https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/PostBuilder.php#L102-L113
230,409
Webiny/Framework
src/Webiny/Component/Rest/Response/Cache.php
Cache.saveResult
public static function saveResult(RequestBag $requestBag, $result) { // check if we have cache in settings if (!$requestBag->getApiConfig()->get('Cache', false) || $requestBag->getMethodData()['cache']['ttl'] <= 0) { return false; } $instance = new self($requestBag); ...
php
public static function saveResult(RequestBag $requestBag, $result) { // check if we have cache in settings if (!$requestBag->getApiConfig()->get('Cache', false) || $requestBag->getMethodData()['cache']['ttl'] <= 0) { return false; } $instance = new self($requestBag); ...
[ "public", "static", "function", "saveResult", "(", "RequestBag", "$", "requestBag", ",", "$", "result", ")", "{", "// check if we have cache in settings", "if", "(", "!", "$", "requestBag", "->", "getApiConfig", "(", ")", "->", "get", "(", "'Cache'", ",", "fal...
Saves the result from the given api request into cache. @param RequestBag $requestBag @param mixed $result @return bool
[ "Saves", "the", "result", "from", "the", "given", "api", "request", "into", "cache", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Response/Cache.php#L58-L68
230,410
Webiny/Framework
src/Webiny/Component/Rest/Response/Cache.php
Cache.saveCallbackResult
public function saveCallbackResult($result) { // get cache key $cacheKey = $this->getCacheKey(); // cache the result try { $cache = $this->cache($this->requestBag->getApiConfig()->get('Cache')); return $cache->save($cacheKey, $result, $this->requestBag->getM...
php
public function saveCallbackResult($result) { // get cache key $cacheKey = $this->getCacheKey(); // cache the result try { $cache = $this->cache($this->requestBag->getApiConfig()->get('Cache')); return $cache->save($cacheKey, $result, $this->requestBag->getM...
[ "public", "function", "saveCallbackResult", "(", "$", "result", ")", "{", "// get cache key", "$", "cacheKey", "=", "$", "this", "->", "getCacheKey", "(", ")", ";", "// cache the result", "try", "{", "$", "cache", "=", "$", "this", "->", "cache", "(", "$",...
Saves the result into cache. @param mixed $result Result that should be saved. @return bool @throws \Webiny\Component\Rest\RestException
[ "Saves", "the", "result", "into", "cache", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Response/Cache.php#L130-L143
230,411
Webiny/Framework
src/Webiny/Component/Rest/Response/Cache.php
Cache.getCacheKey
private function getCacheKey() { if ($this->requestBag->getClassData()['cacheKeyInterface']) { $cacheKey = $this->requestBag->getClassInstance()->getCacheKey(); } else { $url = $this->httpRequest()->getCurrentUrl(true); $cacheKey = 'path-' . $url->getPath(); ...
php
private function getCacheKey() { if ($this->requestBag->getClassData()['cacheKeyInterface']) { $cacheKey = $this->requestBag->getClassInstance()->getCacheKey(); } else { $url = $this->httpRequest()->getCurrentUrl(true); $cacheKey = 'path-' . $url->getPath(); ...
[ "private", "function", "getCacheKey", "(", ")", "{", "if", "(", "$", "this", "->", "requestBag", "->", "getClassData", "(", ")", "[", "'cacheKeyInterface'", "]", ")", "{", "$", "cacheKey", "=", "$", "this", "->", "requestBag", "->", "getClassInstance", "("...
Computes the cache key, or gets it from the implemented interface from the api class. @return string Cache key.
[ "Computes", "the", "cache", "key", "or", "gets", "it", "from", "the", "implemented", "interface", "from", "the", "api", "class", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Response/Cache.php#L171-L187
230,412
milesj/admin
Controller/UploadController.php
UploadController.index
public function index() { $data = $this->request->data; if ($this->request->is('post')) { $data['FileUpload']['user_id'] = $this->Auth->user('id'); try { if ($this->Model->save($data, true)) { $this->Model->set($data); $th...
php
public function index() { $data = $this->request->data; if ($this->request->is('post')) { $data['FileUpload']['user_id'] = $this->Auth->user('id'); try { if ($this->Model->save($data, true)) { $this->Model->set($data); $th...
[ "public", "function", "index", "(", ")", "{", "$", "data", "=", "$", "this", "->", "request", "->", "data", ";", "if", "(", "$", "this", "->", "request", "->", "is", "(", "'post'", ")", ")", "{", "$", "data", "[", "'FileUpload'", "]", "[", "'user...
Upload a file and set transport and transform settings.
[ "Upload", "a", "file", "and", "set", "transport", "and", "transform", "settings", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Controller/UploadController.php#L13-L39
230,413
OpenBuildings/jam
classes/Kohana/Jam/Behavior/Paranoid.php
Kohana_Jam_Behavior_Paranoid.builder_paranoid_filter
public function builder_paranoid_filter(Database_Query $builder) { $filter_type = $builder->params('paranoid_filter_type') ?: Jam_Behavior_Paranoid::filter(); switch ($filter_type) { case Jam_Behavior_Paranoid::ALL: break; case Jam_Behavior_Paranoid::DELETED: $builder->where($this->_field, '=', TR...
php
public function builder_paranoid_filter(Database_Query $builder) { $filter_type = $builder->params('paranoid_filter_type') ?: Jam_Behavior_Paranoid::filter(); switch ($filter_type) { case Jam_Behavior_Paranoid::ALL: break; case Jam_Behavior_Paranoid::DELETED: $builder->where($this->_field, '=', TR...
[ "public", "function", "builder_paranoid_filter", "(", "Database_Query", "$", "builder", ")", "{", "$", "filter_type", "=", "$", "builder", "->", "params", "(", "'paranoid_filter_type'", ")", "?", ":", "Jam_Behavior_Paranoid", "::", "filter", "(", ")", ";", "swit...
Perform the actual where modification when it is needed @param Jam_Query_Builder_Select $builder
[ "Perform", "the", "actual", "where", "modification", "when", "it", "is", "needed" ]
3239e93564d100ddb65055235f87ec99fc0d4370
https://github.com/OpenBuildings/jam/blob/3239e93564d100ddb65055235f87ec99fc0d4370/classes/Kohana/Jam/Behavior/Paranoid.php#L65-L83
230,414
Webiny/Framework
src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php
Message.getTo
public function getTo() { $recipients = []; foreach ($this->message->getTo() as $email => $name) { $recipients[] = new Email($email, $name); } return $recipients; }
php
public function getTo() { $recipients = []; foreach ($this->message->getTo() as $email => $name) { $recipients[] = new Email($email, $name); } return $recipients; }
[ "public", "function", "getTo", "(", ")", "{", "$", "recipients", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "message", "->", "getTo", "(", ")", "as", "$", "email", "=>", "$", "name", ")", "{", "$", "recipients", "[", "]", "=", "new", ...
Returns a list of defined recipients. @return array
[ "Returns", "a", "list", "of", "defined", "recipients", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php#L100-L108
230,415
Webiny/Framework
src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php
Message.getCc
public function getCc() { $recipients = []; foreach ($this->message->getCc() as $email => $name) { $recipients[] = new Email($email, $name); } return $recipients; }
php
public function getCc() { $recipients = []; foreach ($this->message->getCc() as $email => $name) { $recipients[] = new Email($email, $name); } return $recipients; }
[ "public", "function", "getCc", "(", ")", "{", "$", "recipients", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "message", "->", "getCc", "(", ")", "as", "$", "email", "=>", "$", "name", ")", "{", "$", "recipients", "[", "]", "=", "new", ...
Returns a list of addresses to whom the message will be copied to. @return array
[ "Returns", "a", "list", "of", "addresses", "to", "whom", "the", "message", "will", "be", "copied", "to", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php#L115-L123
230,416
Webiny/Framework
src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php
Message.getBcc
public function getBcc() { $recipients = []; foreach ($this->message->getBcc() as $email => $name) { $recipients[] = new Email($email, $name); } return $recipients; }
php
public function getBcc() { $recipients = []; foreach ($this->message->getBcc() as $email => $name) { $recipients[] = new Email($email, $name); } return $recipients; }
[ "public", "function", "getBcc", "(", ")", "{", "$", "recipients", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "message", "->", "getBcc", "(", ")", "as", "$", "email", "=>", "$", "name", ")", "{", "$", "recipients", "[", "]", "=", "new"...
Returns a list of defined bcc recipients. @return array
[ "Returns", "a", "list", "of", "defined", "bcc", "recipients", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php#L130-L138
230,417
Webiny/Framework
src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php
Message.setBody
public function setBody($content, $type = 'text/html', $charset = 'utf-8') { $this->message->setBody($content, $type, $charset); return $this; }
php
public function setBody($content, $type = 'text/html', $charset = 'utf-8') { $this->message->setBody($content, $type, $charset); return $this; }
[ "public", "function", "setBody", "(", "$", "content", ",", "$", "type", "=", "'text/html'", ",", "$", "charset", "=", "'utf-8'", ")", "{", "$", "this", "->", "message", "->", "setBody", "(", "$", "content", ",", "$", "type", ",", "$", "charset", ")",...
Set the message body. @param string $content The content of the body. @param string $type Content type. Default 'text/html'. @param string $charset Content body charset. Default 'utf-8'. @return \Webiny\Component\Mailer\MessageInterface
[ "Set", "the", "message", "body", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php#L161-L166
230,418
Webiny/Framework
src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php
Message.setContentTransferEncoding
public function setContentTransferEncoding($encoding) { switch ($encoding) { case '7bit': $encoder = \Swift_Encoding::get7BitEncoding(); break; case '8bit': $encoder = \Swift_Encoding::get8BitEncoding(); break; ...
php
public function setContentTransferEncoding($encoding) { switch ($encoding) { case '7bit': $encoder = \Swift_Encoding::get7BitEncoding(); break; case '8bit': $encoder = \Swift_Encoding::get8BitEncoding(); break; ...
[ "public", "function", "setContentTransferEncoding", "(", "$", "encoding", ")", "{", "switch", "(", "$", "encoding", ")", "{", "case", "'7bit'", ":", "$", "encoder", "=", "\\", "Swift_Encoding", "::", "get7BitEncoding", "(", ")", ";", "break", ";", "case", ...
Specifies the encoding scheme in the message. @param string $encoding @return $this @throws SwiftMailerException
[ "Specifies", "the", "encoding", "scheme", "in", "the", "message", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php#L252-L281
230,419
Webiny/Framework
src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php
Message.getHeaders
public function getHeaders() { $swiftHeaders = $this->message->getHeaders()->listAll(); $headers = []; foreach ($swiftHeaders as $headerName) { $headers[$headerName] = $this->getHeader($headerName); } return $headers; }
php
public function getHeaders() { $swiftHeaders = $this->message->getHeaders()->listAll(); $headers = []; foreach ($swiftHeaders as $headerName) { $headers[$headerName] = $this->getHeader($headerName); } return $headers; }
[ "public", "function", "getHeaders", "(", ")", "{", "$", "swiftHeaders", "=", "$", "this", "->", "message", "->", "getHeaders", "(", ")", "->", "listAll", "(", ")", ";", "$", "headers", "=", "[", "]", ";", "foreach", "(", "$", "swiftHeaders", "as", "$...
Get all headers from the message. @return array
[ "Get", "all", "headers", "from", "the", "message", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Mailer/Bridge/SwiftMailer/Message.php#L443-L452
230,420
Webiny/Framework
src/Webiny/Component/Image/Bridge/Imagine/Imagine.php
Imagine.getLibraryInstance
private function getLibraryInstance($library) { switch ($library) { case 'gd': return new \Imagine\Gd\Imagine(); break; case 'imagick': return new \Imagine\Imagick\Imagine(); break; case 'gmagick': ...
php
private function getLibraryInstance($library) { switch ($library) { case 'gd': return new \Imagine\Gd\Imagine(); break; case 'imagick': return new \Imagine\Imagick\Imagine(); break; case 'gmagick': ...
[ "private", "function", "getLibraryInstance", "(", "$", "library", ")", "{", "switch", "(", "$", "library", ")", "{", "case", "'gd'", ":", "return", "new", "\\", "Imagine", "\\", "Gd", "\\", "Imagine", "(", ")", ";", "break", ";", "case", "'imagick'", "...
Create a library instance based on given library name. @param string $library Name of the library. Supported libraries are gd, imagick and gmagick. @return \Imagine\Gd\Imagine|\Imagine\Gmagick\Imagine|\Imagine\Imagick\Imagine @throws ImagineException
[ "Create", "a", "library", "instance", "based", "on", "given", "library", "name", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Image/Bridge/Imagine/Imagine.php#L50-L70
230,421
Webiny/Framework
src/Webiny/Component/Router/Loader/ConfigLoader.php
ConfigLoader.getRouteCollection
public function getRouteCollection() { foreach ($this->config as $name => $routeConfig) { $this->routeCollection->add($name, $this->processRoute($routeConfig)); } unset($this->config); return $this->routeCollection; }
php
public function getRouteCollection() { foreach ($this->config as $name => $routeConfig) { $this->routeCollection->add($name, $this->processRoute($routeConfig)); } unset($this->config); return $this->routeCollection; }
[ "public", "function", "getRouteCollection", "(", ")", "{", "foreach", "(", "$", "this", "->", "config", "as", "$", "name", "=>", "$", "routeConfig", ")", "{", "$", "this", "->", "routeCollection", "->", "add", "(", "$", "name", ",", "$", "this", "->", ...
Builds and returns RouteCollection instance. @return RouteCollection
[ "Builds", "and", "returns", "RouteCollection", "instance", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Router/Loader/ConfigLoader.php#L51-L60
230,422
Webiny/Framework
src/Webiny/Component/Router/Loader/ConfigLoader.php
ConfigLoader.processRoute
public function processRoute(ConfigObject $routeConfig) { // base route $callback = $this->isString($routeConfig->Callback) ? $routeConfig->Callback : $routeConfig->Callback->toArray(); $route = new Route($routeConfig->Path, $callback); // route options if (($options = $rout...
php
public function processRoute(ConfigObject $routeConfig) { // base route $callback = $this->isString($routeConfig->Callback) ? $routeConfig->Callback : $routeConfig->Callback->toArray(); $route = new Route($routeConfig->Path, $callback); // route options if (($options = $rout...
[ "public", "function", "processRoute", "(", "ConfigObject", "$", "routeConfig", ")", "{", "// base route", "$", "callback", "=", "$", "this", "->", "isString", "(", "$", "routeConfig", "->", "Callback", ")", "?", "$", "routeConfig", "->", "Callback", ":", "$"...
Builds a Route instance based on the given route config. @param ConfigObject $routeConfig A config object containing route parameters. @return Route
[ "Builds", "a", "Route", "instance", "based", "on", "the", "given", "route", "config", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Router/Loader/ConfigLoader.php#L69-L101
230,423
deanblackborough/zf3-view-helpers
src/Bootstrap3Button.php
Bootstrap3Button.setStyle
public function setStyle(string $style): Bootstrap3Button { if (in_array($style, $this->supported_styles) === true) { $this->style = $style; } else { $this->style = 'default'; } return $this; }
php
public function setStyle(string $style): Bootstrap3Button { if (in_array($style, $this->supported_styles) === true) { $this->style = $style; } else { $this->style = 'default'; } return $this; }
[ "public", "function", "setStyle", "(", "string", "$", "style", ")", ":", "Bootstrap3Button", "{", "if", "(", "in_array", "(", "$", "style", ",", "$", "this", "->", "supported_styles", ")", "===", "true", ")", "{", "$", "this", "->", "style", "=", "$", ...
Set the style for the button, one of the following, default, primary, success, info, warning, danger or link. If an incorrect style is passed in we set the style to btn-default @param string $style @return Bootstrap3Button
[ "Set", "the", "style", "for", "the", "button", "one", "of", "the", "following", "default", "primary", "success", "info", "warning", "danger", "or", "link", ".", "If", "an", "incorrect", "style", "is", "passed", "in", "we", "set", "the", "style", "to", "b...
db8bea4ca62709b2ac8c732aedbb2a5235223f23
https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap3Button.php#L117-L126
230,424
jkphl/squeezr
squeezr/lib/Tollwerk/Squeezr/Css.php
Css._registerBlock
protected function _registerBlock(&$block, array $breakpoints = null) { $this->_blocks[] = array($breakpoints, $this->_minify($block)); $block = ''; }
php
protected function _registerBlock(&$block, array $breakpoints = null) { $this->_blocks[] = array($breakpoints, $this->_minify($block)); $block = ''; }
[ "protected", "function", "_registerBlock", "(", "&", "$", "block", ",", "array", "$", "breakpoints", "=", "null", ")", "{", "$", "this", "->", "_blocks", "[", "]", "=", "array", "(", "$", "breakpoints", ",", "$", "this", "->", "_minify", "(", "$", "b...
Register block data @param string $block Block data @param array $breakpoints Breakpoints
[ "Register", "block", "data" ]
9aed77dcdca889a532a81630498fa51ad63138b7
https://github.com/jkphl/squeezr/blob/9aed77dcdca889a532a81630498fa51ad63138b7/squeezr/lib/Tollwerk/Squeezr/Css.php#L449-L453
230,425
jkphl/squeezr
squeezr/lib/Tollwerk/Squeezr/Css.php
Css._consumeDeclarationBlock
protected function _consumeDeclarationBlock($css, $peek, $offset = 0, &$declarationBlockStart = 0) { $declarationBlockStart = strpos($css, '{', $offset); if ($declarationBlockStart === false) { throw new \Tollwerk\Squeezr\Exception(sprintf(\Tollwerk\Squeezr\Exception::INVALID_DECLARATION...
php
protected function _consumeDeclarationBlock($css, $peek, $offset = 0, &$declarationBlockStart = 0) { $declarationBlockStart = strpos($css, '{', $offset); if ($declarationBlockStart === false) { throw new \Tollwerk\Squeezr\Exception(sprintf(\Tollwerk\Squeezr\Exception::INVALID_DECLARATION...
[ "protected", "function", "_consumeDeclarationBlock", "(", "$", "css", ",", "$", "peek", ",", "$", "offset", "=", "0", ",", "&", "$", "declarationBlockStart", "=", "0", ")", "{", "$", "declarationBlockStart", "=", "strpos", "(", "$", "css", ",", "'{'", ",...
Detect and consume a declaration block within the given CSS text @param string $css CSS text @param int $peek Current peek (for line number detection in case of an error) @param int $offset Optional: Offset position @param int $declarationBlockStart Set by reference: Declaration block start position within the CSS tex...
[ "Detect", "and", "consume", "a", "declaration", "block", "within", "the", "given", "CSS", "text" ]
9aed77dcdca889a532a81630498fa51ad63138b7
https://github.com/jkphl/squeezr/blob/9aed77dcdca889a532a81630498fa51ad63138b7/squeezr/lib/Tollwerk/Squeezr/Css.php#L465-L491
230,426
jkphl/squeezr
squeezr/lib/Tollwerk/Squeezr/Css.php
Css._peekToLine
protected function _peekToLine($peek) { foreach ($this->_lines as $line => $length) { if ($length >= $peek) { break; } } return $line; }
php
protected function _peekToLine($peek) { foreach ($this->_lines as $line => $length) { if ($length >= $peek) { break; } } return $line; }
[ "protected", "function", "_peekToLine", "(", "$", "peek", ")", "{", "foreach", "(", "$", "this", "->", "_lines", "as", "$", "line", "=>", "$", "length", ")", "{", "if", "(", "$", "length", ">=", "$", "peek", ")", "{", "break", ";", "}", "}", "ret...
Find the line number corresponding with a peek position within the CSS file @param int $peek Peek position @return int Line number
[ "Find", "the", "line", "number", "corresponding", "with", "a", "peek", "position", "within", "the", "CSS", "file" ]
9aed77dcdca889a532a81630498fa51ad63138b7
https://github.com/jkphl/squeezr/blob/9aed77dcdca889a532a81630498fa51ad63138b7/squeezr/lib/Tollwerk/Squeezr/Css.php#L584-L592
230,427
jkphl/squeezr
squeezr/lib/Tollwerk/Squeezr/Css.php
Css._compileCacheClassCode
protected function _compileCacheClassCode() { // Instantiate a minification provider (if enabled) if (SQUEEZR_CSS_MINIFY) { $this->_minifier = new Minify(); } // Parse the CSS file and extract breakpoint and CSS block info $this->_parse(); // Compile a c...
php
protected function _compileCacheClassCode() { // Instantiate a minification provider (if enabled) if (SQUEEZR_CSS_MINIFY) { $this->_minifier = new Minify(); } // Parse the CSS file and extract breakpoint and CSS block info $this->_parse(); // Compile a c...
[ "protected", "function", "_compileCacheClassCode", "(", ")", "{", "// Instantiate a minification provider (if enabled)", "if", "(", "SQUEEZR_CSS_MINIFY", ")", "{", "$", "this", "->", "_minifier", "=", "new", "Minify", "(", ")", ";", "}", "// Parse the CSS file and extra...
Compile a PHP cache class representing the loaded CSS stylesheet @return string PHP class code @throws \Tollwerk\Squeezr\Css\Minifier\Exception If an invalid minification provider has been requested
[ "Compile", "a", "PHP", "cache", "class", "representing", "the", "loaded", "CSS", "stylesheet" ]
9aed77dcdca889a532a81630498fa51ad63138b7
https://github.com/jkphl/squeezr/blob/9aed77dcdca889a532a81630498fa51ad63138b7/squeezr/lib/Tollwerk/Squeezr/Css.php#L611-L631
230,428
Webiny/Framework
src/Webiny/Component/Mailer/Mailer.php
Mailer.getMessage
public function getMessage($config = null) { if ($config && !$config instanceof ConfigObject) { $config = new ConfigObject($config); } return Loader::getMessage($this->mailerName, $config); }
php
public function getMessage($config = null) { if ($config && !$config instanceof ConfigObject) { $config = new ConfigObject($config); } return Loader::getMessage($this->mailerName, $config); }
[ "public", "function", "getMessage", "(", "$", "config", "=", "null", ")", "{", "if", "(", "$", "config", "&&", "!", "$", "config", "instanceof", "ConfigObject", ")", "{", "$", "config", "=", "new", "ConfigObject", "(", "$", "config", ")", ";", "}", "...
Creates a new message. @param array|ArrayObject|ConfigObject $config (Optional) @return MessageInterface @throws Bridge\MailerException
[ "Creates", "a", "new", "message", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Mailer/Mailer.php#L59-L65
230,429
Webiny/Framework
src/Webiny/Component/Entity/EntityDataExtractor.php
EntityDataExtractor.buildFields
private function buildFields(&$parsedFields, StringObject $key) { if ($key->contains('.')) { $parts = $key->explode('.', 2)->val(); if (!isset($parsedFields[$parts[0]])) { $parsedFields[$parts[0]] = []; } elseif (!is_array($parsedFields[$parts[0]])) { ...
php
private function buildFields(&$parsedFields, StringObject $key) { if ($key->contains('.')) { $parts = $key->explode('.', 2)->val(); if (!isset($parsedFields[$parts[0]])) { $parsedFields[$parts[0]] = []; } elseif (!is_array($parsedFields[$parts[0]])) { ...
[ "private", "function", "buildFields", "(", "&", "$", "parsedFields", ",", "StringObject", "$", "key", ")", "{", "if", "(", "$", "key", "->", "contains", "(", "'.'", ")", ")", "{", "$", "parts", "=", "$", "key", "->", "explode", "(", "'.'", ",", "2"...
Parse attribute key recursively @param ArrayObject $parsedFields Reference to array of parsed fields @param StringObject $key Current key to parse
[ "Parse", "attribute", "key", "recursively" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Entity/EntityDataExtractor.php#L320-L334
230,430
Webiny/Framework
src/Webiny/Component/Http/Request.php
Request.init
protected function init() { $this->query = new Query(); $this->post = new Post(); $this->payload = new Payload(); $this->server = new Server(); $this->files = new Files(); $this->env = new Env(); $this->headers = new Headers(); }
php
protected function init() { $this->query = new Query(); $this->post = new Post(); $this->payload = new Payload(); $this->server = new Server(); $this->files = new Files(); $this->env = new Env(); $this->headers = new Headers(); }
[ "protected", "function", "init", "(", ")", "{", "$", "this", "->", "query", "=", "new", "Query", "(", ")", ";", "$", "this", "->", "post", "=", "new", "Post", "(", ")", ";", "$", "this", "->", "payload", "=", "new", "Payload", "(", ")", ";", "$...
This function prepare the Request and all of its sub-classes. This class is called automatically by SingletonTrait.
[ "This", "function", "prepare", "the", "Request", "and", "all", "of", "its", "sub", "-", "classes", ".", "This", "class", "is", "called", "automatically", "by", "SingletonTrait", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Http/Request.php#L87-L96
230,431
Webiny/Framework
src/Webiny/Component/Http/Request.php
Request.getTrustedHeaders
public function getTrustedHeaders() { $trustedHeaders = Http::getConfig()->TrustedHeaders; return [ 'client_ip' => $trustedHeaders->get('client_ip', self::HEADER_CLIENT_IP), 'client_host' => $trustedHeaders->get('client_host', self::HEADER_CLIENT_HOST), 'clie...
php
public function getTrustedHeaders() { $trustedHeaders = Http::getConfig()->TrustedHeaders; return [ 'client_ip' => $trustedHeaders->get('client_ip', self::HEADER_CLIENT_IP), 'client_host' => $trustedHeaders->get('client_host', self::HEADER_CLIENT_HOST), 'clie...
[ "public", "function", "getTrustedHeaders", "(", ")", "{", "$", "trustedHeaders", "=", "Http", "::", "getConfig", "(", ")", "->", "TrustedHeaders", ";", "return", "[", "'client_ip'", "=>", "$", "trustedHeaders", "->", "get", "(", "'client_ip'", ",", "self", "...
Get a list of trusted headers. @return array List of trusted headers.
[ "Get", "a", "list", "of", "trusted", "headers", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Http/Request.php#L243-L253
230,432
Webiny/Framework
src/Webiny/Component/Http/Request.php
Request.getCurrentUrl
public function getCurrentUrl($asUrlObject = false) { if ($this->currentUrl == '') { // schema $pageURL = 'http'; if ($this->isRequestSecured()) { $pageURL = 'https'; } $pageURL .= "://"; // port, server name and reques...
php
public function getCurrentUrl($asUrlObject = false) { if ($this->currentUrl == '') { // schema $pageURL = 'http'; if ($this->isRequestSecured()) { $pageURL = 'https'; } $pageURL .= "://"; // port, server name and reques...
[ "public", "function", "getCurrentUrl", "(", "$", "asUrlObject", "=", "false", ")", "{", "if", "(", "$", "this", "->", "currentUrl", "==", "''", ")", "{", "// schema", "$", "pageURL", "=", "'http'", ";", "if", "(", "$", "this", "->", "isRequestSecured", ...
Get current url with schema, host, port, request uri and query string. You can get the result in a form of a string or as a url standard object. @param bool $asUrlObject In which format you want to get the result, url standard object or a string. @return string|\Webiny\Component\StdLib\StdObject\UrlObject\UrlObject C...
[ "Get", "current", "url", "with", "schema", "host", "port", "request", "uri", "and", "query", "string", ".", "You", "can", "get", "the", "result", "in", "a", "form", "of", "a", "string", "or", "as", "a", "url", "standard", "object", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Http/Request.php#L263-L297
230,433
Webiny/Framework
src/Webiny/Component/Http/Request.php
Request.getClientIp
public function getClientIp() { $remoteAddress = $this->server()->remoteAddress(); $fwdClientIp = $this->server()->get($this->getTrustedHeaders()['client_ip']); if ($fwdClientIp && $remoteAddress && in_array($remoteAddress, $this->getTrustedProxies())) { // Use the forwarded IP ...
php
public function getClientIp() { $remoteAddress = $this->server()->remoteAddress(); $fwdClientIp = $this->server()->get($this->getTrustedHeaders()['client_ip']); if ($fwdClientIp && $remoteAddress && in_array($remoteAddress, $this->getTrustedProxies())) { // Use the forwarded IP ...
[ "public", "function", "getClientIp", "(", ")", "{", "$", "remoteAddress", "=", "$", "this", "->", "server", "(", ")", "->", "remoteAddress", "(", ")", ";", "$", "fwdClientIp", "=", "$", "this", "->", "server", "(", ")", "->", "get", "(", "$", "this",...
Get client ip address. This function check and validates headers from trusted proxies. @return string Client IP address.
[ "Get", "client", "ip", "address", ".", "This", "function", "check", "and", "validates", "headers", "from", "trusted", "proxies", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Http/Request.php#L316-L343
230,434
Webiny/Framework
src/Webiny/Component/Http/Request.php
Request.isRequestSecured
public function isRequestSecured() { $remoteAddress = $this->server()->remoteAddress(); $protocol = $this->server()->serverProtocol(); $fwdProto = $this->server()->get($this->getTrustedHeaders()['client_proto']); if ($fwdProto && $fwdProto != '' && in_array($remoteAddress, $this->ge...
php
public function isRequestSecured() { $remoteAddress = $this->server()->remoteAddress(); $protocol = $this->server()->serverProtocol(); $fwdProto = $this->server()->get($this->getTrustedHeaders()['client_proto']); if ($fwdProto && $fwdProto != '' && in_array($remoteAddress, $this->ge...
[ "public", "function", "isRequestSecured", "(", ")", "{", "$", "remoteAddress", "=", "$", "this", "->", "server", "(", ")", "->", "remoteAddress", "(", ")", ";", "$", "protocol", "=", "$", "this", "->", "server", "(", ")", "->", "serverProtocol", "(", "...
Check if connection is secured. This function check the forwarded headers from trusted proxies. @return bool True if connection is secured (https), otherwise false is returned.
[ "Check", "if", "connection", "is", "secured", ".", "This", "function", "check", "the", "forwarded", "headers", "from", "trusted", "proxies", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Http/Request.php#L351-L379
230,435
Webiny/Framework
src/Webiny/Component/Http/Request.php
Request.getConnectionPort
public function getConnectionPort() { $port = 80; $host = $this->server()->httpHost(); if (empty($host)) { return $port; } $host = $this->str($host); if ($host->contains(':')) { $port = $host->explode(':')->last(); } return $...
php
public function getConnectionPort() { $port = 80; $host = $this->server()->httpHost(); if (empty($host)) { return $port; } $host = $this->str($host); if ($host->contains(':')) { $port = $host->explode(':')->last(); } return $...
[ "public", "function", "getConnectionPort", "(", ")", "{", "$", "port", "=", "80", ";", "$", "host", "=", "$", "this", "->", "server", "(", ")", "->", "httpHost", "(", ")", ";", "if", "(", "empty", "(", "$", "host", ")", ")", "{", "return", "$", ...
Return the connection port number. This function check the forwarded headers from trusted proxies. @return int Port number.
[ "Return", "the", "connection", "port", "number", ".", "This", "function", "check", "the", "forwarded", "headers", "from", "trusted", "proxies", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Http/Request.php#L387-L402
230,436
Webiny/Framework
src/Webiny/Component/Http/Request.php
Request.getHostName
public function getHostName() { $remoteAddress = $this->server()->remoteAddress(); $host = $this->server()->serverName(); $fwdHost = $this->server()->get($this->getTrustedHeaders()['client_host']); if ($fwdHost && $fwdHost != '' && in_array($remoteAddress, $this->getTrustedProxies()...
php
public function getHostName() { $remoteAddress = $this->server()->remoteAddress(); $host = $this->server()->serverName(); $fwdHost = $this->server()->get($this->getTrustedHeaders()['client_host']); if ($fwdHost && $fwdHost != '' && in_array($remoteAddress, $this->getTrustedProxies()...
[ "public", "function", "getHostName", "(", ")", "{", "$", "remoteAddress", "=", "$", "this", "->", "server", "(", ")", "->", "remoteAddress", "(", ")", ";", "$", "host", "=", "$", "this", "->", "server", "(", ")", "->", "serverName", "(", ")", ";", ...
Returns the host name. This function check the forwarded headers from trusted proxies. @return string Host name
[ "Returns", "the", "host", "name", ".", "This", "function", "check", "the", "forwarded", "headers", "from", "trusted", "proxies", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Http/Request.php#L410-L421
230,437
Webiny/Framework
src/Webiny/Component/Rest/Response/Security.php
Security.hasAccess
public static function hasAccess(RequestBag $requestBag) { // first we check if method requires a special access level if (!$requestBag->getApiConfig()->get('Security', false)) { return true; // no special access level required } // get the required role if (isse...
php
public static function hasAccess(RequestBag $requestBag) { // first we check if method requires a special access level if (!$requestBag->getApiConfig()->get('Security', false)) { return true; // no special access level required } // get the required role if (isse...
[ "public", "static", "function", "hasAccess", "(", "RequestBag", "$", "requestBag", ")", "{", "// first we check if method requires a special access level", "if", "(", "!", "$", "requestBag", "->", "getApiConfig", "(", ")", "->", "get", "(", "'Security'", ",", "false...
Checks if current user has access to the current rest request. @param RequestBag $requestBag @return bool @throws \Webiny\Component\Rest\RestException
[ "Checks", "if", "current", "user", "has", "access", "to", "the", "current", "rest", "request", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Response/Security.php#L30-L58
230,438
Webiny/Framework
src/Webiny/Component/TemplateEngine/Bridge/Smarty/Smarty.php
Smarty.setCompileDir
public function setCompileDir($compileDir) { if (!file_exists($compileDir)) { mkdir($compileDir, 0755, true); } $this->smarty->setCompileDir($compileDir); }
php
public function setCompileDir($compileDir) { if (!file_exists($compileDir)) { mkdir($compileDir, 0755, true); } $this->smarty->setCompileDir($compileDir); }
[ "public", "function", "setCompileDir", "(", "$", "compileDir", ")", "{", "if", "(", "!", "file_exists", "(", "$", "compileDir", ")", ")", "{", "mkdir", "(", "$", "compileDir", ",", "0755", ",", "true", ")", ";", "}", "$", "this", "->", "smarty", "->"...
Set Smarty compile dir. @param string $compileDir Absolute path where to store compiled files.
[ "Set", "Smarty", "compile", "dir", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/TemplateEngine/Bridge/Smarty/Smarty.php#L86-L93
230,439
Webiny/Framework
src/Webiny/Component/TemplateEngine/Bridge/Smarty/Smarty.php
Smarty.setTemplateDir
public function setTemplateDir($templateDir) { $this->smarty->setTemplateDir($templateDir); if (!$this->getTemplateDir()) { throw new SmartyException("The template dir '" . $templateDir . "' does not exist."); } }
php
public function setTemplateDir($templateDir) { $this->smarty->setTemplateDir($templateDir); if (!$this->getTemplateDir()) { throw new SmartyException("The template dir '" . $templateDir . "' does not exist."); } }
[ "public", "function", "setTemplateDir", "(", "$", "templateDir", ")", "{", "$", "this", "->", "smarty", "->", "setTemplateDir", "(", "$", "templateDir", ")", ";", "if", "(", "!", "$", "this", "->", "getTemplateDir", "(", ")", ")", "{", "throw", "new", ...
Root path where the templates are stored. @param string $templateDir @throws SmartyException @internal param string $path Absolute path to the directory that holds the templates. @return void
[ "Root", "path", "where", "the", "templates", "are", "stored", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/TemplateEngine/Bridge/Smarty/Smarty.php#L139-L145
230,440
Webiny/Framework
src/Webiny/Component/TemplateEngine/Bridge/Smarty/Smarty.php
Smarty.fetch
public function fetch($template, $parameters = []) { try { if (count($parameters) > 0) { $this->smarty->assign($parameters); } return $this->smarty->fetch($template); } catch (\Exception $e) { throw new SmartyException($e->getMessage()...
php
public function fetch($template, $parameters = []) { try { if (count($parameters) > 0) { $this->smarty->assign($parameters); } return $this->smarty->fetch($template); } catch (\Exception $e) { throw new SmartyException($e->getMessage()...
[ "public", "function", "fetch", "(", "$", "template", ",", "$", "parameters", "=", "[", "]", ")", "{", "try", "{", "if", "(", "count", "(", "$", "parameters", ")", ">", "0", ")", "{", "$", "this", "->", "smarty", "->", "assign", "(", "$", "paramet...
Fetch the template from the given location, parse it and return the output. @param string $template Path to the template. @param array $parameters A list of parameters to pass to the template. @throws SmartyException @return string Parsed template.
[ "Fetch", "the", "template", "from", "the", "given", "location", "parse", "it", "and", "return", "the", "output", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/TemplateEngine/Bridge/Smarty/Smarty.php#L206-L217
230,441
Webiny/Framework
src/Webiny/Component/TemplateEngine/Bridge/Smarty/Smarty.php
Smarty.render
public function render($template, $parameters = []) { if (count($parameters) < 1) { $parameters = null; } echo $this->smarty->fetch($template, $parameters); }
php
public function render($template, $parameters = []) { if (count($parameters) < 1) { $parameters = null; } echo $this->smarty->fetch($template, $parameters); }
[ "public", "function", "render", "(", "$", "template", ",", "$", "parameters", "=", "[", "]", ")", "{", "if", "(", "count", "(", "$", "parameters", ")", "<", "1", ")", "{", "$", "parameters", "=", "null", ";", "}", "echo", "$", "this", "->", "smar...
Fetch the template from the given location, parse it and output the result to the browser. @param string $template Path to the template. @param array $parameters A list of parameters to pass to the template. @return void
[ "Fetch", "the", "template", "from", "the", "given", "location", "parse", "it", "and", "output", "the", "result", "to", "the", "browser", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/TemplateEngine/Bridge/Smarty/Smarty.php#L227-L233
230,442
Webiny/Framework
src/Webiny/Component/TemplateEngine/Bridge/Smarty/Smarty.php
Smarty.registerPlugin
public function registerPlugin(Plugin $plugin) { try { $this->smarty->registerPlugin($plugin->getType(), $plugin->getName(), $plugin->getCallbackFunction(), $plugin->getAttribute('Cachable', true), $plugin->getAttribute('CacheAttr', null)); } catch (\SmartyException $e) {...
php
public function registerPlugin(Plugin $plugin) { try { $this->smarty->registerPlugin($plugin->getType(), $plugin->getName(), $plugin->getCallbackFunction(), $plugin->getAttribute('Cachable', true), $plugin->getAttribute('CacheAttr', null)); } catch (\SmartyException $e) {...
[ "public", "function", "registerPlugin", "(", "Plugin", "$", "plugin", ")", "{", "try", "{", "$", "this", "->", "smarty", "->", "registerPlugin", "(", "$", "plugin", "->", "getType", "(", ")", ",", "$", "plugin", "->", "getName", "(", ")", ",", "$", "...
Register a plugin for the template engine. @param Plugin $plugin @throws \Exception|SmartyException @return void
[ "Register", "a", "plugin", "for", "the", "template", "engine", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/TemplateEngine/Bridge/Smarty/Smarty.php#L256-L264
230,443
Webiny/Framework
src/Webiny/Component/Entity/Attribute/One2ManyAttribute.php
One2ManyAttribute.getValue
public function getValue($params = [], $processCallbacks = true) { if ($this->isNull($this->value)) { // We need to load records from DB - but ONLY if parent record has an ID (otherwise no child records can exist in DB) $entityId = $this->parent->id; if (empty($entityId))...
php
public function getValue($params = [], $processCallbacks = true) { if ($this->isNull($this->value)) { // We need to load records from DB - but ONLY if parent record has an ID (otherwise no child records can exist in DB) $entityId = $this->parent->id; if (empty($entityId))...
[ "public", "function", "getValue", "(", "$", "params", "=", "[", "]", ",", "$", "processCallbacks", "=", "true", ")", "{", "if", "(", "$", "this", "->", "isNull", "(", "$", "this", "->", "value", ")", ")", "{", "// We need to load records from DB - but ONLY...
Set or get attribute value @param array $params @param bool $processCallbacks @return bool|null|AbstractEntity
[ "Set", "or", "get", "attribute", "value" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Entity/Attribute/One2ManyAttribute.php#L150-L178
230,444
mnapoli/phpunit-easymock
src/EasyMock.php
EasyMock.easyMock
protected function easyMock($classname, array $methods = array()) { if ($classname instanceof MockObject) { $mock = $classname; } else { $mock = $this->doCreateMock($classname); } foreach ($methods as $method => $return) { $this->mockMethod($mock,...
php
protected function easyMock($classname, array $methods = array()) { if ($classname instanceof MockObject) { $mock = $classname; } else { $mock = $this->doCreateMock($classname); } foreach ($methods as $method => $return) { $this->mockMethod($mock,...
[ "protected", "function", "easyMock", "(", "$", "classname", ",", "array", "$", "methods", "=", "array", "(", ")", ")", "{", "if", "(", "$", "classname", "instanceof", "MockObject", ")", "{", "$", "mock", "=", "$", "classname", ";", "}", "else", "{", ...
Mock the given class. Methods not specified in $methods will be mocked to return null (default PHPUnit behavior). The class constructor will *not* be called. @param string $classname The class to mock. Can also be an existing mock to mock new methods. @param array $methods Array of values to return, indexed by the...
[ "Mock", "the", "given", "class", "." ]
cd71d4d897bab9cba02afd01af7701caf54e8b03
https://github.com/mnapoli/phpunit-easymock/blob/cd71d4d897bab9cba02afd01af7701caf54e8b03/src/EasyMock.php#L28-L41
230,445
mnapoli/phpunit-easymock
src/EasyMock.php
EasyMock.easySpy
protected function easySpy($classname, array $methods = array()) { if ($classname instanceof MockObject) { $mock = $classname; } else { $mock = $this->doCreateMock($classname); } foreach ($methods as $method => $return) { $this->mockMethod($mock, ...
php
protected function easySpy($classname, array $methods = array()) { if ($classname instanceof MockObject) { $mock = $classname; } else { $mock = $this->doCreateMock($classname); } foreach ($methods as $method => $return) { $this->mockMethod($mock, ...
[ "protected", "function", "easySpy", "(", "$", "classname", ",", "array", "$", "methods", "=", "array", "(", ")", ")", "{", "if", "(", "$", "classname", "instanceof", "MockObject", ")", "{", "$", "mock", "=", "$", "classname", ";", "}", "else", "{", "...
Mock the given class by spying on method calls. This is the same as EasyMock::mock() except this assert that methods are called at least once. @see easyMock() @param string $classname The class to mock. Can also be an existing mock to mock new methods. @param array $methods Array of values to return, indexed by t...
[ "Mock", "the", "given", "class", "by", "spying", "on", "method", "calls", "." ]
cd71d4d897bab9cba02afd01af7701caf54e8b03
https://github.com/mnapoli/phpunit-easymock/blob/cd71d4d897bab9cba02afd01af7701caf54e8b03/src/EasyMock.php#L56-L69
230,446
naneau/semver
src/Naneau/SemVer/Parser/Build.php
Build.parse
public static function parse($string) { // Explode over '.' $parts = explode('.', $string); // Instantiate $buildVersion = new BuildVersion; // No parts is no build? if (count($parts) === 0) { return $buildVersion; } // Discard "build" s...
php
public static function parse($string) { // Explode over '.' $parts = explode('.', $string); // Instantiate $buildVersion = new BuildVersion; // No parts is no build? if (count($parts) === 0) { return $buildVersion; } // Discard "build" s...
[ "public", "static", "function", "parse", "(", "$", "string", ")", "{", "// Explode over '.'", "$", "parts", "=", "explode", "(", "'.'", ",", "$", "string", ")", ";", "// Instantiate", "$", "buildVersion", "=", "new", "BuildVersion", ";", "// No parts is no bui...
Parse a build part string A build part can look like build.11.e0f985a @param string $string @return BuildVersion
[ "Parse", "a", "build", "part", "string" ]
c771ad1e6c89064c0a4fa714979639dc3649d6c8
https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Parser/Build.php#L33-L65
230,447
milesj/admin
Model/RequestObject.php
RequestObject.addObject
public function addObject($alias, $parent_id = null) { $query = array( 'alias' => $alias, 'parent_id' => $parent_id ); $result = $this->find('first', array( 'conditions' => $query )); if ($result) { return $result; } ...
php
public function addObject($alias, $parent_id = null) { $query = array( 'alias' => $alias, 'parent_id' => $parent_id ); $result = $this->find('first', array( 'conditions' => $query )); if ($result) { return $result; } ...
[ "public", "function", "addObject", "(", "$", "alias", ",", "$", "parent_id", "=", "null", ")", "{", "$", "query", "=", "array", "(", "'alias'", "=>", "$", "alias", ",", "'parent_id'", "=>", "$", "parent_id", ")", ";", "$", "result", "=", "$", "this",...
Add an object if it does not exist. @param string $alias @param int $parent_id @return int
[ "Add", "an", "object", "if", "it", "does", "not", "exist", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Model/RequestObject.php#L123-L146
230,448
milesj/admin
Model/RequestObject.php
RequestObject.addChildObject
public function addChildObject($alias, $parent_id, $model, $foreignKey) { $query = array( 'alias' => $alias, 'parent_id' => $parent_id, 'model' => $model, 'foreign_key' => $foreignKey ); $result = $this->find('first', array( 'condition...
php
public function addChildObject($alias, $parent_id, $model, $foreignKey) { $query = array( 'alias' => $alias, 'parent_id' => $parent_id, 'model' => $model, 'foreign_key' => $foreignKey ); $result = $this->find('first', array( 'condition...
[ "public", "function", "addChildObject", "(", "$", "alias", ",", "$", "parent_id", ",", "$", "model", ",", "$", "foreignKey", ")", "{", "$", "query", "=", "array", "(", "'alias'", "=>", "$", "alias", ",", "'parent_id'", "=>", "$", "parent_id", ",", "'mo...
Add a child object if it does not exist. @param string $alias @param int $parent_id @param string $model @param int $foreignKey @return int
[ "Add", "a", "child", "object", "if", "it", "does", "not", "exist", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Model/RequestObject.php#L157-L182
230,449
milesj/admin
Model/RequestObject.php
RequestObject.getPermissions
public function getPermissions($user_id) { try { $aros = $this->node(array(USER_MODEL => array('id' => $user_id))); } catch (Exception $e) { return array(); } return $this->ObjectPermission->getByAroId(Hash::extract($aros, '{n}.RequestObject.id')); }
php
public function getPermissions($user_id) { try { $aros = $this->node(array(USER_MODEL => array('id' => $user_id))); } catch (Exception $e) { return array(); } return $this->ObjectPermission->getByAroId(Hash::extract($aros, '{n}.RequestObject.id')); }
[ "public", "function", "getPermissions", "(", "$", "user_id", ")", "{", "try", "{", "$", "aros", "=", "$", "this", "->", "node", "(", "array", "(", "USER_MODEL", "=>", "array", "(", "'id'", "=>", "$", "user_id", ")", ")", ")", ";", "}", "catch", "("...
Return a list of users permissions. Include parent groups permissions also. @param int $user_id @return array
[ "Return", "a", "list", "of", "users", "permissions", ".", "Include", "parent", "groups", "permissions", "also", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Model/RequestObject.php#L276-L284
230,450
milesj/admin
Model/RequestObject.php
RequestObject.getCrudPermissions
public function getCrudPermissions($user_id, $filter = null) { return $this->cache(array(__METHOD__, $user_id), function($self) use ($user_id, $filter) { $crud = array(); if ($permissions = $self->getPermissions($user_id)) { foreach ($permissions as $permission) { ...
php
public function getCrudPermissions($user_id, $filter = null) { return $this->cache(array(__METHOD__, $user_id), function($self) use ($user_id, $filter) { $crud = array(); if ($permissions = $self->getPermissions($user_id)) { foreach ($permissions as $permission) { ...
[ "public", "function", "getCrudPermissions", "(", "$", "user_id", ",", "$", "filter", "=", "null", ")", "{", "return", "$", "this", "->", "cache", "(", "array", "(", "__METHOD__", ",", "$", "user_id", ")", ",", "function", "(", "$", "self", ")", "use", ...
Map all permissions to a boolean flagged list grouped by ACO and CRUD. @param int $user_id @param string $filter @return array
[ "Map", "all", "permissions", "to", "a", "boolean", "flagged", "list", "grouped", "by", "ACO", "and", "CRUD", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Model/RequestObject.php#L293-L314
230,451
milesj/admin
Model/RequestObject.php
RequestObject.getRoles
public function getRoles($user_id) { $results = $this->find('all', array( 'conditions' => array( 'RequestObject.foreign_key' => $user_id, 'RequestObject.model' => USER_MODEL ) )); if ($results) { // Grab the direct parents (or ...
php
public function getRoles($user_id) { $results = $this->find('all', array( 'conditions' => array( 'RequestObject.foreign_key' => $user_id, 'RequestObject.model' => USER_MODEL ) )); if ($results) { // Grab the direct parents (or ...
[ "public", "function", "getRoles", "(", "$", "user_id", ")", "{", "$", "results", "=", "$", "this", "->", "find", "(", "'all'", ",", "array", "(", "'conditions'", "=>", "array", "(", "'RequestObject.foreign_key'", "=>", "$", "user_id", ",", "'RequestObject.mo...
Return a list of users roles defined in the ACL. @param int $user_id @return array
[ "Return", "a", "list", "of", "users", "roles", "defined", "in", "the", "ACL", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Model/RequestObject.php#L322-L347
230,452
milesj/admin
Model/RequestObject.php
RequestObject.getStaffByAlias
public function getStaffByAlias($alias) { $access = $this->getByAlias($alias); return $this->find('all', array( 'conditions' => array( 'RequestObject.parent_id' => $access['RequestObject']['id'], 'RequestObject.foreign_key !=' => null, 'Reques...
php
public function getStaffByAlias($alias) { $access = $this->getByAlias($alias); return $this->find('all', array( 'conditions' => array( 'RequestObject.parent_id' => $access['RequestObject']['id'], 'RequestObject.foreign_key !=' => null, 'Reques...
[ "public", "function", "getStaffByAlias", "(", "$", "alias", ")", "{", "$", "access", "=", "$", "this", "->", "getByAlias", "(", "$", "alias", ")", ";", "return", "$", "this", "->", "find", "(", "'all'", ",", "array", "(", "'conditions'", "=>", "array",...
Return all the staff by slug. @param string $alias @return array
[ "Return", "all", "the", "staff", "by", "slug", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Model/RequestObject.php#L371-L383
230,453
milesj/admin
Model/RequestObject.php
RequestObject.isChildOf
public function isChildOf($user_id, $fk) { if (!$user_id || !$fk) { return false; } try { $aros = $this->node(array( 'model' => USER_MODEL, 'foreign_key' => $user_id )); } catch (Exception $e) { return false...
php
public function isChildOf($user_id, $fk) { if (!$user_id || !$fk) { return false; } try { $aros = $this->node(array( 'model' => USER_MODEL, 'foreign_key' => $user_id )); } catch (Exception $e) { return false...
[ "public", "function", "isChildOf", "(", "$", "user_id", ",", "$", "fk", ")", "{", "if", "(", "!", "$", "user_id", "||", "!", "$", "fk", ")", "{", "return", "false", ";", "}", "try", "{", "$", "aros", "=", "$", "this", "->", "node", "(", "array"...
Check to see if a user is a child of a specific alias. @param int $user_id @param int|string $fk @return bool
[ "Check", "to", "see", "if", "a", "user", "is", "a", "child", "of", "a", "specific", "alias", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Model/RequestObject.php#L406-L431
230,454
Webiny/Framework
src/Webiny/Component/StdLib/StdLibTrait.php
StdLibTrait.jsonDecode
protected static function jsonDecode($json, $assoc = false, $depth = 512, $options = 0) { return json_decode($json, $assoc, $depth, $options); }
php
protected static function jsonDecode($json, $assoc = false, $depth = 512, $options = 0) { return json_decode($json, $assoc, $depth, $options); }
[ "protected", "static", "function", "jsonDecode", "(", "$", "json", ",", "$", "assoc", "=", "false", ",", "$", "depth", "=", "512", ",", "$", "options", "=", "0", ")", "{", "return", "json_decode", "(", "$", "json", ",", "$", "assoc", ",", "$", "dep...
Decode JSON string @param string $json The json string being decoded. This function only works with UTF-8 encoded data. @param bool $assoc When TRUE, returned objects will be converted into associative arrays. @param int $depth User specified recursion depth. @param int $options Bitmask of JSON decode ...
[ "Decode", "JSON", "string" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdLibTrait.php#L44-L47
230,455
Webiny/Framework
src/Webiny/Component/StdLib/StdLibTrait.php
StdLibTrait.unserialize
protected static function unserialize($string) { if (is_array($string)) { return $string; } if (($data = unserialize($string)) !== false) { return $data; } return unserialize(stripslashes($string)); }
php
protected static function unserialize($string) { if (is_array($string)) { return $string; } if (($data = unserialize($string)) !== false) { return $data; } return unserialize(stripslashes($string)); }
[ "protected", "static", "function", "unserialize", "(", "$", "string", ")", "{", "if", "(", "is_array", "(", "$", "string", ")", ")", "{", "return", "$", "string", ";", "}", "if", "(", "(", "$", "data", "=", "unserialize", "(", "$", "string", ")", "...
Unserializes the given string and returns the array. @param string $string String to serialize. @return array|mixed
[ "Unserializes", "the", "given", "string", "and", "returns", "the", "array", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdLibTrait.php#L68-L79
230,456
Webiny/Framework
src/Webiny/Component/OAuth2/OAuth2Request.php
OAuth2Request.setRequestType
public function setRequestType($requestType) { $requestType = $this->str($requestType)->caseUpper(); if (!$requestType->equals('GET') && !$requestType->equals('POST')) { throw new OAuth2Exception('Invalid request type provided "' . $requestType->val() . '". Possible values are...
php
public function setRequestType($requestType) { $requestType = $this->str($requestType)->caseUpper(); if (!$requestType->equals('GET') && !$requestType->equals('POST')) { throw new OAuth2Exception('Invalid request type provided "' . $requestType->val() . '". Possible values are...
[ "public", "function", "setRequestType", "(", "$", "requestType", ")", "{", "$", "requestType", "=", "$", "this", "->", "str", "(", "$", "requestType", ")", "->", "caseUpper", "(", ")", ";", "if", "(", "!", "$", "requestType", "->", "equals", "(", "'GET...
Set the request type either to POST or GET. @param string $requestType Can be POST or GET @throws OAuth2Exception
[ "Set", "the", "request", "type", "either", "to", "POST", "or", "GET", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/OAuth2/OAuth2Request.php#L92-L103
230,457
Webiny/Framework
src/Webiny/Component/OAuth2/OAuth2Request.php
OAuth2Request.executeRequest
public function executeRequest() { // curl general $curl_options = [ CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => true, CURLOPT_CUSTOMREQUEST => $this->requestType ]; // set to post if ($this->requestType == 'POST') { ...
php
public function executeRequest() { // curl general $curl_options = [ CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => true, CURLOPT_CUSTOMREQUEST => $this->requestType ]; // set to post if ($this->requestType == 'POST') { ...
[ "public", "function", "executeRequest", "(", ")", "{", "// curl general", "$", "curl_options", "=", "[", "CURLOPT_RETURNTRANSFER", "=>", "true", ",", "CURLOPT_SSL_VERIFYPEER", "=>", "true", ",", "CURLOPT_CUSTOMREQUEST", "=>", "$", "this", "->", "requestType", "]", ...
Executes the OAuth2 request. @return array Array containing [result, code, content_type]. @throws OAuth2Exception
[ "Executes", "the", "OAuth2", "request", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/OAuth2/OAuth2Request.php#L162-L225
230,458
Webiny/Framework
src/Webiny/Component/Router/Matcher/MatchedRoute.php
MatchedRoute.hasTags
public function hasTags(array $tags, $matchAll = true) { $routeTags = $this->getRoute()->getTags(); $diffCount = count(array_diff($tags, $routeTags)); $tagsCount = count($tags); if ($matchAll) { if ($diffCount === 0) { return true; } }...
php
public function hasTags(array $tags, $matchAll = true) { $routeTags = $this->getRoute()->getTags(); $diffCount = count(array_diff($tags, $routeTags)); $tagsCount = count($tags); if ($matchAll) { if ($diffCount === 0) { return true; } }...
[ "public", "function", "hasTags", "(", "array", "$", "tags", ",", "$", "matchAll", "=", "true", ")", "{", "$", "routeTags", "=", "$", "this", "->", "getRoute", "(", ")", "->", "getTags", "(", ")", ";", "$", "diffCount", "=", "count", "(", "array_diff"...
Checks if the current matched route has the given tags. @param array $tags List of tags to match. @param bool $matchAll Match all, or only one of the tags. @return bool
[ "Checks", "if", "the", "current", "matched", "route", "has", "the", "given", "tags", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Router/Matcher/MatchedRoute.php#L68-L85
230,459
OpenBuildings/jam
classes/Kohana/Upload/Server.php
Kohana_Upload_Server.instance
public static function instance($name = NULL, array $config = NULL) { if ($name === NULL) { // Use the default instance name $name = Upload_Server::$default; } if ( ! isset(Upload_Server::$instances[$name])) { if ($config === NULL) { // Load the configuration for this database $config = ...
php
public static function instance($name = NULL, array $config = NULL) { if ($name === NULL) { // Use the default instance name $name = Upload_Server::$default; } if ( ! isset(Upload_Server::$instances[$name])) { if ($config === NULL) { // Load the configuration for this database $config = ...
[ "public", "static", "function", "instance", "(", "$", "name", "=", "NULL", ",", "array", "$", "config", "=", "NULL", ")", "{", "if", "(", "$", "name", "===", "NULL", ")", "{", "// Use the default instance name", "$", "name", "=", "Upload_Server", "::", "...
Get a singleton Upload_Server instance. If configuration is not specified, it will be loaded from the Upload_Server configuration file using the same group as the name. // Load the default server $server = Upload_Server::instance(); // Create a custom configured instance $server = Upload_Server::instance('custom', $c...
[ "Get", "a", "singleton", "Upload_Server", "instance", ".", "If", "configuration", "is", "not", "specified", "it", "will", "be", "loaded", "from", "the", "Upload_Server", "configuration", "file", "using", "the", "same", "group", "as", "the", "name", "." ]
3239e93564d100ddb65055235f87ec99fc0d4370
https://github.com/OpenBuildings/jam/blob/3239e93564d100ddb65055235f87ec99fc0d4370/classes/Kohana/Upload/Server.php#L37-L67
230,460
Webiny/Framework
src/Webiny/Component/ServiceManager/ServiceCreator.php
ServiceCreator.getService
public function getService() { // Get real arguments values $arguments = []; foreach ($this->config->getArguments() as $arg) { $arguments[] = $arg->value(); } $service = $this->getServiceInstance($arguments); // Call methods foreach ($this->confi...
php
public function getService() { // Get real arguments values $arguments = []; foreach ($this->config->getArguments() as $arg) { $arguments[] = $arg->value(); } $service = $this->getServiceInstance($arguments); // Call methods foreach ($this->confi...
[ "public", "function", "getService", "(", ")", "{", "// Get real arguments values", "$", "arguments", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "config", "->", "getArguments", "(", ")", "as", "$", "arg", ")", "{", "$", "arguments", "[", "]", ...
Get service instance @return object
[ "Get", "service", "instance" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ServiceManager/ServiceCreator.php#L34-L58
230,461
ipalaus/buffer-php-sdk
src/Ipalaus/Buffer/Update.php
Update.addMedia
public function addMedia($key, $value) { $available = array('link', 'description', 'picture', 'thumbnail'); // accept only valid types for media if ( ! in_array($key, $available)) { throw new InvalidArgumentException('Media type must be a valid value: '.implode(', ', $available)...
php
public function addMedia($key, $value) { $available = array('link', 'description', 'picture', 'thumbnail'); // accept only valid types for media if ( ! in_array($key, $available)) { throw new InvalidArgumentException('Media type must be a valid value: '.implode(', ', $available)...
[ "public", "function", "addMedia", "(", "$", "key", ",", "$", "value", ")", "{", "$", "available", "=", "array", "(", "'link'", ",", "'description'", ",", "'picture'", ",", "'thumbnail'", ")", ";", "// accept only valid types for media", "if", "(", "!", "in_a...
Add media to the update. @param string $key @param string $value @return \Ipalaus\Buffer\Update
[ "Add", "media", "to", "the", "update", "." ]
f9314df3510f1dcdd6b3d5f618ce845c5f56bd5f
https://github.com/ipalaus/buffer-php-sdk/blob/f9314df3510f1dcdd6b3d5f618ce845c5f56bd5f/src/Ipalaus/Buffer/Update.php#L95-L107
230,462
ipalaus/buffer-php-sdk
src/Ipalaus/Buffer/Update.php
Update.schedule
public function schedule($when) { if (is_numeric($when)) { $dt = new DateTime; $dt->setTimestamp($when); } else { $dt = new DateTime($when); } $this->scheduled_at = $dt->format(DateTime::ISO8601); return $this; }
php
public function schedule($when) { if (is_numeric($when)) { $dt = new DateTime; $dt->setTimestamp($when); } else { $dt = new DateTime($when); } $this->scheduled_at = $dt->format(DateTime::ISO8601); return $this; }
[ "public", "function", "schedule", "(", "$", "when", ")", "{", "if", "(", "is_numeric", "(", "$", "when", ")", ")", "{", "$", "dt", "=", "new", "DateTime", ";", "$", "dt", "->", "setTimestamp", "(", "$", "when", ")", ";", "}", "else", "{", "$", ...
Schedule a post with a timestamp or a valid DateTime string. @param mixed $when @return \Ipalaus\Buffer\Update
[ "Schedule", "a", "post", "with", "a", "timestamp", "or", "a", "valid", "DateTime", "string", "." ]
f9314df3510f1dcdd6b3d5f618ce845c5f56bd5f
https://github.com/ipalaus/buffer-php-sdk/blob/f9314df3510f1dcdd6b3d5f618ce845c5f56bd5f/src/Ipalaus/Buffer/Update.php#L115-L127
230,463
Webiny/Framework
src/Webiny/Component/OAuth2/OAuth2Loader.php
OAuth2Loader.getInstance
public static function getInstance($key) { if (isset(self::$instances[$key])) { return self::$instances; } $oauth2Config = OAuth2::getConfig()->get($key, false); if (!$oauth2Config) { throw new OAuth2Exception('Unable to read "OAuth2.' . $key . '" configurat...
php
public static function getInstance($key) { if (isset(self::$instances[$key])) { return self::$instances; } $oauth2Config = OAuth2::getConfig()->get($key, false); if (!$oauth2Config) { throw new OAuth2Exception('Unable to read "OAuth2.' . $key . '" configurat...
[ "public", "static", "function", "getInstance", "(", "$", "key", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "instances", "[", "$", "key", "]", ")", ")", "{", "return", "self", "::", "$", "instances", ";", "}", "$", "oauth2Config", "=", "O...
Returns an instance to OAuth2 server based on the current configuration. @param string $key Unique identifier for the OAuth2 server that you wish to get. @return array|OAuth2 @throws OAuth2Exception
[ "Returns", "an", "instance", "to", "OAuth2", "server", "based", "on", "the", "current", "configuration", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/OAuth2/OAuth2Loader.php#L33-L66
230,464
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.append
public function append($str) { $value = $this->val(); $this->val($value . $str); return $this; }
php
public function append($str) { $value = $this->val(); $this->val($value . $str); return $this; }
[ "public", "function", "append", "(", "$", "str", ")", "{", "$", "value", "=", "$", "this", "->", "val", "(", ")", ";", "$", "this", "->", "val", "(", "$", "value", ".", "$", "str", ")", ";", "return", "$", "this", ";", "}" ]
Appends the given string to the current string. @param string $str String you wish to append @return $this
[ "Appends", "the", "given", "string", "to", "the", "current", "string", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L53-L59
230,465
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.prepend
public function prepend($str) { $value = $this->val(); $this->val($str . $value); return $this; }
php
public function prepend($str) { $value = $this->val(); $this->val($str . $value); return $this; }
[ "public", "function", "prepend", "(", "$", "str", ")", "{", "$", "value", "=", "$", "this", "->", "val", "(", ")", ";", "$", "this", "->", "val", "(", "$", "str", ".", "$", "value", ")", ";", "return", "$", "this", ";", "}" ]
Prepend the given string to the current string. @param string $str String you wish to append @return $this
[ "Prepend", "the", "given", "string", "to", "the", "current", "string", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L68-L74
230,466
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.caseWordUpper
public function caseWordUpper() { $this->val(mb_convert_case($this->val(), MB_CASE_TITLE, self::DEF_ENCODING)); return $this; }
php
public function caseWordUpper() { $this->val(mb_convert_case($this->val(), MB_CASE_TITLE, self::DEF_ENCODING)); return $this; }
[ "public", "function", "caseWordUpper", "(", ")", "{", "$", "this", "->", "val", "(", "mb_convert_case", "(", "$", "this", "->", "val", "(", ")", ",", "MB_CASE_TITLE", ",", "self", "::", "DEF_ENCODING", ")", ")", ";", "return", "$", "this", ";", "}" ]
Make the first character of every word upper. @return $this
[ "Make", "the", "first", "character", "of", "every", "word", "upper", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L150-L155
230,467
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.subString
public function subString($startPosition, $length) { if (!$this->isNumber($startPosition)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$startPosition', 'integer' ]); } if (!$this->isNumber($length)) { ...
php
public function subString($startPosition, $length) { if (!$this->isNumber($startPosition)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$startPosition', 'integer' ]); } if (!$this->isNumber($length)) { ...
[ "public", "function", "subString", "(", "$", "startPosition", ",", "$", "length", ")", "{", "if", "(", "!", "$", "this", "->", "isNumber", "(", "$", "startPosition", ")", ")", "{", "throw", "new", "StringObjectException", "(", "StringObjectException", "::", ...
Returns a substring from the current string. @param int $startPosition From which char position will the substring start. @param int $length Where will the substring end. If 0 - to the end of string. @throws StringObjectException @return $this
[ "Returns", "a", "substring", "from", "the", "current", "string", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L295-L318
230,468
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.pregReplace
public function pregReplace($pattern, $replacement, $limit = -1, &$count = null) { $this->val(preg_replace($pattern, $replacement, $this->val(), $limit, $count)); return $this; }
php
public function pregReplace($pattern, $replacement, $limit = -1, &$count = null) { $this->val(preg_replace($pattern, $replacement, $this->val(), $limit, $count)); return $this; }
[ "public", "function", "pregReplace", "(", "$", "pattern", ",", "$", "replacement", ",", "$", "limit", "=", "-", "1", ",", "&", "$", "count", "=", "null", ")", "{", "$", "this", "->", "val", "(", "preg_replace", "(", "$", "pattern", ",", "$", "repla...
Replace string using regex TODO: unit test @param string $pattern The pattern to search for. It can be either a string or an array with strings. @param mixed $replacement The string or an array with strings to replace. @param int $limit The maximum possible replacements for each pattern in each subject string. De...
[ "Replace", "string", "using", "regex" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L354-L360
230,469
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.explode
public function explode($delimiter, $limit = null) { if (!$this->isString($delimiter)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$delimiter', 'string' ]); } if ($this->isNull($limit)) { $a...
php
public function explode($delimiter, $limit = null) { if (!$this->isString($delimiter)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$delimiter', 'string' ]); } if ($this->isNull($limit)) { $a...
[ "public", "function", "explode", "(", "$", "delimiter", ",", "$", "limit", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "isString", "(", "$", "delimiter", ")", ")", "{", "throw", "new", "StringObjectException", "(", "StringObjectException", ...
Explode the current string with the given delimiter and return ArrayObject with the exploded values. @param string $delimiter String upon which the current string will be exploded. @param null|int $limit Limit the number of exploded items. @return ArrayObject ArrayObject object containing exploded values. @throws S...
[ "Explode", "the", "current", "string", "with", "the", "given", "delimiter", "and", "return", "ArrayObject", "with", "the", "exploded", "values", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L371-L398
230,470
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.split
public function split($chunkSize = 1) { if (!$this->isNumber($chunkSize)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$chunkSize', 'integer' ]); } $arr = str_split($this->val(), $chunkSize); re...
php
public function split($chunkSize = 1) { if (!$this->isNumber($chunkSize)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$chunkSize', 'integer' ]); } $arr = str_split($this->val(), $chunkSize); re...
[ "public", "function", "split", "(", "$", "chunkSize", "=", "1", ")", "{", "if", "(", "!", "$", "this", "->", "isNumber", "(", "$", "chunkSize", ")", ")", "{", "throw", "new", "StringObjectException", "(", "StringObjectException", "::", "MSG_INVALID_ARG", "...
Split the string into chunks. @param int $chunkSize Size of each chunk. Set it to 1 if you want to get all the characters from the string. @throws StringObjectException @return ArrayObject ArrayObject containing string chunks.
[ "Split", "the", "string", "into", "chunks", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L408-L420
230,471
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.hash
public function hash($algo = 'sha1') { $algos = new ArrayObject(hash_algos()); if (!$algos->inArray($algo)) { throw new StringObjectException(StringObjectException::MSG_INVALID_HASH_ALGO, [$algo]); } $this->val(hash($algo, $this->val())); return $this; }
php
public function hash($algo = 'sha1') { $algos = new ArrayObject(hash_algos()); if (!$algos->inArray($algo)) { throw new StringObjectException(StringObjectException::MSG_INVALID_HASH_ALGO, [$algo]); } $this->val(hash($algo, $this->val())); return $this; }
[ "public", "function", "hash", "(", "$", "algo", "=", "'sha1'", ")", "{", "$", "algos", "=", "new", "ArrayObject", "(", "hash_algos", "(", ")", ")", ";", "if", "(", "!", "$", "algos", "->", "inArray", "(", "$", "algo", ")", ")", "{", "throw", "new...
Generate a hash value from the current string using the defined algorithm. @param string $algo Name of the algorithm used for calculation (md5, sha1, ripemd160,...). @throws StringObjectException @return $this
[ "Generate", "a", "hash", "value", "from", "the", "current", "string", "using", "the", "defined", "algorithm", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L430-L440
230,472
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.stripTags
public function stripTags($whiteList = '') { if (!$this->isString($whiteList)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$whiteList', 'integer' ]); } $this->val(strip_tags($this->val(), $whiteList)); ...
php
public function stripTags($whiteList = '') { if (!$this->isString($whiteList)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$whiteList', 'integer' ]); } $this->val(strip_tags($this->val(), $whiteList)); ...
[ "public", "function", "stripTags", "(", "$", "whiteList", "=", "''", ")", "{", "if", "(", "!", "$", "this", "->", "isString", "(", "$", "whiteList", ")", ")", "{", "throw", "new", "StringObjectException", "(", "StringObjectException", "::", "MSG_INVALID_ARG"...
Remove HTML tags from the string. @param string $whiteList A list of allowed HTML tags that you don't want to strip. Example: '<p><a>' @throws StringObjectException @return $this
[ "Remove", "HTML", "tags", "from", "the", "string", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L758-L770
230,473
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.wordWrap
public function wordWrap($length, $break = "\n", $cut = false) { if (!$this->isNumber($length)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$length', 'integer' ]); } if (!$this->isString($break)) { ...
php
public function wordWrap($length, $break = "\n", $cut = false) { if (!$this->isNumber($length)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$length', 'integer' ]); } if (!$this->isString($break)) { ...
[ "public", "function", "wordWrap", "(", "$", "length", ",", "$", "break", "=", "\"\\n\"", ",", "$", "cut", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "isNumber", "(", "$", "length", ")", ")", "{", "throw", "new", "StringObjectException...
Wraps a string to a given number of characters using a string break character. @param int $length The number of characters at which the string will be wrapped. @param string $break The line is broken using the optional break parameter. @param bool $cut If the cut is set to TRUE, the string is always wrapped at or...
[ "Wraps", "a", "string", "to", "a", "given", "number", "of", "characters", "using", "a", "string", "break", "character", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L795-L820
230,474
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.truncate
public function truncate($length, $ellipsis = '') { if (!$this->isNumber($length)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$length', 'integer' ]); } if (!$this->isString($ellipsis)) { th...
php
public function truncate($length, $ellipsis = '') { if (!$this->isNumber($length)) { throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [ '$length', 'integer' ]); } if (!$this->isString($ellipsis)) { th...
[ "public", "function", "truncate", "(", "$", "length", ",", "$", "ellipsis", "=", "''", ")", "{", "if", "(", "!", "$", "this", "->", "isNumber", "(", "$", "length", ")", ")", "{", "throw", "new", "StringObjectException", "(", "StringObjectException", "::"...
Truncate the string to the given length without breaking words. @param int $length Length to which you which to trim. @param string $ellipsis Ellipsis is calculated in the string $length. @throws StringObjectException @return $this
[ "Truncate", "the", "string", "to", "the", "given", "length", "without", "breaking", "words", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L831-L860
230,475
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.base64Encode
public function base64Encode($webSafe = false) { $this->val(base64_encode($this->val())); if ($webSafe) { $this->replace('+', '-')->replace('/', '_'); } return $this; }
php
public function base64Encode($webSafe = false) { $this->val(base64_encode($this->val())); if ($webSafe) { $this->replace('+', '-')->replace('/', '_'); } return $this; }
[ "public", "function", "base64Encode", "(", "$", "webSafe", "=", "false", ")", "{", "$", "this", "->", "val", "(", "base64_encode", "(", "$", "this", "->", "val", "(", ")", ")", ")", ";", "if", "(", "$", "webSafe", ")", "{", "$", "this", "->", "re...
Encode string using base64_encode @param bool $webSafe Web safe encoding (replaces '+' with '-' and '/' with '_' after encoding) @return $this
[ "Encode", "string", "using", "base64_encode" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L941-L950
230,476
Webiny/Framework
src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php
ManipulatorTrait.base64Decode
public function base64Decode($webSafe = false) { $this->val(base64_decode($this->val())); if ($webSafe) { $this->replace('-', '+')->replace('_', '/'); } return $this; }
php
public function base64Decode($webSafe = false) { $this->val(base64_decode($this->val())); if ($webSafe) { $this->replace('-', '+')->replace('_', '/'); } return $this; }
[ "public", "function", "base64Decode", "(", "$", "webSafe", "=", "false", ")", "{", "$", "this", "->", "val", "(", "base64_decode", "(", "$", "this", "->", "val", "(", ")", ")", ")", ";", "if", "(", "$", "webSafe", ")", "{", "$", "this", "->", "re...
Decode base64 encoded string @param bool $webSafe Web sage decoding (replaces '-' with '+' and '_' with '/' before decoding) @return $this
[ "Decode", "base64", "encoded", "string" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/ManipulatorTrait.php#L959-L968
230,477
alexandresalome/php-webdriver
src/WebDriver/Client.php
Client.request
public function request($verb, $path, $content = null, array $headers = array()) { $url = $this->url.$path; $request = new Request($verb, $url); $request->setContent($content); $response = new Response(); $this->client->send($request, $response); $response->setConten...
php
public function request($verb, $path, $content = null, array $headers = array()) { $url = $this->url.$path; $request = new Request($verb, $url); $request->setContent($content); $response = new Response(); $this->client->send($request, $response); $response->setConten...
[ "public", "function", "request", "(", "$", "verb", ",", "$", "path", ",", "$", "content", "=", "null", ",", "array", "$", "headers", "=", "array", "(", ")", ")", "{", "$", "url", "=", "$", "this", "->", "url", ".", "$", "path", ";", "$", "reque...
Plumbery method to request webdriver server. @param string $verb HTTP method to use (GET, POST, DELETE) @param string $path Relative URL to server, without prefix "/" @param string $content Content of request @param array $headers Additional HTTP headers
[ "Plumbery", "method", "to", "request", "webdriver", "server", "." ]
ba187e7b13979e1db5001b7bfbe82d07c8e2e39d
https://github.com/alexandresalome/php-webdriver/blob/ba187e7b13979e1db5001b7bfbe82d07c8e2e39d/src/WebDriver/Client.php#L78-L90
230,478
alexandresalome/php-webdriver
src/WebDriver/Client.php
Client.createBrowser
public function createBrowser($capabilities) { if (is_string($capabilities)) { $capabilities = new Capabilities($capabilities); } elseif (!$capabilities instanceof Capabilities) { throw new LibraryException(sprintf('Expected a Capabilities or a string, given a "%s"', gettype(...
php
public function createBrowser($capabilities) { if (is_string($capabilities)) { $capabilities = new Capabilities($capabilities); } elseif (!$capabilities instanceof Capabilities) { throw new LibraryException(sprintf('Expected a Capabilities or a string, given a "%s"', gettype(...
[ "public", "function", "createBrowser", "(", "$", "capabilities", ")", "{", "if", "(", "is_string", "(", "$", "capabilities", ")", ")", "{", "$", "capabilities", "=", "new", "Capabilities", "(", "$", "capabilities", ")", ";", "}", "elseif", "(", "!", "$",...
Creates a new browser with desired capabilities. @param mixed $capabilities Capabilities to request to the server. Value can be a string (firefox) or a Capabilities object. @return Browser
[ "Creates", "a", "new", "browser", "with", "desired", "capabilities", "." ]
ba187e7b13979e1db5001b7bfbe82d07c8e2e39d
https://github.com/alexandresalome/php-webdriver/blob/ba187e7b13979e1db5001b7bfbe82d07c8e2e39d/src/WebDriver/Client.php#L101-L113
230,479
alexandresalome/php-webdriver
src/WebDriver/Client.php
Client.getBrowser
public function getBrowser($sessionId) { if (!isset($this->browsers[$sessionId])) { throw new LibraryException(sprintf('The session "%s" was not found', $sessionId)); } return $this->browsers[$sessionId]; }
php
public function getBrowser($sessionId) { if (!isset($this->browsers[$sessionId])) { throw new LibraryException(sprintf('The session "%s" was not found', $sessionId)); } return $this->browsers[$sessionId]; }
[ "public", "function", "getBrowser", "(", "$", "sessionId", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "browsers", "[", "$", "sessionId", "]", ")", ")", "{", "throw", "new", "LibraryException", "(", "sprintf", "(", "'The session \"%s\" was n...
Returns a browser associated to a session ID. To get it, it must have been created. @param string $sessionId The session ID to fetch @return Browser @throws RuntimeException An exception is thrown if the session does not exists.
[ "Returns", "a", "browser", "associated", "to", "a", "session", "ID", ".", "To", "get", "it", "it", "must", "have", "been", "created", "." ]
ba187e7b13979e1db5001b7bfbe82d07c8e2e39d
https://github.com/alexandresalome/php-webdriver/blob/ba187e7b13979e1db5001b7bfbe82d07c8e2e39d/src/WebDriver/Client.php#L136-L143
230,480
alexandresalome/php-webdriver
src/WebDriver/Client.php
Client.verifyResponse
protected function verifyResponse(Response $response) { $content = json_decode($response->getContent(), true); $statusCode = $response->getStatusCode(); if ($statusCode !== 204 && null === $content) { throw new LibraryException('Unable to parse response from server (status code:...
php
protected function verifyResponse(Response $response) { $content = json_decode($response->getContent(), true); $statusCode = $response->getStatusCode(); if ($statusCode !== 204 && null === $content) { throw new LibraryException('Unable to parse response from server (status code:...
[ "protected", "function", "verifyResponse", "(", "Response", "$", "response", ")", "{", "$", "content", "=", "json_decode", "(", "$", "response", "->", "getContent", "(", ")", ",", "true", ")", ";", "$", "statusCode", "=", "$", "response", "->", "getStatusC...
Verifies every response received from the server to make sure no error happened during processing. @param Buzz\Message\Response A response object to verify
[ "Verifies", "every", "response", "received", "from", "the", "server", "to", "make", "sure", "no", "error", "happened", "during", "processing", "." ]
ba187e7b13979e1db5001b7bfbe82d07c8e2e39d
https://github.com/alexandresalome/php-webdriver/blob/ba187e7b13979e1db5001b7bfbe82d07c8e2e39d/src/WebDriver/Client.php#L163-L179
230,481
Webiny/Framework
src/Webiny/Component/Entity/Attribute/AbstractCollectionAttribute.php
AbstractCollectionAttribute.normalizeValue
protected function normalizeValue($value) { if (is_null($value)) { return $value; } $entityClass = $this->getEntity(); // Validate Many2many attribute value if (!$this->isArray($value) && !$this->isArrayObject($value) && !$this->isInstanceOf($value, EntityCollect...
php
protected function normalizeValue($value) { if (is_null($value)) { return $value; } $entityClass = $this->getEntity(); // Validate Many2many attribute value if (!$this->isArray($value) && !$this->isArrayObject($value) && !$this->isInstanceOf($value, EntityCollect...
[ "protected", "function", "normalizeValue", "(", "$", "value", ")", "{", "if", "(", "is_null", "(", "$", "value", ")", ")", "{", "return", "$", "value", ";", "}", "$", "entityClass", "=", "$", "this", "->", "getEntity", "(", ")", ";", "// Validate Many2...
Normalize given value to be a valid array of entity instances @param mixed $value @return array @throws ValidationException
[ "Normalize", "given", "value", "to", "be", "a", "valid", "array", "of", "entity", "instances" ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Entity/Attribute/AbstractCollectionAttribute.php#L160-L205
230,482
Webiny/Framework
src/Webiny/Component/Cache/Cache.php
Cache.Couchbase
public static function Couchbase($user, $password, $bucket, $host = '127.0.0.1:8091', $options = []) { return new CacheStorage(Storage\Couchbase::getInstance($user, $password, $bucket, $host), $options); }
php
public static function Couchbase($user, $password, $bucket, $host = '127.0.0.1:8091', $options = []) { return new CacheStorage(Storage\Couchbase::getInstance($user, $password, $bucket, $host), $options); }
[ "public", "static", "function", "Couchbase", "(", "$", "user", ",", "$", "password", ",", "$", "bucket", ",", "$", "host", "=", "'127.0.0.1:8091'", ",", "$", "options", "=", "[", "]", ")", "{", "return", "new", "CacheStorage", "(", "Storage", "\\", "Co...
Create a cache instance with Couchbase as cache driver. @param string $user Couchbase username. @param string $password Couchbase password. @param string $bucket Couchbase bucket. @param string $host Couchbase host (with port number). @param array $options Cache options. @return CacheStorage
[ "Create", "a", "cache", "instance", "with", "Couchbase", "as", "cache", "driver", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Cache/Cache.php#L50-L53
230,483
Webiny/Framework
src/Webiny/Component/Cache/Cache.php
Cache.Memcache
public static function Memcache($host = '127.0.0.1', $port = 11211, $options = []) { return new CacheStorage(Storage\Memcache::getInstance($host, $port), $options); }
php
public static function Memcache($host = '127.0.0.1', $port = 11211, $options = []) { return new CacheStorage(Storage\Memcache::getInstance($host, $port), $options); }
[ "public", "static", "function", "Memcache", "(", "$", "host", "=", "'127.0.0.1'", ",", "$", "port", "=", "11211", ",", "$", "options", "=", "[", "]", ")", "{", "return", "new", "CacheStorage", "(", "Storage", "\\", "Memcache", "::", "getInstance", "(", ...
Create a cache instance with Memcache as cache driver. @param string $host Host where the memcached is running. @param int $port Port where memcached is running. @param array $options Cache options. @return CacheStorage
[ "Create", "a", "cache", "instance", "with", "Memcache", "as", "cache", "driver", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Cache/Cache.php#L64-L67
230,484
Webiny/Framework
src/Webiny/Component/Cache/Cache.php
Cache.Redis
public static function Redis($host = '127.0.0.1', $port = 6379, $options = []) { return new CacheStorage(Storage\Redis::getInstance($host, $port), $options); }
php
public static function Redis($host = '127.0.0.1', $port = 6379, $options = []) { return new CacheStorage(Storage\Redis::getInstance($host, $port), $options); }
[ "public", "static", "function", "Redis", "(", "$", "host", "=", "'127.0.0.1'", ",", "$", "port", "=", "6379", ",", "$", "options", "=", "[", "]", ")", "{", "return", "new", "CacheStorage", "(", "Storage", "\\", "Redis", "::", "getInstance", "(", "$", ...
Create a cache instance with Redis as cache driver. @param string $host Host where the Redis server is running. @param int $port Port where Redis server is running. @param array $options Cache options. @return CacheStorage
[ "Create", "a", "cache", "instance", "with", "Redis", "as", "cache", "driver", "." ]
2ca7fb238999387e54a1eea8c5cb4735de9022a7
https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Cache/Cache.php#L78-L81
230,485
milesj/admin
Controller/AdminAppController.php
AdminAppController.isAuthorized
public function isAuthorized($user = null) { if (!$user) { throw new ForbiddenException(__d('admin', 'Invalid User')); } $aro = Admin::introspectModel('Admin.RequestObject'); if ($aro->isAdmin($user['id'])) { if (!$this->Session->read('Admin.crud')) { ...
php
public function isAuthorized($user = null) { if (!$user) { throw new ForbiddenException(__d('admin', 'Invalid User')); } $aro = Admin::introspectModel('Admin.RequestObject'); if ($aro->isAdmin($user['id'])) { if (!$this->Session->read('Admin.crud')) { ...
[ "public", "function", "isAuthorized", "(", "$", "user", "=", "null", ")", "{", "if", "(", "!", "$", "user", ")", "{", "throw", "new", "ForbiddenException", "(", "__d", "(", "'admin'", ",", "'Invalid User'", ")", ")", ";", "}", "$", "aro", "=", "Admin...
Validate the user is authorized. @param array $user @return bool @throws ForbiddenException @throws UnauthorizedException
[ "Validate", "the", "user", "is", "authorized", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Controller/AdminAppController.php#L76-L92
230,486
milesj/admin
Controller/AdminAppController.php
AdminAppController.beforeRender
public function beforeRender() { $this->set('user', $this->Auth->user()); $this->set('config', Configure::read()); $this->set('model', $this->Model); }
php
public function beforeRender() { $this->set('user', $this->Auth->user()); $this->set('config', Configure::read()); $this->set('model', $this->Model); }
[ "public", "function", "beforeRender", "(", ")", "{", "$", "this", "->", "set", "(", "'user'", ",", "$", "this", "->", "Auth", "->", "user", "(", ")", ")", ";", "$", "this", "->", "set", "(", "'config'", ",", "Configure", "::", "read", "(", ")", "...
Before render.
[ "Before", "render", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Controller/AdminAppController.php#L111-L115
230,487
milesj/admin
Controller/AdminAppController.php
AdminAppController.proxy
public function proxy() { if (empty($this->Model) || empty($this->request->data[$this->Model->alias])) { $this->redirect($this->referer()); } $data = $this->request->data[$this->Model->alias]; $named = array(); foreach ($data as $key => $value) { if ( ...
php
public function proxy() { if (empty($this->Model) || empty($this->request->data[$this->Model->alias])) { $this->redirect($this->referer()); } $data = $this->request->data[$this->Model->alias]; $named = array(); foreach ($data as $key => $value) { if ( ...
[ "public", "function", "proxy", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "Model", ")", "||", "empty", "(", "$", "this", "->", "request", "->", "data", "[", "$", "this", "->", "Model", "->", "alias", "]", ")", ")", "{", "$", "th...
Proxy action to handle POST requests and redirect back with named params.
[ "Proxy", "action", "to", "handle", "POST", "requests", "and", "redirect", "back", "with", "named", "params", "." ]
e5e93823d1eb4415f05a3191f653eb50c296d2c6
https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Controller/AdminAppController.php#L120-L154
230,488
everplays/agavi-form-models-set
src/Elements/RadioGroupModel.class.php
Form_Elements_RadioGroupModel.setValue
public function setValue($value) { $value = (int) $value; $value = parent::setValue($value); return $value; }
php
public function setValue($value) { $value = (int) $value; $value = parent::setValue($value); return $value; }
[ "public", "function", "setValue", "(", "$", "value", ")", "{", "$", "value", "=", "(", "int", ")", "$", "value", ";", "$", "value", "=", "parent", "::", "setValue", "(", "$", "value", ")", ";", "return", "$", "value", ";", "}" ]
prepares value before checking regular validation check @param mixed $value @return mixed
[ "prepares", "value", "before", "checking", "regular", "validation", "check" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/RadioGroupModel.class.php#L104-L109
230,489
everplays/agavi-form-models-set
src/Elements/ConditionModel.class.php
Form_Elements_ConditionModel.setValue
public function setValue($value) { $failure = true; switch($this->opration) { case '==': if($value==$this->condition) $failure = false; break; case '>': if($value>$this->condition) $failure = false; break; case '>=': if($value>=$this->condition) $faulure = false; b...
php
public function setValue($value) { $failure = true; switch($this->opration) { case '==': if($value==$this->condition) $failure = false; break; case '>': if($value>$this->condition) $failure = false; break; case '>=': if($value>=$this->condition) $faulure = false; b...
[ "public", "function", "setValue", "(", "$", "value", ")", "{", "$", "failure", "=", "true", ";", "switch", "(", "$", "this", "->", "opration", ")", "{", "case", "'=='", ":", "if", "(", "$", "value", "==", "$", "this", "->", "condition", ")", "$", ...
checks given value can pass the conditions or not @param mixed $value @throws Form_ValidationExceptionModel if condition check fails @return mixed
[ "checks", "given", "value", "can", "pass", "the", "conditions", "or", "not" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/ConditionModel.class.php#L24-L71
230,490
everplays/agavi-form-models-set
src/Elements/CheckboxModel.class.php
Form_Elements_CheckboxModel.registerValidators
public function registerValidators(AgaviValidationManager $vm, array $depends, array $parameters=array()) { $this->value = isset($parameters[$this->name]); $vm->createValidator( 'AgaviIssetValidator', array($this->name), array('' => 'field is required'), array( 'translation_domain' => AgaviConfig::...
php
public function registerValidators(AgaviValidationManager $vm, array $depends, array $parameters=array()) { $this->value = isset($parameters[$this->name]); $vm->createValidator( 'AgaviIssetValidator', array($this->name), array('' => 'field is required'), array( 'translation_domain' => AgaviConfig::...
[ "public", "function", "registerValidators", "(", "AgaviValidationManager", "$", "vm", ",", "array", "$", "depends", ",", "array", "$", "parameters", "=", "array", "(", ")", ")", "{", "$", "this", "->", "value", "=", "isset", "(", "$", "parameters", "[", ...
registers validators for element @param AgaviValidationManager $vm instance of AgaviValidationManager to register validators on it @param array $depends depends parameter of validations that get registered @param array $parameters
[ "registers", "validators", "for", "element" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/CheckboxModel.class.php#L103-L116
230,491
everplays/agavi-form-models-set
src/FormModel.class.php
Form_FormModel.html
public function html($client=null) { $this->setRendered(true); // children level 2 or deeper will be at the end of list so // when their parent get rendered they will be rendered too foreach($this->children as $child) { $child->setRendered(false); } $result = "<form id=\"".self::idPrefix."-{$this->id}...
php
public function html($client=null) { $this->setRendered(true); // children level 2 or deeper will be at the end of list so // when their parent get rendered they will be rendered too foreach($this->children as $child) { $child->setRendered(false); } $result = "<form id=\"".self::idPrefix."-{$this->id}...
[ "public", "function", "html", "(", "$", "client", "=", "null", ")", "{", "$", "this", "->", "setRendered", "(", "true", ")", ";", "// children level 2 or deeper will be at the end of list so", "// when their parent get rendered they will be rendered too", "foreach", "(", ...
generates html of form @return string generated html for element @param string $client javascript client library - for validation purpose
[ "generates", "html", "of", "form" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/FormModel.class.php#L31-L71
230,492
everplays/agavi-form-models-set
src/FormModel.class.php
Form_FormModel.fromJson
public static function fromJson($config, Form_Elements_FieldsetModel $form=null) { $contextProfile = AgaviConfig::get('core.default_context'); if(is_null($contextProfile)) { $contextProfile = md5(microtime()); AgaviConfig::set('core.default_context', $contextProfile); } $context = AgaviContext::getInst...
php
public static function fromJson($config, Form_Elements_FieldsetModel $form=null) { $contextProfile = AgaviConfig::get('core.default_context'); if(is_null($contextProfile)) { $contextProfile = md5(microtime()); AgaviConfig::set('core.default_context', $contextProfile); } $context = AgaviContext::getInst...
[ "public", "static", "function", "fromJson", "(", "$", "config", ",", "Form_Elements_FieldsetModel", "$", "form", "=", "null", ")", "{", "$", "contextProfile", "=", "AgaviConfig", "::", "get", "(", "'core.default_context'", ")", ";", "if", "(", "is_null", "(", ...
parses config object should be used to make Form_FormModel object from a config (configuration is inspired by extjs lazy config) @param object $config lazy configuration @param Form_FormModel $form @return Form_FormModel
[ "parses", "config", "object" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/FormModel.class.php#L114-L126
230,493
everplays/agavi-form-models-set
src/Elements/FileFieldModel.class.php
Form_Elements_FileFieldModel.registerValidators
public function registerValidators(AgaviValidationManager $vm, array $depends, array $parameters=array(), array $files=array()) { if(isset($files[$this->name])) { if($files[$this->name] instanceof AgaviUploadedFile and !$files[$this->name]->hasError()) { $errors = $this->getValidationErrors($files[$this-...
php
public function registerValidators(AgaviValidationManager $vm, array $depends, array $parameters=array(), array $files=array()) { if(isset($files[$this->name])) { if($files[$this->name] instanceof AgaviUploadedFile and !$files[$this->name]->hasError()) { $errors = $this->getValidationErrors($files[$this-...
[ "public", "function", "registerValidators", "(", "AgaviValidationManager", "$", "vm", ",", "array", "$", "depends", ",", "array", "$", "parameters", "=", "array", "(", ")", ",", "array", "$", "files", "=", "array", "(", ")", ")", "{", "if", "(", "isset",...
register special validators of this element on validation manager @param AgaviValidationManager $vm instance of AgaviValidationManager to register validators on it @param array $depends depends parameter of validations that get registered @param array $parameters @param array $files array of AgaviUploadedFile
[ "register", "special", "validators", "of", "this", "element", "on", "validation", "manager" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/FileFieldModel.class.php#L110-L137
230,494
everplays/agavi-form-models-set
src/Elements/FieldsetModel.class.php
Form_Elements_FieldsetModel.addChild
public function addChild(Form_ElementModel $Child) { $cp = (array) $Child->parents; // child parents $fp = (array) $this->parents; // fieldset parents foreach($fp as $parent => $condition) $cp[$parent] = $condition; $Child->parents = $cp; $index = count($this->children); $this->children[] = $Child; if...
php
public function addChild(Form_ElementModel $Child) { $cp = (array) $Child->parents; // child parents $fp = (array) $this->parents; // fieldset parents foreach($fp as $parent => $condition) $cp[$parent] = $condition; $Child->parents = $cp; $index = count($this->children); $this->children[] = $Child; if...
[ "public", "function", "addChild", "(", "Form_ElementModel", "$", "Child", ")", "{", "$", "cp", "=", "(", "array", ")", "$", "Child", "->", "parents", ";", "// child parents", "$", "fp", "=", "(", "array", ")", "$", "this", "->", "parents", ";", "// fie...
adds Child to container @param Form_ElementModel $Child child to be added
[ "adds", "Child", "to", "container" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/FieldsetModel.class.php#L33-L46
230,495
everplays/agavi-form-models-set
src/Elements/FieldsetModel.class.php
Form_Elements_FieldsetModel.getChildById
public function getChildById($id) { if(isset($this->id2index[$id])) return $this->children[$this->id2index[$id]]; return null; }
php
public function getChildById($id) { if(isset($this->id2index[$id])) return $this->children[$this->id2index[$id]]; return null; }
[ "public", "function", "getChildById", "(", "$", "id", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "id2index", "[", "$", "id", "]", ")", ")", "return", "$", "this", "->", "children", "[", "$", "this", "->", "id2index", "[", "$", "id", "]...
returns Child by given id @param int $id id of Child @return Form_ElementModel Child or null
[ "returns", "Child", "by", "given", "id" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/FieldsetModel.class.php#L54-L59
230,496
everplays/agavi-form-models-set
src/Elements/FieldsetModel.class.php
Form_Elements_FieldsetModel.getChildByName
public function getChildByName($name) { if(isset($this->name2index[$name])) return $this->children[$this->name2index[$name]]; return null; }
php
public function getChildByName($name) { if(isset($this->name2index[$name])) return $this->children[$this->name2index[$name]]; return null; }
[ "public", "function", "getChildByName", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "name2index", "[", "$", "name", "]", ")", ")", "return", "$", "this", "->", "children", "[", "$", "this", "->", "name2index", "[", "$", ...
returns Child by given name @param string $name name of Child @return Form_ElementModel Child or null
[ "returns", "Child", "by", "given", "name" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/FieldsetModel.class.php#L67-L72
230,497
everplays/agavi-form-models-set
src/Elements/FieldsetModel.class.php
Form_Elements_FieldsetModel.removeChildById
public function removeChildById($id) { if(isset($this->id2index[$id])) { $tmp = $this->children[$this->id2index[$id]]; if(isset($tmp->name)) unset($this->name2index[$tmp->name]); unset($this->children[$this->id2index[$id]], $this->id2index[$id]); return $tmp; } return null; }
php
public function removeChildById($id) { if(isset($this->id2index[$id])) { $tmp = $this->children[$this->id2index[$id]]; if(isset($tmp->name)) unset($this->name2index[$tmp->name]); unset($this->children[$this->id2index[$id]], $this->id2index[$id]); return $tmp; } return null; }
[ "public", "function", "removeChildById", "(", "$", "id", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "id2index", "[", "$", "id", "]", ")", ")", "{", "$", "tmp", "=", "$", "this", "->", "children", "[", "$", "this", "->", "id2index", "["...
removes an Child by id @param int $id id of Child @return Form_ElementModel removed Child or null
[ "removes", "an", "Child", "by", "id" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/FieldsetModel.class.php#L90-L101
230,498
everplays/agavi-form-models-set
src/Elements/FieldsetModel.class.php
Form_Elements_FieldsetModel.removeChildByName
public function removeChildByName($name) { if(isset($this->name2index[$name])) { $tmp = $this->children[$this->name2index[$name]]; if(isset($tmp->id)) unset($this->id2index[$tmp->id]); unset($this->children[$this->name2index[$name]], $this->name2index[$name]); return $tmp; } return null; }
php
public function removeChildByName($name) { if(isset($this->name2index[$name])) { $tmp = $this->children[$this->name2index[$name]]; if(isset($tmp->id)) unset($this->id2index[$tmp->id]); unset($this->children[$this->name2index[$name]], $this->name2index[$name]); return $tmp; } return null; }
[ "public", "function", "removeChildByName", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "name2index", "[", "$", "name", "]", ")", ")", "{", "$", "tmp", "=", "$", "this", "->", "children", "[", "$", "this", "->", "name2ind...
removes an Child by name @param string $name name of Child @return Form_ElementModel removed Child or null
[ "removes", "an", "Child", "by", "name" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/FieldsetModel.class.php#L109-L120
230,499
everplays/agavi-form-models-set
src/Elements/FieldsetModel.class.php
Form_Elements_FieldsetModel.removeChild
public function removeChild($Child) { $index = array_search($Child, $this->children); if($index!==false) { $tmp = $this->children[$index]; if(isset($tmp->id)) unset($this->id2index[$tmp->id]); if(isset($tmp->name)) unset($this->name2index[$tmp->name]); unset($this->children[$index]); retur...
php
public function removeChild($Child) { $index = array_search($Child, $this->children); if($index!==false) { $tmp = $this->children[$index]; if(isset($tmp->id)) unset($this->id2index[$tmp->id]); if(isset($tmp->name)) unset($this->name2index[$tmp->name]); unset($this->children[$index]); retur...
[ "public", "function", "removeChild", "(", "$", "Child", ")", "{", "$", "index", "=", "array_search", "(", "$", "Child", ",", "$", "this", "->", "children", ")", ";", "if", "(", "$", "index", "!==", "false", ")", "{", "$", "tmp", "=", "$", "this", ...
removes an Child @param Form_ElementModel $Child Child to get removed @return Form_ElementModel removed Child or null
[ "removes", "an", "Child" ]
84b76f5facc6cea686ed2872eb6f4bd499f72d0e
https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/FieldsetModel.class.php#L128-L142