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
15,100
acasademont/wurfl
WURFL/Configuration/InMemoryConfig.php
WURFL_Configuration_InMemoryConfig.matchMode
public function matchMode($mode) { if (!self::validMatchMode($mode)) { throw new WURFL_WURFLException('Invalid Match Mode: '.$mode); } $this->matchMode = $mode; return $this; }
php
public function matchMode($mode) { if (!self::validMatchMode($mode)) { throw new WURFL_WURFLException('Invalid Match Mode: '.$mode); } $this->matchMode = $mode; return $this; }
[ "public", "function", "matchMode", "(", "$", "mode", ")", "{", "if", "(", "!", "self", "::", "validMatchMode", "(", "$", "mode", ")", ")", "{", "throw", "new", "WURFL_WURFLException", "(", "'Invalid Match Mode: '", ".", "$", "mode", ")", ";", "}", "$", ...
Sets the API match mode @param string $mode @return WURFL_Configuration_InMemoryConfig
[ "Sets", "the", "API", "match", "mode" ]
0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Configuration/InMemoryConfig.php#L110-L117
15,101
avto-dev/app-version-laravel
src/AppVersionManager.php
AppVersionManager.buildStored
protected function buildStored() { return $this->files->exists($file_path = $this->config['build_metadata_path']) ? $this->files->get($file_path, $this->use_locking) : null; }
php
protected function buildStored() { return $this->files->exists($file_path = $this->config['build_metadata_path']) ? $this->files->get($file_path, $this->use_locking) : null; }
[ "protected", "function", "buildStored", "(", ")", "{", "return", "$", "this", "->", "files", "->", "exists", "(", "$", "file_path", "=", "$", "this", "->", "config", "[", "'build_metadata_path'", "]", ")", "?", "$", "this", "->", "files", "->", "get", ...
Get build value from metadata file. @return null|string
[ "Get", "build", "value", "from", "metadata", "file", "." ]
5cbf9df5981cadd2d5148c49c834cc17fb903c3f
https://github.com/avto-dev/app-version-laravel/blob/5cbf9df5981cadd2d5148c49c834cc17fb903c3f/src/AppVersionManager.php#L169-L174
15,102
avto-dev/app-version-laravel
src/AppVersionManager.php
AppVersionManager.forgetFormatted
protected function forgetFormatted() { if ($this->files->exists($compiled_path = $this->config['compiled_path'])) { return $this->files->delete($compiled_path); } return false; }
php
protected function forgetFormatted() { if ($this->files->exists($compiled_path = $this->config['compiled_path'])) { return $this->files->delete($compiled_path); } return false; }
[ "protected", "function", "forgetFormatted", "(", ")", "{", "if", "(", "$", "this", "->", "files", "->", "exists", "(", "$", "compiled_path", "=", "$", "this", "->", "config", "[", "'compiled_path'", "]", ")", ")", "{", "return", "$", "this", "->", "fil...
Forget stored formatted value. @return bool
[ "Forget", "stored", "formatted", "value", "." ]
5cbf9df5981cadd2d5148c49c834cc17fb903c3f
https://github.com/avto-dev/app-version-laravel/blob/5cbf9df5981cadd2d5148c49c834cc17fb903c3f/src/AppVersionManager.php#L181-L188
15,103
jan-dolata/crude-crud
src/Engine/Traits/WithPermissionTrait.php
WithPermissionTrait._checkPermission
private function _checkPermission($name, $attribute) { if ($name == 'store') { return $this->permissionStore($attribute); } if ($name == 'update') { return $this->permissionUpdate($attribute); } if ($name == 'delete') { return $this->perm...
php
private function _checkPermission($name, $attribute) { if ($name == 'store') { return $this->permissionStore($attribute); } if ($name == 'update') { return $this->permissionUpdate($attribute); } if ($name == 'delete') { return $this->perm...
[ "private", "function", "_checkPermission", "(", "$", "name", ",", "$", "attribute", ")", "{", "if", "(", "$", "name", "==", "'store'", ")", "{", "return", "$", "this", "->", "permissionStore", "(", "$", "attribute", ")", ";", "}", "if", "(", "$", "na...
Check permission by name @param string $name @param mixed $attribute @return boolean
[ "Check", "permission", "by", "name" ]
9129ea08278835cf5cecfd46a90369226ae6bdd7
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Traits/WithPermissionTrait.php#L59-L82
15,104
jan-dolata/crude-crud
src/Engine/Traits/WithPermissionTrait.php
WithPermissionTrait._checkOption
private function _checkOption($name) { if ($name == 'list') return true; $names = [ 'store' => 'add', 'update' => 'edit', 'delete' => 'delete', 'order' => 'order', 'export' => 'export' ]; return $this->crudeSet...
php
private function _checkOption($name) { if ($name == 'list') return true; $names = [ 'store' => 'add', 'update' => 'edit', 'delete' => 'delete', 'order' => 'order', 'export' => 'export' ]; return $this->crudeSet...
[ "private", "function", "_checkOption", "(", "$", "name", ")", "{", "if", "(", "$", "name", "==", "'list'", ")", "return", "true", ";", "$", "names", "=", "[", "'store'", "=>", "'add'", ",", "'update'", "=>", "'edit'", ",", "'delete'", "=>", "'delete'",...
Check option by name @param string $name @return boolean
[ "Check", "option", "by", "name" ]
9129ea08278835cf5cecfd46a90369226ae6bdd7
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Traits/WithPermissionTrait.php#L89-L103
15,105
phramework/validate
src/BaseValidator.php
BaseValidator.validateCommon
protected function validateCommon($value, $validateResult) { //While current status of validation is true, //keep validating against common keywords //validate against enum using validateEnum if ($validateResult->status === true && $this->enum) { $validateResult = $this-...
php
protected function validateCommon($value, $validateResult) { //While current status of validation is true, //keep validating against common keywords //validate against enum using validateEnum if ($validateResult->status === true && $this->enum) { $validateResult = $this-...
[ "protected", "function", "validateCommon", "(", "$", "value", ",", "$", "validateResult", ")", "{", "//While current status of validation is true,", "//keep validating against common keywords", "//validate against enum using validateEnum", "if", "(", "$", "validateResult", "->", ...
Common helper method to validate against all common keywords @uses validateEnum @param mixed $value Value to validate @param ValidateResult $validateResult Current ValidateResult status @return ValidateResult
[ "Common", "helper", "method", "to", "validate", "against", "all", "common", "keywords" ]
22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/BaseValidator.php#L77-L103
15,106
phramework/validate
src/BaseValidator.php
BaseValidator.validateEnum
protected function validateEnum($value, $parsedValue) { $return = new ValidateResult($parsedValue, false); //Check if $this->enum is set and it's not null since its optional if ($this->enum !== null) { if (is_object($value)) { throw new \Exception('Objects are no...
php
protected function validateEnum($value, $parsedValue) { $return = new ValidateResult($parsedValue, false); //Check if $this->enum is set and it's not null since its optional if ($this->enum !== null) { if (is_object($value)) { throw new \Exception('Objects are no...
[ "protected", "function", "validateEnum", "(", "$", "value", ",", "$", "parsedValue", ")", "{", "$", "return", "=", "new", "ValidateResult", "(", "$", "parsedValue", ",", "false", ")", ";", "//Check if $this->enum is set and it's not null since its optional", "if", "...
Common helper method to validate against "enum" keyword @see 5.5.1. enum http://json-schema.org/latest/json-schema-validation.html#anchor75 @param mixed $value Value to validate @param mixed $value Parsed value from previous validators @return ValidateResult @todo provide support for objects and arrays
[ "Common", "helper", "method", "to", "validate", "against", "enum", "keyword" ]
22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/BaseValidator.php#L133-L189
15,107
phramework/validate
src/BaseValidator.php
BaseValidator.validateNot
protected function validateNot($value, $parsedValue) { $return = new ValidateResult($parsedValue, true); //Check if $this->not is set and it's not null since its optional if ($this->not && $this->not !== null) { if (!is_subclass_of( $this->not, Ba...
php
protected function validateNot($value, $parsedValue) { $return = new ValidateResult($parsedValue, true); //Check if $this->not is set and it's not null since its optional if ($this->not && $this->not !== null) { if (!is_subclass_of( $this->not, Ba...
[ "protected", "function", "validateNot", "(", "$", "value", ",", "$", "parsedValue", ")", "{", "$", "return", "=", "new", "ValidateResult", "(", "$", "parsedValue", ",", "true", ")", ";", "//Check if $this->not is set and it's not null since its optional", "if", "(",...
Common helper method to validate against "not" keyword @param mixed $value Value to validate @param mixed $value Parsed value from previous validators @return ValidateResult @throws \Exception
[ "Common", "helper", "method", "to", "validate", "against", "not", "keyword" ]
22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/BaseValidator.php#L198-L231
15,108
phramework/validate
src/BaseValidator.php
BaseValidator.registerValidator
public static function registerValidator($type, $className) { if (!is_string($type)) { throw new \Exception('"type" MUST be string'); } if (!is_string($className)) { throw new \Exception('"className" MUST be string'); } if (!is_subclass_of( ...
php
public static function registerValidator($type, $className) { if (!is_string($type)) { throw new \Exception('"type" MUST be string'); } if (!is_string($className)) { throw new \Exception('"className" MUST be string'); } if (!is_subclass_of( ...
[ "public", "static", "function", "registerValidator", "(", "$", "type", ",", "$", "className", ")", "{", "if", "(", "!", "is_string", "(", "$", "type", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'\"type\" MUST be string'", ")", ";", "}", "if"...
Register a custom validator for a type @param string $type Type's name, `x-` SHOULD be used for custom types @param string $className Validator's full classname. All validators MUST extend `BaseValidator` class @example ```php BaseValidator::registerValidator('x-address', 'My\APP\AddressValidator'); ``` @throws ...
[ "Register", "a", "custom", "validator", "for", "a", "type" ]
22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/BaseValidator.php#L504-L526
15,109
phramework/validate
src/BaseValidator.php
BaseValidator.createFromObjectForAdditional
protected static function createFromObjectForAdditional($object) { $indexProperty = null; $class = null; if (property_exists($object, 'anyOf')) { $indexProperty = 'anyOf'; $class = AnyOf::class; } elseif (property_exists($object, 'allOf')) { $inde...
php
protected static function createFromObjectForAdditional($object) { $indexProperty = null; $class = null; if (property_exists($object, 'anyOf')) { $indexProperty = 'anyOf'; $class = AnyOf::class; } elseif (property_exists($object, 'allOf')) { $inde...
[ "protected", "static", "function", "createFromObjectForAdditional", "(", "$", "object", ")", "{", "$", "indexProperty", "=", "null", ";", "$", "class", "=", "null", ";", "if", "(", "property_exists", "(", "$", "object", ",", "'anyOf'", ")", ")", "{", "$", ...
Helper method. Used to create anyOf, allOf and oneOf validators from objects @param object $object Validation object @return AnyOf|AllOf|OneOf|null
[ "Helper", "method", ".", "Used", "to", "create", "anyOf", "allOf", "and", "oneOf", "validators", "from", "objects" ]
22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/BaseValidator.php#L534-L560
15,110
phramework/validate
src/BaseValidator.php
BaseValidator.createFromObject
public static function createFromObject($object) { $isFromBase = (static::class === self::class); if (!is_object($object)) { throw new \Exception('Expecting an object'); } //Test type if it's set if (property_exists($object, 'type') && !empty($object->type)) { ...
php
public static function createFromObject($object) { $isFromBase = (static::class === self::class); if (!is_object($object)) { throw new \Exception('Expecting an object'); } //Test type if it's set if (property_exists($object, 'type') && !empty($object->type)) { ...
[ "public", "static", "function", "createFromObject", "(", "$", "object", ")", "{", "$", "isFromBase", "=", "(", "static", "::", "class", "===", "self", "::", "class", ")", ";", "if", "(", "!", "is_object", "(", "$", "object", ")", ")", "{", "throw", "...
Create validator from validation object @param object $object Validation object @return BaseValidator @todo cleanup class loading @throws \Exception When validator class cannot be found for object's type
[ "Create", "validator", "from", "validation", "object" ]
22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/BaseValidator.php#L569-L662
15,111
phramework/validate
src/BaseValidator.php
BaseValidator.createFromJSON
public static function createFromJSON($json) { $object = json_decode($json); if (json_last_error() !== JSON_ERROR_NONE) { throw new \Exception( 'JSON parse had errors - ' . json_last_error_msg() ); } return static::createFromObject($object); ...
php
public static function createFromJSON($json) { $object = json_decode($json); if (json_last_error() !== JSON_ERROR_NONE) { throw new \Exception( 'JSON parse had errors - ' . json_last_error_msg() ); } return static::createFromObject($object); ...
[ "public", "static", "function", "createFromJSON", "(", "$", "json", ")", "{", "$", "object", "=", "json_decode", "(", "$", "json", ")", ";", "if", "(", "json_last_error", "(", ")", "!==", "JSON_ERROR_NONE", ")", "{", "throw", "new", "\\", "Exception", "(...
Create validator from validation object encoded as json object @param string $json Validation json encoded object @return BaseValidator @throws \Exception when JSON sting is not well formed
[ "Create", "validator", "from", "validation", "object", "encoded", "as", "json", "object" ]
22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/BaseValidator.php#L681-L692
15,112
phramework/validate
src/BaseValidator.php
BaseValidator.toJSON
public function toJSON($JSON_PRETTY_PRINT = false) { $object = $this->toObject(); /*foreach ($object as $key => &$attribute) { //Check if any of attributes is an instance of BaseValidator if (is_object($attribute) && is_a($attribute, BaseValidator::class)) { ...
php
public function toJSON($JSON_PRETTY_PRINT = false) { $object = $this->toObject(); /*foreach ($object as $key => &$attribute) { //Check if any of attributes is an instance of BaseValidator if (is_object($attribute) && is_a($attribute, BaseValidator::class)) { ...
[ "public", "function", "toJSON", "(", "$", "JSON_PRETTY_PRINT", "=", "false", ")", "{", "$", "object", "=", "$", "this", "->", "toObject", "(", ")", ";", "/*foreach ($object as $key => &$attribute) {\n //Check if any of attributes is an instance of BaseValidator\n ...
Export validator to json encoded string @param boolean $JSON_PRETTY_PRINT *[Optional]* @return string
[ "Export", "validator", "to", "json", "encoded", "string" ]
22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/BaseValidator.php#L699-L714
15,113
phramework/validate
src/BaseValidator.php
BaseValidator.toObject
public function toObject() { $object = $this->toArray(); //fix type to object if (isset($object['properties'])) { $object['properties'] = (object)$object['properties']; } foreach (['anyOf', 'allOf', 'oneOf', 'not'] as $property) { //fix type to objec...
php
public function toObject() { $object = $this->toArray(); //fix type to object if (isset($object['properties'])) { $object['properties'] = (object)$object['properties']; } foreach (['anyOf', 'allOf', 'oneOf', 'not'] as $property) { //fix type to objec...
[ "public", "function", "toObject", "(", ")", "{", "$", "object", "=", "$", "this", "->", "toArray", "(", ")", ";", "//fix type to object", "if", "(", "isset", "(", "$", "object", "[", "'properties'", "]", ")", ")", "{", "$", "object", "[", "'properties'...
Export validator to object @return object
[ "Export", "validator", "to", "object" ]
22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/BaseValidator.php#L720-L739
15,114
phramework/validate
src/BaseValidator.php
BaseValidator.toArray
public function toArray() { $object = []; if (static::$type) { $object['type'] = static::$type; } $attributes = array_merge( static::getTypeAttributes(), static::$commonAttributes ); foreach ($attributes as $attribute) { ...
php
public function toArray() { $object = []; if (static::$type) { $object['type'] = static::$type; } $attributes = array_merge( static::getTypeAttributes(), static::$commonAttributes ); foreach ($attributes as $attribute) { ...
[ "public", "function", "toArray", "(", ")", "{", "$", "object", "=", "[", "]", ";", "if", "(", "static", "::", "$", "type", ")", "{", "$", "object", "[", "'type'", "]", "=", "static", "::", "$", "type", ";", "}", "$", "attributes", "=", "array_mer...
Export validator to array @return array
[ "Export", "validator", "to", "array" ]
22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/BaseValidator.php#L745-L799
15,115
tjbp/laravel-verify-emails
src/Auth/VerifyEmails/VerifyEmailBroker.php
VerifyEmailBroker.sendVerificationLink
public function sendVerificationLink(CanVerifyEmailContract $user, Closure $callback = null) { // Once we have the verify token, we are ready to send the message out to this // user with a link to verify their email. We will then redirect back to // the current URI having nothing set in the ...
php
public function sendVerificationLink(CanVerifyEmailContract $user, Closure $callback = null) { // Once we have the verify token, we are ready to send the message out to this // user with a link to verify their email. We will then redirect back to // the current URI having nothing set in the ...
[ "public", "function", "sendVerificationLink", "(", "CanVerifyEmailContract", "$", "user", ",", "Closure", "$", "callback", "=", "null", ")", "{", "// Once we have the verify token, we are ready to send the message out to this", "// user with a link to verify their email. We will then...
Send an email verification link to a user. @param \LaravelVerifyEmails\Contracts\Auth\CanVerifyEmail $user @param \Closure|null $callback @return string
[ "Send", "an", "email", "verification", "link", "to", "a", "user", "." ]
1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6
https://github.com/tjbp/laravel-verify-emails/blob/1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6/src/Auth/VerifyEmails/VerifyEmailBroker.php#L55-L65
15,116
tjbp/laravel-verify-emails
src/Auth/VerifyEmails/VerifyEmailBroker.php
VerifyEmailBroker.verify
public function verify(CanVerifyEmailContract $user, $token) { // If the responses from the validate method is not a user instance, we will // assume that it is a redirect and simply return it from this method and // the user is properly redirected having an error message on the post. ...
php
public function verify(CanVerifyEmailContract $user, $token) { // If the responses from the validate method is not a user instance, we will // assume that it is a redirect and simply return it from this method and // the user is properly redirected having an error message on the post. ...
[ "public", "function", "verify", "(", "CanVerifyEmailContract", "$", "user", ",", "$", "token", ")", "{", "// If the responses from the validate method is not a user instance, we will", "// assume that it is a redirect and simply return it from this method and", "// the user is properly r...
Verify the email address for the given token. @param \LaravelVerifyEmails\Contracts\Auth\CanVerifyEmail $user @param string $token @return mixed
[ "Verify", "the", "email", "address", "for", "the", "given", "token", "." ]
1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6
https://github.com/tjbp/laravel-verify-emails/blob/1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6/src/Auth/VerifyEmails/VerifyEmailBroker.php#L98-L116
15,117
tjbp/laravel-verify-emails
src/Auth/VerifyEmails/VerifyEmailBroker.php
VerifyEmailBroker.validateVerification
protected function validateVerification(CanVerifyEmailContract $user, $token) { if (! $this->tokens->exists($user, $token)) { return VerifyEmailBrokerContract::INVALID_TOKEN; } return $user; }
php
protected function validateVerification(CanVerifyEmailContract $user, $token) { if (! $this->tokens->exists($user, $token)) { return VerifyEmailBrokerContract::INVALID_TOKEN; } return $user; }
[ "protected", "function", "validateVerification", "(", "CanVerifyEmailContract", "$", "user", ",", "$", "token", ")", "{", "if", "(", "!", "$", "this", "->", "tokens", "->", "exists", "(", "$", "user", ",", "$", "token", ")", ")", "{", "return", "VerifyEm...
Validate a verification for the given credentials. @param \LaravelVerifyEmails\Contracts\Auth\CanVerifyEmail $user @param string $token @return \LaravelVerifyEmails\Contracts\Auth\CanVerifyEmail
[ "Validate", "a", "verification", "for", "the", "given", "credentials", "." ]
1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6
https://github.com/tjbp/laravel-verify-emails/blob/1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6/src/Auth/VerifyEmails/VerifyEmailBroker.php#L125-L132
15,118
aindong/pluggables
src/Aindong/Pluggables/Console/PluggableMigrateRefreshCommand.php
PluggableMigrateRefreshCommand.runSeeder
protected function runSeeder($module = null, $database = null) { $this->call('pluggables:seed', [ 'pluggable' => $this->argument('pluggable'), '--database' => $database, ]); }
php
protected function runSeeder($module = null, $database = null) { $this->call('pluggables:seed', [ 'pluggable' => $this->argument('pluggable'), '--database' => $database, ]); }
[ "protected", "function", "runSeeder", "(", "$", "module", "=", "null", ",", "$", "database", "=", "null", ")", "{", "$", "this", "->", "call", "(", "'pluggables:seed'", ",", "[", "'pluggable'", "=>", "$", "this", "->", "argument", "(", "'pluggable'", ")"...
Run the module seeder command. @param string $database @return void
[ "Run", "the", "module", "seeder", "command", "." ]
bf8bab46fb65268043fb4b98db21f8e0338b5e96
https://github.com/aindong/pluggables/blob/bf8bab46fb65268043fb4b98db21f8e0338b5e96/src/Aindong/Pluggables/Console/PluggableMigrateRefreshCommand.php#L87-L93
15,119
hrevert/HtUserRegistration
src/Controller/UserRegistrationController.php
UserRegistrationController.verifyEmailAction
public function verifyEmailAction() { $userId = $this->params()->fromRoute('userId', null); $token = $this->params()->fromRoute('token', null); if ($userId === null || $token === null) { return $this->notFoundAction(); } $user = $this->getUserMapper()->findById(...
php
public function verifyEmailAction() { $userId = $this->params()->fromRoute('userId', null); $token = $this->params()->fromRoute('token', null); if ($userId === null || $token === null) { return $this->notFoundAction(); } $user = $this->getUserMapper()->findById(...
[ "public", "function", "verifyEmailAction", "(", ")", "{", "$", "userId", "=", "$", "this", "->", "params", "(", ")", "->", "fromRoute", "(", "'userId'", ",", "null", ")", ";", "$", "token", "=", "$", "this", "->", "params", "(", ")", "->", "fromRoute...
Verifies user`s email address and redirects to login route
[ "Verifies", "user", "s", "email", "address", "and", "redirects", "to", "login", "route" ]
6b4a0cc364153757290ab5eed9ffafe1228f3bd6
https://github.com/hrevert/HtUserRegistration/blob/6b4a0cc364153757290ab5eed9ffafe1228f3bd6/src/Controller/UserRegistrationController.php#L44-L70
15,120
hrevert/HtUserRegistration
src/Controller/UserRegistrationController.php
UserRegistrationController.setPasswordAction
public function setPasswordAction() { $userId = $this->params()->fromRoute('userId', null); $token = $this->params()->fromRoute('token', null); if ($userId === null || $token === null) { return $this->notFoundAction(); } $user = $this->getUserMapper()->findById(...
php
public function setPasswordAction() { $userId = $this->params()->fromRoute('userId', null); $token = $this->params()->fromRoute('token', null); if ($userId === null || $token === null) { return $this->notFoundAction(); } $user = $this->getUserMapper()->findById(...
[ "public", "function", "setPasswordAction", "(", ")", "{", "$", "userId", "=", "$", "this", "->", "params", "(", ")", "->", "fromRoute", "(", "'userId'", ",", "null", ")", ";", "$", "token", "=", "$", "this", "->", "params", "(", ")", "->", "fromRoute...
Allows users to set their account password
[ "Allows", "users", "to", "set", "their", "account", "password" ]
6b4a0cc364153757290ab5eed9ffafe1228f3bd6
https://github.com/hrevert/HtUserRegistration/blob/6b4a0cc364153757290ab5eed9ffafe1228f3bd6/src/Controller/UserRegistrationController.php#L75-L117
15,121
blast-project/CoreBundle
src/DependencyInjection/BlastCoreExtension.php
BlastCoreExtension.buildLoader
public function buildLoader(ContainerBuilder $container) { return new YamlFileLoader($container, new FileLocator($this->dir . $this->prefix)); }
php
public function buildLoader(ContainerBuilder $container) { return new YamlFileLoader($container, new FileLocator($this->dir . $this->prefix)); }
[ "public", "function", "buildLoader", "(", "ContainerBuilder", "$", "container", ")", "{", "return", "new", "YamlFileLoader", "(", "$", "container", ",", "new", "FileLocator", "(", "$", "this", "->", "dir", ".", "$", "this", "->", "prefix", ")", ")", ";", ...
the buildLoader returns the required FileLoader. @param ContainerBuilder $container @return FileLoader
[ "the", "buildLoader", "returns", "the", "required", "FileLoader", "." ]
7a0832758ca14e5bc5d65515532c1220df3930ae
https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/DependencyInjection/BlastCoreExtension.php#L70-L73
15,122
baleen/cli
src/CommandBus/Repository/CreateHandler.php
CreateHandler.writeClass
protected function writeClass(ClassGenerator $class, Filesystem $filesystem, $destinationDir) { $className = $class->getName(); $file = new FileGenerator([ 'fileName' => $className.'.php', 'classes' => [$class], ]); $contents = $file->generate(); $rel...
php
protected function writeClass(ClassGenerator $class, Filesystem $filesystem, $destinationDir) { $className = $class->getName(); $file = new FileGenerator([ 'fileName' => $className.'.php', 'classes' => [$class], ]); $contents = $file->generate(); $rel...
[ "protected", "function", "writeClass", "(", "ClassGenerator", "$", "class", ",", "Filesystem", "$", "filesystem", ",", "$", "destinationDir", ")", "{", "$", "className", "=", "$", "class", "->", "getName", "(", ")", ";", "$", "file", "=", "new", "FileGener...
Function writeClass. @param ClassGenerator $class @param Filesystem $filesystem @param $destinationDir @return string|false @throws CliException
[ "Function", "writeClass", "." ]
2ecbc7179c5800c9075fd93204ef25da375536ed
https://github.com/baleen/cli/blob/2ecbc7179c5800c9075fd93204ef25da375536ed/src/CommandBus/Repository/CreateHandler.php#L160-L180
15,123
Srokap/code_review
classes/CodeReview/PhpFileParser.php
PhpFileParser.validateFileContents
protected function validateFileContents() { if (!$this->fileName) { throw new \LogicException("Missing file's path. Looks like severe internal error."); } $this->validateFilePath($this->fileName); if (!$this->sha1hash) { throw new \LogicException("Missing file's SHA1 hash. Looks like severe internal error...
php
protected function validateFileContents() { if (!$this->fileName) { throw new \LogicException("Missing file's path. Looks like severe internal error."); } $this->validateFilePath($this->fileName); if (!$this->sha1hash) { throw new \LogicException("Missing file's SHA1 hash. Looks like severe internal error...
[ "protected", "function", "validateFileContents", "(", ")", "{", "if", "(", "!", "$", "this", "->", "fileName", ")", "{", "throw", "new", "\\", "LogicException", "(", "\"Missing file's path. Looks like severe internal error.\"", ")", ";", "}", "$", "this", "->", ...
Uses SHA1 hash to determine if file contents has changed since analysis. @return bool @throws \CodeReview\IOException @throws LogicException
[ "Uses", "SHA1", "hash", "to", "determine", "if", "file", "contents", "has", "changed", "since", "analysis", "." ]
c79c619f99279cf15713b118ae19b0ef017db362
https://github.com/Srokap/code_review/blob/c79c619f99279cf15713b118ae19b0ef017db362/classes/CodeReview/PhpFileParser.php#L74-L86
15,124
Srokap/code_review
classes/CodeReview/PhpFileParser.php
PhpFileParser.validateFilePath
protected function validateFilePath($fileName) { if (!file_exists($fileName)) { throw new IOException("File $fileName does not exists"); } if (!is_file($fileName)) { throw new IOException("$fileName must be a file"); } if (!is_readable($fileName)) { throw new IOException("File $fileName is not readab...
php
protected function validateFilePath($fileName) { if (!file_exists($fileName)) { throw new IOException("File $fileName does not exists"); } if (!is_file($fileName)) { throw new IOException("$fileName must be a file"); } if (!is_readable($fileName)) { throw new IOException("File $fileName is not readab...
[ "protected", "function", "validateFilePath", "(", "$", "fileName", ")", "{", "if", "(", "!", "file_exists", "(", "$", "fileName", ")", ")", "{", "throw", "new", "IOException", "(", "\"File $fileName does not exists\"", ")", ";", "}", "if", "(", "!", "is_file...
Checks if file exists and is readable. @param $fileName @return bool @throws \CodeReview\IOException
[ "Checks", "if", "file", "exists", "and", "is", "readable", "." ]
c79c619f99279cf15713b118ae19b0ef017db362
https://github.com/Srokap/code_review/blob/c79c619f99279cf15713b118ae19b0ef017db362/classes/CodeReview/PhpFileParser.php#L95-L106
15,125
Srokap/code_review
classes/CodeReview/PhpFileParser.php
PhpFileParser.computeNestingParentTokens
private function computeNestingParentTokens($debug = false) { $nesting = 0; $parents = array(); $lastParent = null; foreach ($this->tokens as $key => $token) { if (is_array($token)) { //add info about parent to array $parent = $parents ? $parents[count($parents)-1] : null; $this->tokens[$key][3] ...
php
private function computeNestingParentTokens($debug = false) { $nesting = 0; $parents = array(); $lastParent = null; foreach ($this->tokens as $key => $token) { if (is_array($token)) { //add info about parent to array $parent = $parents ? $parents[count($parents)-1] : null; $this->tokens[$key][3] ...
[ "private", "function", "computeNestingParentTokens", "(", "$", "debug", "=", "false", ")", "{", "$", "nesting", "=", "0", ";", "$", "parents", "=", "array", "(", ")", ";", "$", "lastParent", "=", "null", ";", "foreach", "(", "$", "this", "->", "tokens"...
Compute parents of the tokens to easily determine containing methods and classes. @param bool $debug
[ "Compute", "parents", "of", "the", "tokens", "to", "easily", "determine", "containing", "methods", "and", "classes", "." ]
c79c619f99279cf15713b118ae19b0ef017db362
https://github.com/Srokap/code_review/blob/c79c619f99279cf15713b118ae19b0ef017db362/classes/CodeReview/PhpFileParser.php#L113-L150
15,126
shawnsandy/ui-pages
src/Classes/Pages.php
Pages.getView
public function getView($name, $data = []) { $view = 'missing-page'; if (view()->exists('page::' . $name)) { $view = $name; } return view('page::' . $view, $data); }
php
public function getView($name, $data = []) { $view = 'missing-page'; if (view()->exists('page::' . $name)) { $view = $name; } return view('page::' . $view, $data); }
[ "public", "function", "getView", "(", "$", "name", ",", "$", "data", "=", "[", "]", ")", "{", "$", "view", "=", "'missing-page'", ";", "if", "(", "view", "(", ")", "->", "exists", "(", "'page::'", ".", "$", "name", ")", ")", "{", "$", "view", "...
Search and Load the view or fallbacks to specific view @param string $name The name of the view @param array $data View data @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "Search", "and", "Load", "the", "view", "or", "fallbacks", "to", "specific", "view" ]
11584c12fa3e2b9a5c513f4ec9e2eaf78c206ca8
https://github.com/shawnsandy/ui-pages/blob/11584c12fa3e2b9a5c513f4ec9e2eaf78c206ca8/src/Classes/Pages.php#L20-L29
15,127
vsilva472/phpcpf
src/CPF.php
CPF.validate
public function validate($cpf) { $raw_cpf = $cpf; $cpf = $this->clean($cpf); $has_mask = preg_match("/^[0-9]{3}\.[0-9]{3}\.[0-9]{3}\-[0-9]{2}$/", $raw_cpf); if (!$has_mask && !is_numeric($raw_cpf)) { return false; } if (!$this->isLengthValid(...
php
public function validate($cpf) { $raw_cpf = $cpf; $cpf = $this->clean($cpf); $has_mask = preg_match("/^[0-9]{3}\.[0-9]{3}\.[0-9]{3}\-[0-9]{2}$/", $raw_cpf); if (!$has_mask && !is_numeric($raw_cpf)) { return false; } if (!$this->isLengthValid(...
[ "public", "function", "validate", "(", "$", "cpf", ")", "{", "$", "raw_cpf", "=", "$", "cpf", ";", "$", "cpf", "=", "$", "this", "->", "clean", "(", "$", "cpf", ")", ";", "$", "has_mask", "=", "preg_match", "(", "\"/^[0-9]{3}\\.[0-9]{3}\\.[0-9]{3}\\-[0-9...
Validate a given Brazilian CPF number @param $cpf @return bool
[ "Validate", "a", "given", "Brazilian", "CPF", "number" ]
3c37fc1af43de31ed93acc5a9538f349e361af43
https://github.com/vsilva472/phpcpf/blob/3c37fc1af43de31ed93acc5a9538f349e361af43/src/CPF.php#L26-L45
15,128
vsilva472/phpcpf
src/CPF.php
CPF.isDummyValue
public function isDummyValue($cpf) { return ( $cpf == '00000000000' || $cpf == '11111111111' || $cpf == '22222222222' || $cpf == '33333333333' || $cpf == '44444444444' || $cpf == '55555555555' || $cpf == '66666666666' || ...
php
public function isDummyValue($cpf) { return ( $cpf == '00000000000' || $cpf == '11111111111' || $cpf == '22222222222' || $cpf == '33333333333' || $cpf == '44444444444' || $cpf == '55555555555' || $cpf == '66666666666' || ...
[ "public", "function", "isDummyValue", "(", "$", "cpf", ")", "{", "return", "(", "$", "cpf", "==", "'00000000000'", "||", "$", "cpf", "==", "'11111111111'", "||", "$", "cpf", "==", "'22222222222'", "||", "$", "cpf", "==", "'33333333333'", "||", "$", "cpf"...
Check if a given CPF value is a dummy sequence @param $cpf @return bool
[ "Check", "if", "a", "given", "CPF", "value", "is", "a", "dummy", "sequence" ]
3c37fc1af43de31ed93acc5a9538f349e361af43
https://github.com/vsilva472/phpcpf/blob/3c37fc1af43de31ed93acc5a9538f349e361af43/src/CPF.php#L76-L90
15,129
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addElement
public function addElement(\FrenchFrogs\Form\Element\Element $element, FrenchFrogs\Renderer\Renderer $renderer = null) { // Join element to the form $element->setForm($this); $this->elements[$element->getName()] = $element; return $this; }
php
public function addElement(\FrenchFrogs\Form\Element\Element $element, FrenchFrogs\Renderer\Renderer $renderer = null) { // Join element to the form $element->setForm($this); $this->elements[$element->getName()] = $element; return $this; }
[ "public", "function", "addElement", "(", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "Element", "$", "element", ",", "FrenchFrogs", "\\", "Renderer", "\\", "Renderer", "$", "renderer", "=", "null", ")", "{", "// Join element to the form", "$", "e...
Add a single element to the elements container @param \FrenchFrogs\Form\Element\Element $element @return $this
[ "Add", "a", "single", "element", "to", "the", "elements", "container" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L32-L40
15,130
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addDateRange
public function addDateRange($name, $label = '', $from = '', $to = '', $is_mandatory = true) { $e = new \FrenchFrogs\Form\Element\DateRange($name, $label, $from, $to); $this->addElement($e); if ($is_mandatory) { $e->addRule('required'); } else { $e->addFilter...
php
public function addDateRange($name, $label = '', $from = '', $to = '', $is_mandatory = true) { $e = new \FrenchFrogs\Form\Element\DateRange($name, $label, $from, $to); $this->addElement($e); if ($is_mandatory) { $e->addRule('required'); } else { $e->addFilter...
[ "public", "function", "addDateRange", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "from", "=", "''", ",", "$", "to", "=", "''", ",", "$", "is_mandatory", "=", "true", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form"...
Add 2 input for a date range element @param $name @param string $label @param string $from @param string $to @param bool $is_mandatory @return FrenchFrogs\Form\Element\DateRange
[ "Add", "2", "input", "for", "a", "date", "range", "element" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L259-L271
15,131
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addTextarea
public function addTextarea($name, $label = '', $is_mandatory = true ) { $e = new \FrenchFrogs\Form\Element\Textarea($name, $label); $this->addElement($e); if ($is_mandatory) { $e->addRule('required'); } else { $e->addFilter('nullable'); } re...
php
public function addTextarea($name, $label = '', $is_mandatory = true ) { $e = new \FrenchFrogs\Form\Element\Textarea($name, $label); $this->addElement($e); if ($is_mandatory) { $e->addRule('required'); } else { $e->addFilter('nullable'); } re...
[ "public", "function", "addTextarea", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "is_mandatory", "=", "true", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "Textarea", "(", "$", "name", ",", ...
Add textarea element @param $name @param string $label @param array $attr @return \FrenchFrogs\Form\Element\Textarea
[ "Add", "textarea", "element" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L326-L338
15,132
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addSubmit
public function addSubmit($name, $attr = []) { $e = new \FrenchFrogs\Form\Element\Submit($name, $attr); $e->setValue($name); $e->setOptionAsPrimary(); $this->addAction($e); return $e; }
php
public function addSubmit($name, $attr = []) { $e = new \FrenchFrogs\Form\Element\Submit($name, $attr); $e->setValue($name); $e->setOptionAsPrimary(); $this->addAction($e); return $e; }
[ "public", "function", "addSubmit", "(", "$", "name", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "Submit", "(", "$", "name", ",", "$", "attr", ")", ";", "$", "e", "-...
Add action button @param $name @param array $attr @return \FrenchFrogs\Form\Element\Submit
[ "Add", "action", "button" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L347-L354
15,133
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addCheckbox
public function addCheckbox($name, $label = '', $multi = [], $attr = [] ) { $e = new \FrenchFrogs\Form\Element\Checkbox($name, $label, $multi, $attr); $this->addElement($e); return $e; }
php
public function addCheckbox($name, $label = '', $multi = [], $attr = [] ) { $e = new \FrenchFrogs\Form\Element\Checkbox($name, $label, $multi, $attr); $this->addElement($e); return $e; }
[ "public", "function", "addCheckbox", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "multi", "=", "[", "]", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "C...
Add input checkbox element @param $name @param string $label @param array $attr @return \FrenchFrogs\Form\Element\Checkbox
[ "Add", "input", "checkbox", "element" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L365-L370
15,134
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addBoolean
public function addBoolean($name, $label = '', $attr = [] ) { $e = new \FrenchFrogs\Form\Element\Boolean($name, $label, $attr); $this->addElement($e); return $e; }
php
public function addBoolean($name, $label = '', $attr = [] ) { $e = new \FrenchFrogs\Form\Element\Boolean($name, $label, $attr); $this->addElement($e); return $e; }
[ "public", "function", "addBoolean", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "Boolean", "(", "$", "name", ",", "$", ...
Add Boolean Element @param $name @param string $label @param array $attr @return \FrenchFrogs\Form\Element\Boolean
[ "Add", "Boolean", "Element" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L381-L386
15,135
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addButton
public function addButton($name, $label, $attr = [] ) { $e = new \FrenchFrogs\Form\Element\Button($name, $label, $attr); $this->addElement($e); return $e; }
php
public function addButton($name, $label, $attr = [] ) { $e = new \FrenchFrogs\Form\Element\Button($name, $label, $attr); $this->addElement($e); return $e; }
[ "public", "function", "addButton", "(", "$", "name", ",", "$", "label", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "Button", "(", "$", "name", ",", "$", "label", ",",...
Add button element @param $label @param array $attr @return \FrenchFrogs\Form\Element\Button
[ "Add", "button", "element" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L560-L565
15,136
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addTitle
public function addTitle($name, $attr = []) { $e = new \FrenchFrogs\Form\Element\Title($name, $attr); $this->addElement($e); return $e; }
php
public function addTitle($name, $attr = []) { $e = new \FrenchFrogs\Form\Element\Title($name, $attr); $this->addElement($e); return $e; }
[ "public", "function", "addTitle", "(", "$", "name", ",", "$", "attr", "=", "[", "]", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "Title", "(", "$", "name", ",", "$", "attr", ")", ";", "$", "this", "...
Add a Title element @param $name @param array $attr @return \FrenchFrogs\Form\Element\Title
[ "Add", "a", "Title", "element" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L590-L595
15,137
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addContent
public function addContent($label, $value = '', $fullwidth = true) { $e = new \FrenchFrogs\Form\Element\Content($label, $value, $fullwidth); $this->addElement($e); return $e; }
php
public function addContent($label, $value = '', $fullwidth = true) { $e = new \FrenchFrogs\Form\Element\Content($label, $value, $fullwidth); $this->addElement($e); return $e; }
[ "public", "function", "addContent", "(", "$", "label", ",", "$", "value", "=", "''", ",", "$", "fullwidth", "=", "true", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "Content", "(", "$", "label", ",", "$...
Add format content @param $label @param string $content @param array $attr @return \FrenchFrogs\Form\Element\Content
[ "Add", "format", "content" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L606-L611
15,138
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addSelect
public function addSelect($name, $label, $multi = [], $is_mandatory = true) { $e = new \FrenchFrogs\Form\Element\Select($name, $label, $multi); $this->addElement($e); if ($is_mandatory) { $e->addRule('required'); } else { $e->addFilter('nullable'); }...
php
public function addSelect($name, $label, $multi = [], $is_mandatory = true) { $e = new \FrenchFrogs\Form\Element\Select($name, $label, $multi); $this->addElement($e); if ($is_mandatory) { $e->addRule('required'); } else { $e->addFilter('nullable'); }...
[ "public", "function", "addSelect", "(", "$", "name", ",", "$", "label", ",", "$", "multi", "=", "[", "]", ",", "$", "is_mandatory", "=", "true", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "Select", "("...
Add select element @param $name @param $label @param array $multi @param array $attr @return \FrenchFrogs\Form\Element\Select
[ "Add", "select", "element" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L671-L683
15,139
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addDataList
public function addDataList($name, $label, $options = [], $is_mandatory = true) { $e = new \FrenchFrogs\Form\Element\DataList($name, $label, $options); $this->addElement($e); if ($is_mandatory) { $e->addRule('required'); } else { $e->addFilter('nullable'); ...
php
public function addDataList($name, $label, $options = [], $is_mandatory = true) { $e = new \FrenchFrogs\Form\Element\DataList($name, $label, $options); $this->addElement($e); if ($is_mandatory) { $e->addRule('required'); } else { $e->addFilter('nullable'); ...
[ "public", "function", "addDataList", "(", "$", "name", ",", "$", "label", ",", "$", "options", "=", "[", "]", ",", "$", "is_mandatory", "=", "true", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "DataList",...
Add list element @param $name @param $label @param array $options @param bool|true $is_mandatory @return FrenchFrogs\Form\Element\DataList
[ "Add", "list", "element" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L694-L706
15,140
FrenchFrogs/framework
src/Form/Form/Element.php
Element.addFile
public function addFile($name, $label = '', $is_mandatory = true) { $e = new \FrenchFrogs\Form\Element\File($name, $label); $this->addElement($e); if ($is_mandatory) { $e->addRule('required'); } else { $e->addFilter('nullable'); } return $e; ...
php
public function addFile($name, $label = '', $is_mandatory = true) { $e = new \FrenchFrogs\Form\Element\File($name, $label); $this->addElement($e); if ($is_mandatory) { $e->addRule('required'); } else { $e->addFilter('nullable'); } return $e; ...
[ "public", "function", "addFile", "(", "$", "name", ",", "$", "label", "=", "''", ",", "$", "is_mandatory", "=", "true", ")", "{", "$", "e", "=", "new", "\\", "FrenchFrogs", "\\", "Form", "\\", "Element", "\\", "File", "(", "$", "name", ",", "$", ...
Add file element @param $name @param string $label @param array $attr @return \FrenchFrogs\Form\Element\File
[ "Add", "file", "element" ]
a4838c698a5600437e87dac6d35ba8ebe32c4395
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Form/Form/Element.php#L717-L729
15,141
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Formatter.php
Formatter.getArgbHexString
public function getArgbHexString(Color $color) { $alpha = dechex(255 * $color->alpha); return '#' . $alpha . $color->hex; }
php
public function getArgbHexString(Color $color) { $alpha = dechex(255 * $color->alpha); return '#' . $alpha . $color->hex; }
[ "public", "function", "getArgbHexString", "(", "Color", "$", "color", ")", "{", "$", "alpha", "=", "dechex", "(", "255", "*", "$", "color", "->", "alpha", ")", ";", "return", "'#'", ".", "$", "alpha", ".", "$", "color", "->", "hex", ";", "}" ]
Given a Color object, returns a formatted argb hex string @param object $color Color object @return string
[ "Given", "a", "Color", "object", "returns", "a", "formatted", "argb", "hex", "string" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Formatter.php#L34-L38
15,142
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Formatter.php
Formatter.getRgbaHexString
public function getRgbaHexString(Color $color) { $alpha = dechex(255 * $color->alpha); return '#' . $color->hex . $alpha; }
php
public function getRgbaHexString(Color $color) { $alpha = dechex(255 * $color->alpha); return '#' . $color->hex . $alpha; }
[ "public", "function", "getRgbaHexString", "(", "Color", "$", "color", ")", "{", "$", "alpha", "=", "dechex", "(", "255", "*", "$", "color", "->", "alpha", ")", ";", "return", "'#'", ".", "$", "color", "->", "hex", ".", "$", "alpha", ";", "}" ]
Given a Color object, returns a formatted rgba hex string @param object $color Color object @return string
[ "Given", "a", "Color", "object", "returns", "a", "formatted", "rgba", "hex", "string" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Formatter.php#L46-L50
15,143
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Formatter.php
Formatter.getRgbaString
public function getRgbaString(Color $color) { return 'rgba('. $color->red . ', ' . $color->green . ', ' . $color->blue . ', ' . $color->alpha . ')'; }
php
public function getRgbaString(Color $color) { return 'rgba('. $color->red . ', ' . $color->green . ', ' . $color->blue . ', ' . $color->alpha . ')'; }
[ "public", "function", "getRgbaString", "(", "Color", "$", "color", ")", "{", "return", "'rgba('", ".", "$", "color", "->", "red", ".", "', '", ".", "$", "color", "->", "green", ".", "', '", ".", "$", "color", "->", "blue", ".", "', '", ".", "$", "c...
Given a Color object, returns a formatted rgba string @param object $color Color object @return string
[ "Given", "a", "Color", "object", "returns", "a", "formatted", "rgba", "string" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Formatter.php#L69-L72
15,144
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Formatter.php
Formatter.getHslString
public function getHslString(Color $color) { return 'hsl('. round($color->hue) . ', ' . round($color->saturation * 100) . '%, ' . round($color->lightness * 100) . '%)'; }
php
public function getHslString(Color $color) { return 'hsl('. round($color->hue) . ', ' . round($color->saturation * 100) . '%, ' . round($color->lightness * 100) . '%)'; }
[ "public", "function", "getHslString", "(", "Color", "$", "color", ")", "{", "return", "'hsl('", ".", "round", "(", "$", "color", "->", "hue", ")", ".", "', '", ".", "round", "(", "$", "color", "->", "saturation", "*", "100", ")", ".", "'%, '", ".", ...
Given a Color object, returns a formatted hsl string @param object $color Color object @return string
[ "Given", "a", "Color", "object", "returns", "a", "formatted", "hsl", "string" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Formatter.php#L80-L83
15,145
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Formatter.php
Formatter.getHslaString
public function getHslaString(Color $color) { return 'hsla('. round($color->hue) . ', ' . round($color->saturation * 100) . '%, ' . round($color->lightness * 100) . '%, ' . $color->alpha . ')'; }
php
public function getHslaString(Color $color) { return 'hsla('. round($color->hue) . ', ' . round($color->saturation * 100) . '%, ' . round($color->lightness * 100) . '%, ' . $color->alpha . ')'; }
[ "public", "function", "getHslaString", "(", "Color", "$", "color", ")", "{", "return", "'hsla('", ".", "round", "(", "$", "color", "->", "hue", ")", ".", "', '", ".", "round", "(", "$", "color", "->", "saturation", "*", "100", ")", ".", "'%, '", ".",...
Given a Color object, returns a formatted hsla string @param object $color Color object @return string
[ "Given", "a", "Color", "object", "returns", "a", "formatted", "hsla", "string" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Formatter.php#L91-L94
15,146
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Formatter.php
Formatter.load
public function load(Color $color, $value) { $value = strtolower(trim($value)); $format = $this->guess($value); if (is_callable(__CLASS__ . '::' . $format)) { $this->$format($color, $value); } return $color; }
php
public function load(Color $color, $value) { $value = strtolower(trim($value)); $format = $this->guess($value); if (is_callable(__CLASS__ . '::' . $format)) { $this->$format($color, $value); } return $color; }
[ "public", "function", "load", "(", "Color", "$", "color", ",", "$", "value", ")", "{", "$", "value", "=", "strtolower", "(", "trim", "(", "$", "value", ")", ")", ";", "$", "format", "=", "$", "this", "->", "guess", "(", "$", "value", ")", ";", ...
Pass a var in subject param and this method will attempt to parse it into a color object and return it @param object $color Color object @param mixed $subject @return object Color object
[ "Pass", "a", "var", "in", "subject", "param", "and", "this", "method", "will", "attempt", "to", "parse", "it", "into", "a", "color", "object", "and", "return", "it" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Formatter.php#L105-L116
15,147
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Formatter.php
Formatter.guess
private function guess($value) { if (is_string($value)) { $len = strlen($value); if (strpos($value, ' ') === false && strpos($value, ',') === false) { if (substr($value, 0, 1) === '#' && ($len === 7 || $len === 4)) { return 'loadHexString'; ...
php
private function guess($value) { if (is_string($value)) { $len = strlen($value); if (strpos($value, ' ') === false && strpos($value, ',') === false) { if (substr($value, 0, 1) === '#' && ($len === 7 || $len === 4)) { return 'loadHexString'; ...
[ "private", "function", "guess", "(", "$", "value", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", ")", "{", "$", "len", "=", "strlen", "(", "$", "value", ")", ";", "if", "(", "strpos", "(", "$", "value", ",", "' '", ")", "===", "fals...
Given a subject tries to discover the format, then return the appropriate method name @param mixed @return string|boolean string if found, boolean false if not found
[ "Given", "a", "subject", "tries", "to", "discover", "the", "format", "then", "return", "the", "appropriate", "method", "name" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Formatter.php#L125-L150
15,148
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Formatter.php
Formatter.loadHexString
public function loadHexString(Color $color, $subject) { $subject = trim($subject); $subject = str_replace(array('#', ';', ' '), '', $subject); if (strlen($subject) !== 3 && strlen($subject) !== 6) { //Bad Input return false; } elseif (strlen($subject) === 3)...
php
public function loadHexString(Color $color, $subject) { $subject = trim($subject); $subject = str_replace(array('#', ';', ' '), '', $subject); if (strlen($subject) !== 3 && strlen($subject) !== 6) { //Bad Input return false; } elseif (strlen($subject) === 3)...
[ "public", "function", "loadHexString", "(", "Color", "$", "color", ",", "$", "subject", ")", "{", "$", "subject", "=", "trim", "(", "$", "subject", ")", ";", "$", "subject", "=", "str_replace", "(", "array", "(", "'#'", ",", "';'", ",", "' '", ")", ...
Loads a color object from a hex string @param object $color Color object @param mixed @return object Color object
[ "Loads", "a", "color", "object", "from", "a", "hex", "string" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Formatter.php#L159-L177
15,149
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Formatter.php
Formatter.loadRgbString
public function loadRgbString(Color $color, $subject) { $subject = trim($subject); $subject = str_replace(array('rgba', 'rgb', '(', ')', ';', ' '), '', $subject); $rgbnum = explode(',', $subject); if (count($rgbnum) !== 3 && count($rgbnum) !== 4) { return false; ...
php
public function loadRgbString(Color $color, $subject) { $subject = trim($subject); $subject = str_replace(array('rgba', 'rgb', '(', ')', ';', ' '), '', $subject); $rgbnum = explode(',', $subject); if (count($rgbnum) !== 3 && count($rgbnum) !== 4) { return false; ...
[ "public", "function", "loadRgbString", "(", "Color", "$", "color", ",", "$", "subject", ")", "{", "$", "subject", "=", "trim", "(", "$", "subject", ")", ";", "$", "subject", "=", "str_replace", "(", "array", "(", "'rgba'", ",", "'rgb'", ",", "'('", "...
Loads a color object from an rgb or rgba string @param object $color Color object @param mixed @return object Color object
[ "Loads", "a", "color", "object", "from", "an", "rgb", "or", "rgba", "string" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Formatter.php#L186-L215
15,150
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Formatter.php
Formatter.loadHslString
public function loadHslString(Color $color, $subject) { $subject = trim($subject); $subject = str_replace(array('hsla', 'hsl', '(', ')', ';', ' '), '', $subject); $hslnum = explode(',', $subject); if (count($hslnum) !== 3 && count($hslnum) !== 4) { return false; ...
php
public function loadHslString(Color $color, $subject) { $subject = trim($subject); $subject = str_replace(array('hsla', 'hsl', '(', ')', ';', ' '), '', $subject); $hslnum = explode(',', $subject); if (count($hslnum) !== 3 && count($hslnum) !== 4) { return false; ...
[ "public", "function", "loadHslString", "(", "Color", "$", "color", ",", "$", "subject", ")", "{", "$", "subject", "=", "trim", "(", "$", "subject", ")", ";", "$", "subject", "=", "str_replace", "(", "array", "(", "'hsla'", ",", "'hsl'", ",", "'('", "...
Loads a color object from a hsl or hsla string @param object $color Color object @param mixed @return object Color object
[ "Loads", "a", "color", "object", "from", "a", "hsl", "or", "hsla", "string" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Formatter.php#L224-L253
15,151
opis/storages
cache/Database.php
Database.has
public function has($key) { try { $ttlColumn = $this->columns['ttl']; return (bool) $this->db->from($this->table) ->where($this->columns['key'])->eq($this->prefix . $key) ->andWhere(function ($group) use ($ttlColumn) { ...
php
public function has($key) { try { $ttlColumn = $this->columns['ttl']; return (bool) $this->db->from($this->table) ->where($this->columns['key'])->eq($this->prefix . $key) ->andWhere(function ($group) use ($ttlColumn) { ...
[ "public", "function", "has", "(", "$", "key", ")", "{", "try", "{", "$", "ttlColumn", "=", "$", "this", "->", "columns", "[", "'ttl'", "]", ";", "return", "(", "bool", ")", "$", "this", "->", "db", "->", "from", "(", "$", "this", "->", "table", ...
Returns TRUE if the cache key exists and FALSE if not. @param string $key Cache key @return boolean
[ "Returns", "TRUE", "if", "the", "cache", "key", "exists", "and", "FALSE", "if", "not", "." ]
548dd631239c7cd75c04d17878b677e646540fde
https://github.com/opis/storages/blob/548dd631239c7cd75c04d17878b677e646540fde/cache/Database.php#L137-L152
15,152
opis/storages
cache/Database.php
Database.delete
public function delete($key) { try { return (bool) $this->db->from($this->table) ->where($this->columns['key'])->eq($this->prefix . $key) ->delete(); } catch (PDOException $e) { return false; } }
php
public function delete($key) { try { return (bool) $this->db->from($this->table) ->where($this->columns['key'])->eq($this->prefix . $key) ->delete(); } catch (PDOException $e) { return false; } }
[ "public", "function", "delete", "(", "$", "key", ")", "{", "try", "{", "return", "(", "bool", ")", "$", "this", "->", "db", "->", "from", "(", "$", "this", "->", "table", ")", "->", "where", "(", "$", "this", "->", "columns", "[", "'key'", "]", ...
Delete a variable from the cache. @param string $key Cache key @return boolean
[ "Delete", "a", "variable", "from", "the", "cache", "." ]
548dd631239c7cd75c04d17878b677e646540fde
https://github.com/opis/storages/blob/548dd631239c7cd75c04d17878b677e646540fde/cache/Database.php#L161-L170
15,153
opis/storages
cache/Database.php
Database.clear
public function clear() { try { $this->db->from($this->table)->delete(); } catch (PDOException $e) { return false; } return true; }
php
public function clear() { try { $this->db->from($this->table)->delete(); } catch (PDOException $e) { return false; } return true; }
[ "public", "function", "clear", "(", ")", "{", "try", "{", "$", "this", "->", "db", "->", "from", "(", "$", "this", "->", "table", ")", "->", "delete", "(", ")", ";", "}", "catch", "(", "PDOException", "$", "e", ")", "{", "return", "false", ";", ...
Clears the user cache. @return boolean
[ "Clears", "the", "user", "cache", "." ]
548dd631239c7cd75c04d17878b677e646540fde
https://github.com/opis/storages/blob/548dd631239c7cd75c04d17878b677e646540fde/cache/Database.php#L177-L186
15,154
Nayjest/Tree
src/ParentNodeTrait.php
ParentNodeTrait.children
public function children() { if ($this->collection === null) { $this->initializeCollection($this->defaultChildren()); } return $this->collection; }
php
public function children() { if ($this->collection === null) { $this->initializeCollection($this->defaultChildren()); } return $this->collection; }
[ "public", "function", "children", "(", ")", "{", "if", "(", "$", "this", "->", "collection", "===", "null", ")", "{", "$", "this", "->", "initializeCollection", "(", "$", "this", "->", "defaultChildren", "(", ")", ")", ";", "}", "return", "$", "this", ...
Returns collection of child nodes. @return \Nayjest\Collection\CollectionInterface|ChildNodeInterface[]
[ "Returns", "collection", "of", "child", "nodes", "." ]
e73da75f939e207b1c25065e9466c28300e7113c
https://github.com/Nayjest/Tree/blob/e73da75f939e207b1c25065e9466c28300e7113c/src/ParentNodeTrait.php#L56-L63
15,155
Nayjest/Tree
src/ParentNodeTrait.php
ParentNodeTrait.getChildrenRecursive
public function getChildrenRecursive() { $res = new ObjectCollection(); foreach ($this->children() as $child) { $res->add($child); if ($child instanceof ParentNodeInterface) { $res->addMany($child->getChildrenRecursive()); } } retu...
php
public function getChildrenRecursive() { $res = new ObjectCollection(); foreach ($this->children() as $child) { $res->add($child); if ($child instanceof ParentNodeInterface) { $res->addMany($child->getChildrenRecursive()); } } retu...
[ "public", "function", "getChildrenRecursive", "(", ")", "{", "$", "res", "=", "new", "ObjectCollection", "(", ")", ";", "foreach", "(", "$", "this", "->", "children", "(", ")", "as", "$", "child", ")", "{", "$", "res", "->", "add", "(", "$", "child",...
Returns collection containing all descendant nodes. @return CollectionInterface|ObjectCollection|ChildNodeInterface[]
[ "Returns", "collection", "containing", "all", "descendant", "nodes", "." ]
e73da75f939e207b1c25065e9466c28300e7113c
https://github.com/Nayjest/Tree/blob/e73da75f939e207b1c25065e9466c28300e7113c/src/ParentNodeTrait.php#L80-L91
15,156
acasademont/wurfl
WURFL/WURFLUtils.php
WURFL_WURFLUtils.isXhtmlRequester
public static function isXhtmlRequester($request) { if (!isset($request["accept"])) { return false; } $accept = $request["accept"]; if (isset($accept)) { if ((strpos($accept, WURFL_Constants::ACCEPT_HEADER_VND_WAP_XHTML_XML) !== 0) || (str...
php
public static function isXhtmlRequester($request) { if (!isset($request["accept"])) { return false; } $accept = $request["accept"]; if (isset($accept)) { if ((strpos($accept, WURFL_Constants::ACCEPT_HEADER_VND_WAP_XHTML_XML) !== 0) || (str...
[ "public", "static", "function", "isXhtmlRequester", "(", "$", "request", ")", "{", "if", "(", "!", "isset", "(", "$", "request", "[", "\"accept\"", "]", ")", ")", "{", "return", "false", ";", "}", "$", "accept", "=", "$", "request", "[", "\"accept\"", ...
Checks if the requester device is xhtml enabled @param array $request HTTP Request array (normally $_SERVER) @return bool
[ "Checks", "if", "the", "requester", "device", "is", "xhtml", "enabled" ]
0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/WURFLUtils.php#L90-L106
15,157
activecollab/databasestructure
src/Builder/AssociationsBuilder.php
AssociationsBuilder.prepareHasOneConstraintStatement
public function prepareHasOneConstraintStatement(TypeInterface $type, HasOneAssociation $association) { $result = []; $result[] = 'ALTER TABLE ' . $this->getConnection()->escapeTableName($type->getName()); $result[] = ' ADD CONSTRAINT ' . $this->getConnection()->escapeFieldName($associat...
php
public function prepareHasOneConstraintStatement(TypeInterface $type, HasOneAssociation $association) { $result = []; $result[] = 'ALTER TABLE ' . $this->getConnection()->escapeTableName($type->getName()); $result[] = ' ADD CONSTRAINT ' . $this->getConnection()->escapeFieldName($associat...
[ "public", "function", "prepareHasOneConstraintStatement", "(", "TypeInterface", "$", "type", ",", "HasOneAssociation", "$", "association", ")", "{", "$", "result", "=", "[", "]", ";", "$", "result", "[", "]", "=", "'ALTER TABLE '", ".", "$", "this", "->", "g...
Prepare has one constraint statement. @param TypeInterface $type @param HasOneAssociation $association @return string
[ "Prepare", "has", "one", "constraint", "statement", "." ]
4b2353c4422186bcfce63b3212da3e70e63eb5df
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/AssociationsBuilder.php#L145-L160
15,158
activecollab/databasestructure
src/Builder/AssociationsBuilder.php
AssociationsBuilder.prepareHasAndBelongsToManyConstraintStatement
public function prepareHasAndBelongsToManyConstraintStatement($type_name, $connection_table, $constraint_name, $field_name) { $result = []; $result[] = 'ALTER TABLE ' . $this->getConnection()->escapeTableName($connection_table); $result[] = ' ADD CONSTRAINT ' . $this->getConnection()->es...
php
public function prepareHasAndBelongsToManyConstraintStatement($type_name, $connection_table, $constraint_name, $field_name) { $result = []; $result[] = 'ALTER TABLE ' . $this->getConnection()->escapeTableName($connection_table); $result[] = ' ADD CONSTRAINT ' . $this->getConnection()->es...
[ "public", "function", "prepareHasAndBelongsToManyConstraintStatement", "(", "$", "type_name", ",", "$", "connection_table", ",", "$", "constraint_name", ",", "$", "field_name", ")", "{", "$", "result", "=", "[", "]", ";", "$", "result", "[", "]", "=", "'ALTER ...
Prepare has and belongs to many constraint statement. @param string $type_name @param string $connection_table @param string $constraint_name @param string $field_name @return string
[ "Prepare", "has", "and", "belongs", "to", "many", "constraint", "statement", "." ]
4b2353c4422186bcfce63b3212da3e70e63eb5df
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/AssociationsBuilder.php#L171-L181
15,159
seeren/http
src/Stream/Stream.php
Stream.setReadableWritable
private final function setReadableWritable(string $mode) { if (self::MODE_R === $mode) { $this->meta["readable"] = true; $this->meta["writable"] = false; } else if (self::MODE_W === $mode || self::MODE_A === $mode || self::MODE_C === $mode ...
php
private final function setReadableWritable(string $mode) { if (self::MODE_R === $mode) { $this->meta["readable"] = true; $this->meta["writable"] = false; } else if (self::MODE_W === $mode || self::MODE_A === $mode || self::MODE_C === $mode ...
[ "private", "final", "function", "setReadableWritable", "(", "string", "$", "mode", ")", "{", "if", "(", "self", "::", "MODE_R", "===", "$", "mode", ")", "{", "$", "this", "->", "meta", "[", "\"readable\"", "]", "=", "true", ";", "$", "this", "->", "m...
Set stream readable and writable status @param string $mode ressource mode @return null
[ "Set", "stream", "readable", "and", "writable", "status" ]
b5e692e085c41fe25714d17ee90ba78eaf1923c4
https://github.com/seeren/http/blob/b5e692e085c41fe25714d17ee90ba78eaf1923c4/src/Stream/Stream.php#L76-L95
15,160
seeren/http
src/Stream/Stream.php
Stream.getMetadata
public final function getMetadata($key = null) { return isset($key) ? (array_key_exists($key, $this->meta) ? $this->meta[$key] : null) : $this->meta; }
php
public final function getMetadata($key = null) { return isset($key) ? (array_key_exists($key, $this->meta) ? $this->meta[$key] : null) : $this->meta; }
[ "public", "final", "function", "getMetadata", "(", "$", "key", "=", "null", ")", "{", "return", "isset", "(", "$", "key", ")", "?", "(", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "meta", ")", "?", "$", "this", "->", "meta", "[", ...
Get stream metadata @param string $key metadata key @return array|mixed|null meta or value for key or null
[ "Get", "stream", "metadata" ]
b5e692e085c41fe25714d17ee90ba78eaf1923c4
https://github.com/seeren/http/blob/b5e692e085c41fe25714d17ee90ba78eaf1923c4/src/Stream/Stream.php#L301-L306
15,161
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Toolkit.php
Toolkit.sync
public function sync(Color $firstcolor, Color $secondcolor) { foreach ($this->colorprops as $name) { $firstcolor->$name = $secondcolor->$name; } return $firstcolor; }
php
public function sync(Color $firstcolor, Color $secondcolor) { foreach ($this->colorprops as $name) { $firstcolor->$name = $secondcolor->$name; } return $firstcolor; }
[ "public", "function", "sync", "(", "Color", "$", "firstcolor", ",", "Color", "$", "secondcolor", ")", "{", "foreach", "(", "$", "this", "->", "colorprops", "as", "$", "name", ")", "{", "$", "firstcolor", "->", "$", "name", "=", "$", "secondcolor", "->"...
Sync first color with second color The first color will receive all property values from the second color @param object $firstcolor first Color object to receive the values @param object $secondcolor second Color object to give the values @return object self
[ "Sync", "first", "color", "with", "second", "color" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Toolkit.php#L56-L63
15,162
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Toolkit.php
Toolkit.getCssGradient
public function getCssGradient(Color $color, $amount = null) { // Get gradient colors if (self::isLight($color)) { $lightColor = $color->hex; $darkColor = self::darken($color->copy(), $amount)->hex; } else { $lightColor = self::lighten($color->copy(), $amo...
php
public function getCssGradient(Color $color, $amount = null) { // Get gradient colors if (self::isLight($color)) { $lightColor = $color->hex; $darkColor = self::darken($color->copy(), $amount)->hex; } else { $lightColor = self::lighten($color->copy(), $amo...
[ "public", "function", "getCssGradient", "(", "Color", "$", "color", ",", "$", "amount", "=", "null", ")", "{", "// Get gradient colors", "if", "(", "self", "::", "isLight", "(", "$", "color", ")", ")", "{", "$", "lightColor", "=", "$", "color", "->", "...
Returns the cross browser CSS3 gradient @param object $color Color object @param integer $amount Optional: percentage amount to light/darken the gradient @return string CSS3 gradient for chrome, safari, firefox, opera and IE10 with fallbacks
[ "Returns", "the", "cross", "browser", "CSS3", "gradient" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Toolkit.php#L120-L154
15,163
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Toolkit.php
Toolkit.darken
public function darken(Color $color, $amount = null) { $current = $color->lightness; $amount = ($amount === null) ? self::DEFAULT_ADJUST : $amount ; $amount = intval($amount) / 100; $new = $current - $amount; $new = ($new < 0) ? 0 : $new; $new = ($new > 1) ? 1 : ...
php
public function darken(Color $color, $amount = null) { $current = $color->lightness; $amount = ($amount === null) ? self::DEFAULT_ADJUST : $amount ; $amount = intval($amount) / 100; $new = $current - $amount; $new = ($new < 0) ? 0 : $new; $new = ($new > 1) ? 1 : ...
[ "public", "function", "darken", "(", "Color", "$", "color", ",", "$", "amount", "=", "null", ")", "{", "$", "current", "=", "$", "color", "->", "lightness", ";", "$", "amount", "=", "(", "$", "amount", "===", "null", ")", "?", "self", "::", "DEFAUL...
Darkens color by a percentage a given Color object @param object $color Color object @param integer @return object Color
[ "Darkens", "color", "by", "a", "percentage", "a", "given", "Color", "object" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Toolkit.php#L163-L180
15,164
syhol/mrcolor
src/SyHolloway/MrColor/Extension/Toolkit.php
Toolkit.merge
public function merge(Color $color1, Color $color2, $percentage = 50) { return new Color(array( 'red' => $this->getMergedColorPart('red', $color1, $color2, $percentage), 'green' => $this->getMergedColorPart('green', $color1, $color2, $percentage), 'blue' => $this->getMerg...
php
public function merge(Color $color1, Color $color2, $percentage = 50) { return new Color(array( 'red' => $this->getMergedColorPart('red', $color1, $color2, $percentage), 'green' => $this->getMergedColorPart('green', $color1, $color2, $percentage), 'blue' => $this->getMerg...
[ "public", "function", "merge", "(", "Color", "$", "color1", ",", "Color", "$", "color2", ",", "$", "percentage", "=", "50", ")", "{", "return", "new", "Color", "(", "array", "(", "'red'", "=>", "$", "this", "->", "getMergedColorPart", "(", "'red'", ","...
Merges the current color with a second color with an optional percentage @param object $color1 Color object @param object $color2 Color object @param integer $percentage @return object Color
[ "Merges", "the", "current", "color", "with", "a", "second", "color", "with", "an", "optional", "percentage" ]
b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d
https://github.com/syhol/mrcolor/blob/b0cfef8fa3dc52940ff6cb78d19a4fac9e02ef4d/src/SyHolloway/MrColor/Extension/Toolkit.php#L216-L223
15,165
dynamic/silverstripe-geocoder
src/AddressDataExtension.php
AddressDataExtension.getMapStyleJSON
public static function getMapStyleJSON() { $folders = [ 'client/dist/js/', 'client/dist/javascript/', 'dist/js/', 'dist/javascript/', 'src/javascript/thirdparty', 'js/', 'javascript/', ]; $file = 'mapStyle.js...
php
public static function getMapStyleJSON() { $folders = [ 'client/dist/js/', 'client/dist/javascript/', 'dist/js/', 'dist/javascript/', 'src/javascript/thirdparty', 'js/', 'javascript/', ]; $file = 'mapStyle.js...
[ "public", "static", "function", "getMapStyleJSON", "(", ")", "{", "$", "folders", "=", "[", "'client/dist/js/'", ",", "'client/dist/javascript/'", ",", "'dist/js/'", ",", "'dist/javascript/'", ",", "'src/javascript/thirdparty'", ",", "'js/'", ",", "'javascript/'", ","...
Gets the style of the map @return string|null
[ "Gets", "the", "style", "of", "the", "map" ]
234ec4caa8f73f7a6432a098548f8d55c7894251
https://github.com/dynamic/silverstripe-geocoder/blob/234ec4caa8f73f7a6432a098548f8d55c7894251/src/AddressDataExtension.php#L134-L157
15,166
dynamic/silverstripe-geocoder
src/AddressDataExtension.php
AddressDataExtension.getIconImage
public static function getIconImage($svg = true) { $folders = [ 'client/dist/img/', 'client/dist/images/', 'dist/img/', 'dist/images/', 'img/', 'images/', ]; $extensions = [ 'png', 'jpg', ...
php
public static function getIconImage($svg = true) { $folders = [ 'client/dist/img/', 'client/dist/images/', 'dist/img/', 'dist/images/', 'img/', 'images/', ]; $extensions = [ 'png', 'jpg', ...
[ "public", "static", "function", "getIconImage", "(", "$", "svg", "=", "true", ")", "{", "$", "folders", "=", "[", "'client/dist/img/'", ",", "'client/dist/images/'", ",", "'dist/img/'", ",", "'dist/images/'", ",", "'img/'", ",", "'images/'", ",", "]", ";", "...
Gets the maker icon image @var boolean $svg if svgs should be included @return null|string
[ "Gets", "the", "maker", "icon", "image" ]
234ec4caa8f73f7a6432a098548f8d55c7894251
https://github.com/dynamic/silverstripe-geocoder/blob/234ec4caa8f73f7a6432a098548f8d55c7894251/src/AddressDataExtension.php#L164-L200
15,167
dynamic/silverstripe-geocoder
src/AddressDataExtension.php
AddressDataExtension.isAddressChanged
public function isAddressChanged($level = 1) { $fields = ['Address', 'Address2', 'City', 'State', 'PostalCode', 'Country']; $changed = $this->owner->getChangedFields(false, $level); foreach ($fields as $field) { if (array_key_exists($field, $changed)) { return tru...
php
public function isAddressChanged($level = 1) { $fields = ['Address', 'Address2', 'City', 'State', 'PostalCode', 'Country']; $changed = $this->owner->getChangedFields(false, $level); foreach ($fields as $field) { if (array_key_exists($field, $changed)) { return tru...
[ "public", "function", "isAddressChanged", "(", "$", "level", "=", "1", ")", "{", "$", "fields", "=", "[", "'Address'", ",", "'Address2'", ",", "'City'", ",", "'State'", ",", "'PostalCode'", ",", "'Country'", "]", ";", "$", "changed", "=", "$", "this", ...
Returns TRUE if any of the address fields have changed. @param int $level @return bool
[ "Returns", "TRUE", "if", "any", "of", "the", "address", "fields", "have", "changed", "." ]
234ec4caa8f73f7a6432a098548f8d55c7894251
https://github.com/dynamic/silverstripe-geocoder/blob/234ec4caa8f73f7a6432a098548f8d55c7894251/src/AddressDataExtension.php#L236-L247
15,168
dragosprotung/stc-core
src/Workout/Dumper/TCX.php
TCX.writeTracks
private function writeTracks(\XMLWriter $xmlWriter, Workout $workout) { $xmlWriter->startElement('Activities'); foreach ($workout->tracks() as $track) { $xmlWriter->startElement('Activity'); $xmlWriter->writeAttribute('Sport', ucfirst($track->sport())); // Use the...
php
private function writeTracks(\XMLWriter $xmlWriter, Workout $workout) { $xmlWriter->startElement('Activities'); foreach ($workout->tracks() as $track) { $xmlWriter->startElement('Activity'); $xmlWriter->writeAttribute('Sport', ucfirst($track->sport())); // Use the...
[ "private", "function", "writeTracks", "(", "\\", "XMLWriter", "$", "xmlWriter", ",", "Workout", "$", "workout", ")", "{", "$", "xmlWriter", "->", "startElement", "(", "'Activities'", ")", ";", "foreach", "(", "$", "workout", "->", "tracks", "(", ")", "as",...
Write the tracks to the TCX. @param \XMLWriter $xmlWriter The XML writer. @param Workout $workout The workout.
[ "Write", "the", "tracks", "to", "the", "TCX", "." ]
9783e3414294f4ee555a1d538d2807269deeb9e7
https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/Dumper/TCX.php#L52-L78
15,169
dragosprotung/stc-core
src/Workout/Dumper/TCX.php
TCX.writeTrackPoints
private function writeTrackPoints(\XMLWriter $xmlWriter, array $trackPoints) { $previousTrackPoint = null; foreach ($trackPoints as $trackPoint) { $xmlWriter->startElement('Trackpoint'); // Time of position $dateTime = clone $trackPoint->dateTime(); $...
php
private function writeTrackPoints(\XMLWriter $xmlWriter, array $trackPoints) { $previousTrackPoint = null; foreach ($trackPoints as $trackPoint) { $xmlWriter->startElement('Trackpoint'); // Time of position $dateTime = clone $trackPoint->dateTime(); $...
[ "private", "function", "writeTrackPoints", "(", "\\", "XMLWriter", "$", "xmlWriter", ",", "array", "$", "trackPoints", ")", "{", "$", "previousTrackPoint", "=", "null", ";", "foreach", "(", "$", "trackPoints", "as", "$", "trackPoint", ")", "{", "$", "xmlWrit...
Write the track points to the TCX. @param \XMLWriter $xmlWriter The XML writer. @param TrackPoint[] $trackPoints The track points to write.
[ "Write", "the", "track", "points", "to", "the", "TCX", "." ]
9783e3414294f4ee555a1d538d2807269deeb9e7
https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/Dumper/TCX.php#L86-L120
15,170
dragosprotung/stc-core
src/Workout/Dumper/TCX.php
TCX.writeLapHeartRateDate
protected function writeLapHeartRateDate(\XMLWriter $xmlWriter, Track $track) { $averageHeartRate = array(); $maxHearRate = null; foreach ($track->trackPoints() as $trackPoint) { if ($trackPoint->hasExtension(HR::ID()) === true) { $pointHearRate = $trackPoint->ext...
php
protected function writeLapHeartRateDate(\XMLWriter $xmlWriter, Track $track) { $averageHeartRate = array(); $maxHearRate = null; foreach ($track->trackPoints() as $trackPoint) { if ($trackPoint->hasExtension(HR::ID()) === true) { $pointHearRate = $trackPoint->ext...
[ "protected", "function", "writeLapHeartRateDate", "(", "\\", "XMLWriter", "$", "xmlWriter", ",", "Track", "$", "track", ")", "{", "$", "averageHeartRate", "=", "array", "(", ")", ";", "$", "maxHearRate", "=", "null", ";", "foreach", "(", "$", "track", "->"...
Write the heart rate data for a lap. @param \XMLWriter $xmlWriter The XML writer. @param Track $track The track to write.
[ "Write", "the", "heart", "rate", "data", "for", "a", "lap", "." ]
9783e3414294f4ee555a1d538d2807269deeb9e7
https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/Dumper/TCX.php#L128-L155
15,171
dragosprotung/stc-core
src/Workout/Dumper/TCX.php
TCX.writeExtensions
protected function writeExtensions(\XMLWriter $xmlWriter, array $extensions) { foreach ($extensions as $extension) { switch ($extension::ID()) { case HR::ID(): $xmlWriter->startElement('HeartRateBpm'); $xmlWriter->writeElement('Value', (str...
php
protected function writeExtensions(\XMLWriter $xmlWriter, array $extensions) { foreach ($extensions as $extension) { switch ($extension::ID()) { case HR::ID(): $xmlWriter->startElement('HeartRateBpm'); $xmlWriter->writeElement('Value', (str...
[ "protected", "function", "writeExtensions", "(", "\\", "XMLWriter", "$", "xmlWriter", ",", "array", "$", "extensions", ")", "{", "foreach", "(", "$", "extensions", "as", "$", "extension", ")", "{", "switch", "(", "$", "extension", "::", "ID", "(", ")", "...
Write the extensions into the TCX. @param \XMLWriter $xmlWriter The XMLWriter. @param ExtensionInterface[] $extensions The extensions to write.
[ "Write", "the", "extensions", "into", "the", "TCX", "." ]
9783e3414294f4ee555a1d538d2807269deeb9e7
https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/Dumper/TCX.php#L163-L174
15,172
e0ipso/drupal-unit-autoload
src/TokenResolver.php
TokenResolver.cleanToken
protected function cleanToken() { if ($token_name = $this->getToken()) { // Remove the token and arguments and return the path. $path = substr($this->path, strlen($token_name)); return preg_replace('/<.*>/', '', $path); } $message = sprintf('No token could be found in "%s". Available token...
php
protected function cleanToken() { if ($token_name = $this->getToken()) { // Remove the token and arguments and return the path. $path = substr($this->path, strlen($token_name)); return preg_replace('/<.*>/', '', $path); } $message = sprintf('No token could be found in "%s". Available token...
[ "protected", "function", "cleanToken", "(", ")", "{", "if", "(", "$", "token_name", "=", "$", "this", "->", "getToken", "(", ")", ")", "{", "// Remove the token and arguments and return the path.", "$", "path", "=", "substr", "(", "$", "this", "->", "path", ...
Removes the token from the tokenized path. @throws ClassLoaderException If no token can be found. @return string The cleaned path.
[ "Removes", "the", "token", "from", "the", "tokenized", "path", "." ]
7ce147b269c7333eca31e2cd04b736d6274b9cbf
https://github.com/e0ipso/drupal-unit-autoload/blob/7ce147b269c7333eca31e2cd04b736d6274b9cbf/src/TokenResolver.php#L91-L99
15,173
e0ipso/drupal-unit-autoload
src/TokenResolver.php
TokenResolver.getToken
protected function getToken() { // Iterate over the supported tokens to find the token in the tokenized // path. foreach (array_keys($this->supportedTokens) as $token_name) { if (strpos($this->path, $token_name) !== FALSE) { return $token_name; } } return NULL; }
php
protected function getToken() { // Iterate over the supported tokens to find the token in the tokenized // path. foreach (array_keys($this->supportedTokens) as $token_name) { if (strpos($this->path, $token_name) !== FALSE) { return $token_name; } } return NULL; }
[ "protected", "function", "getToken", "(", ")", "{", "// Iterate over the supported tokens to find the token in the tokenized", "// path.", "foreach", "(", "array_keys", "(", "$", "this", "->", "supportedTokens", ")", "as", "$", "token_name", ")", "{", "if", "(", "strp...
Checks if the current tokenized path contains a known token. @return string The token found. NULL otherwise.
[ "Checks", "if", "the", "current", "tokenized", "path", "contains", "a", "known", "token", "." ]
7ce147b269c7333eca31e2cd04b736d6274b9cbf
https://github.com/e0ipso/drupal-unit-autoload/blob/7ce147b269c7333eca31e2cd04b736d6274b9cbf/src/TokenResolver.php#L107-L116
15,174
e0ipso/drupal-unit-autoload
src/TokenResolver.php
TokenResolver.parseArguments
protected function parseArguments() { $token_name = $this->getToken(); $delimiter = '/'; $matches = array(); if (preg_match($delimiter . preg_quote($token_name) . '<(.+)>.*' . $delimiter, $this->path, $matches)) { // Some arguments were found. return explode(',', $matches[1]); } retu...
php
protected function parseArguments() { $token_name = $this->getToken(); $delimiter = '/'; $matches = array(); if (preg_match($delimiter . preg_quote($token_name) . '<(.+)>.*' . $delimiter, $this->path, $matches)) { // Some arguments were found. return explode(',', $matches[1]); } retu...
[ "protected", "function", "parseArguments", "(", ")", "{", "$", "token_name", "=", "$", "this", "->", "getToken", "(", ")", ";", "$", "delimiter", "=", "'/'", ";", "$", "matches", "=", "array", "(", ")", ";", "if", "(", "preg_match", "(", "$", "delimi...
Gets the arguments in the token. @return string[] A numeric array containing the token arguments.
[ "Gets", "the", "arguments", "in", "the", "token", "." ]
7ce147b269c7333eca31e2cd04b736d6274b9cbf
https://github.com/e0ipso/drupal-unit-autoload/blob/7ce147b269c7333eca31e2cd04b736d6274b9cbf/src/TokenResolver.php#L135-L144
15,175
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.arrayFrom
private function arrayFrom($requestMethod): array { if (is_string($requestMethod)) { return [$requestMethod]; } if (null === $requestMethod) { return [Http::GET, Http::HEAD, Http::POST, Http::PUT, Http::DELETE]; } if (is_array($requestMethod)) { ...
php
private function arrayFrom($requestMethod): array { if (is_string($requestMethod)) { return [$requestMethod]; } if (null === $requestMethod) { return [Http::GET, Http::HEAD, Http::POST, Http::PUT, Http::DELETE]; } if (is_array($requestMethod)) { ...
[ "private", "function", "arrayFrom", "(", "$", "requestMethod", ")", ":", "array", "{", "if", "(", "is_string", "(", "$", "requestMethod", ")", ")", "{", "return", "[", "$", "requestMethod", "]", ";", "}", "if", "(", "null", "===", "$", "requestMethod", ...
turns given value into a list @param string|string[] $requestMethod @return string[] @throws \InvalidArgumentException
[ "turns", "given", "value", "into", "a", "list" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L135-L153
15,176
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.matches
public function matches(CalledUri $calledUri): bool { if (!$this->matchesPath($calledUri)) { return false; } if (in_array($calledUri->method(), $this->allowedRequestMethods)) { return true; } if (in_array(Http::GET, $this->allowedRequestMethods)) { ...
php
public function matches(CalledUri $calledUri): bool { if (!$this->matchesPath($calledUri)) { return false; } if (in_array($calledUri->method(), $this->allowedRequestMethods)) { return true; } if (in_array(Http::GET, $this->allowedRequestMethods)) { ...
[ "public", "function", "matches", "(", "CalledUri", "$", "calledUri", ")", ":", "bool", "{", "if", "(", "!", "$", "this", "->", "matchesPath", "(", "$", "calledUri", ")", ")", "{", "return", "false", ";", "}", "if", "(", "in_array", "(", "$", "calledU...
checks if this route is applicable for given request @param \stubbles\webapp\CalledUri $calledUri current request uri @return bool
[ "checks", "if", "this", "route", "is", "applicable", "for", "given", "request" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L171-L186
15,177
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.preIntercept
public function preIntercept($preInterceptor): ConfigurableRoute { if (!is_callable($preInterceptor) && !($preInterceptor instanceof PreInterceptor) && !class_exists((string) $preInterceptor)) { throw new \InvalidArgumentException( 'Given pre interceptor must be a callable, a...
php
public function preIntercept($preInterceptor): ConfigurableRoute { if (!is_callable($preInterceptor) && !($preInterceptor instanceof PreInterceptor) && !class_exists((string) $preInterceptor)) { throw new \InvalidArgumentException( 'Given pre interceptor must be a callable, a...
[ "public", "function", "preIntercept", "(", "$", "preInterceptor", ")", ":", "ConfigurableRoute", "{", "if", "(", "!", "is_callable", "(", "$", "preInterceptor", ")", "&&", "!", "(", "$", "preInterceptor", "instanceof", "PreInterceptor", ")", "&&", "!", "class_...
add a pre interceptor for this route @param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor @return \stubbles\webapp\routing\Route @throws \InvalidArgumentException
[ "add", "a", "pre", "interceptor", "for", "this", "route" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L226-L238
15,178
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.postIntercept
public function postIntercept($postInterceptor): ConfigurableRoute { if (!is_callable($postInterceptor) && !($postInterceptor instanceof PostInterceptor) && !class_exists((string) $postInterceptor)) { throw new \InvalidArgumentException( 'Given pre interceptor must be a calla...
php
public function postIntercept($postInterceptor): ConfigurableRoute { if (!is_callable($postInterceptor) && !($postInterceptor instanceof PostInterceptor) && !class_exists((string) $postInterceptor)) { throw new \InvalidArgumentException( 'Given pre interceptor must be a calla...
[ "public", "function", "postIntercept", "(", "$", "postInterceptor", ")", ":", "ConfigurableRoute", "{", "if", "(", "!", "is_callable", "(", "$", "postInterceptor", ")", "&&", "!", "(", "$", "postInterceptor", "instanceof", "PostInterceptor", ")", "&&", "!", "c...
add a post interceptor for this route @param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor @return \stubbles\webapp\routing\Route @throws \InvalidArgumentException
[ "add", "a", "post", "interceptor", "for", "this", "route" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L257-L269
15,179
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.requiresHttps
public function requiresHttps(): bool { if ($this->requiresHttps) { return true; } $this->requiresHttps = $this->routingAnnotations()->requiresHttps(); return $this->requiresHttps; }
php
public function requiresHttps(): bool { if ($this->requiresHttps) { return true; } $this->requiresHttps = $this->routingAnnotations()->requiresHttps(); return $this->requiresHttps; }
[ "public", "function", "requiresHttps", "(", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "requiresHttps", ")", "{", "return", "true", ";", "}", "$", "this", "->", "requiresHttps", "=", "$", "this", "->", "routingAnnotations", "(", ")", "->", "r...
whether route is only available via https @return bool
[ "whether", "route", "is", "only", "available", "via", "https" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L297-L305
15,180
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.authConstraint
public function authConstraint(): AuthConstraint { if (null === $this->authConstraint) { $this->authConstraint = new AuthConstraint($this->routingAnnotations()); } return $this->authConstraint; }
php
public function authConstraint(): AuthConstraint { if (null === $this->authConstraint) { $this->authConstraint = new AuthConstraint($this->routingAnnotations()); } return $this->authConstraint; }
[ "public", "function", "authConstraint", "(", ")", ":", "AuthConstraint", "{", "if", "(", "null", "===", "$", "this", "->", "authConstraint", ")", "{", "$", "this", "->", "authConstraint", "=", "new", "AuthConstraint", "(", "$", "this", "->", "routingAnnotati...
returns auth constraint for this route @return \stubbles\webapp\auth\AuthConstraint
[ "returns", "auth", "constraint", "for", "this", "route" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L363-L370
15,181
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.supportsMimeType
public function supportsMimeType(string $mimeType, string $class = null): ConfigurableRoute { if (null === $class && !SupportedMimeTypes::provideDefaultClassFor($mimeType)) { throw new \InvalidArgumentException( 'No default class known for mime type ' . $mimeType ...
php
public function supportsMimeType(string $mimeType, string $class = null): ConfigurableRoute { if (null === $class && !SupportedMimeTypes::provideDefaultClassFor($mimeType)) { throw new \InvalidArgumentException( 'No default class known for mime type ' . $mimeType ...
[ "public", "function", "supportsMimeType", "(", "string", "$", "mimeType", ",", "string", "$", "class", "=", "null", ")", ":", "ConfigurableRoute", "{", "if", "(", "null", "===", "$", "class", "&&", "!", "SupportedMimeTypes", "::", "provideDefaultClassFor", "("...
add a mime type which this route supports @param string $mimeType @param string $class optional special class to be used for given mime type on this route @return \stubbles\webapp\routing\Route @throws \InvalidArgumentException
[ "add", "a", "mime", "type", "which", "this", "route", "supports" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L380-L395
15,182
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.supportedMimeTypes
public function supportedMimeTypes( array $globalMimeTypes = [], array $globalClasses = [] ): SupportedMimeTypes { if ($this->disableContentNegotation || $this->routingAnnotations()->isContentNegotiationDisabled()) { return SupportedMimeTypes::createWithDisabledContentNeg...
php
public function supportedMimeTypes( array $globalMimeTypes = [], array $globalClasses = [] ): SupportedMimeTypes { if ($this->disableContentNegotation || $this->routingAnnotations()->isContentNegotiationDisabled()) { return SupportedMimeTypes::createWithDisabledContentNeg...
[ "public", "function", "supportedMimeTypes", "(", "array", "$", "globalMimeTypes", "=", "[", "]", ",", "array", "$", "globalClasses", "=", "[", "]", ")", ":", "SupportedMimeTypes", "{", "if", "(", "$", "this", "->", "disableContentNegotation", "||", "$", "thi...
returns list of mime types supported by this route @param string[] $globalMimeTypes optional list of globally supported mime types @param string[] $globalClasses optional list of globally defined mime type classes @return \stubbles\webapp\routing\SupportedMimeTypes
[ "returns", "list", "of", "mime", "types", "supported", "by", "this", "route" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L404-L425
15,183
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.routingAnnotations
private function routingAnnotations(): RoutingAnnotations { if (null === $this->routingAnnotations) { $this->routingAnnotations = new RoutingAnnotations($this->target); } return $this->routingAnnotations; }
php
private function routingAnnotations(): RoutingAnnotations { if (null === $this->routingAnnotations) { $this->routingAnnotations = new RoutingAnnotations($this->target); } return $this->routingAnnotations; }
[ "private", "function", "routingAnnotations", "(", ")", ":", "RoutingAnnotations", "{", "if", "(", "null", "===", "$", "this", "->", "routingAnnotations", ")", "{", "$", "this", "->", "routingAnnotations", "=", "new", "RoutingAnnotations", "(", "$", "this", "->...
returns list of callback annotations @return \stubbles\webapp\routing\RoutingAnnotations
[ "returns", "list", "of", "callback", "annotations" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L444-L451
15,184
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.asResource
public function asResource(HttpUri $uri, array $globalMimeTypes = []): Resource { $routeUri = $uri->withPath($this->normalizePath()); return new Resource( $this->resourceName(), $this->allowedRequestMethods, $this->requiresHttps() ? $routeUri->toHttps(...
php
public function asResource(HttpUri $uri, array $globalMimeTypes = []): Resource { $routeUri = $uri->withPath($this->normalizePath()); return new Resource( $this->resourceName(), $this->allowedRequestMethods, $this->requiresHttps() ? $routeUri->toHttps(...
[ "public", "function", "asResource", "(", "HttpUri", "$", "uri", ",", "array", "$", "globalMimeTypes", "=", "[", "]", ")", ":", "Resource", "{", "$", "routeUri", "=", "$", "uri", "->", "withPath", "(", "$", "this", "->", "normalizePath", "(", ")", ")", ...
returns route as resource @param \stubbles\peer\http\HttpUri $uri @param string[] $globalMimeTypes list of globally supported mime types @return \stubbles\webapp\routing\api\Resource @since 6.1.0
[ "returns", "route", "as", "resource" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L488-L499
15,185
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.normalizePath
private function normalizePath(): string { $path = $this->path; if (substr($path, -1) === '$') { $path = substr($path, 0, strlen($path) - 1); } if (substr($path, -1) === '?') { $path = substr($path, 0, strlen($path) - 1); } return $path; ...
php
private function normalizePath(): string { $path = $this->path; if (substr($path, -1) === '$') { $path = substr($path, 0, strlen($path) - 1); } if (substr($path, -1) === '?') { $path = substr($path, 0, strlen($path) - 1); } return $path; ...
[ "private", "function", "normalizePath", "(", ")", ":", "string", "{", "$", "path", "=", "$", "this", "->", "path", ";", "if", "(", "substr", "(", "$", "path", ",", "-", "1", ")", "===", "'$'", ")", "{", "$", "path", "=", "substr", "(", "$", "pa...
normalizes path for better understanding @return string
[ "normalizes", "path", "for", "better", "understanding" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L506-L518
15,186
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.resourceName
private function resourceName() { if ($this->routingAnnotations()->hasName()) { return $this->routingAnnotations()->name(); } if (is_string($this->target) && class_exists($this->target)) { return substr( $this->target, strrpos(...
php
private function resourceName() { if ($this->routingAnnotations()->hasName()) { return $this->routingAnnotations()->name(); } if (is_string($this->target) && class_exists($this->target)) { return substr( $this->target, strrpos(...
[ "private", "function", "resourceName", "(", ")", "{", "if", "(", "$", "this", "->", "routingAnnotations", "(", ")", "->", "hasName", "(", ")", ")", "{", "return", "$", "this", "->", "routingAnnotations", "(", ")", "->", "name", "(", ")", ";", "}", "i...
returns useful name for resource @return string|null
[ "returns", "useful", "name", "for", "resource" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L525-L544
15,187
danmichaelo/quitesimplexmlelement
src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php
SimpleXMLElementWrapper.registerXPathNamespace
public function registerXPathNamespace($prefix, $uri) { $this->el->registerXPathNamespace($prefix, $uri); $this->namespaces[$prefix] = $uri; }
php
public function registerXPathNamespace($prefix, $uri) { $this->el->registerXPathNamespace($prefix, $uri); $this->namespaces[$prefix] = $uri; }
[ "public", "function", "registerXPathNamespace", "(", "$", "prefix", ",", "$", "uri", ")", "{", "$", "this", "->", "el", "->", "registerXPathNamespace", "(", "$", "prefix", ",", "$", "uri", ")", ";", "$", "this", "->", "namespaces", "[", "$", "prefix", ...
Register a new xpath namespace. @param string $prefix @param string $uri
[ "Register", "a", "new", "xpath", "namespace", "." ]
566261ac5a789d63fda4ffc328501213772c1b27
https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php#L146-L150
15,188
danmichaelo/quitesimplexmlelement
src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php
SimpleXMLElementWrapper.registerXPathNamespaces
public function registerXPathNamespaces($namespaces) { // Convenience method to add multiple namespaces at once foreach ($namespaces as $prefix => $uri) { $this->registerXPathNamespace($prefix, $uri); } }
php
public function registerXPathNamespaces($namespaces) { // Convenience method to add multiple namespaces at once foreach ($namespaces as $prefix => $uri) { $this->registerXPathNamespace($prefix, $uri); } }
[ "public", "function", "registerXPathNamespaces", "(", "$", "namespaces", ")", "{", "// Convenience method to add multiple namespaces at once", "foreach", "(", "$", "namespaces", "as", "$", "prefix", "=>", "$", "uri", ")", "{", "$", "this", "->", "registerXPathNamespac...
Register an array of new xpath namespaces. @param array $namespaces
[ "Register", "an", "array", "of", "new", "xpath", "namespaces", "." ]
566261ac5a789d63fda4ffc328501213772c1b27
https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php#L157-L163
15,189
danmichaelo/quitesimplexmlelement
src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php
SimpleXMLElementWrapper.children
public function children($ns = null) { $ch = is_null($ns) ? $this->el->children() : $this->el->children($this->namespaces[$ns]); $o = []; foreach ($ch as $c) { $o[] = new static($c, $this); } return $o; }
php
public function children($ns = null) { $ch = is_null($ns) ? $this->el->children() : $this->el->children($this->namespaces[$ns]); $o = []; foreach ($ch as $c) { $o[] = new static($c, $this); } return $o; }
[ "public", "function", "children", "(", "$", "ns", "=", "null", ")", "{", "$", "ch", "=", "is_null", "(", "$", "ns", ")", "?", "$", "this", "->", "el", "->", "children", "(", ")", ":", "$", "this", "->", "el", "->", "children", "(", "$", "this",...
Returns child elements. Note: By default, only children without namespace will be returned! You can specify a namespace prefix to get children with that namespace prefix. If you want all child elements, namespaced or not, use `$record->all('child::*')` instead. @param string $ns @return QuiteSimpleXMLElement[]
[ "Returns", "child", "elements", "." ]
566261ac5a789d63fda4ffc328501213772c1b27
https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php#L196-L208
15,190
danmichaelo/quitesimplexmlelement
src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php
SimpleXMLElementWrapper.attributes
public function attributes($ns = null, $is_prefix = false) { return $this->el->attributes($ns, $is_prefix); }
php
public function attributes($ns = null, $is_prefix = false) { return $this->el->attributes($ns, $is_prefix); }
[ "public", "function", "attributes", "(", "$", "ns", "=", "null", ",", "$", "is_prefix", "=", "false", ")", "{", "return", "$", "this", "->", "el", "->", "attributes", "(", "$", "ns", ",", "$", "is_prefix", ")", ";", "}" ]
Returns and element's attributes. @param string $ns @param bool $is_prefix @return SimpleXMLElement a `SimpleXMLElement` object that can be iterated over to loop through the attributes on the tag.
[ "Returns", "and", "element", "s", "attributes", "." ]
566261ac5a789d63fda4ffc328501213772c1b27
https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php#L235-L238
15,191
phramework/jsonapi
src/Controller/DELETE.php
DELETE.handleDELETE
protected static function handleDELETE( $parameters, $method, $headers, $id, $modelClass, $primaryDataParameters = [], $validationCallbacks = [], $viewCallback = null ) { if ($viewCallback !== null && !is_callable($viewCallback)) { ...
php
protected static function handleDELETE( $parameters, $method, $headers, $id, $modelClass, $primaryDataParameters = [], $validationCallbacks = [], $viewCallback = null ) { if ($viewCallback !== null && !is_callable($viewCallback)) { ...
[ "protected", "static", "function", "handleDELETE", "(", "$", "parameters", ",", "$", "method", ",", "$", "headers", ",", "$", "id", ",", "$", "modelClass", ",", "$", "primaryDataParameters", "=", "[", "]", ",", "$", "validationCallbacks", "=", "[", "]", ...
Handle DELETE method On success will respond with 204 No Content @param object $parameters Request parameters @param string $method Request method @param array $headers Request headers @param integer|string $id Requested...
[ "Handle", "DELETE", "method", "On", "success", "will", "respond", "with", "204", "No", "Content" ]
af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/DELETE.php#L49-L102
15,192
fuelphp/display
src/Parser/Mustache.php
Mustache.setupMustache
public function setupMustache() { $mustacheLoader = new MustacheLoader($this->viewManager); $config = ['loader' => $mustacheLoader]; if ($this->viewManager->cachePath) { $config['cache'] = $this->viewManager->cachePath.'mustache/'; } $this->mustache = new Mustache_Engine($config); }
php
public function setupMustache() { $mustacheLoader = new MustacheLoader($this->viewManager); $config = ['loader' => $mustacheLoader]; if ($this->viewManager->cachePath) { $config['cache'] = $this->viewManager->cachePath.'mustache/'; } $this->mustache = new Mustache_Engine($config); }
[ "public", "function", "setupMustache", "(", ")", "{", "$", "mustacheLoader", "=", "new", "MustacheLoader", "(", "$", "this", "->", "viewManager", ")", ";", "$", "config", "=", "[", "'loader'", "=>", "$", "mustacheLoader", "]", ";", "if", "(", "$", "this"...
Sets up Mustache_Engine
[ "Sets", "up", "Mustache_Engine" ]
d9a3eddbf80f0fd81beb40d9f4507600ac6611a4
https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/Parser/Mustache.php#L51-L62
15,193
activecollab/databasestructure
src/Builder/BaseManagerDirBuilder.php
BaseManagerDirBuilder.preBuild
public function preBuild() { $build_path = $this->getBuildPath(); if ($build_path) { if (is_dir($build_path)) { $build_path = rtrim($build_path, DIRECTORY_SEPARATOR); if (!is_dir("$build_path/Manager/Base")) { $old_umask = umask(0); ...
php
public function preBuild() { $build_path = $this->getBuildPath(); if ($build_path) { if (is_dir($build_path)) { $build_path = rtrim($build_path, DIRECTORY_SEPARATOR); if (!is_dir("$build_path/Manager/Base")) { $old_umask = umask(0); ...
[ "public", "function", "preBuild", "(", ")", "{", "$", "build_path", "=", "$", "this", "->", "getBuildPath", "(", ")", ";", "if", "(", "$", "build_path", ")", "{", "if", "(", "is_dir", "(", "$", "build_path", ")", ")", "{", "$", "build_path", "=", "...
Execute prior to type build.
[ "Execute", "prior", "to", "type", "build", "." ]
4b2353c4422186bcfce63b3212da3e70e63eb5df
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/BaseManagerDirBuilder.php#L22-L45
15,194
stubbles/stubbles-webapp-core
src/main/php/response/Headers.php
Headers.add
public function add(string $name, $value): self { $this->headers[$name] = $value; return $this; }
php
public function add(string $name, $value): self { $this->headers[$name] = $value; return $this; }
[ "public", "function", "add", "(", "string", "$", "name", ",", "$", "value", ")", ":", "self", "{", "$", "this", "->", "headers", "[", "$", "name", "]", "=", "$", "value", ";", "return", "$", "this", ";", "}" ]
adds header with given name @param string $name @param mixed $value @return \stubbles\webapp\response\Headers
[ "adds", "header", "with", "given", "name" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/Headers.php#L34-L38
15,195
stubbles/stubbles-webapp-core
src/main/php/response/Headers.php
Headers.location
public function location($uri): self { return $this->add( 'Location', (($uri instanceof HttpUri) ? ($uri->asStringWithNonDefaultPort()) : ($uri)) ); }
php
public function location($uri): self { return $this->add( 'Location', (($uri instanceof HttpUri) ? ($uri->asStringWithNonDefaultPort()) : ($uri)) ); }
[ "public", "function", "location", "(", "$", "uri", ")", ":", "self", "{", "return", "$", "this", "->", "add", "(", "'Location'", ",", "(", "(", "$", "uri", "instanceof", "HttpUri", ")", "?", "(", "$", "uri", "->", "asStringWithNonDefaultPort", "(", ")"...
adds location header with given uri @param string|\stubbles\peer\http\HttpUri $uri @return \stubbles\webapp\response\Headers
[ "adds", "location", "header", "with", "given", "uri" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/Headers.php#L59-L65
15,196
stubbles/stubbles-webapp-core
src/main/php/response/Headers.php
Headers.acceptable
public function acceptable(array $supportedMimeTypes): self { if (count($supportedMimeTypes) > 0) { $this->add('X-Acceptable', join(', ', $supportedMimeTypes)); } return $this; }
php
public function acceptable(array $supportedMimeTypes): self { if (count($supportedMimeTypes) > 0) { $this->add('X-Acceptable', join(', ', $supportedMimeTypes)); } return $this; }
[ "public", "function", "acceptable", "(", "array", "$", "supportedMimeTypes", ")", ":", "self", "{", "if", "(", "count", "(", "$", "supportedMimeTypes", ")", ">", "0", ")", "{", "$", "this", "->", "add", "(", "'X-Acceptable'", ",", "join", "(", "', '", ...
adds non-standard acceptable header with list of supported mime types @param string[] $supportedMimeTypes @return \stubbles\webapp\response\Headers
[ "adds", "non", "-", "standard", "acceptable", "header", "with", "list", "of", "supported", "mime", "types" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/Headers.php#L84-L91
15,197
stubbles/stubbles-webapp-core
src/main/php/response/Headers.php
Headers.cacheControl
public function cacheControl(): CacheControl { $cacheControl = new CacheControl(); $this->add(CacheControl::HEADER_NAME, $cacheControl); return $cacheControl; }
php
public function cacheControl(): CacheControl { $cacheControl = new CacheControl(); $this->add(CacheControl::HEADER_NAME, $cacheControl); return $cacheControl; }
[ "public", "function", "cacheControl", "(", ")", ":", "CacheControl", "{", "$", "cacheControl", "=", "new", "CacheControl", "(", ")", ";", "$", "this", "->", "add", "(", "CacheControl", "::", "HEADER_NAME", ",", "$", "cacheControl", ")", ";", "return", "$",...
enables the Cache-Control header If no specific directives are enabled the value will be <code>Cache-Control: private</code> by default. @return \stubbles\webapp\response\CacheControl @see http://tools.ietf.org/html/rfc7234#section-5.2 @since 5.1.0
[ "enables", "the", "Cache", "-", "Control", "header" ]
7705f129011a81d5cc3c76b4b150fab3dadac6a3
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/Headers.php#L115-L120
15,198
czim/laravel-pxlcms
src/Generator/Writer/Model/Steps/StubReplaceAccessorsAndMutators.php
StubReplaceAccessorsAndMutators.collectNormalBelongsToRelationAccessors
protected function collectNormalBelongsToRelationAccessors() { $accessors = []; foreach ($this->data['relationships']['normal'] as $name => $relationship) { if ($relationship['type'] != Generator::RELATIONSHIP_BELONGS_TO) continue; if ( ! empty($relationship['key']) && snake...
php
protected function collectNormalBelongsToRelationAccessors() { $accessors = []; foreach ($this->data['relationships']['normal'] as $name => $relationship) { if ($relationship['type'] != Generator::RELATIONSHIP_BELONGS_TO) continue; if ( ! empty($relationship['key']) && snake...
[ "protected", "function", "collectNormalBelongsToRelationAccessors", "(", ")", "{", "$", "accessors", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "data", "[", "'relationships'", "]", "[", "'normal'", "]", "as", "$", "name", "=>", "$", "relationship...
For belongs-to relationships that share foreign key & relation name @return array name => array with properties
[ "For", "belongs", "-", "to", "relationships", "that", "share", "foreign", "key", "&", "relation", "name" ]
910297d2a3f2db86dde51b0e10fe5aad45f1aa1a
https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/Model/Steps/StubReplaceAccessorsAndMutators.php#L75-L94
15,199
acasademont/wurfl
WURFL/WURFLService.php
WURFL_WURFLService.getDeviceForRequest
public function getDeviceForRequest(WURFL_Request_GenericRequest $request) { $deviceId = $this->deviceIdForRequest($request); return $this->getWrappedDevice($deviceId, $request); }
php
public function getDeviceForRequest(WURFL_Request_GenericRequest $request) { $deviceId = $this->deviceIdForRequest($request); return $this->getWrappedDevice($deviceId, $request); }
[ "public", "function", "getDeviceForRequest", "(", "WURFL_Request_GenericRequest", "$", "request", ")", "{", "$", "deviceId", "=", "$", "this", "->", "deviceIdForRequest", "(", "$", "request", ")", ";", "return", "$", "this", "->", "getWrappedDevice", "(", "$", ...
Returns the Device for the given WURFL_Request_GenericRequest @param WURFL_Request_GenericRequest $request @return WURFL_CustomDevice
[ "Returns", "the", "Device", "for", "the", "given", "WURFL_Request_GenericRequest" ]
0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/WURFLService.php#L62-L66