idx
int64
0
60.3k
question
stringlengths
92
4.62k
target
stringlengths
7
635
59,100
public function comparison ( DynamicOperand $ operand1 , $ operator , $ operand2 = null ) { return new Comparison ( $ operand1 , $ operator , $ operand2 ) ; }
Filters tuples based on the outcome of a binary operation .
59,101
public static function pbkdf2 ( $ password , $ salt , $ iterationCount , $ derivedKeyLength , $ algorithm = 'sha256' ) { $ hashLength = strlen ( hash ( $ algorithm , null , true ) ) ; $ keyBlocksToCompute = ceil ( $ derivedKeyLength / $ hashLength ) ; $ derivedKey = '' ; for ( $ block = 1 ; $ block <= $ keyBlocksToComp...
Compute a derived key from a password based on PBKDF2
59,102
public static function getPackagesData ( $ packagesPath ) { $ packagesData = array ( ) ; $ packagesDirectoryIterator = new \ DirectoryIterator ( $ packagesPath ) ; foreach ( $ packagesDirectoryIterator as $ categoryFileInfo ) { $ category = $ categoryFileInfo -> getFilename ( ) ; if ( ! $ categoryFileInfo -> isDir ( ) ...
Will return an array with all available packages .
59,103
public static function writeComposerManifest ( array $ manifest , $ pathAndFilename ) { file_put_contents ( $ pathAndFilename , json_encode ( $ manifest , JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE ) ) ; }
Write the manifest to the given file .
59,104
public static function searchAndReplace ( $ search , $ replace , $ pathAndFilename , $ regularExpression = false ) { $ pathInfo = pathinfo ( $ pathAndFilename ) ; if ( ! isset ( $ pathInfo [ 'filename' ] ) || $ pathAndFilename === __FILE__ ) { return false ; } $ file = file_get_contents ( $ pathAndFilename ) ; $ fileBa...
Does a search and replace operation on the given file .
59,105
public static function initializeStreamWrapper ( $ objectManager ) { $ streamWrapperClassNames = static :: getStreamWrapperImplementationClassNames ( $ objectManager ) ; foreach ( $ streamWrapperClassNames as $ streamWrapperClassName ) { $ scheme = $ streamWrapperClassName :: getScheme ( ) ; if ( in_array ( $ scheme , ...
Initialize StreamWrappers with this adapter
59,106
protected function createStreamWrapper ( $ path ) { if ( $ this -> streamWrapper === null ) { $ explodedPath = explode ( ':' , $ path , 2 ) ; $ scheme = array_shift ( $ explodedPath ) ; $ registeredStreamWrappers = self :: $ registeredStreamWrappers ; $ registeredStreamWrapperForScheme = $ registeredStreamWrappers [ $ ...
Create the internal stream wrapper if needed .
59,107
protected function isValid ( $ value ) { if ( ! is_string ( $ value ) || ! preg_match ( self :: PATTERN_MATCH_UUID , $ value ) ) { $ this -> addError ( 'The given subject was not a valid UUID.' , 1221565853 ) ; } }
Checks if the given value is a syntactically valid UUID .
59,108
public function processResources ( array & $ configuration ) { if ( ! isset ( $ configuration [ 'resources' ] ) || ! is_array ( $ configuration [ 'resources' ] ) ) { return ; } $ newPrivilegeTargetConfiguration = array ( ) ; foreach ( $ configuration [ 'resources' ] as $ resourceType => $ resourceConfiguration ) { swit...
Replaces the resource configuration by the new privilegeTargets syntax
59,109
public function processAcls ( array & $ configuration ) { if ( ! isset ( $ configuration [ 'acls' ] ) ) { return ; } $ newRolesConfiguration = isset ( $ configuration [ 'roles' ] ) ? $ configuration [ 'roles' ] : array ( ) ; foreach ( $ configuration [ 'acls' ] as $ roleIdentifier => $ aclConfiguration ) { $ roleIdenti...
Removes the acls configuration and adds privileges to related roles
59,110
protected function expandRoleIdentifier ( $ roleIdentifier ) { if ( strpos ( $ roleIdentifier , ':' ) !== false ) { return $ roleIdentifier ; } if ( in_array ( $ roleIdentifier , array ( 'Everybody' , 'Anonymous' , 'AuthenticatedUser' ) ) ) { return 'Neos.Flow:' . $ roleIdentifier ; } return $ this -> targetPackageData...
Convert a relative role identifier to one that includes the package key
59,111
public function formatCldr ( $ date , $ cldrFormat , $ locale = null ) { if ( $ date === 'now' ) { $ date = new \ DateTime ( ) ; } elseif ( is_int ( $ date ) ) { $ timestamp = $ date ; $ date = new \ DateTime ( ) ; $ date -> setTimestamp ( $ timestamp ) ; } elseif ( ! $ date instanceof \ DateTimeInterface ) { throw new...
Format a date to a string with a given cldr format
59,112
public function add ( $ date , $ interval ) { if ( ! $ interval instanceof \ DateInterval ) { $ interval = new \ DateInterval ( $ interval ) ; } $ result = clone $ date ; return $ result -> add ( $ interval ) ; }
Add an interval to a date and return a new DateTime object
59,113
public function subtract ( $ date , $ interval ) { if ( ! $ interval instanceof \ DateInterval ) { $ interval = new \ DateInterval ( $ interval ) ; } $ result = clone $ date ; return $ result -> sub ( $ interval ) ; }
Subtract an interval from a date and return a new DateTime object
59,114
public function setCache ( FrontendInterface $ cache ) { parent :: setCache ( $ cache ) ; $ pathHash = substr ( md5 ( $ this -> environmentConfiguration -> getApplicationIdentifier ( ) . $ cache -> getIdentifier ( ) ) , 0 , 12 ) ; $ this -> identifierPrefix = 'Flow_' . $ pathHash . '_' ; }
Initializes the identifier prefix when setting the cache .
59,115
public function injectObjectManager ( ObjectManagerInterface $ objectManager ) { $ this -> objectManager = $ objectManager ; $ cacheManager = $ this -> objectManager -> get ( CacheManager :: class ) ; $ this -> methodPermissionCache = $ cacheManager -> getCache ( 'Flow_Security_Authorization_Privilege_Method' ) ; $ thi...
This object is created very early so we can t rely on AOP for the property injection
59,116
public function matches ( $ className , $ methodName , $ methodDeclaringClassName , $ pointcutQueryIdentifier ) : bool { if ( $ this -> filters === null ) { $ this -> buildPointcutFilters ( ) ; } $ matchingFilters = array_filter ( $ this -> filters , $ this -> getFilterEvaluator ( $ className , $ methodName , $ methodD...
Checks if the specified class and method matches against the filter i . e . if there is a policy entry to intercept this method . This method also creates a cache entry for every method to cache the associated roles and privileges .
59,117
protected function buildPointcutFilters ( ) { $ this -> filters = [ ] ; $ policyService = $ this -> objectManager -> get ( PolicyService :: class ) ; $ methodPrivileges = $ policyService -> getAllPrivilegesByType ( MethodPrivilegeInterface :: class ) ; foreach ( $ methodPrivileges as $ privilege ) { $ this -> filters [...
Builds the needed pointcut filters for matching the policy privileges
59,118
public function savePolicyCache ( ) { $ tags = [ 'Neos_Flow_Aop' ] ; if ( ! $ this -> methodPermissionCache -> has ( 'methodPermission' ) ) { $ this -> methodPermissionCache -> set ( 'methodPermission' , $ this -> methodPermissions , $ tags ) ; } }
Save the found matches to the cache .
59,119
protected function getTypeConvertersWithParentClasses ( $ typeConverter ) { $ typeConverterClasses = class_parents ( $ typeConverter ) ; $ typeConverterClasses = $ typeConverterClasses === false ? [ ] : $ typeConverterClasses ; $ typeConverterClasses [ ] = $ typeConverter ; return $ typeConverterClasses ; }
Get type converter classes including parents for the given type converter
59,120
public function handleError ( int $ errorLevel , string $ errorMessage , string $ errorFile , int $ errorLine ) { if ( error_reporting ( ) === 0 ) { return ; } $ errorLevels = [ E_WARNING => 'Warning' , E_NOTICE => 'Notice' , E_USER_ERROR => 'User Error' , E_USER_WARNING => 'User Warning' , E_USER_NOTICE => 'User Notic...
Handles an error by converting it into an exception .
59,121
public function humanizeCamelCase ( $ camelCased , $ lowercase = false ) { $ spacified = $ this -> spacify ( $ camelCased ) ; $ result = strtolower ( $ spacified ) ; if ( ! $ lowercase ) { $ result = ucfirst ( $ result ) ; } return $ result ; }
Convert a model class name like BlogAuthor or a field name like blogAuthor to a humanized version like Blog author for better readability .
59,122
public function resolve ( array & $ routeValues ) { if ( $ this -> name === null || $ this -> name === '' ) { return false ; } $ this -> value = $ this -> name ; if ( $ this -> lowerCase ) { $ this -> value = strtolower ( $ this -> value ) ; } return true ; }
Sets the Route Part value to the Route Part name and returns true if successful .
59,123
private function Flow_Proxy_LazyPropertyInjection ( $ propertyObjectName , $ propertyClassName , $ propertyName , $ setterArgumentHash , callable $ lazyInjectionResolver ) { $ injection_reference = & $ this -> $ propertyName ; $ this -> $ propertyName = \ Neos \ Flow \ Core \ Bootstrap :: $ staticObjectManager -> getIn...
Does a property injection lazily with fallbacks . Used in proxy classes .
59,124
public function open ( ) { parent :: open ( ) ; $ this -> tagFormats = [ 'emergency' => self :: FG_BLACK . self :: BG_RED . '|' . self :: END , 'alert' => self :: FG_BLACK . self :: BG_YELLOW . '|' . self :: END , 'critical' => self :: FG_BLACK . self :: BG_CYAN . '|' . self :: END , 'error' => self :: FG_RED . '|' . s...
Open the log backend
59,125
protected function formatOutput ( $ output ) { $ tagFormats = $ this -> tagFormats ; $ disableAnsi = $ this -> disableAnsi ; do { $ lastOutput = $ output ; $ output = preg_replace_callback ( '|(<([^>]+?)>(.*?)</\2>)|s' , function ( $ matches ) use ( $ tagFormats , $ disableAnsi ) { $ format = isset ( $ tagFormats [ $ m...
Apply ansi formatting to output according to tags
59,126
public function getAvailableCommands ( ) : array { if ( $ this -> availableCommands === null ) { $ this -> availableCommands = [ ] ; foreach ( static :: getCommandControllerMethodArguments ( $ this -> objectManager ) as $ className => $ methods ) { foreach ( array_keys ( $ methods ) as $ methodName ) { $ this -> availa...
Returns an array of all commands
59,127
public function getCommandByIdentifier ( string $ commandIdentifier ) : Command { $ commandIdentifier = strtolower ( trim ( $ commandIdentifier ) ) ; if ( $ commandIdentifier === 'help' ) { $ commandIdentifier = 'neos.flow:help:help' ; } if ( $ commandIdentifier === 'sys' ) { $ commandIdentifier = 'neos.flow:cache:sys'...
Returns a Command that matches the given identifier . If no Command could be found a CommandNotFoundException is thrown If more than one Command matches an AmbiguousCommandIdentifierException is thrown that contains the matched Commands
59,128
public function getCommandsByIdentifier ( string $ commandIdentifier ) : array { $ availableCommands = $ this -> getAvailableCommands ( ) ; $ matchedCommands = [ ] ; foreach ( $ availableCommands as $ command ) { if ( $ this -> commandMatchesIdentifier ( $ command , $ commandIdentifier ) ) { $ matchedCommands [ ] = $ c...
Returns an array of Commands that matches the given identifier . If no Command could be found an empty array is returned
59,129
protected function getShortCommandIdentifiers ( ) : array { if ( $ this -> shortCommandIdentifiers === null ) { $ this -> shortCommandIdentifiers = [ ] ; $ commandsByCommandName = [ ] ; foreach ( $ this -> getAvailableCommands ( ) as $ availableCommand ) { list ( $ packageKey , $ controllerName , $ commandName ) = expl...
Returns an array that contains all available command identifiers and their shortest non - ambiguous alias
59,130
public function getCommandMethodParameters ( string $ controllerObjectName , string $ commandMethodName ) : array { $ commandControllerMethodArgumentMap = static :: getCommandControllerMethodArguments ( $ this -> objectManager ) ; return isset ( $ commandControllerMethodArgumentMap [ $ controllerObjectName ] [ $ comman...
Get the possible parameters for the command specified by CommandController and method name .
59,131
protected function isValid ( $ dateTime ) { if ( ! $ dateTime instanceof \ DateTimeInterface ) { $ this -> addError ( 'The given value was not a valid date' , 1324314378 ) ; return ; } $ earliestDate = isset ( $ this -> options [ 'earliestDate' ] ) ? $ this -> parseReferenceDate ( $ this -> options [ 'earliestDate' ] )...
Adds errors if the given DateTime does not match the set boundaries .
59,132
protected function parseReferenceDate ( $ referenceDateString ) { $ referenceDateParts = explode ( '/' , $ referenceDateString , 2 ) ; if ( count ( $ referenceDateParts ) === 1 ) { return new \ DateTime ( $ referenceDateParts [ 0 ] ) ; } if ( strpos ( $ referenceDateParts [ 0 ] , 'P' ) === 0 ) { $ interval = new \ Date...
Calculates a DateTime object from a given Time interval
59,133
public function substr ( $ string , $ start , $ length = null ) { $ string = ( string ) $ string ; if ( $ length === null ) { $ length = mb_strlen ( $ string , 'UTF-8' ) ; } $ length = max ( 0 , $ length ) ; return mb_substr ( $ string , $ start , $ length , 'UTF-8' ) ; }
Return the characters in a string from start up to the given length
59,134
public function substring ( $ string , $ start , $ end = null ) { $ string = ( string ) $ string ; if ( $ end === null ) { $ end = mb_strlen ( $ string , 'UTF-8' ) ; } $ start = max ( 0 , $ start ) ; $ end = max ( 0 , $ end ) ; if ( $ start > $ end ) { $ temp = $ start ; $ start = $ end ; $ end = $ temp ; } $ length = ...
Return the characters in a string from a start index to an end index
59,135
public function endsWith ( $ string , $ search , $ position = null ) { $ string = ( string ) $ string ; $ position = $ position !== null ? $ position : mb_strlen ( $ string , 'UTF-8' ) ; $ position = $ position - mb_strlen ( $ search , 'UTF-8' ) ; return mb_strrpos ( $ string , $ search , null , 'UTF-8' ) === $ positio...
Test if a string ends with the given search string
59,136
public function indexOf ( $ string , $ search , $ fromIndex = null ) { $ string = ( string ) $ string ; $ fromIndex = max ( 0 , $ fromIndex ) ; if ( $ search === '' ) { return min ( mb_strlen ( $ string , 'UTF-8' ) , $ fromIndex ) ; } $ index = mb_strpos ( $ string , $ search , $ fromIndex , 'UTF-8' ) ; if ( $ index ==...
Find the first position of a substring in the given string
59,137
public function lastIndexOf ( $ string , $ search , $ toIndex = null ) { $ string = ( string ) $ string ; $ length = mb_strlen ( $ string , 'UTF-8' ) ; if ( $ toIndex === null ) { $ toIndex = $ length ; } $ toIndex = max ( 0 , $ toIndex ) ; if ( $ search === '' ) { return min ( $ length , $ toIndex ) ; } $ string = mb_...
Find the last position of a substring in the given string
59,138
public function split ( $ string , $ separator = null , $ limit = null ) { $ string = ( string ) $ string ; if ( $ separator === null ) { return [ $ string ] ; } if ( $ separator === '' ) { $ result = str_split ( $ string ) ; if ( $ limit !== null ) { $ result = array_slice ( $ result , 0 , $ limit ) ; } return $ resul...
Split a string by a separator
59,139
public function startsWith ( $ string , $ search , $ position = null ) { $ position = $ position !== null ? $ position : 0 ; return mb_strpos ( ( string ) $ string , $ search , null , 'UTF-8' ) === $ position ; }
Test if a string starts with the given search string
59,140
public function trim ( $ string , $ charlist = null ) { $ string = ( string ) $ string ; if ( $ charlist === null ) { return trim ( $ string ) ; } else { return trim ( $ string , $ charlist ) ; } }
Trim whitespace at the beginning and end of a string
59,141
public function crop ( $ string , $ maximumCharacters , $ suffix = '' ) { $ string = ( string ) $ string ; if ( UnicodeFunctions :: strlen ( $ string ) > $ maximumCharacters ) { $ string = UnicodeFunctions :: substr ( $ string , 0 , $ maximumCharacters ) ; $ string .= $ suffix ; } return $ string ; }
Crop a string to maximumCharacters length optionally appending suffix if cropping was necessary .
59,142
public function cropAtWord ( $ string , $ maximumCharacters , $ suffix = '' ) { $ string = ( string ) $ string ; if ( UnicodeFunctions :: strlen ( $ string ) > $ maximumCharacters ) { $ iterator = new TextIterator ( $ string , TextIterator :: WORD ) ; $ string = UnicodeFunctions :: substr ( $ string , 0 , $ iterator ->...
Crop a string to maximumCharacters length taking words into account optionally appending suffix if cropping was necessary .
59,143
public function cropAtSentence ( $ string , $ maximumCharacters , $ suffix = '' ) { $ string = ( string ) $ string ; if ( UnicodeFunctions :: strlen ( $ string ) > $ maximumCharacters ) { $ iterator = new TextIterator ( $ string , TextIterator :: SENTENCE ) ; $ string = UnicodeFunctions :: substr ( $ string , 0 , $ ite...
Crop a string to maximumCharacters length taking sentences into account optionally appending suffix if cropping was necessary .
59,144
protected function validateOptions ( array $ options ) { if ( ( $ unsupportedOptions = array_diff_key ( $ options , $ this -> supportedOptions ) ) !== [ ] ) { throw new Exception ( sprintf ( 'The view options "%s" you\'re trying to set don\'t exist in class "%s".' , implode ( ',' , array_keys ( $ unsupportedOptions ) )...
Validate options given to this view .
59,145
protected function setOptions ( array $ options ) { $ this -> options = array_merge ( array_map ( function ( $ value ) { return $ value [ 0 ] ; } , $ this -> supportedOptions ) , $ options ) ; }
Merges the given options with the default values and sets the resulting options in this object .
59,146
public function setRequestPatterns ( array $ requestPatterns ) { foreach ( $ requestPatterns as $ requestPattern ) { if ( ! $ requestPattern instanceof RequestPatternInterface ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid request pattern passed to token of type "%s"' , get_class ( $ this ) ) , 132739836...
Sets request patterns
59,147
public function handleRequest ( ) { $ runLevel = $ this -> bootstrap -> isCompiletimeCommand ( isset ( $ _SERVER [ 'argv' ] [ 1 ] ) ? $ _SERVER [ 'argv' ] [ 1 ] : '' ) ? Bootstrap :: RUNLEVEL_COMPILETIME : Bootstrap :: RUNLEVEL_RUNTIME ; $ this -> boot ( $ runLevel ) ; $ commandLine = isset ( $ _SERVER [ 'argv' ] ) ? $...
Handles a command line request .
59,148
public function exitIfCompiletimeCommandWasNotCalledCorrectly ( string $ runlevel ) { if ( $ runlevel === Bootstrap :: RUNLEVEL_COMPILETIME ) { return ; } $ command = $ this -> request -> getCommand ( ) ; if ( $ this -> bootstrap -> isCompiletimeCommand ( $ command -> getCommandIdentifier ( ) ) ) { $ this -> response -...
Checks if compile time command was not recognized as such then runlevel was booted but it turned out that in fact the command is a compile time command .
59,149
protected function shutdown ( string $ runlevel ) { $ this -> bootstrap -> shutdown ( $ runlevel ) ; if ( $ runlevel === Bootstrap :: RUNLEVEL_COMPILETIME ) { $ this -> objectManager -> get ( LockManager :: class ) -> unlockSite ( ) ; } exit ( $ this -> response -> getExitCode ( ) ) ; }
Starts the shutdown sequence
59,150
protected function parseTag ( $ line ) { $ tagAndValue = [ ] ; if ( preg_match ( '/@[A-Za-z0-9\\\\]+\\\\([A-Za-z0-9]+)(?:\\((.*)\\))?$/' , $ line , $ tagAndValue ) === 0 ) { $ tagAndValue = preg_split ( '/\s/' , $ line , 2 ) ; } else { array_shift ( $ tagAndValue ) ; } $ tag = strtolower ( trim ( $ tagAndValue [ 0 ] , ...
Parses a line of a doc comment for a tag and its value . The result is stored in the internal tags array .
59,151
public function initialize ( Bootstrap $ bootstrap ) { $ this -> bootstrap = $ bootstrap ; $ this -> packageStatesConfiguration = $ this -> getCurrentPackageStates ( ) ; $ this -> registerPackagesFromConfiguration ( $ this -> packageStatesConfiguration ) ; foreach ( $ this -> packages as $ package ) { if ( $ package in...
Initializes the package manager
59,152
public function getPackage ( $ packageKey ) { if ( ! $ this -> isPackageAvailable ( $ packageKey ) ) { throw new Exception \ UnknownPackageException ( 'Package "' . $ packageKey . '" is not available. Please check if the package exists and that the package key is correct (package keys are case sensitive).' , 1166546734...
Returns a PackageInterface object for the specified package .
59,153
public function getFrozenPackages ( ) { $ frozenPackages = [ ] ; if ( $ this -> bootstrap -> getContext ( ) -> isDevelopment ( ) ) { foreach ( $ this -> packages as $ packageKey => $ package ) { if ( isset ( $ this -> packageStatesConfiguration [ 'packages' ] [ $ package -> getComposerName ( ) ] [ 'frozen' ] ) && $ thi...
Returns an array of PackageInterface objects of all frozen packages . A frozen package is not considered by file monitoring and provides some precompiled reflection data in order to improve performance .
59,154
public function getFilteredPackages ( $ packageState = 'available' , $ packagePath = null , $ packageType = null ) { switch ( strtolower ( $ packageState ) ) { case 'available' : $ packages = $ this -> getAvailablePackages ( ) ; break ; case 'frozen' : $ packages = $ this -> getFrozenPackages ( ) ; break ; default : th...
Returns an array of PackageInterface objects of all packages that match the given package state path and type filters . All three filters must match if given .
59,155
protected function filterPackagesByPath ( $ packages , $ filterPath ) { $ filteredPackages = [ ] ; foreach ( $ packages as $ package ) { $ packagePath = substr ( $ package -> getPackagePath ( ) , strlen ( $ this -> packagesBasePath ) ) ; $ packageGroup = substr ( $ packagePath , 0 , strpos ( $ packagePath , '/' ) ) ; i...
Returns an array of PackageInterface objects in the given array of packages that are in the specified Package Path
59,156
protected function filterPackagesByType ( $ packages , $ packageType ) { $ filteredPackages = [ ] ; foreach ( $ packages as $ package ) { if ( $ package -> getComposerManifest ( 'type' ) === $ packageType ) { $ filteredPackages [ $ package -> getPackageKey ( ) ] = $ package ; } } return $ filteredPackages ; }
Returns an array of PackageInterface objects in the given array of packages that are of the specified package type .
59,157
protected function movePackage ( $ fromAbsolutePath , $ toAbsolutePath ) { Files :: createDirectoryRecursively ( $ toAbsolutePath ) ; Files :: copyDirectoryRecursively ( $ fromAbsolutePath , $ toAbsolutePath , false , true ) ; Files :: removeDirectoryRecursively ( $ fromAbsolutePath ) ; }
Moves a package from one path to another .
59,158
public function freezePackage ( $ packageKey ) { if ( ! $ this -> bootstrap -> getContext ( ) -> isDevelopment ( ) ) { throw new \ LogicException ( 'Package freezing is only supported in Development context.' , 1338810870 ) ; } if ( ! $ this -> isPackageAvailable ( $ packageKey ) ) { throw new Exception \ UnknownPackag...
Freezes a package
59,159
public function isPackageFrozen ( $ packageKey ) { if ( ! isset ( $ this -> packages [ $ packageKey ] ) ) { return false ; } $ composerName = $ this -> packages [ $ packageKey ] -> getComposerName ( ) ; return ( $ this -> bootstrap -> getContext ( ) -> isDevelopment ( ) && isset ( $ this -> packageStatesConfiguration [...
Tells if a package is frozen
59,160
public function unfreezePackage ( $ packageKey ) { if ( ! $ this -> isPackageFrozen ( $ packageKey ) ) { return ; } if ( ! isset ( $ this -> packages [ $ packageKey ] ) ) { return ; } $ composerName = $ this -> packages [ $ packageKey ] -> getComposerName ( ) ; $ this -> bootstrap -> getObjectManager ( ) -> get ( Refle...
Unfreezes a package
59,161
public function refreezePackage ( $ packageKey ) { if ( ! $ this -> isPackageFrozen ( $ packageKey ) ) { return ; } $ this -> bootstrap -> getObjectManager ( ) -> get ( ReflectionService :: class ) -> unfreezePackageReflection ( $ packageKey ) ; }
Refreezes a package
59,162
protected function getCurrentPackageStates ( ) { $ savePackageStates = false ; $ loadedPackageStates = $ this -> loadPackageStates ( ) ; if ( empty ( $ loadedPackageStates ) || ! isset ( $ loadedPackageStates [ 'version' ] ) || $ loadedPackageStates [ 'version' ] < self :: PACKAGESTATE_FORMAT_VERSION ) { $ loadedPackag...
Loads the states of available packages from the PackageStates . php file and initialises a package scan if the file was not found or the configuration format was not current .
59,163
protected function findComposerPackagesInPath ( $ startingDirectory ) { $ directories = [ $ startingDirectory ] ; while ( $ directories !== [ ] ) { $ currentDirectory = array_pop ( $ directories ) ; if ( $ handle = opendir ( $ currentDirectory ) ) { while ( false !== ( $ filename = readdir ( $ handle ) ) ) { if ( $ fil...
Recursively traverses directories from the given starting points and returns all folder paths that contain a composer . json and which does NOT have the key extra . neos . is - merged - repository set as that indicates a composer package that joins several real packages together . In case a is - merged - repository is ...
59,164
protected function registerPackagesFromConfiguration ( $ packageStatesConfiguration ) { foreach ( $ packageStatesConfiguration [ 'packages' ] as $ composerName => $ packageStateConfiguration ) { $ this -> registerPackageFromStateConfiguration ( $ composerName , $ packageStateConfiguration ) ; } }
Requires and registers all packages which were defined in packageStatesConfiguration
59,165
protected function registerPackageFromStateConfiguration ( $ composerName , $ packageStateConfiguration ) { $ packagePath = isset ( $ packageStateConfiguration [ 'packagePath' ] ) ? $ packageStateConfiguration [ 'packagePath' ] : null ; $ packageClassInformation = isset ( $ packageStateConfiguration [ 'packageClassInfo...
Registers a package under the given composer name with the configuration . This uses the PackageFactory to create the Package instance and sets it to all relevant data arrays .
59,166
protected function sortAndSavePackageStates ( array $ packageStates ) { $ orderedPackageStates = $ this -> sortAvailablePackagesByDependencies ( $ packageStates ) ; $ this -> savePackageStates ( $ orderedPackageStates ) ; return $ orderedPackageStates ; }
Takes the given packageStatesConfiguration sorts it by dependencies saves it and returns the ordered list
59,167
protected function sortAvailablePackagesByDependencies ( array $ packageStates ) { $ packageOrderResolver = new PackageOrderResolver ( $ packageStates [ 'packages' ] , $ this -> collectPackageManifestData ( $ packageStates ) ) ; $ packageStates [ 'packages' ] = $ packageOrderResolver -> sort ( ) ; return $ packageState...
Orders all packages by comparing their dependencies . By this the packages and package configurations arrays holds all packages in the correct initialization order .
59,168
protected function collectPackageManifestData ( array $ packageStates ) { return array_map ( function ( $ packageState ) { return ComposerUtility :: getComposerManifest ( Files :: getNormalizedPath ( Files :: concatenatePaths ( [ $ this -> packagesBasePath , $ packageState [ 'packagePath' ] ] ) ) ) ; } , $ packageState...
Collects the manifest data for all packages in the given package states array
59,169
public function getCaseSensitivePackageKey ( $ unknownCasedPackageKey ) { $ lowerCasedPackageKey = strtolower ( $ unknownCasedPackageKey ) ; return ( isset ( $ this -> packageKeys [ $ lowerCasedPackageKey ] ) ) ? $ this -> packageKeys [ $ lowerCasedPackageKey ] : false ; }
Returns the correctly cased version of the given package key or false if no such package is available .
59,170
public function getPackageKeyFromComposerName ( $ composerName ) { if ( $ this -> composerNameToPackageKeyMap === [ ] ) { foreach ( $ this -> packageStatesConfiguration [ 'packages' ] as $ packageStateConfiguration ) { $ this -> composerNameToPackageKeyMap [ $ packageStateConfiguration [ 'composerName' ] ] = $ packageS...
Resolves a Flow package key from a composer package name .
59,171
protected function getPackageKeyFromManifest ( array $ manifest , $ packagePath ) { if ( isset ( $ manifest [ 'extra' ] [ 'neos' ] [ 'package-key' ] ) && $ this -> isPackageKeyValid ( $ manifest [ 'extra' ] [ 'neos' ] [ 'package-key' ] ) ) { return $ manifest [ 'extra' ] [ 'neos' ] [ 'package-key' ] ; } $ composerName ...
Resolves package key from Composer manifest
59,172
public function build ( $ commandLine ) : Request { $ request = new Request ( ) ; $ request -> setControllerObjectName ( HelpCommandController :: class ) ; if ( is_array ( $ commandLine ) === true ) { $ rawCommandLineArguments = $ commandLine ; } else { preg_match_all ( self :: ARGUMENT_MATCHING_EXPRESSION , $ commandL...
Builds a CLI request object from a command line .
59,173
protected function parseRawCommandLineArguments ( array $ rawCommandLineArguments , string $ controllerObjectName , string $ controllerCommandName ) : array { $ commandLineArguments = [ ] ; $ exceedingArguments = [ ] ; $ commandMethodName = $ controllerCommandName . 'Command' ; $ commandMethodParameters = $ this -> com...
Takes an array of unparsed command line arguments and options and converts it separated by named arguments options and unnamed arguments .
59,174
protected function getValueOfCurrentCommandLineOption ( string $ currentArgument , array & $ rawCommandLineArguments , string $ expectedArgumentType ) { if ( ( ! isset ( $ rawCommandLineArguments [ 0 ] ) && ( strpos ( $ currentArgument , '=' ) === false ) ) || ( isset ( $ rawCommandLineArguments [ 0 ] ) && $ rawCommand...
Returns the value of the first argument of the given input array . Shifts the parsed argument off the array .
59,175
protected function getBooleanValue ( $ path ) { $ normalizedPath = strtolower ( $ path ) ; if ( in_array ( $ normalizedPath , [ 'true' , 'on' , 'yes' ] ) ) { return true ; } if ( in_array ( $ normalizedPath , [ 'false' , 'off' , 'no' ] ) ) { return false ; } return null ; }
Tries to interpret the given path as boolean value either returns the boolean value or null .
59,176
public function setValue ( $ rawValue ) { if ( $ rawValue === null ) { $ this -> value = null ; return $ this ; } if ( is_object ( $ rawValue ) && $ rawValue instanceof $ this -> dataType ) { $ this -> value = $ rawValue ; return $ this ; } $ this -> value = $ this -> propertyMapper -> convert ( $ rawValue , $ this -> ...
Sets the value of this argument .
59,177
protected function enhanceRawConfigurationWithAnnotationOptions ( $ className , array $ rawObjectConfiguration ) { if ( $ this -> reflectionService -> isClassAnnotatedWith ( $ className , Flow \ Scope :: class ) ) { $ rawObjectConfiguration [ 'scope' ] = $ this -> reflectionService -> getClassAnnotation ( $ className ,...
Builds a raw configuration array by parsing possible scope and autowiring annotations from the given class or interface .
59,178
protected function parseScope ( $ value ) { switch ( $ value ) { case 'singleton' : return Configuration :: SCOPE_SINGLETON ; case 'prototype' : return Configuration :: SCOPE_PROTOTYPE ; case 'session' : return Configuration :: SCOPE_SESSION ; default : throw new InvalidObjectConfigurationException ( 'Invalid scope "' ...
Parses the value of the option scope
59,179
protected static function parseAutowiring ( $ value ) { switch ( $ value ) { case true : case Configuration :: AUTOWIRING_MODE_ON : return Configuration :: AUTOWIRING_MODE_ON ; case false : case Configuration :: AUTOWIRING_MODE_OFF : return Configuration :: AUTOWIRING_MODE_OFF ; default : throw new InvalidObjectConfigu...
Parses the value of the option autowiring
59,180
protected function parsePropertyOfTypeObject ( $ propertyName , $ objectNameOrConfiguration , Configuration $ parentObjectConfiguration ) { if ( is_array ( $ objectNameOrConfiguration ) ) { if ( isset ( $ objectNameOrConfiguration [ 'name' ] ) ) { $ objectName = $ objectNameOrConfiguration [ 'name' ] ; unset ( $ object...
Parses the configuration for properties of type OBJECT
59,181
protected function parseArgumentOfTypeObject ( $ argumentName , $ objectNameOrConfiguration , $ configurationSourceHint ) { if ( is_array ( $ objectNameOrConfiguration ) ) { if ( isset ( $ objectNameOrConfiguration [ 'name' ] ) ) { $ objectName = $ objectNameOrConfiguration [ 'name' ] ; unset ( $ objectNameOrConfigurat...
Parses the configuration for arguments of type OBJECT
59,182
protected function autowireArguments ( array & $ objectConfigurations ) { foreach ( $ objectConfigurations as $ objectConfiguration ) { if ( $ objectConfiguration -> getClassName ( ) === '' ) { continue ; } if ( $ objectConfiguration -> getAutowiring ( ) === Configuration :: AUTOWIRING_MODE_OFF ) { continue ; } $ class...
If mandatory constructor arguments have not been defined yet this function tries to autowire them if possible .
59,183
public function setStatusCache ( StringFrontend $ cache ) { $ this -> statusCache = $ cache ; $ backend = $ this -> statusCache -> getBackend ( ) ; if ( is_callable ( [ 'initializeObject' , $ backend ] ) ) { $ backend -> initializeObject ( ) ; } }
Sets the status cache
59,184
protected function initialize ( ) { $ this -> context = $ this -> environment -> getContext ( ) ; if ( $ this -> hasFrozenCacheInProduction ( ) ) { $ this -> classReflectionData = $ this -> reflectionDataRuntimeCache -> get ( '__classNames' ) ; $ this -> annotatedClasses = $ this -> reflectionDataRuntimeCache -> get ( ...
Initialize the reflection service lazily
59,185
public function buildReflectionData ( array $ availableClassNames ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ this -> availableClassNames = $ availableClassNames ; $ this -> forgetChangedClasses ( ) ; $ this -> reflectEmergedClasses ( ) ; }
Builds the reflection data cache during compile time .
59,186
public function isClassReflected ( $ className ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ className = $ this -> cleanClassName ( $ className ) ; return isset ( $ this -> classReflectionData [ $ className ] ) ; }
Tells if the specified class is known to this reflection service and reflection information is available .
59,187
public function getDefaultImplementationClassNameForInterface ( $ interfaceName ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ interfaceName = $ this -> cleanClassName ( $ interfaceName ) ; if ( interface_exists ( $ interfaceName ) === false ) { throw new \ InvalidArgumentException ( '"' . $ interf...
Searches for and returns the class name of the default implementation of the given interface name . If no class implementing the interface was found or more than one implementation was found in the package defining the interface false is returned .
59,188
public function getAllSubClassNamesForClass ( $ className ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ className = $ this -> cleanClassName ( $ className ) ; if ( class_exists ( $ className ) === false ) { throw new \ InvalidArgumentException ( '"' . $ className . '" does not exist or is not the ...
Searches for and returns all names of classes inheriting the specified class . If no class inheriting the given class was found an empty array is returned .
59,189
public function getClassNamesByAnnotation ( $ annotationClassName ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ annotationClassName = $ this -> cleanClassName ( $ annotationClassName ) ; return ( isset ( $ this -> annotatedClasses [ $ annotationClassName ] ) ? array_keys ( $ this -> annotatedClass...
Searches for and returns all names of classes which are tagged by the specified annotation . If no classes were found an empty array is returned .
59,190
public function isClassAnnotatedWith ( $ className , $ annotationClassName ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ className = $ this -> cleanClassName ( $ className ) ; $ annotationClassName = $ this -> cleanClassName ( $ annotationClassName ) ; return ( isset ( $ this -> annotatedClasses [...
Tells if the specified class has the given annotation
59,191
public function getClassAnnotations ( $ className , $ annotationClassName = null ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; $ annotationClassName = $ annotationClassName === null ? null : $ this -> cleanClassName ( $ annotationClassName ) ; if ( ! isset ( $ this -> classReflectionData ...
Returns the specified class annotations or an empty array
59,192
public function getClassAnnotation ( $ className , $ annotationClassName ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ annotations = $ this -> getClassAnnotations ( $ className , $ annotationClassName ) ; return $ annotations === [ ] ? null : current ( $ annotations ) ; }
Returns the specified class annotation or NULL .
59,193
public function isClassImplementationOf ( $ className , $ interfaceName ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; $ interfaceName = $ this -> cleanClassName ( $ interfaceName ) ; $ this -> loadOrReflectClassIfNecessary ( $ interfaceName ) ; return ( isset ( $ this -> classReflectionDa...
Tells if the specified class implements the given interface
59,194
public function isClassAbstract ( $ className ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; return isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_ABSTRACT ] ) ; }
Tells if the specified class is abstract or not
59,195
public function isClassFinal ( $ className ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; return isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_FINAL ] ) ; }
Tells if the specified class is final or not
59,196
public function getClassesContainingMethodsAnnotatedWith ( $ annotationClassName ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } return isset ( $ this -> classesByMethodAnnotations [ $ annotationClassName ] ) ? array_keys ( $ this -> classesByMethodAnnotations [ $ annotationClassName ] ) : [ ] ; }
Returns all class names of classes containing at least one method annotated with the given annotation class
59,197
public function getMethodsAnnotatedWith ( $ className , $ annotationClassName ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } return isset ( $ this -> classesByMethodAnnotations [ $ annotationClassName ] [ $ className ] ) ? $ this -> classesByMethodAnnotations [ $ annotationClassName ] [ $ className ]...
Returns all names of methods of the given class that are annotated with the given annotation class
59,198
public function isMethodFinal ( $ className , $ methodName ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; return isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_METHODS ] [ $ methodName ] [ self :: DATA_METHOD_FINAL ] ) ; }
Tells if the specified method is final or not
59,199
public function isMethodStatic ( $ className , $ methodName ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; return isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_METHODS ] [ $ methodName ] [ self :: DATA_METHOD_STATIC ] ) ; }
Tells if the specified method is declared as static or not