idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
56,500 | protected function getEventDispatcher ( IContainer $ container ) : IEventDispatcher { $ eventRegistry = new EventRegistry ( ) ; foreach ( $ this -> getEventListenerConfig ( ) as $ eventName => $ listeners ) { foreach ( ( array ) $ listeners as $ listener ) { $ eventRegistry -> registerListener ( $ eventName , $ this ->... | Gets the event dispatcher |
56,501 | protected function getEventListenerCallback ( $ listenerConfig , IContainer $ container ) : callable { if ( is_callable ( $ listenerConfig ) ) { return $ listenerConfig ; } if ( is_string ( $ listenerConfig ) ) { if ( strpos ( $ listenerConfig , '@' ) === false ) { throw new InvalidArgumentException ( "Listener data \"... | Gets a callback for an event listener from a config |
56,502 | public static function createFromString ( string $ token ) : SignedJwt { $ segments = explode ( '.' , $ token ) ; if ( count ( $ segments ) !== 3 ) { throw new InvalidArgumentException ( 'Token did not contain 3 segments' ) ; } list ( $ encodedHeader , $ encodedPayload , $ encodedSignature ) = $ segments ; $ decodedHea... | Creates a signed JWT from a raw string |
56,503 | public static function createFromUnsignedJwt ( UnsignedJwt $ unsignedJwt , string $ signature ) : SignedJwt { return new self ( $ unsignedJwt -> getHeader ( ) , $ unsignedJwt -> getPayload ( ) , $ signature ) ; } | Creates a signed JWT from an unsigned JWT and signature |
56,504 | public function encode ( ) : string { $ segments = [ $ this -> header -> encode ( ) , $ this -> payload -> encode ( ) , self :: base64UrlEncode ( $ this -> signature ) ] ; return implode ( '.' , $ segments ) ; } | Encodes this token as a string |
56,505 | public function addConditionToClause ( array $ clauseConditions , string $ operation , string ... $ conditions ) : array { foreach ( $ conditions as $ condition ) { $ clauseConditions [ ] = [ 'operation' => $ operation , 'condition' => $ condition ] ; } return $ clauseConditions ; } | Adds a condition to a clause |
56,506 | public function getClauseConditionSql ( string $ conditionType , array $ clauseConditions ) : string { if ( count ( $ clauseConditions ) === 0 ) { return '' ; } $ sql = ' ' . strtoupper ( $ conditionType ) ; $ haveAddedAClause = false ; foreach ( $ clauseConditions as $ conditionData ) { $ sql .= ( $ haveAddedAClause ?... | Gets the SQL that makes up a clause that permits boolean operations ie AND and OR |
56,507 | public function getHashKey ( $ value ) : string { if ( is_string ( $ value ) ) { return "__opulence:s:$value" ; } if ( is_int ( $ value ) ) { return "__opulence:i:$value" ; } if ( is_float ( $ value ) ) { return "__opulence:f:$value" ; } if ( is_object ( $ value ) ) { if ( method_exists ( $ value , '__toString' ) ) { r... | Gets the hash key for a value |
56,508 | public function between ( $ min , $ max , bool $ isInclusive = true ) : self { $ this -> createRule ( BetweenRule :: class , [ $ min , $ max , $ isInclusive ] ) ; return $ this ; } | Marks a field as having to be between values |
56,509 | public function condition ( $ callback ) : self { if ( $ this -> inCondition ) { throw new LogicException ( 'Cannot nest rule conditions' ) ; } $ this -> createRule ( ConditionalRule :: class , [ $ callback ] ) ; $ this -> inCondition = true ; return $ this ; } | Specifies conditions that must be met for certain rules to be set |
56,510 | public function getErrors ( string $ field ) : array { $ compiledErrors = [ ] ; foreach ( $ this -> errorSlugsAndPlaceholders as $ errorData ) { $ compiledErrors [ ] = $ this -> errorTemplateCompiler -> compile ( $ field , $ this -> errorTemplateRegistry -> getErrorTemplate ( $ field , $ errorData [ 'slug' ] ) , $ erro... | Gets the error messages |
56,511 | public function max ( $ max , bool $ isInclusive = true ) : self { $ this -> createRule ( MaxRule :: class , [ $ max , $ isInclusive ] ) ; return $ this ; } | Marks a field as having a maximum acceptable value |
56,512 | public function min ( $ min , bool $ isInclusive = true ) : self { $ this -> createRule ( MinRule :: class , [ $ min , $ isInclusive ] ) ; return $ this ; } | Marks a field as having a minimum acceptable value |
56,513 | public function pass ( $ value , array $ allValues = [ ] , bool $ haltFieldValidationOnFailure = false ) : bool { $ this -> errorSlugsAndPlaceholders = [ ] ; $ passes = true ; foreach ( $ this -> rules as $ rule ) { if ( ! $ this -> isRequired ) { if ( $ value === null || ( is_string ( $ value ) && $ value === '' ) || ... | Gets whether or not all the rules pass |
56,514 | protected function addRule ( IRule $ rule ) { if ( $ this -> inCondition ) { $ lastRule = $ this -> rules [ count ( $ this -> rules ) - 1 ] ; $ lastRule -> addRule ( $ rule ) ; } else { $ this -> rules [ ] = $ rule ; } } | Adds a rule to the list |
56,515 | protected function createRule ( string $ className , array $ args = [ ] ) { if ( ! class_exists ( $ className ) ) { throw new InvalidArgumentException ( "Class \"$className\" does not exist" ) ; } $ rule = new $ className ; if ( $ rule instanceof IRuleWithArgs ) { $ rule -> setArgs ( $ args ) ; } $ this -> addRule ( $ ... | Adds a rule with the input name and arguments |
56,516 | protected function getDefaultResponseContent ( Exception $ ex , int $ statusCode ) : string { if ( $ this -> inDevelopmentEnvironment ) { $ content = $ this -> getDevelopmentEnvironmentContent ( $ ex , $ statusCode ) ; } else { $ content = $ this -> getProductionEnvironmentContent ( $ ex , $ statusCode ) ; } return $ c... | Gets the default response content |
56,517 | protected function getDevelopmentEnvironmentContent ( Exception $ ex , int $ statusCode ) : string { ob_start ( ) ; if ( $ statusCode === 503 ) { require __DIR__ . "/templates/{$this->getRequestFormat()}/MaintenanceMode.php" ; } else { require __DIR__ . "/templates/{$this->getRequestFormat()}/DevelopmentException.php" ... | Gets the page contents for the default production exception page |
56,518 | protected function getResponseContent ( $ ex , int $ statusCode , array $ headers ) : string { return $ this -> getDefaultResponseContent ( $ ex , $ statusCode ) ; } | Gets the content for the response |
56,519 | public function shutDown ( callable $ shutdownTask = null ) { $ taskReturnValue = null ; if ( $ this -> isRunning ) { try { $ this -> taskDispatcher -> dispatch ( TaskTypes :: PRE_SHUTDOWN ) ; $ this -> isRunning = false ; if ( $ shutdownTask !== null ) { $ taskReturnValue = $ shutdownTask ( ) ; } $ this -> taskDispatc... | Shuts down this application |
56,520 | public function start ( callable $ startTask = null ) { $ taskReturnValue = null ; if ( ! $ this -> isRunning ) { try { $ this -> taskDispatcher -> dispatch ( TaskTypes :: PRE_START ) ; $ this -> isRunning = true ; if ( $ startTask !== null ) { $ taskReturnValue = $ startTask ( ) ; } $ this -> taskDispatcher -> dispatc... | Starts this application |
56,521 | public function addUsing ( string ... $ expression ) : self { $ this -> usingExpressions = array_merge ( $ this -> usingExpressions , $ expression ) ; return $ this ; } | Adds to a USING expression |
56,522 | private function createConditionExpressions ( array $ conditions ) : array { $ conditionExpressions = [ ] ; foreach ( $ conditions as $ condition ) { if ( $ condition instanceof ICondition ) { $ this -> addUnnamedPlaceholderValues ( $ condition -> getParameters ( ) ) ; $ conditionExpressions [ ] = $ condition -> getSql... | Converts a list of condition strings or objects to their string representations |
56,523 | public function add ( ParsedRoute $ route ) { foreach ( $ route -> getMethods ( ) as $ method ) { $ this -> routes [ $ method ] [ ] = $ route ; if ( ! empty ( $ route -> getName ( ) ) ) { $ this -> namedRoutes [ $ route -> getName ( ) ] = & $ route ; } } } | Adds a route to the collection |
56,524 | public function get ( string $ method = null ) : array { if ( $ method === null ) { return $ this -> routes ; } elseif ( isset ( $ this -> routes [ $ method ] ) ) { return $ this -> routes [ $ method ] ; } else { return [ ] ; } } | Gets all the routes |
56,525 | public function addUpdateColumnValues ( array $ columnNamesToValues ) : self { $ this -> duplicateKeyUpdateColumnNamesToValues = array_merge ( $ this -> duplicateKeyUpdateColumnNamesToValues , $ columnNamesToValues ) ; return $ this ; } | Adds columns to update in the case a row already exists in the table |
56,526 | public function addNamedPlaceholderValue ( string $ placeholderName , $ value , int $ dataType = PDO :: PARAM_STR ) : self { if ( $ this -> usingUnnamedPlaceholders === true ) { throw new InvalidQueryException ( 'Cannot mix unnamed placeholders with named placeholders' ) ; } $ this -> usingUnnamedPlaceholders = false ;... | Adds a named placeholder s value Note that you cannot use a mix of named and unnamed placeholders in a query |
56,527 | public function addNamedPlaceholderValues ( array $ placeholderNamesToValues ) : self { foreach ( $ placeholderNamesToValues as $ placeholderName => $ value ) { if ( is_array ( $ value ) ) { if ( count ( $ value ) !== 2 ) { throw new InvalidQueryException ( 'Incorrect number of items in value array' ) ; } $ this -> add... | Adds named placeholders values Note that you cannot use a mix of named and unnamed placeholders in a query |
56,528 | public function addUnnamedPlaceholderValue ( $ value , int $ dataType = PDO :: PARAM_STR ) : self { if ( $ this -> usingUnnamedPlaceholders === false ) { throw new InvalidQueryException ( 'Cannot mix unnamed placeholders with named placeholders' ) ; } $ this -> usingUnnamedPlaceholders = true ; $ this -> parameters [ ]... | Adds an unnamed placeholder s value Note that you cannot use a mix of named and unnamed placeholders in a query |
56,529 | public function addUnnamedPlaceholderValues ( array $ placeholderValues ) : self { foreach ( $ placeholderValues as $ value ) { if ( is_array ( $ value ) ) { if ( count ( $ value ) !== 2 ) { throw new InvalidQueryException ( 'Incorrect number of items in value array' ) ; } $ this -> addUnnamedPlaceholderValue ( $ value... | Adds multiple unnamed placeholders values Note that you cannot use a mix of named and unnamed placeholders in a query |
56,530 | public function removeNamedPlaceHolder ( string $ placeholderName ) : self { if ( $ this -> usingUnnamedPlaceholders === true ) { throw new InvalidQueryException ( 'Cannot mix unnamed placeholders with named placeholders' ) ; } unset ( $ this -> parameters [ $ placeholderName ] ) ; return $ this ; } | Removes a named placeholder from the query |
56,531 | public function removeUnnamedPlaceHolder ( int $ placeholderIndex ) : self { if ( $ this -> usingUnnamedPlaceholders === false ) { throw new InvalidQueryException ( 'Cannot mix unnamed placeholders with named placeholders' ) ; } unset ( $ this -> parameters [ $ placeholderIndex ] ) ; $ this -> parameters = array_values... | Removes an unnamed placeholder from the query |
56,532 | protected function setTable ( string $ tableName , string $ tableAlias = '' ) { $ this -> tableName = $ tableName ; $ this -> tableAlias = $ tableAlias ; } | Sets the table we re querying |
56,533 | public function getPathVar ( string $ name ) { if ( isset ( $ this -> pathVars [ $ name ] ) ) { return $ this -> pathVars [ $ name ] ; } return null ; } | Gets the value of a path variable |
56,534 | public function getErrorTemplate ( string $ field , string $ ruleSlug ) : string { if ( isset ( $ this -> fieldTemplates [ $ field ] [ $ ruleSlug ] ) ) { return $ this -> fieldTemplates [ $ field ] [ $ ruleSlug ] ; } if ( isset ( $ this -> globalTemplates [ $ ruleSlug ] ) ) { return $ this -> globalTemplates [ $ ruleSl... | Gets the error template for a field and rule |
56,535 | public function registerErrorTemplatesFromConfig ( array $ config ) { foreach ( $ config as $ key => $ template ) { if ( trim ( $ key ) === '' ) { throw new InvalidArgumentException ( 'Error template config key cannot be empty' ) ; } if ( mb_strpos ( $ key , '.' ) === false ) { $ this -> registerGlobalErrorTemplate ( $... | Registers error templates from a config array |
56,536 | public function registerFieldErrorTemplate ( string $ field , string $ ruleSlug , string $ template ) { if ( ! isset ( $ this -> fieldTemplates [ $ field ] ) ) { $ this -> fieldTemplates [ $ field ] = [ ] ; } $ this -> fieldTemplates [ $ field ] [ $ ruleSlug ] = $ template ; } | Registers an error template for a specific field and rule |
56,537 | private function compareCacheAndSqlEntities ( bool $ doRefresh ) : array { $ unkeyedCacheEntities = $ this -> cacheDataMapper -> getAll ( ) ; if ( $ unkeyedCacheEntities === null ) { $ unkeyedCacheEntities = [ ] ; } $ cacheEntities = $ this -> keyEntityArray ( $ unkeyedCacheEntities ) ; $ sqlEntities = $ this -> keyEnt... | Does the comparison of entities in cache to entities in the SQL database Also performs refresh if the user chooses to do so |
56,538 | private function keyEntityArray ( array $ entities ) : array { $ keyedArray = [ ] ; foreach ( $ entities as $ entity ) { $ keyedArray [ $ this -> idAccessorRegistry -> getEntityId ( $ entity ) ] = $ entity ; } return $ keyedArray ; } | Converts a list of entities to a keyed array of those entities The keys are the entity Ids |
56,539 | protected function compile ( string $ templateContents , string $ fullyQualifiedClassName ) : string { $ explodedClass = explode ( '\\' , $ fullyQualifiedClassName ) ; $ namespace = implode ( '\\' , array_slice ( $ explodedClass , 0 , - 1 ) ) ; $ className = end ( $ explodedClass ) ; $ compiledTemplate = str_replace ( ... | Compiles a template |
56,540 | protected function makeDirectories ( string $ path ) { $ directoryName = dirname ( $ path ) ; if ( ! $ this -> fileSystem -> isDirectory ( $ directoryName ) ) { $ this -> fileSystem -> makeDirectory ( $ directoryName , 0777 , true ) ; } } | Makes the necessary directories for a class |
56,541 | public function bindValues ( array $ values ) { $ isAssociativeArray = count ( array_filter ( array_keys ( $ values ) , 'is_string' ) ) > 0 ; foreach ( $ values as $ parameterName => $ value ) { if ( ! is_array ( $ value ) ) { $ value = [ $ value , PDO :: PARAM_STR ] ; } if ( ! $ isAssociativeArray ) { ++ $ parameterNa... | Binds a list of values to the statement |
56,542 | protected function getExecutedMigrationRepository ( IContainer $ container ) : IExecutedMigrationRepository { $ driverClass = getenv ( 'DB_DRIVER' ) ? : PostgreSqlDriver :: class ; switch ( $ driverClass ) { case MySqlDriver :: class : $ queryBuilder = new MySqlQueryBuilder ( ) ; $ container -> bindInstance ( MySqlQuer... | Gets the executed migration repository to use in the migrator |
56,543 | protected function createTableIfDoesNotExist ( ) : void { switch ( get_class ( $ this -> queryBuilder ) ) { case MySqlQueryBuilder :: class : $ sql = 'CREATE TABLE IF NOT EXISTS ' . $ this -> tableName . ' (migration varchar(255), dateran timestamp NOT NULL, PRIMARY KEY (migration));' ; break ; case PostgreSqlQueryBuil... | Creates the table that the migrations are stored in |
56,544 | public function format ( ICommand $ command ) : string { $ text = $ command -> getName ( ) . ' ' ; foreach ( $ command -> getOptions ( ) as $ option ) { $ text .= $ this -> formatOption ( $ option ) . ' ' ; } $ requiredArguments = [ ] ; $ optionalArguments = [ ] ; $ arrayArgument = null ; foreach ( $ command -> getArgu... | Gets the command as text |
56,545 | private function formatArrayArgument ( Argument $ argument ) : string { $ arrayArgumentTextOne = $ argument -> getName ( ) . '1' ; $ arrayArgumentTextN = $ argument -> getName ( ) . 'N' ; if ( $ argument -> isOptional ( ) ) { $ arrayArgumentTextOne = "[$arrayArgumentTextOne]" ; $ arrayArgumentTextN = "[$arrayArgumentTe... | Formats an array argument |
56,546 | private function formatOption ( Option $ option ) : string { $ text = "[--{$option->getName()}" ; if ( $ option -> valueIsOptional ( ) ) { $ text .= '=' . $ option -> getDefaultValue ( ) ; } if ( $ option -> getShortName ( ) !== null ) { $ text .= "|-{$option->getShortName()}" ; } $ text .= ']' ; return $ text ; } | Formats an option |
56,547 | private function callController ( $ controller , CompiledRoute $ route ) : Response { if ( is_callable ( $ controller ) ) { try { $ reflection = new ReflectionFunction ( $ controller ) ; } catch ( \ ReflectionException $ e ) { throw new RouteException ( "Function {$controller} does not exist" ) ; } $ parameters = $ thi... | Calls the method on the input controller |
56,548 | private function resolveController ( string $ controllerName , Request $ request ) { if ( ! class_exists ( $ controllerName ) ) { throw new RouteException ( "Controller class $controllerName does not exist" ) ; } $ controller = $ this -> dependencyResolver -> resolve ( $ controllerName ) ; if ( $ controller instanceof ... | Creates an instance of the input controller |
56,549 | private function resolveControllerParameters ( array $ reflectionParameters , array $ pathVars , CompiledRoute $ route , bool $ acceptObjectParameters ) : array { $ resolvedParameters = [ ] ; foreach ( $ reflectionParameters as $ parameter ) { if ( $ acceptObjectParameters && $ parameter -> getClass ( ) !== null ) { $ ... | Gets the resolved parameters for a controller |
56,550 | private function resolveMiddleware ( array $ middleware ) : array { $ resolvedMiddleware = [ ] ; foreach ( $ middleware as $ singleMiddleware ) { if ( $ singleMiddleware instanceof MiddlewareParameters ) { $ tempMiddleware = $ this -> dependencyResolver -> resolve ( $ singleMiddleware -> getMiddlewareClassName ( ) ) ; ... | Resolves the list of middleware |
56,551 | private function getCompiledViewPaths ( string $ path ) : array { if ( ! is_dir ( $ path ) ) { return [ ] ; } $ files = [ ] ; $ iter = new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( $ path , RecursiveDirectoryIterator :: SKIP_DOTS ) , RecursiveIteratorIterator :: SELF_FIRST , RecursiveIteratorIterator... | Gets a list of view file paths that appear |
56,552 | private function getViewPath ( IView $ view , bool $ checkVars ) : string { $ data = [ 'u' => $ view -> getContents ( ) ] ; if ( $ checkVars ) { $ data [ 'v' ] = $ view -> getVars ( ) ; } return $ this -> path . '/' . md5 ( http_build_query ( $ data ) ) ; } | Gets path to cached view |
56,553 | private function isExpired ( string $ viewPath ) : bool { $ lastModified = DateTime :: createFromFormat ( 'U' , filemtime ( $ viewPath ) ) ; return $ lastModified < new DateTime ( '-' . $ this -> lifetime . ' seconds' ) ; } | Checks whether or not a view path is expired |
56,554 | private function getCommandText ( ) : string { if ( count ( $ this -> commandCollection -> getAll ( ) ) === 0 ) { return ' <info>No commands</info>' ; } $ sort = function ( $ a , $ b ) { if ( strpos ( $ a -> getName ( ) , ':' ) === false ) { if ( strpos ( $ b -> getName ( ) , ':' ) === false ) { return $ a -> getName ... | Converts commands to text |
56,555 | protected function startSession ( Request $ request ) { $ this -> gc ( ) ; $ this -> session -> setId ( $ request -> getCookies ( ) -> get ( $ this -> session -> getName ( ) ) ) ; $ this -> sessionHandler -> open ( null , $ this -> session -> getName ( ) ) ; $ sessionVars = @ unserialize ( $ this -> sessionHandler -> r... | Starts the session |
56,556 | protected function writeSession ( Response $ response ) { $ this -> session -> ageFlashData ( ) ; $ this -> sessionHandler -> write ( $ this -> session -> getId ( ) , serialize ( $ this -> session -> getAll ( ) ) ) ; $ this -> writeToResponse ( $ response ) ; } | Writes the session data to the response |
56,557 | public function getRule ( string $ ruleName ) : IRule { if ( ! $ this -> hasRule ( $ ruleName ) ) { throw new InvalidArgumentException ( "No rule extension with name \"$ruleName\" found" ) ; } return $ this -> extensions [ $ ruleName ] ; } | Gets the rule extension with the input name |
56,558 | public function registerRuleExtension ( $ rule , string $ slug = '' ) { if ( $ rule instanceof IRule ) { $ slug = $ rule -> getSlug ( ) ; } if ( is_callable ( $ rule ) ) { $ callback = $ rule ; $ rule = new CallbackRule ( ) ; $ rule -> setArgs ( [ $ callback ] ) ; } if ( ! $ rule instanceof IRule ) { throw new InvalidA... | Registers a rule extension |
56,559 | protected function addBinding ( string $ interface , IBinding $ binding ) { if ( ! isset ( $ this -> bindings [ $ this -> currentTarget ] ) ) { $ this -> bindings [ $ this -> currentTarget ] = [ ] ; } $ this -> bindings [ $ this -> currentTarget ] [ $ interface ] = $ binding ; } | Adds a binding to an interface |
56,560 | protected function getBinding ( string $ interface ) { if ( $ this -> currentTarget !== self :: $ emptyTarget && isset ( $ this -> bindings [ $ this -> currentTarget ] [ $ interface ] ) ) { return $ this -> bindings [ $ this -> currentTarget ] [ $ interface ] ; } if ( isset ( $ this -> bindings [ self :: $ emptyTarget ... | Gets a binding for an interface |
56,561 | protected function hasTargetedBinding ( string $ interface , string $ target = null ) : bool { return isset ( $ this -> bindings [ $ target ] [ $ interface ] ) ; } | Gets whether or not a targeted binding exists |
56,562 | protected function resolveClass ( string $ class , array $ primitives = [ ] ) { try { if ( isset ( $ this -> constructorReflectionCache [ $ class ] ) ) { list ( $ constructor , $ parameters ) = $ this -> constructorReflectionCache [ $ class ] ; } else { $ reflectionClass = new ReflectionClass ( $ class ) ; if ( ! $ ref... | Resolves a class |
56,563 | protected function resolveParameters ( $ class , array $ unresolvedParameters , array $ primitives ) : array { $ resolvedParameters = [ ] ; foreach ( $ unresolvedParameters as $ parameter ) { $ resolvedParameter = null ; if ( $ parameter -> getClass ( ) === null ) { $ resolvedParameter = $ this -> resolvePrimitive ( $ ... | Resolves a list of parameters for a function call |
56,564 | protected function resolvePrimitive ( ReflectionParameter $ parameter , array & $ primitives ) { if ( count ( $ primitives ) > 0 ) { return array_shift ( $ primitives ) ; } if ( $ parameter -> isDefaultValueAvailable ( ) ) { return $ parameter -> getDefaultValue ( ) ; } throw new IocException ( sprintf ( 'No default va... | Resolves a primitive parameter |
56,565 | public function addGroupBy ( string ... $ expression ) : self { $ this -> groupByClauses = array_merge ( $ this -> groupByClauses , $ expression ) ; return $ this ; } | Adds to a GROUP BY clause |
56,566 | public function addOrderBy ( string ... $ expression ) : self { $ this -> orderBy = array_merge ( $ this -> orderBy , $ expression ) ; return $ this ; } | Adds to a ORDER BY clause |
56,567 | public function addSelectExpression ( string ... $ expression ) : self { $ this -> selectExpressions = array_merge ( $ this -> selectExpressions , $ expression ) ; return $ this ; } | Adds more select expressions |
56,568 | public function andHaving ( ... $ conditions ) : self { $ this -> havingConditions = $ this -> conditionalQueryBuilder -> addConditionToClause ( $ this -> havingConditions , 'AND' , ... $ this -> createConditionExpressions ( $ conditions ) ) ; return $ this ; } | Adds to a HAVING condition that will be AND ed with other conditions |
56,569 | public function from ( string $ tableName , string $ tableAlias = '' ) : self { $ this -> setTable ( $ tableName , $ tableAlias ) ; return $ this ; } | Specifies which table we re selecting from |
56,570 | public function having ( ... $ conditions ) : self { $ this -> havingConditions = [ ] ; $ this -> havingConditions = $ this -> conditionalQueryBuilder -> addConditionToClause ( $ this -> havingConditions , 'AND' , ... $ this -> createConditionExpressions ( $ conditions ) ) ; return $ this ; } | Starts a HAVING condition Only call this method once per query because it will overwrite any previously - set HAVING expressions |
56,571 | public function innerJoin ( string $ tableName , string $ tableAlias , string $ condition ) : self { $ this -> joins [ 'inner' ] [ ] = [ 'tableName' => $ tableName , 'tableAlias' => $ tableAlias , 'condition' => $ condition ] ; return $ this ; } | Adds a inner join to the query |
56,572 | public function join ( string $ tableName , string $ tableAlias , string $ condition ) : self { return $ this -> innerJoin ( $ tableName , $ tableAlias , $ condition ) ; } | Adds a join to the query This is the same thing as an inner join |
56,573 | public function leftJoin ( string $ tableName , string $ tableAlias , string $ condition ) : self { $ this -> joins [ 'left' ] [ ] = [ 'tableName' => $ tableName , 'tableAlias' => $ tableAlias , 'condition' => $ condition ] ; return $ this ; } | Adds a left join to the query |
56,574 | public function orHaving ( ... $ conditions ) : self { $ this -> havingConditions = $ this -> conditionalQueryBuilder -> addConditionToClause ( $ this -> havingConditions , 'OR' , ... $ this -> createConditionExpressions ( $ conditions ) ) ; return $ this ; } | Adds to a HAVING condition that will be OR ed with other conditions |
56,575 | public function rightJoin ( string $ tableName , string $ tableAlias , string $ condition ) : self { $ this -> joins [ 'right' ] [ ] = [ 'tableName' => $ tableName , 'tableAlias' => $ tableAlias , 'condition' => $ condition ] ; return $ this ; } | Adds a right join to the query |
56,576 | private function dispatchEagerly ( array $ bootstrapperClasses , bool $ run ) { foreach ( $ bootstrapperClasses as $ bootstrapperClass ) { $ bootstrapper = $ this -> bootstrapperResolver -> resolve ( $ bootstrapperClass ) ; $ this -> bootstrapperObjects [ ] = $ bootstrapper ; $ bootstrapper -> registerBindings ( $ this... | Dispatches the registry eagerly |
56,577 | private function dispatchLazily ( array $ boundClassesToBindingData , bool $ run ) { foreach ( $ boundClassesToBindingData as $ boundClass => $ bindingData ) { $ bootstrapperClass = $ bindingData [ 'bootstrapper' ] ; $ target = $ bindingData [ 'target' ] ; $ factory = function ( ) use ( $ boundClass , $ bootstrapperCla... | Dispatches the registry lazily |
56,578 | public function fromMemcachedTimestamp ( $ timestamp ) : DateTime { $ date = DateTime :: createFromFormat ( 'U' , $ timestamp ) ; $ date -> setTimezone ( new DateTimeZone ( date_default_timezone_get ( ) ) ) ; return $ date ; } | Converts a Memcached Unix timestamp to a PHP timestamp |
56,579 | private function getOpenSslAlgorithm ( string $ algorithm ) : int { switch ( $ algorithm ) { case Algorithms :: RSA_SHA256 : return OPENSSL_ALGO_SHA256 ; case Algorithms :: RSA_SHA384 : return OPENSSL_ALGO_SHA384 ; case Algorithms :: RSA_SHA512 : return OPENSSL_ALGO_SHA512 ; default : throw new InvalidArgumentException... | Gets the OpenSSL Id for a algorithm |
56,580 | public function addReturning ( string ... $ expression ) : self { $ this -> returningExpressions = array_merge ( $ this -> returningExpressions , $ expression ) ; return $ this ; } | Adds to a RETURNING clause |
56,581 | private function flushBootstrapperCache ( IResponse $ response ) { $ this -> httpBootstrapperCache -> flush ( ) ; $ this -> consoleBootstrapperCache -> flush ( ) ; $ response -> writeln ( '<info>Bootstrapper cache flushed</info>' ) ; } | Flushes the bootstrapper cache |
56,582 | private function flushRouteCache ( IResponse $ response ) { if ( ( $ path = Config :: get ( 'paths' , 'routes.cache' ) ) !== null ) { $ this -> routeCache -> flush ( "$path/" . RouteCache :: DEFAULT_CACHED_ROUTES_FILE_NAME ) ; } $ response -> writeln ( '<info>Route cache flushed</info>' ) ; } | Flushes the route cache |
56,583 | public function handle ( Request $ request ) : Response { try { return ( new Pipeline ) -> send ( $ request ) -> through ( $ this -> convertMiddlewareToPipelineStages ( $ this -> getMiddleware ( ) ) , 'handle' ) -> then ( function ( $ request ) { return $ this -> router -> route ( $ request ) ; } ) -> execute ( ) ; } c... | Handles an HTTP request |
56,584 | protected function convertMiddlewareToPipelineStages ( array $ middleware ) : array { $ stages = [ ] ; foreach ( $ middleware as $ singleMiddleware ) { if ( $ singleMiddleware instanceof MiddlewareParameters ) { $ tempMiddleware = $ this -> container -> resolve ( $ singleMiddleware -> getMiddlewareClassName ( ) ) ; $ t... | Converts middleware to pipeline stages |
56,585 | private function setExceptionRendererVars ( Request $ request ) { $ this -> exceptionRenderer -> setRequest ( $ request ) ; if ( $ this -> container -> hasBinding ( ICompiler :: class ) ) { $ this -> exceptionRenderer -> setViewCompiler ( $ this -> container -> resolve ( ICompiler :: class ) ) ; } if ( $ this -> contai... | Sets the variables in the exception renderer |
56,586 | public function addRoute ( Route $ route ) : ParsedRoute { $ route = $ this -> applyGroupSettings ( $ route ) ; $ parsedRoute = $ this -> parser -> parse ( $ route ) ; $ this -> routeCollection -> add ( $ parsedRoute ) ; return $ parsedRoute ; } | Adds a route to the router |
56,587 | public function any ( string $ path , $ controller , array $ options = [ ] ) : array { return $ this -> multiple ( RouteCollection :: getMethods ( ) , $ path , $ controller , $ options ) ; } | Adds a route for the any method at the given path |
56,588 | public function delete ( string $ path , $ controller , array $ options = [ ] ) : ParsedRoute { $ route = $ this -> createRoute ( RequestMethods :: DELETE , $ path , $ controller , $ options ) ; return $ this -> addRoute ( $ route ) ; } | Adds a route for the DELETE method at the given path |
56,589 | public function get ( string $ path , $ controller , array $ options = [ ] ) : ParsedRoute { $ route = $ this -> createRoute ( RequestMethods :: GET , $ path , $ controller , $ options ) ; return $ this -> addRoute ( $ route ) ; } | Adds a route for the GET method at the given path |
56,590 | public function group ( array $ options , callable $ callback ) { array_push ( $ this -> groupOptionsStack , $ options ) ; $ callback ( $ this ) ; array_pop ( $ this -> groupOptionsStack ) ; } | Groups similar routes together so that you don t have to repeat route options |
56,591 | public function head ( string $ path , $ controller , array $ options = [ ] ) : ParsedRoute { $ route = $ this -> createRoute ( RequestMethods :: HEAD , $ path , $ controller , $ options ) ; return $ this -> addRoute ( $ route ) ; } | Adds a route for the HEAD method at the given path |
56,592 | public function multiple ( array $ methods , string $ path , $ controller , array $ options = [ ] ) : array { $ routes = [ ] ; foreach ( $ methods as $ method ) { $ route = $ this -> createRoute ( $ method , $ path , $ controller , $ options ) ; $ parsedRoute = $ this -> addRoute ( $ route ) ; $ routes [ ] = $ parsedRo... | Adds a route for multiple methods |
56,593 | public function options ( string $ path , $ controller , array $ options = [ ] ) : ParsedRoute { $ route = $ this -> createRoute ( RequestMethods :: OPTIONS , $ path , $ controller , $ options ) ; return $ this -> addRoute ( $ route ) ; } | Adds a route for the OPTIONS method at the given path |
56,594 | public function patch ( string $ path , $ controller , array $ options = [ ] ) : ParsedRoute { $ route = $ this -> createRoute ( RequestMethods :: PATCH , $ path , $ controller , $ options ) ; return $ this -> addRoute ( $ route ) ; } | Adds a route for the PATCH method at the given path |
56,595 | public function post ( string $ path , $ controller , array $ options = [ ] ) : ParsedRoute { $ route = $ this -> createRoute ( RequestMethods :: POST , $ path , $ controller , $ options ) ; return $ this -> addRoute ( $ route ) ; } | Adds a route for the POST method at the given path |
56,596 | public function put ( string $ path , $ controller , array $ options = [ ] ) : ParsedRoute { $ route = $ this -> createRoute ( RequestMethods :: PUT , $ path , $ controller , $ options ) ; return $ this -> addRoute ( $ route ) ; } | Adds a route for the PUT method at the given path |
56,597 | public function route ( Request $ request ) : Response { $ method = $ request -> getMethod ( ) ; foreach ( $ this -> routeCollection -> get ( $ method ) as $ route ) { $ compiledRoute = $ this -> compiler -> compile ( $ route , $ request ) ; if ( $ compiledRoute -> isMatch ( ) ) { $ this -> matchedRoute = $ compiledRou... | Routes a request |
56,598 | private function applyGroupSettings ( Route $ route ) : Route { $ route -> setRawPath ( $ this -> getGroupPath ( ) . $ route -> getRawPath ( ) ) ; $ route -> setRawHost ( $ this -> getGroupHost ( ) . $ route -> getRawHost ( ) ) ; if ( ! $ route -> usesCallable ( ) ) { $ route -> setControllerName ( $ this -> getGroupCo... | Applies any group settings to a route |
56,599 | private function createRoute ( string $ method , string $ path , $ controller , array $ options = [ ] ) : Route { return new Route ( [ $ method ] , $ path , $ controller , $ options ) ; } | Creates a route from the input |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.