idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
59,200 | public function isMethodPublic ( $ className , $ methodName ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; return ( isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_METHODS ] [ $ methodName ] [ self :: DATA_METHOD_VISIBILITY ] ) && $ this -> classReflectionData [ ... | Tells if the specified method is public |
59,201 | public function isMethodProtected ( $ className , $ methodName ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; return ( isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_METHODS ] [ $ methodName ] [ self :: DATA_METHOD_VISIBILITY ] ) && $ this -> classReflectionData... | Tells if the specified method is protected |
59,202 | public function isMethodPrivate ( $ className , $ methodName ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; return ( isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_METHODS ] [ $ methodName ] [ self :: DATA_METHOD_VISIBILITY ] ) && $ this -> classReflectionData [... | Tells if the specified method is private |
59,203 | public function isMethodTaggedWith ( $ className , $ methodName , $ tag ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ method = new MethodReflection ( $ this -> cleanClassName ( $ className ) , $ methodName ) ; $ tagsValues = $ method -> getTagsValues ( ) ; return isset ( $ tagsValues [ $ tag ] ) ;... | Tells if the specified method is tagged with the given tag |
59,204 | public function getMethodAnnotations ( $ className , $ methodName , $ annotationClassName = null ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ className = $ this -> cleanClassName ( $ className ) ; $ annotationClassName = $ annotationClassName === null ? null : $ this -> cleanClassName ( $ annotat... | Returns the specified method annotations or an empty array |
59,205 | public function getMethodAnnotation ( $ className , $ methodName , $ annotationClassName ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ annotations = $ this -> getMethodAnnotations ( $ className , $ methodName , $ annotationClassName ) ; return $ annotations === [ ] ? null : current ( $ annotations... | Returns the specified method annotation or NULL . |
59,206 | public function getPropertyNamesByTag ( $ className , $ tag ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; if ( ! isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_PROPERTIES ] ) ) { return [ ] ; } $ propertyNames = [ ] ; foreach ( $ this -> classReflectionData [ $... | Searches for and returns all names of class properties which are tagged by the specified tag . If no properties were found an empty array is returned . |
59,207 | public function isPropertyPrivate ( $ className , $ propertyName ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; return ( isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_PROPERTIES ] [ $ propertyName ] [ self :: DATA_PROPERTY_VISIBILITY ] ) && $ this -> classRefle... | Tells if the specified property is private |
59,208 | public function isPropertyAnnotatedWith ( $ className , $ propertyName , $ annotationClassName ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; return isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_PROPERTIES ] [ $ propertyName ] [ self :: DATA_PROPERTY_ANNOTATION... | Tells if the specified property has the given annotation |
59,209 | public function getPropertyNamesByAnnotation ( $ className , $ annotationClassName ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; if ( ! isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_PROPERTIES ] ) ) { return [ ] ; } $ propertyNames = [ ] ; foreach ( $ this -> ... | Searches for and returns all names of class properties which are marked by the specified annotation . If no properties were found an empty array is returned . |
59,210 | public function getPropertyAnnotations ( $ className , $ propertyName , $ annotationClassName = null ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; if ( ! isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_PROPERTIES ] [ $ propertyName ] [ self :: DATA_PROPERTY_ANNO... | Returns the specified property annotations or an empty array |
59,211 | public function getPropertyAnnotation ( $ className , $ propertyName , $ annotationClassName ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ annotations = $ this -> getPropertyAnnotations ( $ className , $ propertyName , $ annotationClassName ) ; return $ annotations === [ ] ? null : current ( $ ann... | Returns the specified property annotation or NULL . |
59,212 | protected function prepareClassReflectionForUsage ( $ className ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ className = $ this -> cleanClassName ( $ className ) ; $ this -> loadOrReflectClassIfNecessary ( $ className ) ; return $ className ; } | Initializes the ReflectionService cleans the given class name and finally reflects the class if necessary . |
59,213 | protected function reflectEmergedClasses ( ) { $ classNamesToReflect = [ ] ; foreach ( $ this -> availableClassNames as $ classNamesInOnePackage ) { $ classNamesToReflect = array_merge ( $ classNamesToReflect , $ classNamesInOnePackage ) ; } $ reflectedClassNames = array_keys ( $ this -> classReflectionData ) ; sort ( ... | Checks if the given class names match those which already have been reflected . If the given array contains class names not yet known to this service these classes will be reflected . |
59,214 | protected function isTagIgnored ( $ tagName ) { if ( isset ( $ this -> settings [ 'ignoredTags' ] [ $ tagName ] ) && $ this -> settings [ 'ignoredTags' ] [ $ tagName ] === true ) { return true ; } if ( in_array ( $ tagName , $ this -> settings [ 'ignoredTags' ] , true ) ) { return true ; } return false ; } | Check if a specific annotation tag is configured to be ignored . |
59,215 | protected function expandType ( ClassReflection $ class , $ type ) { $ typeWithoutNull = TypeHandling :: stripNullableType ( $ type ) ; $ isNullable = $ typeWithoutNull !== $ type ; if ( strpos ( $ type , '<' ) !== false ) { $ typeParts = explode ( '<' , $ typeWithoutNull ) ; $ type = $ typeParts [ 0 ] ; $ elementType ... | Expand shortened class names in var and param annotations taking use statements into account . |
59,216 | protected function getParentClasses ( ClassReflection $ class , array $ parentClasses = [ ] ) { $ parentClass = $ class -> getParentClass ( ) ; if ( $ parentClass !== false ) { $ parentClasses [ ] = $ parentClass ; $ parentClasses = $ this -> getParentClasses ( $ parentClass , $ parentClasses ) ; } return $ parentClass... | Finds all parent classes of the given class |
59,217 | protected function buildClassSchema ( $ className ) { $ classSchema = new ClassSchema ( $ className ) ; $ this -> addPropertiesToClassSchema ( $ classSchema ) ; if ( $ this -> isClassAnnotatedWith ( $ className , ORM \ Embeddable :: class ) ) { return $ classSchema ; } if ( $ this -> isClassAnnotatedWith ( $ className ... | Builds a class schema for the given class name . |
59,218 | protected function addPropertiesToClassSchema ( ClassSchema $ classSchema ) { $ className = $ classSchema -> getClassName ( ) ; $ skipArtificialIdentity = false ; $ valueObjectAnnotation = $ this -> getClassAnnotation ( $ className , Flow \ ValueObject :: class ) ; if ( $ valueObjectAnnotation !== null && $ valueObject... | Adds properties of the class at hand to the class schema . |
59,219 | protected function completeRepositoryAssignments ( ) { foreach ( $ this -> getAllImplementationClassNamesForInterface ( RepositoryInterface :: class ) as $ repositoryClassName ) { if ( ! class_exists ( $ repositoryClassName ) || $ this -> isClassAbstract ( $ repositoryClassName ) ) { continue ; } if ( ! $ this -> isCla... | Complete repository - to - entity assignments . |
59,220 | protected function makeChildClassesAggregateRoot ( ClassSchema $ classSchema ) { foreach ( $ this -> getAllSubClassNamesForClass ( $ classSchema -> getClassName ( ) ) as $ childClassName ) { if ( ! isset ( $ this -> classSchemata [ $ childClassName ] ) || $ this -> classSchemata [ $ childClassName ] -> isAggregateRoot ... | Assigns the repository of any aggregate root to all it s subclasses unless they are aggregate root already . |
59,221 | protected function ensureAggregateRootInheritanceChainConsistency ( ) { foreach ( $ this -> classSchemata as $ className => $ classSchema ) { if ( ! class_exists ( $ className ) || ( $ classSchema instanceof ClassSchema && $ classSchema -> isAggregateRoot ( ) === false ) ) { continue ; } foreach ( class_parents ( $ cla... | Checks whether all aggregate roots having superclasses have a repository assigned up to the tip of their hierarchy . |
59,222 | protected function checkValueObjectRequirements ( $ className ) { $ methods = get_class_methods ( $ className ) ; if ( in_array ( '__construct' , $ methods , true ) === false ) { throw new InvalidValueObjectException ( 'A value object must have a constructor, "' . $ className . '" does not have one.' , 1268740874 ) ; }... | Checks if the given class meets the requirements for a value object i . e . does have a constructor and does not have any setter methods . |
59,223 | protected function convertParameterDataToArray ( array $ parametersInformation ) { $ parameters = [ ] ; foreach ( $ parametersInformation as $ parameterName => $ parameterData ) { $ parameters [ $ parameterName ] = [ 'position' => $ parameterData [ self :: DATA_PARAMETER_POSITION ] , 'optional' => isset ( $ parameterDa... | Converts the internal optimized data structure of parameter information into a human - friendly array with speaking indexes . |
59,224 | protected function forgetChangedClasses ( ) { $ frozenNamespaces = [ ] ; foreach ( $ this -> packageManager -> getAvailablePackages ( ) as $ packageKey => $ package ) { if ( $ this -> packageManager -> isPackageFrozen ( $ packageKey ) ) { $ frozenNamespaces = array_merge ( $ frozenNamespaces , $ package -> getNamespace... | Checks which classes lack a cache entry and removes their reflection data accordingly . |
59,225 | protected function forgetClass ( $ className ) { $ this -> log ( 'Forget class ' . $ className , LogLevel :: DEBUG ) ; if ( isset ( $ this -> classesCurrentlyBeingForgotten [ $ className ] ) ) { $ this -> log ( 'Detected recursion while forgetting class ' . $ className , LogLevel :: WARNING ) ; return ; } $ this -> cla... | Forgets all reflection data related to the specified class |
59,226 | protected function loadClassReflectionCompiletimeCache ( ) { $ data = $ this -> reflectionDataCompiletimeCache -> get ( 'ReflectionData' ) ; if ( $ data !== false ) { foreach ( $ data as $ propertyName => $ propertyValue ) { $ this -> $ propertyName = $ propertyValue ; } return true ; } if ( ! $ this -> context -> isDe... | Tries to load the reflection data from the compile time cache . |
59,227 | protected function loadOrReflectClassIfNecessary ( $ className ) { if ( ! isset ( $ this -> classReflectionData [ $ className ] ) || is_array ( $ this -> classReflectionData [ $ className ] ) ) { return ; } if ( $ this -> loadFromClassSchemaRuntimeCache === true ) { $ this -> classReflectionData [ $ className ] = $ thi... | Loads reflection data from the cache or reflects the class if needed . |
59,228 | public function freezePackageReflection ( $ packageKey ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } if ( empty ( $ this -> availableClassNames ) ) { $ this -> availableClassNames = $ this -> reflectionDataRuntimeCache -> get ( '__availableClassNames' ) ; } $ reflectionData = [ 'classReflectionData'... | Stores the current reflection data related to classes of the specified package in the PrecompiledReflectionData directory for the current context . |
59,229 | protected function filterArrayByClassesInPackageNamespace ( array $ array , $ packageKey ) { return array_filter ( $ array , function ( $ className ) use ( $ packageKey ) { return ( isset ( $ this -> availableClassNames [ $ packageKey ] ) && in_array ( $ className , $ this -> availableClassNames [ $ packageKey ] ) ) ; ... | Filter an array of entries were keys are class names by being in the given package namespace . |
59,230 | public function unfreezePackageReflection ( $ packageKey ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ pathAndFilename = $ this -> getPrecompiledReflectionStoragePath ( ) . $ packageKey . '.dat' ; if ( file_exists ( $ pathAndFilename ) ) { unlink ( $ pathAndFilename ) ; } } | Removes the precompiled reflection data of a frozen package |
59,231 | public function saveToCache ( ) { if ( $ this -> hasFrozenCacheInProduction ( ) ) { return ; } if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } if ( $ this -> loadFromClassSchemaRuntimeCache === true ) { return ; } if ( ! ( $ this -> reflectionDataCompiletimeCache instanceof FrontendInterface ) ) { throw n... | Exports the internal reflection data into the ReflectionData cache |
59,232 | protected function saveDevelopmentData ( ) { foreach ( array_keys ( $ this -> packageManager -> getFrozenPackages ( ) ) as $ packageKey ) { $ pathAndFilename = $ this -> getPrecompiledReflectionStoragePath ( ) . $ packageKey . '.dat' ; if ( ! file_exists ( $ pathAndFilename ) ) { $ this -> log ( sprintf ( 'Rebuilding p... | Save reflection data to cache in Development context . |
59,233 | protected function saveProductionData ( ) { $ this -> reflectionDataRuntimeCache -> flush ( ) ; $ classNames = [ ] ; foreach ( $ this -> classReflectionData as $ className => $ reflectionData ) { $ classNames [ $ className ] = true ; $ cacheIdentifier = $ this -> produceCacheIdentifierFromClassName ( $ className ) ; $ ... | Save reflection data to cache in Production context . |
59,234 | protected function updateReflectionData ( ) { $ this -> log ( sprintf ( 'Found %s classes whose reflection data was not cached previously.' , count ( $ this -> updatedReflectionData ) ) , LogLevel :: DEBUG ) ; foreach ( array_keys ( $ this -> updatedReflectionData ) as $ className ) { $ this -> statusCache -> set ( $ t... | Set updated reflection data to caches . |
59,235 | public function addFlashMessage ( $ messageBody , $ messageTitle = '' , $ severity = Error \ Message :: SEVERITY_OK , array $ messageArguments = [ ] , $ messageCode = null ) { if ( ! is_string ( $ messageBody ) ) { throw new \ InvalidArgumentException ( 'The message body must be of type string, "' . gettype ( $ message... | Creates a Message object and adds it to the FlashMessageContainer . |
59,236 | protected function redirectToUri ( $ uri , $ delay = 0 , $ statusCode = 303 ) { if ( $ delay === 0 ) { if ( ! $ uri instanceof UriInterface ) { $ uri = new \ Neos \ Flow \ Http \ Uri ( $ uri ) ; } $ this -> response -> setStatus ( $ statusCode ) ; $ this -> response -> setHeader ( 'Location' , ( string ) $ uri ) ; } el... | Redirects to another URI |
59,237 | protected function throwStatus ( $ statusCode , $ statusMessage = null , $ content = null ) { $ this -> response -> setStatus ( $ statusCode , $ statusMessage ) ; if ( $ content === null ) { $ content = $ this -> response -> getStatus ( ) ; } $ this -> response -> setContent ( $ content ) ; throw new StopActionExceptio... | Sends the specified HTTP status immediately . |
59,238 | protected function setCompression ( bool $ useCompression ) { if ( $ this -> memcache instanceof \ Memcached ) { $ this -> memcache -> setOption ( \ Memcached :: OPT_COMPRESSION , $ useCompression ) ; return ; } if ( $ useCompression === true ) { $ this -> flags ^= MEMCACHE_COMPRESSED ; } else { $ this -> flags &= ~ ME... | Setter for compression flags bit |
59,239 | protected function setItem ( string $ key , string $ value , int $ expiration ) { if ( $ this -> memcache instanceof \ Memcached ) { return $ this -> memcache -> set ( $ key , $ value , $ expiration ) ; } return $ this -> memcache -> set ( $ key , $ value , $ this -> flags , $ expiration ) ; } | Stores an item on the server |
59,240 | protected function addIdentifierToTags ( string $ entryIdentifier , array $ tags ) { foreach ( $ tags as $ tag ) { $ identifiers = $ this -> findIdentifiersByTag ( $ tag ) ; if ( array_search ( $ entryIdentifier , $ identifiers ) === false ) { $ identifiers [ ] = $ entryIdentifier ; $ this -> memcache -> set ( $ this -... | Associates the identifier with the given tags |
59,241 | public function create ( ) { if ( $ this -> reflectionService !== null ) { return $ this -> reflectionService ; } $ cacheManager = $ this -> bootstrap -> getEarlyInstance ( CacheManager :: class ) ; $ configurationManager = $ this -> bootstrap -> getEarlyInstance ( ConfigurationManager :: class ) ; $ settings = $ confi... | Get reflection service instance |
59,242 | public static function containsMultipleTypes ( array $ array ) : bool { if ( count ( $ array ) > 0 ) { reset ( $ array ) ; $ previousType = gettype ( current ( $ array ) ) ; next ( $ array ) ; foreach ( $ array as $ value ) { if ( $ previousType !== gettype ( $ value ) ) { return true ; } } } return false ; } | Returns true if the given array contains elements of varying types |
59,243 | public static function getValueByPath ( array & $ array , $ path ) { if ( is_string ( $ path ) ) { $ path = explode ( '.' , $ path ) ; } elseif ( ! is_array ( $ path ) ) { throw new \ InvalidArgumentException ( 'getValueByPath() expects $path to be string or array, "' . gettype ( $ path ) . '" given.' , 1304950007 ) ; ... | Returns the value of a nested array by following the specifed path . |
59,244 | public static function setValueByPath ( $ subject , $ path , $ value ) { if ( ! is_array ( $ subject ) && ! ( $ subject instanceof \ ArrayAccess ) ) { throw new \ InvalidArgumentException ( 'setValueByPath() expects $subject to be array or an object implementing \ArrayAccess, "' . ( is_object ( $ subject ) ? get_class ... | Sets the given value in a nested array or object by following the specified path . |
59,245 | public static function sortKeysRecursively ( array & $ array , int $ sortFlags = null ) : bool { foreach ( $ array as & $ value ) { if ( is_array ( $ value ) ) { if ( self :: sortKeysRecursively ( $ value , $ sortFlags ) === false ) { return false ; } } } return ksort ( $ array , $ sortFlags ) ; } | Sorts multidimensional arrays by recursively calling ksort on its elements . |
59,246 | public static function convertObjectToArray ( $ subject ) : array { if ( ! is_object ( $ subject ) && ! is_array ( $ subject ) ) { throw new \ InvalidArgumentException ( 'convertObjectToArray expects either array or object as input, ' . gettype ( $ subject ) . ' given.' , 1287059709 ) ; } if ( is_object ( $ subject ) )... | Recursively convert an object hierarchy into an associative array . |
59,247 | public static function removeEmptyElementsRecursively ( array $ array ) : array { $ result = $ array ; foreach ( $ result as $ key => $ value ) { if ( is_array ( $ value ) ) { $ result [ $ key ] = self :: removeEmptyElementsRecursively ( $ value ) ; if ( $ result [ $ key ] === [ ] ) { unset ( $ result [ $ key ] ) ; } }... | Recursively removes empty array elements . |
59,248 | protected function getTrustedProxyHeaderValues ( $ type , ServerRequestInterface $ request ) { if ( isset ( $ this -> settings [ 'headers' ] ) && is_string ( $ this -> settings [ 'headers' ] ) ) { $ trustedHeaders = $ this -> settings [ 'headers' ] ; } else { $ trustedHeaders = $ this -> settings [ 'headers' ] [ $ type... | Get the values of trusted proxy header . |
59,249 | protected function getFirstTrustedProxyHeaderValue ( $ type , Request $ request ) { $ values = $ this -> getTrustedProxyHeaderValues ( $ type , $ request ) -> current ( ) ; return $ values !== null ? reset ( $ values ) : null ; } | Convenience getter for the first value of a given trusted proxy header . |
59,250 | protected function ipIsTrustedProxy ( $ ipAddress ) { if ( filter_var ( $ ipAddress , FILTER_VALIDATE_IP ) === false ) { return false ; } $ allowedProxies = $ this -> settings [ 'proxies' ] ; if ( $ allowedProxies === '*' ) { return true ; } if ( is_string ( $ allowedProxies ) ) { $ allowedProxies = array_map ( 'trim' ... | Check if the given IP address is from a trusted proxy . |
59,251 | protected function isFromTrustedProxy ( Request $ request ) { $ server = $ request -> getServerParams ( ) ; if ( ! isset ( $ server [ 'REMOTE_ADDR' ] ) ) { return false ; } return $ this -> ipIsTrustedProxy ( $ server [ 'REMOTE_ADDR' ] ) ; } | Check if the given request is from a trusted proxy . |
59,252 | protected function getTrustedClientIpAddress ( ServerRequestInterface $ request ) { $ server = $ request -> getServerParams ( ) ; if ( ! isset ( $ server [ 'REMOTE_ADDR' ] ) ) { return false ; } $ ipAddress = $ server [ 'REMOTE_ADDR' ] ; $ trustedIpHeaders = $ this -> getTrustedProxyHeaderValues ( self :: HEADER_CLIENT... | Get the most trusted client s IP address . |
59,253 | public function forwardSignalToDispatcher ( JoinPointInterface $ joinPoint ) { $ signalName = lcfirst ( str_replace ( 'emit' , '' , $ joinPoint -> getMethodName ( ) ) ) ; $ this -> dispatcher -> dispatch ( $ joinPoint -> getClassName ( ) , $ signalName , $ joinPoint -> getMethodArguments ( ) ) ; } | Passes the signal over to the Dispatcher |
59,254 | public function handle ( ComponentContext $ componentContext ) { if ( ! isset ( $ this -> options [ 'components' ] ) ) { return ; } foreach ( $ this -> options [ 'components' ] as $ component ) { if ( $ component === null ) { continue ; } $ component -> handle ( $ componentContext ) ; $ this -> response = $ componentCo... | Handle the configured components in the order of the chain |
59,255 | public function injectSettings ( array $ settings ) { $ this -> sessionCookieName = $ settings [ 'session' ] [ 'name' ] ; $ this -> sessionCookieLifetime = ( integer ) $ settings [ 'session' ] [ 'cookie' ] [ 'lifetime' ] ; $ this -> sessionCookieDomain = $ settings [ 'session' ] [ 'cookie' ] [ 'domain' ] ; $ this -> se... | Injects the Flow settings |
59,256 | public function start ( ) { if ( $ this -> started === false ) { $ this -> sessionIdentifier = Algorithms :: generateRandomString ( 32 ) ; $ this -> storageIdentifier = Algorithms :: generateUUID ( ) ; $ this -> sessionCookie = new Cookie ( $ this -> sessionCookieName , $ this -> sessionIdentifier , 0 , $ this -> sessi... | Starts the session if it has not been already started |
59,257 | public function canBeResumed ( ) { if ( $ this -> sessionCookie === null || $ this -> started === true ) { return false ; } $ sessionMetaData = $ this -> metaDataCache -> get ( $ this -> sessionCookie -> getValue ( ) ) ; if ( $ sessionMetaData === false ) { return false ; } $ this -> lastActivityTimestamp = $ sessionMe... | Returns true if there is a session that can be resumed . |
59,258 | public function touch ( ) { if ( $ this -> started !== true ) { throw new Exception \ SessionNotStartedException ( 'Tried to touch a session, but the session has not been started yet.' , 1354284318 ) ; } if ( $ this -> remote === true ) { $ this -> lastActivityTimestamp = $ this -> now ; $ this -> writeSessionMetaDataC... | Updates the last activity time to now . |
59,259 | public function collectGarbage ( ) { if ( $ this -> inactivityTimeout === 0 ) { return 0 ; } if ( $ this -> metaDataCache -> has ( '_garbage-collection-running' ) ) { return false ; } $ sessionRemovalCount = 0 ; $ this -> metaDataCache -> set ( '_garbage-collection-running' , true , [ ] , 120 ) ; foreach ( $ this -> me... | Iterates over all existing sessions and removes their data if the inactivity timeout was reached . |
59,260 | public function shutdownObject ( ) { if ( $ this -> started === true && $ this -> remote === false ) { if ( $ this -> metaDataCache -> has ( $ this -> sessionIdentifier ) ) { $ securityContext = $ this -> objectManager -> get ( Context :: class ) ; if ( $ securityContext -> isInitialized ( ) ) { $ this -> storeAuthenti... | Shuts down this session |
59,261 | protected function storeAuthenticatedAccountsInfo ( array $ tokens ) { $ accountProviderAndIdentifierPairs = [ ] ; foreach ( $ tokens as $ token ) { $ account = $ token -> getAccount ( ) ; if ( $ token -> isAuthenticated ( ) && $ account !== null ) { $ accountProviderAndIdentifierPairs [ $ account -> getAuthenticationP... | Stores some information about the authenticated accounts in the session data . |
59,262 | protected function writeSessionMetaDataCacheEntry ( ) { $ sessionInfo = [ 'lastActivityTimestamp' => $ this -> lastActivityTimestamp , 'storageIdentifier' => $ this -> storageIdentifier , 'tags' => $ this -> tags ] ; $ tagsForCacheEntry = array_map ( function ( $ tag ) { return Session :: TAG_PREFIX . $ tag ; } , $ thi... | Writes the cache entry containing information about the session such as the last activity time and the storage identifier . |
59,263 | public function set ( $ name , $ value , $ type = self :: PROPERTY_TYPES_STRAIGHTVALUE , $ objectConfiguration = null , $ lazyLoading = true ) { $ this -> name = $ name ; $ this -> value = $ value ; $ this -> type = $ type ; $ this -> objectConfiguration = $ objectConfiguration ; $ this -> lazyLoading = $ lazyLoading ;... | Sets the name type and value of the property |
59,264 | public function getNormalizedLegacyConfiguration ( ) : array { $ normalizedConfiguration = [ ] ; foreach ( $ this -> legacyConfiguration as $ logIdentifier => $ configuration ) { if ( ! isset ( $ configuration [ 'backend' ] ) ) { continue ; } $ backendObjectNames = $ configuration [ 'backend' ] ; $ backendOptions = $ c... | Normalize a backend configuration to a unified format . |
59,265 | public function getFirst ( ) { if ( is_array ( $ this -> rows ) ) { $ rows = & $ this -> rows ; } else { $ query = clone $ this -> query ; $ query -> setLimit ( 1 ) ; $ rows = $ query -> getResult ( ) ; } return ( isset ( $ rows [ 0 ] ) ) ? $ rows [ 0 ] : null ; } | Returns the first object in the result set |
59,266 | public function generateTrustedPropertiesToken ( $ formFieldNames , $ fieldNamePrefix = '' ) { $ formFieldArray = [ ] ; foreach ( $ formFieldNames as $ formField ) { $ formFieldParts = explode ( '[' , $ formField ) ; $ currentPosition = & $ formFieldArray ; $ formFieldPartsCount = count ( $ formFieldParts ) ; for ( $ i... | Generate a request hash for a list of form fields |
59,267 | public function valid ( ) : bool { if ( $ this -> getCurrentElement ( ) !== null && $ this -> getCurrentElement ( ) -> getValue ( ) !== self :: DONE && $ this -> getCurrentElement ( ) -> getOffset ( ) !== - 1 ) { return true ; } return false ; } | Returns true if the current element is not the end of the iterator |
59,268 | public function last ( ) : string { $ this -> rewind ( ) ; $ previousElement = $ this -> getCurrentElement ( ) ; while ( $ this -> valid ( ) ) { $ previousElement = $ this -> getCurrentElement ( ) ; $ this -> next ( ) ; } return $ previousElement -> getValue ( ) ; } | Returns the last element of the iterator |
59,269 | public function following ( int $ offset ) : string { $ this -> rewind ( ) ; while ( $ this -> valid ( ) ) { $ this -> next ( ) ; $ nextElement = $ this -> getCurrentElement ( ) ; if ( $ nextElement -> getOffset ( ) >= $ offset ) { return $ nextElement -> getOffset ( ) ; } } return $ this -> offset ( ) ; } | Returns the next elment following the character of the original string given by its offset |
59,270 | public function preceding ( int $ offset ) : string { $ this -> rewind ( ) ; while ( $ this -> valid ( ) ) { $ previousElement = $ this -> getCurrentElement ( ) ; $ this -> next ( ) ; $ currentElement = $ this -> getCurrentElement ( ) ; if ( ( $ currentElement -> getOffset ( ) + $ currentElement -> getLength ( ) ) >= $... | Returns the element preceding the character of the original string given by its offset |
59,271 | public function getAll ( ) : array { $ this -> rewind ( ) ; $ allValues = [ ] ; while ( $ this -> valid ( ) ) { $ allValues [ ] = $ this -> getCurrentElement ( ) -> getValue ( ) ; $ this -> next ( ) ; } return $ allValues ; } | Returns all elements of the iterator in an array |
59,272 | private function generateIteratorElements ( ) { if ( $ this -> subject === '' ) { $ this -> iteratorCache -> append ( new TextIteratorElement ( self :: DONE , - 1 ) ) ; return ; } if ( $ this -> iteratorType === self :: CODE_POINT ) { throw new UnsupportedFeatureException ( 'Unsupported iterator type.' , 1210849150 ) ;... | Helper function to coordinate the string splitting |
59,273 | private function parseSubjectByCharacter ( ) { $ i = 0 ; foreach ( preg_split ( '//u' , $ this -> subject ) as $ currentCharacter ) { if ( $ currentCharacter === '' ) { continue ; } $ this -> iteratorCache -> append ( new TextIteratorElement ( $ currentCharacter , $ i , 1 , false ) ) ; $ i ++ ; } } | Helper function to do the splitting by character |
59,274 | public function set ( $ index , $ value , $ type = self :: ARGUMENT_TYPES_STRAIGHTVALUE ) { $ this -> index = $ index ; $ this -> value = $ value ; $ this -> type = $ type ; } | Sets the index value type of the argument and object configuration |
59,275 | public static function expand ( $ template , array $ variables ) { if ( strpos ( $ template , '{' ) === false ) { return $ template ; } self :: $ variables = $ variables ; return preg_replace_callback ( '/\{([^\}]+)\}/' , [ UriTemplate :: class , 'expandMatch' ] , $ template ) ; } | Expand the template string using the supplied variables |
59,276 | protected static function encodeArrayVariable ( array $ variable , array $ value , $ operator , $ separator , & $ useQueryString ) { $ isAssociativeArray = self :: isAssociative ( $ variable ) ; $ keyValuePairs = [ ] ; foreach ( $ variable as $ key => $ var ) { if ( $ isAssociativeArray ) { $ key = rawurlencode ( $ key... | Encode arrays for use in the expanded URI string |
59,277 | public function injectObjectManager ( ObjectManagerInterface $ objectManager ) : void { if ( $ this -> objectManager === null ) { $ this -> objectManager = $ objectManager ; $ cacheManager = $ this -> objectManager -> get ( CacheManager :: class ) ; $ this -> runtimeExpressionsCache = $ cacheManager -> getCache ( 'Flow... | This object is created very early and is part of the blacklisted Neos \ Flow \ Aop namespace so we can t rely on AOP for the property injection . |
59,278 | public function evaluate ( string $ privilegeIdentifier , JoinPointInterface $ joinPoint ) { $ functionName = $ this -> generateExpressionFunctionName ( $ privilegeIdentifier ) ; if ( isset ( $ this -> runtimeExpressions [ $ functionName ] ) ) { return $ this -> runtimeExpressions [ $ functionName ] -> __invoke ( $ joi... | Evaluate an expression with the given JoinPoint |
59,279 | public function addExpression ( string $ privilegeIdentifier , string $ expression ) : void { $ functionName = $ this -> generateExpressionFunctionName ( $ privilegeIdentifier ) ; $ wrappedExpression = 'return ' . $ expression . ';' ; $ this -> runtimeExpressionsCache -> set ( $ functionName , $ wrappedExpression ) ; $... | Add expression to the evaluator |
59,280 | public function render ( ) { $ methodDocumentation = $ this -> buildMethodDocumentation ( $ this -> fullOriginalClassName , $ this -> methodName ) ; $ callParentMethodCode = $ this -> buildCallParentMethodCode ( $ this -> fullOriginalClassName , $ this -> methodName ) ; $ finalKeyword = $ this -> reflectionService -> i... | Renders the code for a proxy constructor |
59,281 | public function getStatus ( $ packageKey , $ versionNumber = null ) { $ status = array ( ) ; $ migrations = $ this -> getMigrations ( $ versionNumber ) ; foreach ( $ this -> getPackagesData ( $ packageKey ) as & $ this -> currentPackageData ) { $ packageStatus = array ( ) ; foreach ( $ migrations as $ migration ) { if ... | Returns the migration status for all packages . |
59,282 | public function migrate ( $ packageKey , $ versionNumber = null , $ force = false ) { $ packagesData = $ this -> getPackagesData ( $ packageKey ) ; foreach ( $ this -> getMigrations ( $ versionNumber ) as $ migration ) { $ this -> triggerEvent ( self :: EVENT_MIGRATION_START , array ( $ migration ) ) ; foreach ( $ pack... | This iterates over available migrations and applies them to the existing packages if - the package needs the migration - is a clean git working copy |
59,283 | protected function migratePackage ( AbstractMigration $ migration , $ force = false ) { $ packagePath = $ this -> currentPackageData [ 'path' ] ; if ( $ this -> hasMigrationApplied ( $ migration ) ) { $ this -> triggerEvent ( self :: EVENT_MIGRATION_ALREADY_APPLIED , array ( $ migration , 'Migration already applied' ) ... | Apply the given migration to the package and commit the result . |
59,284 | protected function markMigrationApplied ( AbstractMigration $ migration ) { if ( ! isset ( $ this -> currentPackageData [ 'composerManifest' ] [ 'extra' ] [ 'applied-flow-migrations' ] ) ) { $ this -> currentPackageData [ 'composerManifest' ] [ 'extra' ] [ 'applied-flow-migrations' ] = [ ] ; } $ this -> currentPackageD... | Whether or not the given migration has been applied in the given path |
59,285 | protected function registerMigrationFiles ( $ packagePath ) { $ packagePath = rtrim ( $ packagePath , '/' ) ; $ packageKey = substr ( $ packagePath , strrpos ( $ packagePath , '/' ) + 1 ) ; $ migrationsDirectory = Files :: concatenatePaths ( array ( $ packagePath , 'Migrations/Code' ) ) ; if ( ! is_dir ( $ migrationsDi... | Look for code migration files in the given package path and register them for further action . |
59,286 | protected function initializeDependencies ( ) { if ( $ this -> securityContext === null ) { $ this -> securityContext = Bootstrap :: $ staticObjectManager -> get ( Context :: class ) ; } if ( $ this -> policyService === null ) { $ this -> policyService = Bootstrap :: $ staticObjectManager -> get ( PolicyService :: clas... | Initializes the dependencies by retrieving them from the object manager |
59,287 | public function validateMapping ( ) { try { $ validator = new SchemaValidator ( $ this -> entityManager ) ; return $ validator -> validateMapping ( ) ; } catch ( \ Exception $ exception ) { return [ [ $ exception -> getMessage ( ) ] ] ; } } | Validates the metadata mapping for Doctrine using the SchemaValidator of Doctrine . |
59,288 | public function createSchema ( $ outputPathAndFilename = null ) { $ schemaTool = new SchemaTool ( $ this -> entityManager ) ; $ allMetaData = $ this -> entityManager -> getMetadataFactory ( ) -> getAllMetadata ( ) ; if ( $ outputPathAndFilename === null ) { $ schemaTool -> createSchema ( $ allMetaData ) ; } else { $ cr... | Creates the needed DB schema using Doctrine s SchemaTool . If tables already exist this will throw an exception . |
59,289 | public function compileProxies ( ) { Files :: emptyDirectoryRecursively ( Files :: concatenatePaths ( [ $ this -> environment -> getPathToTemporaryDirectory ( ) , 'Doctrine/Proxies' ] ) ) ; $ proxyFactory = $ this -> entityManager -> getProxyFactory ( ) ; $ proxyFactory -> generateProxyClasses ( $ this -> entityManager... | Compiles the Doctrine proxy class code using the Doctrine ProxyFactory . |
59,290 | public function getEntityStatus ( ) { $ info = [ ] ; $ entityClassNames = $ this -> entityManager -> getConfiguration ( ) -> getMetadataDriverImpl ( ) -> getAllClassNames ( ) ; foreach ( $ entityClassNames as $ entityClassName ) { try { $ info [ $ entityClassName ] = $ this -> entityManager -> getClassMetadata ( $ enti... | Returns information about which entities exist and possibly if their mapping information contains errors or not . |
59,291 | public function runDql ( $ dql , $ hydrationMode = \ Doctrine \ ORM \ Query :: HYDRATE_OBJECT , $ firstResult = null , $ maxResult = null ) { $ query = $ this -> entityManager -> createQuery ( $ dql ) ; if ( $ firstResult !== null ) { $ query -> setFirstResult ( $ firstResult ) ; } if ( $ maxResult !== null ) { $ query... | Run DQL and return the result as - is . |
59,292 | protected function getMigrationConfiguration ( ) { $ this -> output = [ ] ; $ that = $ this ; $ outputWriter = new OutputWriter ( function ( $ message ) use ( $ that ) { $ that -> output [ ] = $ message ; } ) ; $ connection = $ this -> entityManager -> getConnection ( ) ; $ schemaManager = $ connection -> getSchemaMana... | Return the configuration needed for Migrations . |
59,293 | public function getMigrationStatus ( ) { $ configuration = $ this -> getMigrationConfiguration ( ) ; $ executedMigrations = $ configuration -> getMigratedVersions ( ) ; $ availableMigrations = $ configuration -> getAvailableVersions ( ) ; $ executedUnavailableMigrations = array_diff ( $ executedMigrations , $ available... | Returns the current migration status as an array . |
59,294 | public function getFormattedMigrationStatus ( $ showMigrations = false , $ showDescriptions = false ) { $ statusInformation = $ this -> getMigrationStatus ( ) ; $ output = PHP_EOL . '<info>==</info> Configuration' . PHP_EOL ; foreach ( $ statusInformation as $ name => $ value ) { if ( $ name == 'New Migrations' ) { $ v... | Returns a formatted string of current database migration status . |
59,295 | protected function getPackageKeyFromMigrationVersion ( Version $ version ) { $ sortedAvailablePackages = $ this -> packageManager -> getAvailablePackages ( ) ; usort ( $ sortedAvailablePackages , function ( PackageInterface $ packageOne , PackageInterface $ packageTwo ) { return strlen ( $ packageTwo -> getPackagePath ... | Tries to find out a package key which the Version belongs to . If no package could be found an empty string is returned . |
59,296 | protected function getFormattedVersionAlias ( $ alias , Configuration $ configuration ) { $ version = $ configuration -> resolveVersionAlias ( $ alias ) ; if ( $ version === null ) { if ( $ alias == 'next' ) { return 'Already at latest version' ; } elseif ( $ alias == 'prev' ) { return 'Already at first version' ; } } ... | Returns a formatted version string for the alias . |
59,297 | protected function getMigrationDescription ( Version $ version , DocCommentParser $ parser ) { if ( $ version -> getMigration ( ) -> getDescription ( ) ) { return $ version -> getMigration ( ) -> getDescription ( ) ; } else { $ reflectedClass = new \ ReflectionClass ( $ version -> getMigration ( ) ) ; $ parser -> parse... | Returns the description of a migration . |
59,298 | public function markAsMigrated ( $ version , $ markAsMigrated ) { $ configuration = $ this -> getMigrationConfiguration ( ) ; if ( $ version === 'all' ) { foreach ( $ configuration -> getMigrations ( ) as $ version ) { if ( $ markAsMigrated === true && $ configuration -> hasVersionMigrated ( $ version ) === false ) { $... | Add a migration version to the migrations table or remove it . |
59,299 | public function generateMigration ( $ diffAgainstCurrent = true , $ filterExpression = null ) { $ configuration = $ this -> getMigrationConfiguration ( ) ; $ up = null ; $ down = null ; if ( $ diffAgainstCurrent === true ) { $ connection = $ this -> entityManager -> getConnection ( ) ; if ( $ filterExpression ) { $ con... | Generates a new migration file and returns the path to it . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.