idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
59,000 | protected function buildAspectContainers ( array & $ classNames ) : array { $ aspectContainers = [ ] ; foreach ( $ classNames as $ aspectClassName ) { $ aspectContainers [ $ aspectClassName ] = $ this -> buildAspectContainer ( $ aspectClassName ) ; } return $ aspectContainers ; } | Checks the annotations of the specified classes for aspect tags and creates an aspect with advisors accordingly . |
59,001 | protected function proxySubClassesOfClassToEnsureAdvices ( string $ className , ClassNameIndex $ targetClassNameCandidates , ClassNameIndex $ treatedSubClasses ) : ClassNameIndex { if ( $ this -> reflectionService -> isClassReflected ( $ className ) === false ) { return $ treatedSubClasses ; } if ( trait_exists ( $ cla... | Makes sure that any sub classes of an adviced class also build the advices array on construction . |
59,002 | protected function addBuildMethodsAndAdvicesCodeToClass ( string $ className , ClassNameIndex $ treatedSubClasses ) : ClassNameIndex { if ( $ treatedSubClasses -> hasClassName ( $ className ) ) { return $ treatedSubClasses ; } $ treatedSubClasses = $ treatedSubClasses -> union ( new ClassNameIndex ( [ $ className ] ) )... | Adds code to build the methods and advices array in case the parent class has some . |
59,003 | protected function getMethodsFromTargetClass ( string $ targetClassName ) : array { $ methods = [ ] ; $ class = new \ ReflectionClass ( $ targetClassName ) ; foreach ( [ '__construct' , '__clone' ] as $ builtInMethodName ) { if ( ! $ class -> hasMethod ( $ builtInMethodName ) ) { $ methods [ ] = [ $ targetClassName , $... | Returns the methods of the target class . |
59,004 | protected function buildMethodsAndAdvicesArrayCode ( array $ methodsAndGroupedAdvices ) : string { if ( count ( $ methodsAndGroupedAdvices ) < 1 ) { return '' ; } $ methodsAndAdvicesArrayCode = "\n \$objectManager = \\Neos\\Flow\\Core\\Bootstrap::\$staticObjectManager;\n" ; $ methodsAndAdvicesArrayCode .= " ... | Creates code for an array of target methods and their advices . |
59,005 | protected function buildMethodsInterceptorCode ( string $ targetClassName , array $ interceptedMethods ) : void { foreach ( $ interceptedMethods as $ methodName => $ methodMetaInformation ) { if ( count ( $ methodMetaInformation [ 'groupedAdvices' ] ) === 0 ) { throw new Aop \ Exception \ VoidImplementationException ( ... | Traverses all intercepted methods and their advices and builds PHP code to intercept methods if necessary . |
59,006 | protected function addIntroducedMethodsToInterceptedMethods ( array & $ interceptedMethods , array $ methodsFromIntroducedInterfaces ) : void { foreach ( $ methodsFromIntroducedInterfaces as $ interfaceAndMethodName ) { list ( $ interfaceName , $ methodName ) = $ interfaceAndMethodName ; if ( ! isset ( $ interceptedMet... | Traverses all methods which were introduced by interfaces and adds them to the intercepted methods array if they didn t exist already . |
59,007 | protected function getMatchingInterfaceIntroductions ( array & $ aspectContainers , string $ targetClassName ) : array { $ introductions = [ ] ; foreach ( $ aspectContainers as $ aspectContainer ) { if ( ! $ aspectContainer -> getCachedTargetClassNameCandidates ( ) -> hasClassName ( $ targetClassName ) ) { continue ; }... | Traverses all aspect containers and returns an array of interface introductions which match the target class . |
59,008 | protected function getMatchingPropertyIntroductions ( array & $ aspectContainers , string $ targetClassName ) : array { $ introductions = [ ] ; foreach ( $ aspectContainers as $ aspectContainer ) { if ( ! $ aspectContainer -> getCachedTargetClassNameCandidates ( ) -> hasClassName ( $ targetClassName ) ) { continue ; } ... | Traverses all aspect containers and returns an array of property introductions which match the target class . |
59,009 | protected function getMatchingTraitNamesFromIntroductions ( array & $ aspectContainers , string $ targetClassName ) : array { $ introductions = [ ] ; foreach ( $ aspectContainers as $ aspectContainer ) { if ( ! $ aspectContainer -> getCachedTargetClassNameCandidates ( ) -> hasClassName ( $ targetClassName ) ) { continu... | Traverses all aspect containers and returns an array of trait introductions which match the target class . |
59,010 | protected function getInterfaceNamesFromIntroductions ( array $ interfaceIntroductions ) : array { $ interfaceNames = [ ] ; foreach ( $ interfaceIntroductions as $ introduction ) { $ interfaceNames [ ] = '\\' . $ introduction -> getInterfaceName ( ) ; } return $ interfaceNames ; } | Returns an array of interface names introduced by the given introductions |
59,011 | protected function getIntroducedMethodsFromInterfaceIntroductions ( array $ interfaceIntroductions ) : array { $ methods = [ ] ; $ methodsAndIntroductions = [ ] ; foreach ( $ interfaceIntroductions as $ introduction ) { $ interfaceName = $ introduction -> getInterfaceName ( ) ; $ methodNames = get_class_methods ( $ int... | Returns all methods declared by the introduced interfaces |
59,012 | protected function renderSourceHint ( string $ aspectClassName , string $ methodName , string $ tagName ) : string { return sprintf ( '%s::%s (%s advice)' , $ aspectClassName , $ methodName , $ tagName ) ; } | Renders a short message which gives a hint on where the currently parsed pointcut expression was defined . |
59,013 | public function protectCDataSectionsFromParser ( $ templateSource ) { $ parts = preg_split ( '/(\<\!\[CDATA\[|\]\]\>)/' , $ templateSource , - 1 , PREG_SPLIT_DELIM_CAPTURE ) ; $ balance = 0 ; $ content = '' ; $ resultingParts = [ ] ; foreach ( $ parts as $ index => $ part ) { unset ( $ parts [ $ index ] ) ; if ( $ bala... | Encodes areas enclosed in CDATA to prevent further parsing by the Fluid engine . CDATA sections will appear as they are in the final rendered result . |
59,014 | public function throwExceptionsForUnhandledNamespaces ( $ templateSource ) { $ viewHelperResolver = $ this -> renderingContext -> getViewHelperResolver ( ) ; $ splitTemplate = preg_split ( static :: $ EXTENDED_SPLIT_PATTERN_TEMPLATE_DYNAMICTAGS , $ templateSource , - 1 , PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY )... | Throw an UnknownNamespaceException for any unknown and not ignored namespace inside the template string . |
59,015 | protected static function initialize ( ) { self :: $ clearCacheCallbacks = [ ] ; if ( extension_loaded ( 'Zend OPcache' ) && ini_get ( 'opcache.enable' ) === '1' ) { self :: $ clearCacheCallbacks [ ] = function ( $ absolutePathAndFilename ) { if ( $ absolutePathAndFilename !== null && function_exists ( 'opcache_invalid... | Initialize the ClearCache - Callbacks |
59,016 | public static function clearAllActive ( string $ absolutePathAndFilename = null ) { if ( self :: $ clearCacheCallbacks === null ) { self :: initialize ( ) ; } foreach ( self :: $ clearCacheCallbacks as $ clearCacheCallback ) { $ clearCacheCallback ( $ absolutePathAndFilename ) ; } } | Clear a PHP file from all active cache files . Also supports to flush the cache completely if called without parameter . |
59,017 | protected function evaluatePropertyNameFilter ( FlowQuery $ query , $ propertyNameFilter ) { $ resultObjects = [ ] ; $ resultObjectHashes = [ ] ; foreach ( $ query -> getContext ( ) as $ element ) { $ subProperty = ObjectAccess :: getPropertyPath ( $ element , $ propertyNameFilter ) ; if ( is_object ( $ subProperty ) |... | Evaluate the property name filter by traversing to the child object . We only support nested objects right now |
59,018 | public function store ( WidgetContext $ widgetContext ) { $ ajaxWidgetId = $ this -> nextFreeAjaxWidgetId ++ ; $ widgetContext -> setAjaxWidgetIdentifier ( $ ajaxWidgetId ) ; $ this -> widgetContexts [ $ ajaxWidgetId ] = $ widgetContext ; } | Stores the WidgetContext inside the Context and sets the AjaxWidgetIdentifier inside the Widget Context correctly . |
59,019 | public function getShortDescription ( ) : string { $ commandMethodReflection = $ this -> getCommandMethodReflection ( ) ; $ lines = explode ( chr ( 10 ) , $ commandMethodReflection -> getDescription ( ) ) ; $ shortDescription = ( ( count ( $ lines ) > 0 ) ? trim ( $ lines [ 0 ] ) : '<no description available>' ) . ( $ ... | Returns a short description of this command |
59,020 | public function uriFor ( $ actionName , $ controllerArguments = [ ] , $ controllerName = null , $ packageKey = null , $ subPackageKey = null ) { if ( $ actionName === null || $ actionName === '' ) { throw new Exception \ MissingActionNameException ( 'The URI Builder could not build a URI linking to an action controller... | Creates an URI used for linking to an Controller action . |
59,021 | public function build ( array $ arguments = [ ] ) { $ arguments = Arrays :: arrayMergeRecursiveOverrule ( $ this -> arguments , $ arguments ) ; $ arguments = $ this -> mergeArgumentsWithRequestArguments ( $ arguments ) ; $ httpRequest = $ this -> request -> getHttpRequest ( ) ; $ uriPathPrefix = $ this -> environment -... | Builds the URI |
59,022 | protected function mergeArgumentsWithRequestArguments ( array $ arguments ) { if ( $ this -> request !== $ this -> request -> getMainRequest ( ) ) { $ subRequest = $ this -> request ; while ( $ subRequest instanceof ActionRequest ) { $ requestArguments = ( array ) $ subRequest -> getArguments ( ) ; if ( $ subRequest ==... | Merges specified arguments with arguments from request . |
59,023 | public function registerNewObject ( Aspect \ PersistenceMagicInterface $ object ) { $ identifier = ObjectAccess :: getProperty ( $ object , 'Persistence_Object_Identifier' , true ) ; $ this -> newObjects [ $ identifier ] = $ object ; } | Registers an object which has been created or cloned during this request . |
59,024 | protected function throwExceptionIfObjectIsNotWhitelisted ( $ object ) { if ( ! $ this -> whitelistedObjects -> contains ( $ object ) ) { $ message = 'Detected modified or new objects (' . get_class ( $ object ) . ', uuid:' . $ this -> getIdentifierByObject ( $ object ) . ') to be persisted which is not allowed for "sa... | Checks if the given object is whitelisted and if not throws an exception |
59,025 | public function convertObjectToIdentityArray ( $ object ) { $ identifier = $ this -> getIdentifierByObject ( $ object ) ; if ( $ identifier === null ) { throw new Exception \ UnknownObjectException ( sprintf ( 'Tried to convert an object of type "%s" to an identity array, but it is unknown to the Persistence Manager.' ... | Converts the given object into an array containing the identity of the domain object . |
59,026 | public function convertObjectsToIdentityArrays ( array $ array ) { foreach ( $ array as $ key => $ value ) { if ( is_array ( $ value ) ) { $ array [ $ key ] = $ this -> convertObjectsToIdentityArrays ( $ value ) ; } elseif ( is_object ( $ value ) && $ value instanceof \ Traversable ) { $ array [ $ key ] = $ this -> con... | Recursively iterates through the given array and turns objects into an arrays containing the identity of the domain object . |
59,027 | public function walkSelectStatement ( \ Doctrine \ ORM \ Query \ AST \ SelectStatement $ AST ) { $ parent = null ; $ parentName = null ; foreach ( $ this -> _getQueryComponents ( ) as $ dqlAlias => $ qComp ) { if ( $ qComp [ 'parent' ] === null && $ qComp [ 'nestingLevel' ] == 0 ) { $ parent = $ qComp ; $ parentName = ... | Walks down a SelectStatement AST node modifying it to retrieve a COUNT |
59,028 | public function connect ( $ signalClassName , $ signalName , $ slotClassNameOrObject , $ slotMethodName = '' , $ passSignalInformation = true ) { $ class = null ; $ object = null ; if ( strpos ( $ signalName , 'emit' ) === 0 ) { $ possibleSignalName = lcfirst ( substr ( $ signalName , strlen ( 'emit' ) ) ) ; throw new ... | Connects a signal with a slot . One slot can be connected with multiple signals by calling this method multiple times . |
59,029 | public function dispatch ( $ signalClassName , $ signalName , array $ signalArguments = [ ] ) { if ( ! isset ( $ this -> slots [ $ signalClassName ] [ $ signalName ] ) ) { return ; } foreach ( $ this -> slots [ $ signalClassName ] [ $ signalName ] as $ slotInformation ) { $ finalSignalArguments = $ signalArguments ; if... | Dispatches a signal by calling the registered Slot methods |
59,030 | public function getSlots ( $ signalClassName , $ signalName ) { return ( isset ( $ this -> slots [ $ signalClassName ] [ $ signalName ] ) ) ? $ this -> slots [ $ signalClassName ] [ $ signalName ] : [ ] ; } | Returns all slots which are connected with the given signal |
59,031 | public function parseNumberWithCustomPattern ( $ numberToParse , $ format , Locale $ locale , $ strictMode = true ) { return $ this -> doParsingWithParsedFormat ( $ numberToParse , $ this -> numbersReader -> parseCustomFormat ( $ format ) , $ this -> numbersReader -> getLocalizedSymbolsForLocale ( $ locale ) , $ strict... | Parses number given as a string using provided format . |
59,032 | public function parseDecimalNumber ( $ numberToParse , Locale $ locale , $ formatLength = NumbersReader :: FORMAT_LENGTH_DEFAULT , $ strictMode = true ) { NumbersReader :: validateFormatLength ( $ formatLength ) ; return $ this -> doParsingWithParsedFormat ( $ numberToParse , $ this -> numbersReader -> parseFormatFromC... | Parses decimal number using proper format from CLDR . |
59,033 | public function parsePercentNumber ( $ numberToParse , Locale $ locale , $ formatLength = NumbersReader :: FORMAT_LENGTH_DEFAULT , $ strictMode = true ) { NumbersReader :: validateFormatLength ( $ formatLength ) ; return $ this -> doParsingWithParsedFormat ( $ numberToParse , $ this -> numbersReader -> parseFormatFromC... | Parses percent number using proper format from CLDR . |
59,034 | protected function doParsingWithParsedFormat ( $ numberToParse , array $ parsedFormat , array $ localizedSymbols , $ strictMode ) { return ( $ strictMode ) ? $ this -> doParsingInStrictMode ( $ numberToParse , $ parsedFormat , $ localizedSymbols ) : $ this -> doParsingInLenientMode ( $ numberToParse , $ parsedFormat , ... | Parses number using parsed format in strict or lenient mode . |
59,035 | protected function doParsingInLenientMode ( $ numberToParse , array $ parsedFormat , array $ localizedSymbols ) { $ numberIsNegative = false ; $ positionOfFirstDigit = null ; $ positionOfLastDigit = null ; $ charactersOfNumberString = str_split ( $ numberToParse ) ; foreach ( $ charactersOfNumberString as $ position =>... | Parses number in lenient mode . |
59,036 | public function setPackages ( array $ activePackages ) { foreach ( $ activePackages as $ packageKey => $ package ) { foreach ( $ package -> getFlattenedAutoloadConfiguration ( ) as $ configuration ) { $ this -> createNamespaceMapEntry ( $ configuration [ 'namespace' ] , $ configuration [ 'classPath' ] , $ configuration... | Sets the available packages |
59,037 | protected function createNamespaceMapEntry ( string $ namespace , string $ classPath , string $ mappingType = self :: MAPPING_TYPE_PSR0 ) { $ unifiedClassPath = Files :: getNormalizedPath ( $ classPath ) ; $ entryIdentifier = md5 ( $ unifiedClassPath . '-' . $ mappingType ) ; $ currentArray = & $ this -> packageNamespa... | Add a namespace to class path mapping to the class loader for resolving classes . |
59,038 | public function createFallbackPathEntry ( string $ path ) { $ entryIdentifier = md5 ( $ path ) ; if ( ! isset ( $ this -> fallbackClassPaths [ $ entryIdentifier ] ) ) { $ this -> fallbackClassPaths [ $ entryIdentifier ] = [ 'path' => $ path , 'mappingType' => self :: MAPPING_TYPE_PSR4 ] ; } } | Adds an entry to the fallback path map . MappingType for this kind of paths is always PSR4 as no package namespace is used then . |
59,039 | protected function buildClassPathWithPsr0 ( array $ classNameParts , string $ classPath ) : string { $ fileName = implode ( '/' , $ classNameParts ) . '.php' ; return $ classPath . $ fileName ; } | Try to build a path to a class according to PSR - 0 rules . |
59,040 | protected function buildClassPathWithPsr4 ( array $ classNameParts , string $ classPath , int $ packageNamespacePartCount ) : string { $ fileName = implode ( '/' , array_slice ( $ classNameParts , $ packageNamespacePartCount ) ) . '.php' ; return $ classPath . $ fileName ; } | Try to build a path to a class according to PSR - 4 rules . |
59,041 | protected function parseUsingLocaleIfConfigured ( $ source , PropertyMappingConfigurationInterface $ configuration ) { $ configuration = $ this -> getConfigurationKeysAndValues ( $ configuration , [ 'locale' , 'strictMode' , 'formatLength' , 'formatType' ] ) ; if ( $ configuration [ 'locale' ] === null ) { return $ sou... | Tries to parse the input using the NumberParser . |
59,042 | protected function getConfigurationKeysAndValues ( PropertyMappingConfigurationInterface $ configuration , array $ configurationKeys ) { $ keysAndValues = [ ] ; foreach ( $ configurationKeys as $ configurationKey ) { $ keysAndValues [ $ configurationKey ] = $ configuration -> getConfigurationValue ( FloatConverter :: c... | Helper method to collect configuration for this class . |
59,043 | public function getConstructor ( ) { if ( ! isset ( $ this -> constructor ) ) { $ this -> constructor = new ProxyConstructor ( $ this -> fullOriginalClassName ) ; $ this -> constructor -> injectReflectionService ( $ this -> reflectionService ) ; } return $ this -> constructor ; } | Returns the ProxyConstructor for this ProxyClass . Creates it if needed . |
59,044 | public function getMethod ( $ methodName ) { if ( $ methodName === '__construct' ) { return $ this -> getConstructor ( ) ; } if ( ! isset ( $ this -> methods [ $ methodName ] ) ) { $ this -> methods [ $ methodName ] = new ProxyMethod ( $ this -> fullOriginalClassName , $ methodName ) ; $ this -> methods [ $ methodName ... | Returns the named ProxyMethod for this ProxyClass . Creates it if needed . |
59,045 | public function addProperty ( $ name , $ initialValueCode , $ visibility = 'private' , $ docComment = '' ) { $ this -> properties [ $ name ] = [ 'initialValueCode' => $ initialValueCode , 'visibility' => $ visibility , 'docComment' => $ docComment ] ; } | Adds a class property to this proxy class |
59,046 | public function render ( ) { $ namespace = $ this -> namespace ; $ proxyClassName = $ this -> originalClassName ; $ originalClassName = $ this -> originalClassName . Compiler :: ORIGINAL_CLASSNAME_SUFFIX ; $ classModifier = '' ; if ( $ this -> reflectionService -> isClassAbstract ( $ this -> fullOriginalClassName ) ) {... | Renders and returns the PHP code for this ProxyClass . |
59,047 | protected function buildClassDocumentation ( ) { $ classDocumentation = "/**\n" ; $ classReflection = new ClassReflection ( $ this -> fullOriginalClassName ) ; $ classDescription = $ classReflection -> getDescription ( ) ; $ classDocumentation .= ' * ' . str_replace ( "\n" , "\n * " , $ classDescription ) . "\n" ; fore... | Builds the class documentation block for the specified class keeping doc comments and vital annotations |
59,048 | protected function renderConstantsCode ( ) { $ code = '' ; foreach ( $ this -> constants as $ name => $ valueCode ) { $ code .= ' const ' . $ name . ' = ' . $ valueCode . ";\n\n" ; } return $ code ; } | Renders code for the added class constants |
59,049 | protected function renderPropertiesCode ( ) { $ code = '' ; foreach ( $ this -> properties as $ name => $ attributes ) { if ( ! empty ( $ attributes [ 'docComment' ] ) ) { $ code .= ' ' . $ attributes [ 'docComment' ] . "\n" ; } $ code .= ' ' . $ attributes [ 'visibility' ] . ' $' . $ name . ' = ' . $ attributes ... | Renders code for the added class properties |
59,050 | public function parseDate ( $ dateToParse , I18n \ Locale $ locale , $ formatLength = DatesReader :: FORMAT_LENGTH_DEFAULT , $ strictMode = true ) { DatesReader :: validateFormatLength ( $ formatLength ) ; return $ this -> doParsingWithParsedFormat ( $ dateToParse , $ this -> datesReader -> parseFormatFromCldr ( $ loca... | Parses date with format string for date defined in CLDR for particular locale . |
59,051 | public function parseTime ( $ timeToParse , I18n \ Locale $ locale , $ formatLength = DatesReader :: FORMAT_LENGTH_DEFAULT , $ strictMode = true ) { DatesReader :: validateFormatLength ( $ formatLength ) ; return $ this -> doParsingWithParsedFormat ( $ timeToParse , $ this -> datesReader -> parseFormatFromCldr ( $ loca... | Parses time with format string for time defined in CLDR for particular locale . |
59,052 | public function parseDateAndTime ( $ dateAndTimeToParse , I18n \ Locale $ locale , $ formatLength = DatesReader :: FORMAT_LENGTH_DEFAULT , $ strictMode = true ) { DatesReader :: validateFormatLength ( $ formatLength ) ; return $ this -> doParsingWithParsedFormat ( $ dateAndTimeToParse , $ this -> datesReader -> parseFo... | Parses dateTime with format string for date and time defined in CLDR for particular locale . |
59,053 | protected function extractAndCheckNumber ( $ datetimeToParse , $ isTwoDigits , $ minValue , $ maxValue ) { if ( $ isTwoDigits || is_numeric ( $ datetimeToParse [ 1 ] ) ) { $ number = substr ( $ datetimeToParse , 0 , 2 ) ; } else { $ number = $ datetimeToParse [ 0 ] ; } if ( is_numeric ( $ number ) ) { $ number = ( int ... | Extracts one or two - digit number from the beginning of the string . |
59,054 | protected function extractNumberAndGetPosition ( $ datetimeToParse , & $ position ) { $ characters = str_split ( $ datetimeToParse ) ; $ number = '' ; $ numberStarted = false ; foreach ( $ characters as $ index => $ character ) { if ( ord ( $ character ) >= 48 && ord ( $ character ) <= 57 ) { if ( ! $ numberStarted ) {... | Extracts and returns first integer number encountered in provided string . |
59,055 | public function get ( string $ entryIdentifier ) { if ( ! $ this -> isValidEntryIdentifier ( $ entryIdentifier ) ) { throw new \ InvalidArgumentException ( '"' . $ entryIdentifier . '" is not a valid cache entry identifier.' , 1233057752 ) ; } $ code = $ this -> backend -> get ( $ entryIdentifier ) ; if ( $ code === fa... | Finds and returns the original code from the cache . |
59,056 | public function getWrapped ( string $ entryIdentifier ) : string { if ( ! $ this -> isValidEntryIdentifier ( $ entryIdentifier ) ) { throw new \ InvalidArgumentException ( '"' . $ entryIdentifier . '" is not a valid cache entry identifier.' , 1233057752 ) ; } return $ this -> backend -> get ( $ entryIdentifier ) ; } | Returns the code wrapped in php tags as written to the cache ready to be included . |
59,057 | public function set ( string $ entryIdentifier , $ sourceCode , array $ tags = [ ] , int $ lifetime = null ) { if ( ! $ this -> isValidEntryIdentifier ( $ entryIdentifier ) ) { throw new \ InvalidArgumentException ( '"' . $ entryIdentifier . '" is not a valid cache entry identifier.' , 1264023823 ) ; } if ( ! is_string... | Saves the PHP source code in the cache . |
59,058 | protected function isValid ( $ value ) { if ( ! is_object ( $ value ) ) { throw new InvalidValidationOptionsException ( 'The value supplied for the UniqueEntityValidator must be an object.' , 1358454270 ) ; } $ classSchema = $ this -> reflectionService -> getClassSchema ( TypeHandling :: getTypeForValue ( $ value ) ) ;... | Checks if the given value is a unique entity depending on it s identity properties or custom configured identity properties . |
59,059 | public function logicalAnd ( $ constraint1 ) { if ( is_array ( $ constraint1 ) ) { $ resultingConstraint = array_shift ( $ constraint1 ) ; $ constraints = $ constraint1 ; } else { $ constraints = func_get_args ( ) ; $ resultingConstraint = array_shift ( $ constraints ) ; } if ( $ resultingConstraint === null ) { throw ... | Performs a logical conjunction of the two given constraints . The method takes one or more contraints and concatenates them with a boolean AND . It also accepts a single array of constraints to be concatenated . |
59,060 | public function contains ( $ propertyName , $ operand ) { if ( ! $ this -> classSchema -> isMultiValuedProperty ( $ propertyName ) ) { throw new InvalidQueryException ( 'Property "' . $ propertyName . '" must be multi-valued' , 1276781026 ) ; } return $ this -> qomFactory -> comparison ( $ this -> qomFactory -> propert... | Returns a contains criterion used for matching objects against a query . It matches if the multivalued property contains the given operand . |
59,061 | public function isEmpty ( $ propertyName ) { if ( ! $ this -> classSchema -> isMultiValuedProperty ( $ propertyName ) ) { throw new InvalidQueryException ( 'Property "' . $ propertyName . '" must be multi-valued' , 1276853547 ) ; } return $ this -> qomFactory -> comparison ( $ this -> qomFactory -> propertyValue ( $ pr... | Returns an isEmpty criterion used for matching objects against a query . It matches if the multivalued property contains no values or is NULL . |
59,062 | protected function matchRequestProperty ( $ propertyName , $ expectedValue , $ weight ) { if ( $ this -> request === null ) { return false ; } $ value = ObjectAccess :: getProperty ( $ this -> request , $ propertyName ) ; if ( $ value === $ expectedValue ) { $ this -> addWeight ( $ weight ) ; return true ; } return fal... | Compare a request propertyValue against an expected value and add the weight if it s true |
59,063 | public function getParentRequest ( ) { if ( $ this -> request === null || $ this -> request -> isMainRequest ( ) ) { return new RequestMatcher ( ) ; } $ this -> addWeight ( 1000000 ) ; return new RequestMatcher ( $ this -> request -> getParentRequest ( ) , $ this ) ; } | Get a new RequestMatcher for the Request s ParentRequest |
59,064 | public function addWeight ( $ weight ) { $ this -> weight += $ weight ; if ( $ this -> parentMatcher !== null ) { $ this -> parentMatcher -> addWeight ( $ weight ) ; } } | Add a weight to the total |
59,065 | public function concat ( $ array1 , $ array2 , $ array_ = null ) : array { $ arguments = func_get_args ( ) ; foreach ( $ arguments as & $ argument ) { if ( ! is_array ( $ argument ) ) { $ argument = [ $ argument ] ; } } return call_user_func_array ( 'array_merge' , $ arguments ) ; } | Concatenate arrays or values to a new array |
59,066 | public function slice ( array $ array , $ begin , $ end = null ) : array { if ( $ end === null ) { $ end = count ( $ array ) ; } elseif ( $ end < 0 ) { $ end = count ( $ array ) + $ end ; } $ length = $ end - $ begin ; return array_slice ( $ array , $ begin , $ length ) ; } | Extract a portion of an indexed array |
59,067 | public function indexOf ( array $ array , $ searchElement , $ fromIndex = null ) : int { if ( $ fromIndex !== null ) { $ array = array_slice ( $ array , $ fromIndex , null , true ) ; } $ result = array_search ( $ searchElement , $ array , true ) ; if ( $ result === false ) { return - 1 ; } return $ result ; } | Returns the first index at which a given element can be found in the array or - 1 if it is not present |
59,068 | public function sort ( array $ array ) : array { if ( $ array === [ ] ) { return $ array ; } natsort ( $ array ) ; $ i = 0 ; $ newArray = [ ] ; foreach ( $ array as $ key => $ value ) { if ( is_string ( $ key ) ) { $ newArray [ $ key ] = $ value ; } else { $ newArray [ $ i ] = $ value ; $ i ++ ; } } return $ newArray ;... | Sorts an array |
59,069 | public function shuffle ( array $ array , $ preserveKeys = true ) : array { if ( $ array === [ ] ) { return $ array ; } if ( $ preserveKeys ) { $ keys = array_keys ( $ array ) ; shuffle ( $ keys ) ; $ shuffledArray = [ ] ; foreach ( $ keys as $ key ) { $ shuffledArray [ $ key ] = $ array [ $ key ] ; } $ array = $ shuff... | Shuffle an array |
59,070 | public function push ( array $ array , $ element ) : array { $ elements = func_get_args ( ) ; array_shift ( $ elements ) ; foreach ( $ elements as $ element ) { array_push ( $ array , $ element ) ; } return $ array ; } | Insert one or more elements at the end of an array |
59,071 | public function unshift ( array $ array , $ element ) : array { $ elements = func_get_args ( ) ; array_shift ( $ elements ) ; foreach ( $ elements as $ element ) { array_unshift ( $ array , $ element ) ; } return $ array ; } | Insert one or more elements at the beginning of an array |
59,072 | public function splice ( array $ array , $ offset , $ length = 1 , $ replacements = null ) : array { $ arguments = func_get_args ( ) ; $ replacements = array_slice ( $ arguments , 3 ) ; array_splice ( $ array , $ offset , $ length , $ replacements ) ; return $ array ; } | Replaces a range of an array by the given replacements |
59,073 | public function map ( array $ array , callable $ callback ) : array { $ result = [ ] ; foreach ( $ array as $ key => $ element ) { $ result [ $ key ] = $ callback ( $ element , $ key ) ; } return $ result ; } | Apply the callback to each element of the array passing each element and key as arguments |
59,074 | public function reduce ( array $ array , callable $ callback , $ initialValue = null ) { if ( $ initialValue !== null ) { $ accumulator = $ initialValue ; } else { $ accumulator = array_shift ( $ array ) ; } foreach ( $ array as $ key => $ element ) { $ accumulator = $ callback ( $ accumulator , $ element , $ key ) ; }... | Apply the callback to each element of the array and accumulate a single value |
59,075 | public function some ( array $ array , callable $ callback ) : bool { foreach ( $ array as $ key => $ value ) { if ( $ callback ( $ value , $ key ) ) { return true ; } } return false ; } | Check if at least one element in an array passes a test given by the calback passing each element and key as arguments |
59,076 | public function every ( array $ array , callable $ callback ) : bool { foreach ( $ array as $ key => $ value ) { if ( ! $ callback ( $ value , $ key ) ) { return false ; } } return true ; } | Check if all elements in an array pass a test given by the calback passing each element and key as arguments |
59,077 | public function generateXsd ( $ viewHelperNamespace , $ xsdNamespace ) { if ( substr ( $ viewHelperNamespace , - 1 ) !== '\\' ) { $ viewHelperNamespace .= '\\' ; } $ classNames = $ this -> getClassNamesInNamespace ( $ viewHelperNamespace ) ; if ( count ( $ classNames ) === 0 ) { throw new Exception ( sprintf ( 'No View... | Generate the XML Schema definition for a given namespace . It will generate an XSD file for all view helpers in this namespace . |
59,078 | protected function generateXmlForClassName ( $ className , $ viewHelperNamespace , \ SimpleXMLElement $ xmlRootNode ) { $ reflectionClass = new ClassReflection ( $ className ) ; if ( ! $ reflectionClass -> isSubclassOf ( $ this -> abstractViewHelperReflectionClass ) ) { return ; } $ tagName = $ this -> getTagNameForCla... | Generate the XML Schema for a given class name . |
59,079 | public function generateUuid ( JoinPointInterface $ joinPoint ) { $ proxy = $ joinPoint -> getProxy ( ) ; ObjectAccess :: setProperty ( $ proxy , 'Persistence_Object_Identifier' , Algorithms :: generateUUID ( ) , true ) ; $ this -> persistenceManager -> registerNewObject ( $ proxy ) ; } | After returning advice making sure we have an UUID for each and every entity . |
59,080 | public function generateValueHash ( JoinPointInterface $ joinPoint ) { $ proxy = $ joinPoint -> getProxy ( ) ; $ proxyClassName = get_class ( $ proxy ) ; $ hashSourceParts = [ ] ; $ classSchema = $ this -> reflectionService -> getClassSchema ( $ proxyClassName ) ; foreach ( $ classSchema -> getProperties ( ) as $ prope... | After returning advice generates the value hash for the object |
59,081 | public function getPluralForms ( Locale $ locale ) { if ( ! isset ( $ this -> rulesetsIndices [ $ locale -> getLanguage ( ) ] ) ) { return [ self :: RULE_OTHER ] ; } $ ruleset = $ this -> rulesets [ $ locale -> getLanguage ( ) ] [ $ this -> rulesetsIndices [ $ locale -> getLanguage ( ) ] ] ?? null ; if ( $ ruleset === ... | Returns array of plural forms available for particular locale . |
59,082 | protected function generateRulesets ( ) { $ model = $ this -> cldrRepository -> getModel ( 'supplemental/plurals' ) ; $ pluralRulesSet = $ model -> getRawArray ( 'plurals' ) ; $ index = 0 ; foreach ( $ pluralRulesSet as $ pluralRulesNodeString => $ pluralRules ) { $ localeLanguages = $ model -> getAttributeValue ( $ pl... | Generates an internal representation of plural rules which can be found in plurals . xml CLDR file . |
59,083 | protected function parseRule ( $ rule ) { $ parsedRule = [ ] ; if ( preg_match_all ( self :: PATTERN_MATCH_SUBRULE , strtolower ( str_replace ( ' ' , '' , $ rule ) ) , $ matches , \ PREG_SET_ORDER ) ) { foreach ( $ matches as $ matchedSubrule ) { $ subrule = [ ] ; if ( $ matchedSubrule [ 1 ] === 'nmod' ) { $ subrule [ ... | Parses a plural rule from CLDR . |
59,084 | protected function storeObjectPathMapping ( $ pathSegment , $ identifier ) { $ objectPathMapping = new ObjectPathMapping ( ) ; $ objectPathMapping -> setObjectType ( $ this -> objectType ) ; $ objectPathMapping -> setUriPattern ( $ this -> getUriPattern ( ) ) ; $ objectPathMapping -> setPathSegment ( $ pathSegment ) ; ... | Creates a new ObjectPathMapping and stores it in the repository |
59,085 | public function matchRequest ( RequestInterface $ request ) { if ( ! isset ( $ this -> options [ 'controllerObjectNamePattern' ] ) ) { throw new InvalidRequestPatternException ( 'Missing option "controllerObjectNamePattern" in the ControllerObjectName request pattern configuration' , 1446224501 ) ; } return ( boolean )... | Matches a \ Neos \ Flow \ Mvc \ RequestInterface against its set controller object name pattern rules |
59,086 | public function setUriPattern ( $ uriPattern ) { if ( ! is_string ( $ uriPattern ) ) { throw new \ InvalidArgumentException ( sprintf ( 'URI Pattern must be of type string, %s given.' , gettype ( $ uriPattern ) ) , 1223499724 ) ; } $ this -> uriPattern = $ uriPattern ; $ this -> isParsed = false ; } | Sets the URI pattern this route should match with |
59,087 | protected function containsObject ( $ subject ) { if ( is_object ( $ subject ) ) { return true ; } if ( ! is_array ( $ subject ) ) { return false ; } foreach ( $ subject as $ value ) { if ( $ this -> containsObject ( $ value ) ) { return true ; } } return false ; } | Checks if the given subject contains an object |
59,088 | public function lockSiteOrExit ( ) { touch ( $ this -> lockFlagPathAndFilename ) ; $ this -> lockResource = fopen ( $ this -> lockPathAndFilename , 'w+' ) ; if ( ! flock ( $ this -> lockResource , LOCK_EX | LOCK_NB ) ) { fclose ( $ this -> lockResource ) ; $ this -> doExit ( ) ; } } | Locks the site for further requests . |
59,089 | public function unlockSite ( ) { if ( is_resource ( $ this -> lockResource ) ) { flock ( $ this -> lockResource , LOCK_UN ) ; fclose ( $ this -> lockResource ) ; unlink ( $ this -> lockPathAndFilename ) ; } @ unlink ( $ this -> lockFlagPathAndFilename ) ; } | Unlocks the site if this request has locked it . |
59,090 | protected function doExit ( ) { if ( FLOW_SAPITYPE === 'Web' ) { header ( 'HTTP/1.1 503 Service Temporarily Unavailable' ) ; readfile ( $ this -> lockHoldingPage ) ; } else { $ expiresIn = abs ( ( time ( ) - self :: LOCKFILE_MAXIMUM_AGE - filemtime ( $ this -> lockFlagPathAndFilename ) ) ) ; echo 'Site is currently loc... | Exit and emit a message about the reason . |
59,091 | public function isGranted ( $ privilegeType , $ subject , & $ reason = '' ) { return $ this -> isGrantedForRoles ( $ this -> securityContext -> getRoles ( ) , $ privilegeType , $ subject , $ reason ) ; } | Returns true if the given privilege type is granted for the given subject based on the current security context . |
59,092 | public function isGrantedForRoles ( array $ roles , $ privilegeType , $ subject , & $ reason = '' ) { $ availablePrivileges = array_reduce ( $ roles , $ this -> getPrivilegeByTypeReducer ( $ privilegeType ) , [ ] ) ; $ effectivePrivileges = array_filter ( $ availablePrivileges , $ this -> getPrivilegeSubjectFilter ( $ ... | Returns true if the given privilege type would be granted for the given roles and subject |
59,093 | public function setContent ( $ content ) { $ this -> content = null ; if ( $ content === null ) { return ; } if ( TypeHandling :: isSimpleType ( gettype ( $ content ) ) && ! is_array ( $ content ) ) { $ this -> content = ( string ) $ content ; } if ( is_resource ( $ content ) ) { $ this -> content = $ content ; } retur... | Explicitly sets the content of the message body |
59,094 | public function setCharset ( $ charset ) { $ this -> charset = $ charset ; if ( $ this -> headers -> has ( 'Content-Type' ) ) { $ contentType = $ this -> headers -> get ( 'Content-Type' ) ; if ( stripos ( $ contentType , 'text/' ) === 0 ) { $ matches = [ ] ; if ( preg_match ( '/(?P<contenttype>.*); ?charset[^;]+(?P<ext... | Sets the character set for this message . |
59,095 | public function matches ( $ className , $ methodName , $ methodDeclaringClassName , $ pointcutQueryIdentifier ) : bool { try { $ matchResult = preg_match ( $ this -> classFilterExpression , $ className ) ; } catch ( \ Exception $ exception ) { throw new Exception ( 'Error in regular expression "' . $ this -> classFilte... | Checks if the specified class matches with the class filter pattern |
59,096 | public function updateCredentials ( ActionRequest $ actionRequest ) { $ httpRequest = $ actionRequest -> getHttpRequest ( ) ; if ( $ httpRequest -> getMethod ( ) !== 'POST' ) { return ; } $ arguments = $ actionRequest -> getInternalArguments ( ) ; $ username = ObjectAccess :: getPropertyPath ( $ arguments , '__authenti... | Updates the username and password credentials from the POST vars if the POST parameters are available . Sets the authentication status to REAUTHENTICATION_NEEDED if credentials have been sent . |
59,097 | public function getFraction ( $ currencyCode ) { if ( array_key_exists ( $ currencyCode , $ this -> fractions ) ) { return $ this -> fractions [ $ currencyCode ] ; } return $ this -> fractions [ 'DEFAULT' ] ; } | Returns an array with keys digits and rounding each an integer . |
59,098 | protected function generateFractions ( ) { $ model = $ this -> cldrRepository -> getModel ( 'supplemental/supplementalData' ) ; $ currencyData = $ model -> getRawArray ( 'currencyData' ) ; foreach ( $ currencyData [ 'fractions' ] as $ fractionString ) { $ currencyCode = $ model -> getAttributeValue ( $ fractionString ,... | Generates an internal representation of currency fractions which can be found in supplementalData . xml CLDR file . |
59,099 | public function validate ( $ value ) { $ validators = $ this -> getValidators ( ) ; if ( $ validators -> count ( ) > 0 ) { $ result = null ; foreach ( $ validators as $ validator ) { if ( $ result === null ) { $ result = $ validator -> validate ( $ value ) ; } else { $ result -> merge ( $ validator -> validate ( $ valu... | Checks if the given value is valid according to the validators of the conjunction . Every validator has to be valid to make the whole conjunction valid . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.