idx
int64
0
60.3k
question
stringlengths
101
6.21k
target
stringlengths
7
803
12,900
protected function getTaskActions ( ) { if ( ! $ this -> _taskActions ) { $ this -> _taskActions = new TaskActionsList ( $ this -> version , $ this -> solution [ 'assistantSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _taskActions ; }
Access the taskActions
12,901
public function request ( $ method , $ uri , $ params = array ( ) , $ data = array ( ) , $ headers = array ( ) , $ user = null , $ password = null , $ timeout = null ) { $ url = $ this -> absoluteUrl ( $ uri ) ; return $ this -> client -> request ( $ method , $ url , $ params , $ data , $ headers , $ user , $ password , $ timeout ) ; }
Make an HTTP request to the domain
12,902
private function buildElement ( $ twiml , $ document ) { $ element = $ document -> createElement ( $ twiml -> name ) ; foreach ( $ twiml -> attributes as $ name => $ value ) { if ( is_bool ( $ value ) ) { $ value = ( $ value === true ) ? 'true' : 'false' ; } $ element -> setAttribute ( $ name , $ value ) ; } foreach ( $ twiml -> children as $ child ) { if ( is_string ( $ child ) ) { $ element -> appendChild ( $ document -> createTextNode ( $ child ) ) ; } else { $ element -> appendChild ( $ this -> buildElement ( $ child , $ document ) ) ; } } return $ element ; }
Build TwiML element .
12,903
private function xml ( ) { $ document = new DOMDocument ( '1.0' , 'UTF-8' ) ; $ document -> appendChild ( $ this -> buildElement ( $ this , $ document ) ) ; return $ document ; }
Build XML element .
12,904
public function create ( $ customerName , $ street , $ city , $ region , $ postalCode , $ isoCountry , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'CustomerName' => $ customerName , 'Street' => $ street , 'City' => $ city , 'Region' => $ region , 'PostalCode' => $ postalCode , 'IsoCountry' => $ isoCountry , 'FriendlyName' => $ options [ 'friendlyName' ] , 'EmergencyEnabled' => Serialize :: booleanToString ( $ options [ 'emergencyEnabled' ] ) , 'AutoCorrectAddress' => Serialize :: booleanToString ( $ options [ 'autoCorrectAddress' ] ) , ) ) ; $ payload = $ this -> version -> create ( 'POST' , $ this -> uri , array ( ) , $ data ) ; return new AddressInstance ( $ this -> version , $ payload , $ this -> solution [ 'accountSid' ] ) ; }
Create a new AddressInstance
12,905
protected function getInteractions ( ) { if ( ! $ this -> _interactions ) { $ this -> _interactions = new InteractionList ( $ this -> version , $ this -> solution [ 'serviceSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _interactions ; }
Access the interactions
12,906
protected function getParticipants ( ) { if ( ! $ this -> _participants ) { $ this -> _participants = new ParticipantList ( $ this -> version , $ this -> solution [ 'serviceSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _participants ; }
Access the participants
12,907
protected function getEngagementContext ( ) { if ( ! $ this -> _engagementContext ) { $ this -> _engagementContext = new EngagementContextList ( $ this -> version , $ this -> solution [ 'flowSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _engagementContext ; }
Access the engagementContext
12,908
protected function getRegistrations ( ) { if ( ! $ this -> _registrations ) { $ this -> _registrations = new AuthTypeRegistrationsList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'domainSid' ] ) ; } return $ this -> _registrations ; }
Access the registrations
12,909
protected function getPublishedTracks ( ) { if ( ! $ this -> _publishedTracks ) { $ this -> _publishedTracks = new PublishedTrackList ( $ this -> version , $ this -> solution [ 'roomSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _publishedTracks ; }
Access the publishedTracks
12,910
protected function getSubscribedTracks ( ) { if ( ! $ this -> _subscribedTracks ) { $ this -> _subscribedTracks = new SubscribedTrackList ( $ this -> version , $ this -> solution [ 'roomSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _subscribedTracks ; }
Access the subscribedTracks
12,911
public function create ( $ friendlyName , $ ipAddress , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'FriendlyName' => $ friendlyName , 'IpAddress' => $ ipAddress , 'CidrPrefixLength' => $ options [ 'cidrPrefixLength' ] , ) ) ; $ payload = $ this -> version -> create ( 'POST' , $ this -> uri , array ( ) , $ data ) ; return new IpAddressInstance ( $ this -> version , $ payload , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'ipAccessControlListSid' ] ) ; }
Create a new IpAddressInstance
12,912
public function getContext ( $ sid ) { return new IpAddressContext ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'ipAccessControlListSid' ] , $ sid ) ; }
Constructs a IpAddressContext
12,913
public function getContext ( $ channelSid ) { return new UserChannelContext ( $ this -> version , $ this -> solution [ 'serviceSid' ] , $ this -> solution [ 'userSid' ] , $ channelSid ) ; }
Constructs a UserChannelContext
12,914
protected function getCredentials ( ) { if ( ! $ this -> _credentials ) { $ this -> _credentials = new CredentialList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _credentials ; }
Access the credentials
12,915
protected function getUserBindings ( ) { if ( ! $ this -> _userBindings ) { $ this -> _userBindings = new UserBindingList ( $ this -> version , $ this -> solution [ 'serviceSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _userBindings ; }
Access the userBindings
12,916
public function getContext ( $ sid ) { return new NotificationContext ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'callSid' ] , $ sid ) ; }
Constructs a NotificationContext
12,917
private function reactableModelFromType ( string $ modelType ) : ReactableContract { if ( ! class_exists ( $ modelType ) ) { $ modelType = $ this -> findModelTypeInMorphMap ( $ modelType ) ; } $ model = new $ modelType ; if ( ! $ model instanceof ReactableContract ) { throw ReactableInvalid :: notImplementInterface ( $ modelType ) ; } return $ model ; }
Instantiate model from type or morph map value .
12,918
private function findModelTypeInMorphMap ( string $ modelType ) : string { $ morphMap = Relation :: morphMap ( ) ; if ( ! isset ( $ morphMap [ $ modelType ] ) ) { throw ReactableInvalid :: classNotExists ( $ modelType ) ; } return $ morphMap [ $ modelType ] ; }
Find model type in morph mappings registry .
12,919
private function registerListeners ( ) : void { Event :: listen ( ReactionHasBeenAdded :: class , IncrementAggregates :: class ) ; Event :: listen ( ReactionHasBeenRemoved :: class , DecrementAggregates :: class ) ; }
Register the Love event listeners .
12,920
private function getStdin ( ) { if ( ! isset ( $ this -> stdin ) ) { $ this -> stdin = \ fopen ( 'php://stdin' , 'r' ) ; } if ( \ feof ( $ this -> stdin ) ) { throw new BreakException ( 'Ctrl+D' ) ; } return $ this -> stdin ; }
Get a STDIN file handle .
12,921
protected function getConstants ( $ category = null ) { if ( ! $ category ) { return \ get_defined_constants ( ) ; } $ consts = \ get_defined_constants ( true ) ; if ( $ category === 'internal' ) { unset ( $ consts [ 'user' ] ) ; return \ call_user_func_array ( 'array_merge' , $ consts ) ; } return isset ( $ consts [ $ category ] ) ? $ consts [ $ category ] : [ ] ; }
Get defined constants .
12,922
private function reload ( Shell $ shell ) { \ clearstatcache ( ) ; $ modified = [ ] ; foreach ( \ get_included_files ( ) as $ file ) { $ timestamp = \ filemtime ( $ file ) ; if ( ! isset ( $ this -> timestamps [ $ file ] ) ) { $ this -> timestamps [ $ file ] = $ timestamp ; continue ; } if ( $ this -> timestamps [ $ file ] === $ timestamp ) { continue ; } if ( ! $ this -> lintFile ( $ file ) ) { $ msg = \ sprintf ( 'Modified file "%s" could not be reloaded' , $ file ) ; $ shell -> writeException ( new ParseErrorException ( $ msg ) ) ; continue ; } $ modified [ ] = $ file ; $ this -> timestamps [ $ file ] = $ timestamp ; } foreach ( $ modified as $ file ) { runkit_import ( $ file , ( RUNKIT_IMPORT_FUNCTIONS | RUNKIT_IMPORT_CLASSES | RUNKIT_IMPORT_CLASS_METHODS | RUNKIT_IMPORT_CLASS_CONSTS | RUNKIT_IMPORT_CLASS_PROPS | RUNKIT_IMPORT_OVERRIDE ) ) ; } }
Look through included files and update anything with a new timestamp .
12,923
private function lintFile ( $ file ) { try { $ this -> parser -> parse ( \ file_get_contents ( $ file ) ) ; } catch ( \ Exception $ e ) { return false ; } return true ; }
Should this file be re - imported?
12,924
public static function format ( \ Reflector $ reflector ) { switch ( true ) { case $ reflector instanceof \ ReflectionFunction : case $ reflector instanceof ReflectionLanguageConstruct : return self :: formatFunction ( $ reflector ) ; case $ reflector instanceof \ ReflectionClass : return self :: formatClass ( $ reflector ) ; case $ reflector instanceof ReflectionClassConstant : case $ reflector instanceof \ ReflectionClassConstant : return self :: formatClassConstant ( $ reflector ) ; case $ reflector instanceof \ ReflectionMethod : return self :: formatMethod ( $ reflector ) ; case $ reflector instanceof \ ReflectionProperty : return self :: formatProperty ( $ reflector ) ; case $ reflector instanceof ReflectionConstant_ : return self :: formatConstant ( $ reflector ) ; default : throw new \ InvalidArgumentException ( 'Unexpected Reflector class: ' . \ get_class ( $ reflector ) ) ; } }
Format a signature for the given reflector .
12,925
private static function formatModifiers ( \ Reflector $ reflector ) { if ( $ reflector instanceof \ ReflectionClass && $ reflector -> isTrait ( ) ) { if ( \ version_compare ( PHP_VERSION , '7.0.0' , '<' ) ) { return [ ] ; } } return \ implode ( ' ' , \ array_map ( function ( $ modifier ) { return \ sprintf ( '<keyword>%s</keyword>' , $ modifier ) ; } , \ Reflection :: getModifierNames ( $ reflector -> getModifiers ( ) ) ) ) ; }
Print the method property or class modifiers .
12,926
private static function formatClass ( \ ReflectionClass $ reflector ) { $ chunks = [ ] ; if ( $ modifiers = self :: formatModifiers ( $ reflector ) ) { $ chunks [ ] = $ modifiers ; } if ( $ reflector -> isTrait ( ) ) { $ chunks [ ] = 'trait' ; } else { $ chunks [ ] = $ reflector -> isInterface ( ) ? 'interface' : 'class' ; } $ chunks [ ] = \ sprintf ( '<class>%s</class>' , self :: formatName ( $ reflector ) ) ; if ( $ parent = $ reflector -> getParentClass ( ) ) { $ chunks [ ] = 'extends' ; $ chunks [ ] = \ sprintf ( '<class>%s</class>' , $ parent -> getName ( ) ) ; } $ interfaces = $ reflector -> getInterfaceNames ( ) ; if ( ! empty ( $ interfaces ) ) { \ sort ( $ interfaces ) ; $ chunks [ ] = 'implements' ; $ chunks [ ] = \ implode ( ', ' , \ array_map ( function ( $ name ) { return \ sprintf ( '<class>%s</class>' , $ name ) ; } , $ interfaces ) ) ; } return \ implode ( ' ' , $ chunks ) ; }
Format a class signature .
12,927
private static function getTypeStyle ( $ value ) { if ( \ is_int ( $ value ) || \ is_float ( $ value ) ) { return 'number' ; } elseif ( \ is_string ( $ value ) ) { return 'string' ; } elseif ( \ is_bool ( $ value ) || \ is_null ( $ value ) ) { return 'bool' ; } else { return 'strong' ; } }
Helper for getting output style for a given value s type .
12,928
private static function formatFunction ( \ ReflectionFunctionAbstract $ reflector ) { return \ sprintf ( '<keyword>function</keyword> %s<function>%s</function>(%s)' , $ reflector -> returnsReference ( ) ? '&' : '' , self :: formatName ( $ reflector ) , \ implode ( ', ' , self :: formatFunctionParams ( $ reflector ) ) ) ; }
Format a function signature .
12,929
private static function formatMethod ( \ ReflectionMethod $ reflector ) { return \ sprintf ( '%s %s' , self :: formatModifiers ( $ reflector ) , self :: formatFunction ( $ reflector ) ) ; }
Format a method signature .
12,930
private static function formatFunctionParams ( \ ReflectionFunctionAbstract $ reflector ) { $ params = [ ] ; foreach ( $ reflector -> getParameters ( ) as $ param ) { $ hint = '' ; try { if ( $ param -> isArray ( ) ) { $ hint = '<keyword>array</keyword> ' ; } elseif ( $ class = $ param -> getClass ( ) ) { $ hint = \ sprintf ( '<class>%s</class> ' , $ class -> getName ( ) ) ; } } catch ( \ Exception $ e ) { $ chunks = \ explode ( '$' . $ param -> getName ( ) , ( string ) $ param ) ; $ chunks = \ explode ( ' ' , \ trim ( $ chunks [ 0 ] ) ) ; $ guess = \ end ( $ chunks ) ; $ hint = \ sprintf ( '<urgent>%s</urgent> ' , $ guess ) ; } if ( $ param -> isOptional ( ) ) { if ( ! $ param -> isDefaultValueAvailable ( ) ) { $ value = 'unknown' ; $ typeStyle = 'urgent' ; } else { $ value = $ param -> getDefaultValue ( ) ; $ typeStyle = self :: getTypeStyle ( $ value ) ; $ value = \ is_array ( $ value ) ? 'array()' : \ is_null ( $ value ) ? 'null' : \ var_export ( $ value , true ) ; } $ default = \ sprintf ( ' = <%s>%s</%s>' , $ typeStyle , OutputFormatter :: escape ( $ value ) , $ typeStyle ) ; } else { $ default = '' ; } $ params [ ] = \ sprintf ( '%s%s<strong>$%s</strong>%s' , $ param -> isPassedByReference ( ) ? '&' : '' , $ hint , $ param -> getName ( ) , $ default ) ; } return $ params ; }
Print the function params .
12,931
protected static function prefixLength ( array $ lines ) { $ lines = \ array_filter ( $ lines , function ( $ line ) { return \ substr ( $ line , \ strspn ( $ line , "* \t\n\r\0\x0B" ) ) ; } ) ; \ sort ( $ lines ) ; $ first = \ reset ( $ lines ) ; $ last = \ end ( $ lines ) ; $ count = \ min ( \ strlen ( $ first ) , \ strlen ( $ last ) ) ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { if ( $ first [ $ i ] !== $ last [ $ i ] ) { return $ i ; } } return $ count ; }
Find the length of the docblock prefix .
12,932
public function enterNode ( Node $ node ) { if ( $ node instanceof Array_ || $ this -> isCallNode ( $ node ) ) { $ items = $ node instanceof Array_ ? $ node -> items : $ node -> args ; foreach ( $ items as $ item ) { if ( $ item && $ item -> byRef && $ this -> isCallNode ( $ item -> value ) ) { throw new FatalErrorException ( self :: EXCEPTION_MESSAGE , 0 , E_ERROR , null , $ node -> getLine ( ) ) ; } } } elseif ( $ node instanceof Isset_ || $ node instanceof Unset_ ) { foreach ( $ node -> vars as $ var ) { if ( ! $ this -> isCallNode ( $ var ) ) { continue ; } $ msg = ( $ node instanceof Isset_ && $ this -> atLeastPhp55 ) ? self :: PHP55_MESSAGE : self :: EXCEPTION_MESSAGE ; throw new FatalErrorException ( $ msg , 0 , E_ERROR , null , $ node -> getLine ( ) ) ; } } elseif ( $ node instanceof Empty_ && ! $ this -> atLeastPhp55 && $ this -> isCallNode ( $ node -> expr ) ) { throw new FatalErrorException ( self :: EXCEPTION_MESSAGE , 0 , E_ERROR , null , $ node -> getLine ( ) ) ; } elseif ( $ node instanceof Assign && $ this -> isCallNode ( $ node -> var ) ) { throw new FatalErrorException ( self :: EXCEPTION_MESSAGE , 0 , E_ERROR , null , $ node -> getLine ( ) ) ; } }
Validate that the functions are used correctly .
12,933
public function enterNode ( Node $ node ) { parent :: enterNode ( $ node ) ; if ( self :: isConditional ( $ node ) ) { $ this -> conditionalScopes ++ ; } else { if ( $ this -> conditionalScopes === 0 ) { if ( $ node instanceof Class_ ) { $ this -> validateClassStatement ( $ node ) ; } elseif ( $ node instanceof Interface_ ) { $ this -> validateInterfaceStatement ( $ node ) ; } elseif ( $ node instanceof Trait_ ) { $ this -> validateTraitStatement ( $ node ) ; } } } }
Validate class interface and trait definitions .
12,934
public function leaveNode ( Node $ node ) { if ( self :: isConditional ( $ node ) ) { $ this -> conditionalScopes -- ; } elseif ( $ node instanceof New_ ) { $ this -> validateNewExpression ( $ node ) ; } elseif ( $ node instanceof ClassConstFetch ) { $ this -> validateClassConstFetchExpression ( $ node ) ; } elseif ( $ node instanceof StaticCall ) { $ this -> validateStaticCallExpression ( $ node ) ; } }
Validate new expressions class constant fetches and static calls .
12,935
protected function validateClassStatement ( Class_ $ stmt ) { $ this -> ensureCanDefine ( $ stmt , self :: CLASS_TYPE ) ; if ( isset ( $ stmt -> extends ) ) { $ this -> ensureClassExists ( $ this -> getFullyQualifiedName ( $ stmt -> extends ) , $ stmt ) ; } $ this -> ensureInterfacesExist ( $ stmt -> implements , $ stmt ) ; }
Validate a class definition statement .
12,936
protected function validateInterfaceStatement ( Interface_ $ stmt ) { $ this -> ensureCanDefine ( $ stmt , self :: INTERFACE_TYPE ) ; $ this -> ensureInterfacesExist ( $ stmt -> extends , $ stmt ) ; }
Validate an interface definition statement .
12,937
protected function validateNewExpression ( New_ $ stmt ) { if ( ! $ stmt -> class instanceof Expr && ! $ stmt -> class instanceof Class_ ) { $ this -> ensureClassExists ( $ this -> getFullyQualifiedName ( $ stmt -> class ) , $ stmt ) ; } }
Validate a new expression .
12,938
protected function ensureCanDefine ( Stmt $ stmt , $ scopeType = self :: CLASS_TYPE ) { $ name = $ this -> getFullyQualifiedName ( $ stmt -> name ) ; $ errorType = null ; if ( $ this -> classExists ( $ name ) ) { $ errorType = self :: CLASS_TYPE ; } elseif ( $ this -> interfaceExists ( $ name ) ) { $ errorType = self :: INTERFACE_TYPE ; } elseif ( $ this -> traitExists ( $ name ) ) { $ errorType = self :: TRAIT_TYPE ; } if ( $ errorType !== null ) { throw $ this -> createError ( \ sprintf ( '%s named %s already exists' , \ ucfirst ( $ errorType ) , $ name ) , $ stmt ) ; } $ this -> currentScope [ \ strtolower ( $ name ) ] = $ scopeType ; }
Ensure that no class interface or trait name collides with a new definition .
12,939
protected function ensureClassExists ( $ name , $ stmt ) { if ( ! $ this -> classExists ( $ name ) ) { throw $ this -> createError ( \ sprintf ( 'Class \'%s\' not found' , $ name ) , $ stmt ) ; } }
Ensure that a referenced class exists .
12,940
protected function ensureClassOrInterfaceExists ( $ name , $ stmt ) { if ( ! $ this -> classExists ( $ name ) && ! $ this -> interfaceExists ( $ name ) ) { throw $ this -> createError ( \ sprintf ( 'Class \'%s\' not found' , $ name ) , $ stmt ) ; } }
Ensure that a referenced class _or interface_ exists .
12,941
protected function ensureClassOrTraitExists ( $ name , $ stmt ) { if ( ! $ this -> classExists ( $ name ) && ! $ this -> traitExists ( $ name ) ) { throw $ this -> createError ( \ sprintf ( 'Class \'%s\' not found' , $ name ) , $ stmt ) ; } }
Ensure that a referenced class _or trait_ exists .
12,942
protected function ensureMethodExists ( $ class , $ name , $ stmt ) { $ this -> ensureClassOrTraitExists ( $ class , $ stmt ) ; if ( \ in_array ( \ strtolower ( $ class ) , [ 'self' , 'parent' , 'static' ] ) ) { return ; } if ( $ this -> findInScope ( $ class ) === self :: CLASS_TYPE ) { return ; } if ( $ name instanceof Expr ) { return ; } if ( ! \ method_exists ( $ class , $ name ) && ! \ method_exists ( $ class , '__callStatic' ) ) { throw $ this -> createError ( \ sprintf ( 'Call to undefined method %s::%s()' , $ class , $ name ) , $ stmt ) ; } }
Ensure that a statically called method exists .
12,943
protected function ensureInterfacesExist ( $ interfaces , $ stmt ) { foreach ( $ interfaces as $ interface ) { $ name = $ this -> getFullyQualifiedName ( $ interface ) ; if ( ! $ this -> interfaceExists ( $ name ) ) { throw $ this -> createError ( \ sprintf ( 'Interface \'%s\' not found' , $ name ) , $ stmt ) ; } } }
Ensure that a referenced interface exists .
12,944
protected function getScopeType ( Stmt $ stmt ) { if ( $ stmt instanceof Class_ ) { return self :: CLASS_TYPE ; } elseif ( $ stmt instanceof Interface_ ) { return self :: INTERFACE_TYPE ; } elseif ( $ stmt instanceof Trait_ ) { return self :: TRAIT_TYPE ; } }
Get a symbol type key for storing in the scope name cache .
12,945
protected function classExists ( $ name ) { if ( \ in_array ( \ strtolower ( $ name ) , [ 'self' , 'static' , 'parent' ] ) ) { return true ; } return \ class_exists ( $ name ) || $ this -> findInScope ( $ name ) === self :: CLASS_TYPE ; }
Check whether a class exists or has been defined in the current code snippet .
12,946
protected function findInScope ( $ name ) { $ name = \ strtolower ( $ name ) ; if ( isset ( $ this -> currentScope [ $ name ] ) ) { return $ this -> currentScope [ $ name ] ; } }
Find a symbol in the current code snippet scope .
12,947
public static function fetchProperty ( $ object , $ property ) { $ refl = new \ ReflectionObject ( $ object ) ; $ prop = $ refl -> getProperty ( $ property ) ; $ prop -> setAccessible ( true ) ; return $ prop -> getValue ( $ object ) ; }
Fetch a property of an object bypassing visibility restrictions .
12,948
public static function assignProperty ( $ object , $ property , $ value ) { $ refl = new \ ReflectionObject ( $ object ) ; $ prop = $ refl -> getProperty ( $ property ) ; $ prop -> setAccessible ( true ) ; $ prop -> setValue ( $ object , $ value ) ; return $ value ; }
Assign the value of a property of an object bypassing visibility restrictions .
12,949
public static function callMethod ( $ object , $ method , $ args = null ) { $ args = \ func_get_args ( ) ; $ object = \ array_shift ( $ args ) ; $ method = \ array_shift ( $ args ) ; $ refl = new \ ReflectionObject ( $ object ) ; $ reflMethod = $ refl -> getMethod ( $ method ) ; $ reflMethod -> setAccessible ( true ) ; return $ reflMethod -> invokeArgs ( $ object , $ args ) ; }
Call a method on an object bypassing visibility restrictions .
12,950
public static function fetchStaticProperty ( $ class , $ property ) { $ refl = new \ ReflectionClass ( $ class ) ; $ prop = $ refl -> getProperty ( $ property ) ; $ prop -> setAccessible ( true ) ; return $ prop -> getValue ( ) ; }
Fetch a property of a class bypassing visibility restrictions .
12,951
public static function assignStaticProperty ( $ class , $ property , $ value ) { $ refl = new \ ReflectionClass ( $ class ) ; $ prop = $ refl -> getProperty ( $ property ) ; $ prop -> setAccessible ( true ) ; $ prop -> setValue ( $ value ) ; return $ value ; }
Assign the value of a static property of a class bypassing visibility restrictions .
12,952
public static function callStatic ( $ class , $ method , $ args = null ) { $ args = \ func_get_args ( ) ; $ class = \ array_shift ( $ args ) ; $ method = \ array_shift ( $ args ) ; $ refl = new \ ReflectionClass ( $ class ) ; $ reflMethod = $ refl -> getMethod ( $ method ) ; $ reflMethod -> setAccessible ( true ) ; return $ reflMethod -> invokeArgs ( null , $ args ) ; }
Call a static method on a class bypassing visibility restrictions .
12,953
public function setCommands ( array $ commands ) { $ names = [ ] ; foreach ( $ commands as $ command ) { $ names = \ array_merge ( [ $ command -> getName ( ) ] , $ names ) ; $ names = \ array_merge ( $ command -> getAliases ( ) , $ names ) ; } $ this -> commands = $ names ; }
Set Commands for completion .
12,954
protected function matchCommand ( $ name ) { foreach ( $ this -> commands as $ cmd ) { if ( $ this -> startsWith ( $ name , $ cmd ) ) { return true ; } } return false ; }
Check whether input matches a defined command .
12,955
public static function export ( $ class , $ name , $ return = false ) { $ refl = new self ( $ class , $ name ) ; $ value = $ refl -> getValue ( ) ; $ str = \ sprintf ( 'Constant [ public %s %s ] { %s }' , \ gettype ( $ value ) , $ refl -> getName ( ) , $ value ) ; if ( $ return ) { return $ str ; } echo $ str . "\n" ; }
Exports a reflection .
12,956
public function getDeclaringClass ( ) { $ parent = $ this -> class ; do { $ class = $ parent ; $ parent = $ class -> getParentClass ( ) ; } while ( $ parent && $ parent -> hasConstant ( $ this -> name ) && $ parent -> getConstant ( $ this -> name ) === $ this -> value ) ; return $ class ; }
Gets the declaring class .
12,957
protected function getTarget ( $ valueName ) { $ valueName = \ trim ( $ valueName ) ; $ matches = [ ] ; switch ( true ) { case \ preg_match ( self :: CLASS_OR_FUNC , $ valueName , $ matches ) : return [ $ this -> resolveName ( $ matches [ 0 ] , true ) , null , 0 ] ; case \ preg_match ( self :: CLASS_MEMBER , $ valueName , $ matches ) : return [ $ this -> resolveName ( $ matches [ 1 ] ) , $ matches [ 2 ] , Mirror :: CONSTANT | Mirror :: METHOD ] ; case \ preg_match ( self :: CLASS_STATIC , $ valueName , $ matches ) : return [ $ this -> resolveName ( $ matches [ 1 ] ) , $ matches [ 2 ] , Mirror :: STATIC_PROPERTY | Mirror :: PROPERTY ] ; case \ preg_match ( self :: INSTANCE_MEMBER , $ valueName , $ matches ) : if ( $ matches [ 2 ] === '->' ) { $ kind = Mirror :: METHOD | Mirror :: PROPERTY ; } else { $ kind = Mirror :: CONSTANT | Mirror :: METHOD ; } return [ $ this -> resolveObject ( $ matches [ 1 ] ) , $ matches [ 3 ] , $ kind ] ; default : return [ $ this -> resolveObject ( $ valueName ) , null , 0 ] ; } }
Get the target for a value .
12,958
protected function getTargetAndReflector ( $ valueName ) { list ( $ value , $ member , $ kind ) = $ this -> getTarget ( $ valueName ) ; return [ $ value , Mirror :: get ( $ value , $ member , $ kind ) ] ; }
Get a Reflector and documentation for a function class or instance constant method or property .
12,959
protected function resolveCode ( $ code ) { try { $ value = $ this -> getApplication ( ) -> execute ( $ code , true ) ; } catch ( \ Exception $ e ) { } if ( ! isset ( $ value ) || $ value instanceof NoReturnValue ) { throw new RuntimeException ( 'Unknown target: ' . $ code ) ; } return $ value ; }
Resolve code to a value in the current scope .
12,960
private function resolveObject ( $ code ) { $ value = $ this -> resolveCode ( $ code ) ; if ( ! \ is_object ( $ value ) ) { throw new RuntimeException ( 'Unable to inspect a non-object' ) ; } return $ value ; }
Resolve code to an object in the current scope .
12,961
protected function getGlobals ( ) { global $ GLOBALS ; $ names = \ array_keys ( $ GLOBALS ) ; \ natcasesort ( $ names ) ; $ ret = [ ] ; foreach ( $ names as $ name ) { $ ret [ $ name ] = $ GLOBALS [ $ name ] ; } return $ ret ; }
Get defined global variables .
12,962
protected function prepareGlobals ( $ globals ) { $ ret = [ ] ; foreach ( $ globals as $ name => $ value ) { if ( $ this -> showItem ( $ name ) ) { $ fname = '$' . $ name ; $ ret [ $ fname ] = [ 'name' => $ fname , 'style' => self :: IS_GLOBAL , 'value' => $ this -> presentRef ( $ value ) , ] ; } } return $ ret ; }
Prepare formatted global variable array .
12,963
public function enterNode ( Node $ node ) { if ( $ node instanceof Namespace_ ) { $ this -> namespace = isset ( $ node -> name ) ? $ node -> name -> parts : [ ] ; } elseif ( $ node instanceof Class_ ) { $ constructor = null ; foreach ( $ node -> stmts as $ stmt ) { if ( $ stmt instanceof ClassMethod ) { if ( '__construct' === \ strtolower ( $ stmt -> name ) ) { $ this -> validateConstructor ( $ stmt , $ node ) ; return ; } if ( empty ( $ this -> namespace ) && \ strtolower ( $ node -> name ) === \ strtolower ( $ stmt -> name ) ) { $ constructor = $ stmt ; } } } if ( $ constructor ) { $ this -> validateConstructor ( $ constructor , $ node ) ; } } }
Validate that the constructor is not static and does not have a return type .
12,964
public static function format ( \ Reflector $ reflector ) { $ docblock = new Docblock ( $ reflector ) ; $ chunks = [ ] ; if ( ! empty ( $ docblock -> desc ) ) { $ chunks [ ] = '<comment>Description:</comment>' ; $ chunks [ ] = self :: indent ( OutputFormatter :: escape ( $ docblock -> desc ) , ' ' ) ; $ chunks [ ] = '' ; } if ( ! empty ( $ docblock -> tags ) ) { foreach ( $ docblock :: $ vectors as $ name => $ vector ) { if ( isset ( $ docblock -> tags [ $ name ] ) ) { $ chunks [ ] = \ sprintf ( '<comment>%s:</comment>' , self :: inflect ( $ name ) ) ; $ chunks [ ] = self :: formatVector ( $ vector , $ docblock -> tags [ $ name ] ) ; $ chunks [ ] = '' ; } } $ tags = self :: formatTags ( \ array_keys ( $ docblock :: $ vectors ) , $ docblock -> tags ) ; if ( ! empty ( $ tags ) ) { $ chunks [ ] = $ tags ; $ chunks [ ] = '' ; } } return \ rtrim ( \ implode ( "\n" , $ chunks ) ) ; }
Format a docblock .
12,965
private static function formatTags ( array $ skip , array $ tags ) { $ chunks = [ ] ; foreach ( $ tags as $ name => $ values ) { if ( \ in_array ( $ name , $ skip ) ) { continue ; } foreach ( $ values as $ value ) { $ chunks [ ] = \ sprintf ( '<comment>%s%s</comment> %s' , self :: inflect ( $ name ) , empty ( $ value ) ? '' : ':' , OutputFormatter :: escape ( $ value ) ) ; } $ chunks [ ] = '' ; } return \ implode ( "\n" , $ chunks ) ; }
Format docblock tags .
12,966
private static function getVectorParamTemplate ( $ type , $ max ) { if ( ! isset ( self :: $ vectorParamTemplates [ $ type ] ) ) { return \ sprintf ( '%%-%ds' , $ max ) ; } return \ sprintf ( '<%s>%%-%ds</%s>' , self :: $ vectorParamTemplates [ $ type ] , $ max , self :: $ vectorParamTemplates [ $ type ] ) ; }
Get a docblock vector template .
12,967
private static function inflect ( $ text ) { $ words = \ trim ( \ preg_replace ( '/[\s_-]+/' , ' ' , \ preg_replace ( '/([a-z])([A-Z])/' , '$1 $2' , $ text ) ) ) ; return \ implode ( ' ' , \ array_map ( 'ucfirst' , \ explode ( ' ' , $ words ) ) ) ; }
Convert underscored or whitespace separated words into sentence case .
12,968
protected function getDefaultLoopListeners ( ) { $ listeners = [ ] ; if ( ProcessForker :: isSupported ( ) && $ this -> config -> usePcntl ( ) ) { $ listeners [ ] = new ProcessForker ( ) ; } if ( RunkitReloader :: isSupported ( ) ) { $ listeners [ ] = new RunkitReloader ( ) ; } return $ listeners ; }
Gets the default command loop listeners .
12,969
public function addMatchers ( array $ matchers ) { $ this -> matchers = \ array_merge ( $ this -> matchers , $ matchers ) ; if ( isset ( $ this -> autoCompleter ) ) { $ this -> addMatchersToAutoCompleter ( $ matchers ) ; } }
Add tab completion matchers .
12,970
public function getInput ( ) { $ this -> codeBufferOpen = false ; do { $ this -> output -> setVerbosity ( ShellOutput :: VERBOSITY_VERBOSE ) ; $ input = $ this -> readline ( ) ; if ( $ input === false ) { $ this -> output -> writeln ( '' ) ; if ( $ this -> hasCode ( ) ) { $ this -> resetCodeBuffer ( ) ; } else { throw new BreakException ( 'Ctrl+D' ) ; } } if ( \ trim ( $ input ) === '' && ! $ this -> codeBufferOpen ) { continue ; } $ input = $ this -> onInput ( $ input ) ; if ( $ this -> hasCommand ( $ input ) && ! $ this -> inputInOpenStringOrComment ( $ input ) ) { $ this -> addHistory ( $ input ) ; $ this -> runCommand ( $ input ) ; continue ; } $ this -> addCode ( $ input ) ; } while ( ! $ this -> hasValidCode ( ) ) ; }
Read user input .
12,971
public function onInput ( $ input ) { foreach ( $ this -> loopListeners as $ listeners ) { if ( ( $ return = $ listeners -> onInput ( $ this , $ input ) ) !== null ) { $ input = $ return ; } } return $ input ; }
Run execution loop listeners on user input .
12,972
public function onExecute ( $ code ) { foreach ( $ this -> loopListeners as $ listener ) { if ( ( $ return = $ listener -> onExecute ( $ this , $ code ) ) !== null ) { $ code = $ return ; } } return $ code ; }
Run execution loop listeners on code to be executed .
12,973
public function getScopeVariables ( $ includeBoundObject = true ) { $ vars = $ this -> context -> getAll ( ) ; if ( ! $ includeBoundObject ) { unset ( $ vars [ 'this' ] ) ; } return $ vars ; }
Return the set of variables currently in scope .
12,974
public function getSpecialScopeVariables ( $ includeBoundObject = true ) { $ vars = $ this -> context -> getSpecialVariables ( ) ; if ( ! $ includeBoundObject ) { unset ( $ vars [ 'this' ] ) ; } return $ vars ; }
Return the set of magic variables currently in scope .
12,975
public function addCode ( $ code , $ silent = false ) { try { if ( \ substr ( \ rtrim ( $ code ) , - 1 ) === '\\' ) { $ this -> codeBufferOpen = true ; $ code = \ substr ( \ rtrim ( $ code ) , 0 , - 1 ) ; } else { $ this -> codeBufferOpen = false ; } $ this -> codeBuffer [ ] = $ silent ? new SilentInput ( $ code ) : $ code ; $ this -> code = $ this -> cleaner -> clean ( $ this -> codeBuffer , $ this -> config -> requireSemicolons ( ) ) ; } catch ( \ Exception $ e ) { $ this -> addCodeBufferToHistory ( ) ; throw $ e ; } }
Add code to the code buffer .
12,976
private function setCode ( $ code , $ silent = false ) { if ( $ this -> hasCode ( ) ) { $ this -> codeStack [ ] = [ $ this -> codeBuffer , $ this -> codeBufferOpen , $ this -> code ] ; } $ this -> resetCodeBuffer ( ) ; try { $ this -> addCode ( $ code , $ silent ) ; } catch ( \ Throwable $ e ) { $ this -> popCodeStack ( ) ; throw $ e ; } catch ( \ Exception $ e ) { $ this -> popCodeStack ( ) ; throw $ e ; } if ( ! $ this -> hasValidCode ( ) ) { $ this -> popCodeStack ( ) ; throw new \ InvalidArgumentException ( 'Unexpected end of input' ) ; } }
Set the code buffer .
12,977
protected function runCommand ( $ input ) { $ command = $ this -> getCommand ( $ input ) ; if ( empty ( $ command ) ) { throw new \ InvalidArgumentException ( 'Command not found: ' . $ input ) ; } $ input = new ShellInput ( \ str_replace ( '\\' , '\\\\' , \ rtrim ( $ input , " \t\n\r\0\x0B;" ) ) ) ; if ( $ input -> hasParameterOption ( [ '--help' , '-h' ] ) ) { $ helpCommand = $ this -> get ( 'help' ) ; $ helpCommand -> setCommand ( $ command ) ; return $ helpCommand -> run ( $ input , $ this -> output ) ; } return $ command -> run ( $ input , $ this -> output ) ; }
Run a Psy Shell command given the user input .
12,978
public function addInput ( $ input , $ silent = false ) { foreach ( ( array ) $ input as $ line ) { $ this -> inputBuffer [ ] = $ silent ? new SilentInput ( $ line ) : $ line ; } }
Inject input into the input buffer .
12,979
private function popCodeStack ( ) { $ this -> resetCodeBuffer ( ) ; if ( empty ( $ this -> codeStack ) ) { return ; } list ( $ codeBuffer , $ codeBufferOpen , $ code ) = \ array_pop ( $ this -> codeStack ) ; $ this -> codeBuffer = $ codeBuffer ; $ this -> codeBufferOpen = $ codeBufferOpen ; $ this -> code = $ code ; }
Reset the code buffer and restore any code pushed during execute calls .
12,980
private function addCodeBufferToHistory ( ) { $ codeBuffer = \ array_filter ( $ this -> codeBuffer , function ( $ line ) { return ! $ line instanceof SilentInput ; } ) ; $ this -> addHistory ( \ implode ( "\n" , $ codeBuffer ) ) ; }
Filter silent input from code buffer write the rest to readline history .
12,981
public function writeReturnValue ( $ ret ) { $ this -> lastExecSuccess = true ; if ( $ ret instanceof NoReturnValue ) { return ; } $ this -> context -> setReturnValue ( $ ret ) ; $ ret = $ this -> presentValue ( $ ret ) ; $ indent = \ str_repeat ( ' ' , \ strlen ( static :: RETVAL ) ) ; $ this -> output -> writeln ( static :: RETVAL . \ str_replace ( PHP_EOL , PHP_EOL . $ indent , $ ret ) ) ; }
Write a return value to stdout .
12,982
public function writeException ( \ Exception $ e ) { $ this -> lastExecSuccess = false ; $ this -> context -> setLastException ( $ e ) ; $ this -> output -> writeln ( $ this -> formatException ( $ e ) ) ; $ this -> resetCodeBuffer ( ) ; }
Renders a caught Exception .
12,983
protected function getSeverity ( \ ErrorException $ e ) { $ severity = $ e -> getSeverity ( ) ; if ( $ severity & \ error_reporting ( ) ) { switch ( $ severity ) { case E_WARNING : case E_NOTICE : case E_CORE_WARNING : case E_COMPILE_WARNING : case E_USER_WARNING : case E_USER_NOTICE : case E_STRICT : return 'warning' ; default : return 'error' ; } } else { return 'warning' ; } }
Helper for getting an output style for the given ErrorException s level .
12,984
public function execute ( $ code , $ throwExceptions = false ) { $ this -> setCode ( $ code , true ) ; $ closure = new ExecutionClosure ( $ this ) ; if ( $ throwExceptions ) { return $ closure -> execute ( ) ; } try { return $ closure -> execute ( ) ; } catch ( \ TypeError $ _e ) { $ this -> writeException ( TypeErrorException :: fromTypeError ( $ _e ) ) ; } catch ( \ Error $ _e ) { $ this -> writeException ( ErrorException :: fromError ( $ _e ) ) ; } catch ( \ Exception $ _e ) { $ this -> writeException ( $ _e ) ; } }
Execute code in the shell execution context .
12,985
protected function hasCommand ( $ input ) { if ( \ preg_match ( '/([^\s]+?)(?:\s|$)/A' , \ ltrim ( $ input ) , $ match ) ) { return $ this -> has ( $ match [ 1 ] ) ; } return false ; }
Check whether a command is set for the current input string .
12,986
protected function readline ( ) { if ( ! empty ( $ this -> inputBuffer ) ) { $ line = \ array_shift ( $ this -> inputBuffer ) ; if ( ! $ line instanceof SilentInput ) { $ this -> output -> writeln ( \ sprintf ( '<aside>%s %s</aside>' , static :: REPLAY , OutputFormatter :: escape ( $ line ) ) ) ; } return $ line ; } if ( $ bracketedPaste = $ this -> config -> useBracketedPaste ( ) ) { \ printf ( "\e[?2004h" ) ; } $ line = $ this -> readline -> readline ( $ this -> getPrompt ( ) ) ; if ( $ bracketedPaste ) { \ printf ( "\e[?2004l" ) ; } return $ line ; }
Read a line of user input .
12,987
protected function initializeTabCompletion ( ) { if ( ! $ this -> config -> useTabCompletion ( ) ) { return ; } $ this -> autoCompleter = $ this -> config -> getAutoCompleter ( ) ; $ this -> addMatchersToAutoCompleter ( $ this -> getDefaultMatchers ( ) ) ; $ this -> addMatchersToAutoCompleter ( $ this -> matchers ) ; $ this -> autoCompleter -> activate ( ) ; }
Initialize tab completion matchers .
12,988
private function addMatchersToAutoCompleter ( array $ matchers ) { foreach ( $ matchers as $ matcher ) { if ( $ matcher instanceof ContextAware ) { $ matcher -> setContext ( $ this -> context ) ; } $ this -> autoCompleter -> addMatcher ( $ matcher ) ; } }
Add matchers to the auto completer setting context if needed .
12,989
protected function writeStartupMessage ( ) { $ message = $ this -> config -> getStartupMessage ( ) ; if ( $ message !== null && $ message !== '' ) { $ this -> output -> writeln ( $ message ) ; } }
Write a startup message if set .
12,990
protected function getConstants ( \ Reflector $ reflector , $ noInherit = false ) { $ className = $ reflector -> getName ( ) ; $ constants = [ ] ; foreach ( $ reflector -> getConstants ( ) as $ name => $ constant ) { $ constReflector = ReflectionClassConstant :: create ( $ reflector -> name , $ name ) ; if ( $ noInherit && $ constReflector -> getDeclaringClass ( ) -> getName ( ) !== $ className ) { continue ; } $ constants [ $ name ] = $ constReflector ; } \ ksort ( $ constants , SORT_NATURAL | SORT_FLAG_CASE ) ; return $ constants ; }
Get defined constants for the given class or object Reflector .
12,991
public function getConsoleColor ( ) { if ( $ this -> colorMode === Configuration :: COLOR_MODE_AUTO ) { return $ this -> getDefaultConsoleColor ( ) ; } elseif ( $ this -> colorMode === Configuration :: COLOR_MODE_FORCED ) { return $ this -> getForcedConsoleColor ( ) ; } elseif ( $ this -> colorMode === Configuration :: COLOR_MODE_DISABLED ) { return $ this -> getDisabledConsoleColor ( ) ; } }
Get a ConsoleColor instance configured according to the given color mode .
12,992
public function get ( $ name ) { switch ( $ name ) { case '_' : return $ this -> returnValue ; case '_e' : if ( isset ( $ this -> lastException ) ) { return $ this -> lastException ; } break ; case '__out' : if ( isset ( $ this -> lastStdout ) ) { return $ this -> lastStdout ; } break ; case 'this' : if ( isset ( $ this -> boundObject ) ) { return $ this -> boundObject ; } break ; case '__function' : case '__method' : case '__class' : case '__namespace' : case '__file' : case '__line' : case '__dir' : if ( \ array_key_exists ( $ name , $ this -> commandScopeVariables ) ) { return $ this -> commandScopeVariables [ $ name ] ; } break ; default : if ( \ array_key_exists ( $ name , $ this -> scopeVariables ) ) { return $ this -> scopeVariables [ $ name ] ; } break ; } throw new \ InvalidArgumentException ( 'Unknown variable: $' . $ name ) ; }
Get a context variable .
12,993
public function setAll ( array $ vars ) { foreach ( self :: $ specialNames as $ key ) { unset ( $ vars [ $ key ] ) ; } foreach ( self :: $ commandScopeNames as $ key ) { unset ( $ vars [ $ key ] ) ; } $ this -> scopeVariables = $ vars ; }
Set all scope variables .
12,994
public static function isSpecialVariableName ( $ name ) { return \ in_array ( $ name , self :: $ specialNames ) || \ in_array ( $ name , self :: $ commandScopeNames ) ; }
Check whether a variable name is a magic variable .
12,995
public static function fromThrowable ( $ throwable ) { if ( $ throwable instanceof \ Error ) { $ throwable = ErrorException :: fromError ( $ throwable ) ; } if ( ! $ throwable instanceof \ Exception ) { throw new \ InvalidArgumentException ( 'throw-up can only throw Exceptions and Errors' ) ; } return new self ( $ throwable ) ; }
Create a ThrowUpException from a Throwable .
12,996
public function enterNode ( Node $ node ) { if ( $ node instanceof Namespace_ ) { if ( \ strtolower ( $ node -> name ) === \ strtolower ( $ this -> lastNamespace ) ) { $ this -> aliases = $ this -> lastAliases ; } } }
Re - load the last set of use statements on re - entering a namespace .
12,997
public function leaveNode ( Node $ node ) { if ( $ node instanceof Use_ ) { foreach ( $ node -> uses as $ use ) { $ alias = $ use -> alias ? : \ end ( $ use -> name -> parts ) ; $ this -> aliases [ \ strtolower ( $ alias ) ] = $ use -> name ; } return NodeTraverser :: REMOVE_NODE ; } elseif ( $ node instanceof GroupUse ) { foreach ( $ node -> uses as $ use ) { $ alias = $ use -> alias ? : \ end ( $ use -> name -> parts ) ; $ this -> aliases [ \ strtolower ( $ alias ) ] = Name :: concat ( $ node -> prefix , $ use -> name , [ 'startLine' => $ node -> prefix -> getAttribute ( 'startLine' ) , 'endLine' => $ use -> name -> getAttribute ( 'endLine' ) , ] ) ; } return NodeTraverser :: REMOVE_NODE ; } elseif ( $ node instanceof Namespace_ ) { $ this -> lastNamespace = $ node -> name ; $ this -> lastAliases = $ this -> aliases ; $ this -> aliases = [ ] ; } else { foreach ( $ node as $ name => $ subNode ) { if ( $ subNode instanceof Name ) { if ( $ replacement = $ this -> findAlias ( $ subNode ) ) { $ node -> $ name = $ replacement ; } } } return $ node ; } }
If this statement is a namespace forget all the aliases we had .
12,998
public function enumerate ( InputInterface $ input , \ Reflector $ reflector = null , $ target = null ) { $ this -> filter -> bind ( $ input ) ; return $ this -> listItems ( $ input , $ reflector , $ target ) ; }
Return a list of categorized things with the given input options and target .
12,999
public function init ( ) { $ this -> hasReadline = \ function_exists ( 'readline' ) ; $ this -> hasPcntl = \ function_exists ( 'pcntl_signal' ) && \ function_exists ( 'posix_getpid' ) ; if ( $ configFile = $ this -> getConfigFile ( ) ) { $ this -> loadConfigFile ( $ configFile ) ; } if ( ! $ this -> configFile && $ localConfig = $ this -> getLocalConfigFile ( ) ) { $ this -> loadConfigFile ( $ localConfig ) ; } }
Initialize the configuration .