idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
56,900 | public static function setBaseDir ( $ path ) { $ path = realpath ( rtrim ( $ path , '/\\ ' ) ) ; if ( $ path === false ) { throw new \ InvalidArgumentException ( "cat`t get real path: seems like path does`t exists: $path" ) ; } return static :: $ baseDir = $ path ; } | Sets path of the directory where config files are stored . |
56,901 | public function register ( ) { $ events = $ this -> app -> config ( 'event' ) ; foreach ( $ events as $ name => $ handlers ) { $ this -> events [ $ name ] = $ handlers ; } } | Bootstrap registered events |
56,902 | public function listen ( $ event , $ handler ) { if ( array_key_exists ( $ event , $ this -> broadcast ) ) { $ eventObject = $ this -> getEventObject ( $ event , $ this -> broadcast [ $ event ] ) ; if ( is_callable ( $ handler ) ) { call_user_func_array ( $ handler , [ $ eventObject ] ) ; } else { call_user_func_array ... | Event listener to listen broadcast |
56,903 | protected function execute ( $ event ) { foreach ( $ this -> events [ $ event ] as $ handler ) { $ this -> listen ( $ event , $ handler ) ; } } | Listening all broadcast events |
56,904 | protected function getEventObject ( $ event , $ data ) { $ eventClass = new ReflectionClass ( $ this -> getEventClass ( $ event ) ) ; return $ eventClass -> newInstanceArgs ( $ data ) ; } | Get event class object |
56,905 | public static function getDefaultInputOptions ( ) { $ inputOptions = array ( new InputOption ( 'filter' , null , InputOption :: VALUE_REQUIRED | InputOption :: VALUE_IS_ARRAY , 'A string pattern used to match entities that should be mapped' ) , new InputOption ( 'force' , 'f' , null , 'Override existing extension' ) , ... | Get command options for all environments . |
56,906 | private function mergeDefaults ( $ options ) { $ defaults = $ this -> defaults ; if ( ! empty ( $ defaults [ 'headers' ] ) && ! empty ( $ options [ 'headers' ] ) ) { $ lkeys = [ ] ; foreach ( array_keys ( $ options [ 'headers' ] ) as $ k ) { $ lkeys [ strtolower ( $ k ) ] = true ; } foreach ( $ defaults [ 'headers' ] a... | Merges default options into the array passed by reference . |
56,907 | public function execute ( $ command ) { $ retValue = $ this -> _conn -> query ( $ command ) -> fetchAll ( ) ; if ( $ this -> error ( $ this -> _conn -> error ( ) ) ) return array ( ) ; else return $ retValue ; } | Execute Command in DataBase |
56,908 | public static function template ( $ template , $ parameters , $ startChar = '%' , $ endChar = '%' ) { foreach ( $ parameters as $ key => $ value ) { $ template = str_replace ( $ startChar . $ key . $ endChar , $ value , $ template ) ; } return $ template ; } | Replace %key% from template string with their value from parameters array |
56,909 | public function process ( ContainerBuilder $ container ) { $ this -> addFilters ( $ container , 'pre' ) ; $ this -> addFilters ( $ container , 'post' ) ; $ this -> addFilters ( $ container , 'output' ) ; } | You can modify the container here before it is dumped to PHP code . r |
56,910 | public function bind ( $ eventName , $ callback , $ mode = self :: BINDING_MODE_LAST ) { $ alias = false ; if ( $ callback instanceof AliasedCallback ) { $ alias = $ callback -> getAlias ( ) ; $ callback = $ callback -> getCallback ( ) ; if ( ! isset ( $ this -> aliases [ $ alias ] ) ) { $ this -> aliases [ $ alias ] =... | Attaches a callback to an event |
56,911 | private function loop ( ) { $ c = $ this -> controller ; if ( is_callable ( [ $ c , 'throttle' ] ) ) { $ throttle = function ( ) use ( $ c ) { return $ c -> throttle ( ) ; } ; } else { $ throttle = function ( ) { return $ this -> throttle ( ) ; } ; } while ( $ c -> signal ( ) ) { $ c -> process ( ) ; time_nanosleep ( 0... | Execute the primary daemon runtime loop |
56,912 | public function throttle ( ) { if ( ( time ( ) - $ this -> lastCpuCheck ) >= $ this -> cpuCheckFrequency ) { $ load = sys_getloadavg ( ) ; if ( $ load [ 0 ] / $ this -> cpuCount >= $ this -> cpuTarget ) { $ this -> pause += $ this -> throttleSensitivity ; $ this -> controller -> notify ( 'Daemon throttling down' ) ; } ... | Determine the throttle execution time available to the public |
56,913 | public function buildForm ( FormBuilderInterface $ builder , array $ options ) { $ builder -> addEventListener ( FormEvents :: PRE_SET_DATA , function ( FormEvent $ event ) use ( $ builder , $ options ) { if ( empty ( $ options [ 'templates' ] ) ) { return ; } $ event -> getForm ( ) -> add ( '_template' , ChoiceType ::... | Static component form definition . |
56,914 | public static function installConfig ( ) { $ conf_tgt = self :: get ( 'app_config_filepath' ) ; $ i18n_tgt = self :: get ( 'app_i18n_filepath' ) ; if ( false === @ file_exists ( $ conf_tgt ) ) { $ conf_src = self :: getPath ( 'config' ) . self :: $ _defaults [ 'filenames' ] [ 'app_config' ] ; if ( false === @ copy ( $ ... | Install WebDocBook s config files |
56,915 | public static function isWorkflowMessage ( $ aMessageName ) { $ match = array ( ) ; preg_match ( static :: MESSAGE_PARTS_PATTERN , $ aMessageName , $ match ) ; if ( isset ( $ match [ 'message' ] ) ) { $ choices = array_merge ( static :: $ commandSuffixes , static :: $ eventSuffixes ) ; return in_array ( $ match [ 'mess... | Is given message name a processing command or processing event |
56,916 | public static function isProcessingCommand ( $ aMessageName ) { $ match = array ( ) ; preg_match ( static :: MESSAGE_PARTS_PATTERN , $ aMessageName , $ match ) ; if ( isset ( $ match [ 'message' ] ) ) { return in_array ( $ match [ 'message' ] , static :: $ commandSuffixes ) ; } return false ; } | Is given message name a processing command |
56,917 | public static function isProcessingEvent ( $ aMessageName ) { $ match = array ( ) ; preg_match ( static :: MESSAGE_PARTS_PATTERN , $ aMessageName , $ match ) ; if ( isset ( $ match [ 'message' ] ) ) { return in_array ( $ match [ 'message' ] , static :: $ eventSuffixes ) ; } return false ; } | Is given message name a processing event |
56,918 | protected static function append ( $ path ) { if ( is_dir ( $ path ) ) { $ env = ( is_admin ( ) ) ? 'admin' : 'front' ; static :: requireFiles ( $ path ) ; static :: requireFiles ( $ path . "/{$env}" ) ; return true ; } return false ; } | Validate the path and require common and environment files |
56,919 | public static function requireFiles ( $ path ) { $ dir = new \ DirectoryIterator ( $ path ) ; foreach ( $ dir as $ file ) { if ( ! $ file -> isDot ( ) || ! $ file -> isDir ( ) ) { $ file_extension = pathinfo ( $ file -> getFilename ( ) , PATHINFO_EXTENSION ) ; if ( $ file_extension === 'php' ) { static :: $ names [ ] =... | Scan the directory at the given path and include all files . Only 1 level iteration . |
56,920 | public function publishScaffoldTemplates ( ) { $ templateType = config ( 'jiyis.laravel_generator.templates' , 'core-templates' ) ; $ templatesPath = base_path ( 'vendor/jiyis/' . $ templateType . '/templates/scaffold' ) ; return $ this -> publishDirectory ( $ templatesPath , $ this -> templatesDir . '/scaffold' , 'jiy... | Publishes templates . |
56,921 | public function prepareSession ( NativeSession $ session , Injector $ injector ) { if ( $ this -> canSessionStart ( ) && $ this -> isCli ( ) === false ) { $ this -> startSession ( ) ; } } | Initialize the session |
56,922 | public function findLocaleFile ( $ file ) { $ app = $ this -> service -> getKernel ( ) -> getApplication ( ) ; $ locale = $ app -> getLocalization ( ) -> getLocale ( ) ; $ repo = $ this -> service -> getResourceRepository ( ) ; $ workDownLanguageTag = function ( $ locale , $ next ) use ( $ repo , $ file ) { if ( strpos... | Finds a localized file by working down the language - tag using the apps associated locale and finally english as fallback |
56,923 | public function loadLocaleFile ( $ file , $ domain ) { $ filename = $ this -> findLocaleFile ( $ file ) ; if ( $ filename !== null ) { $ locale = $ this -> getLocaleFromFilename ( $ filename ) ; $ translator = $ this -> service -> getTranslator ( ) ; $ translator -> addResource ( 'json' , $ filename , $ locale , $ doma... | Load a locale file into the translator |
56,924 | public function check ( string $ password , string $ hashedPassword ) : bool { return $ hashedPassword === $ this -> hash ( $ password ) ; } | Check hash . Generate hash for user provided password and check against existing hash . |
56,925 | public function set ( ) { try { $ this -> loadEnv ( ) ; $ this -> setPhpIni ( getenv ( 'WP_ENV' ) ? : 'development' ) ; $ this -> setConfig ( getenv ( 'WP_ENV' ) ? : 'development' ) ; $ this -> registerMuLoaderLoader ( ) ; $ this -> registerMultiSitePath ( ) ; } catch ( \ RuntimeException $ e ) { die ( '<h1>Configurati... | Set the local WordPress configuration |
56,926 | public function getConfig ( $ config ) { return getenv ( $ config ) ? : $ this -> getDefault ( $ config , $ this -> getEnvConfig ( "config.{$config}" , WP_ENV ) ) ; } | Get a config value |
56,927 | protected function loadEnv ( ) { try { $ this -> dotenv -> load ( ) ; $ this -> dotenv -> required ( $ this -> required ) ; } catch ( \ InvalidArgumentException $ e ) { } } | Use Dotenv to set required environment variables from . env file in root |
56,928 | protected function setPhpIni ( $ env = 'development' ) { foreach ( $ this -> getPhpIni ( $ env ) as $ varname => $ newvalue ) { ini_set ( $ varname , $ newvalue ) ; } } | Set custom PHP ini settings |
56,929 | protected function setConfig ( $ env = 'development' ) { define ( 'WP_ENV' , $ env ) ; $ configs = array_merge ( $ this -> minimal , array_keys ( $ this -> getArrayDot ( $ this -> config , "config" , [ ] ) ) , array_keys ( $ this -> getArrayDot ( $ this -> config , "env.{$env}.config" , [ ] ) ) ) ; foreach ( $ configs ... | Set the WordPress configuration constants |
56,930 | protected function getJsonConfig ( $ file ) { $ configFile = $ this -> path . DIRECTORY_SEPARATOR . $ file ; if ( ! file_exists ( $ this -> path . DIRECTORY_SEPARATOR . $ file ) ) { trigger_error ( "Couldn't load Autobahn config from `{$configFile}`: File not found." , E_USER_NOTICE ) ; return [ ] ; } $ config = json_d... | Get the contents of the local configuration file |
56,931 | protected function getDefault ( $ name , $ real ) { if ( ! is_null ( $ real ) ) { return $ real ; } if ( isset ( $ this -> defaults [ $ name ] ) ) { return $ this -> defaults [ $ name ] ; } switch ( $ name ) { case 'WP_CONTENT_DIR' : return $ this -> path . PUBLIC_DIR . CONTENT_DIR ; case 'WP_SITEURL' : return WP_HOME ... | Get default config value if real one does not exist |
56,932 | protected function getEnvConfig ( $ name , $ env = 'development' ) { $ default = $ this -> getArrayDot ( $ this -> config , $ name , null ) ; $ env = $ this -> getArrayDot ( $ this -> config , "env.{$env}.{$name}" , null ) ; if ( is_array ( $ default ) && is_array ( $ env ) ) { return array_replace_recursive ( $ defaul... | Get the environment depend config value in dot syntax |
56,933 | protected function registerMuLoaderLoader ( ) { if ( defined ( 'WPMU_LOADER' ) ) { $ this -> addFilter ( 'muplugins_loaded' , function ( ) { if ( defined ( 'WPMU_LOADER' ) && file_exists ( WPMU_PLUGIN_DIR . DIRECTORY_SEPARATOR . WPMU_LOADER ) ) { require_once ( WPMU_PLUGIN_DIR . DIRECTORY_SEPARATOR . WPMU_LOADER ) ; } ... | Register the mu - loader loader with wordpress action array |
56,934 | protected function addFilter ( $ tag , $ function_to_add , $ priority = 10 , $ accepted_args = 1 ) { global $ wp_filter ; $ idx = $ this -> filterBuildUniqueId ( $ function_to_add ) ; $ wp_filter [ $ tag ] [ $ priority ] [ $ idx ] = array ( 'function' => $ function_to_add , 'accepted_args' => $ accepted_args ) ; return... | Add a WordPress filter before WordPress is loaded |
56,935 | public function launch ( ) { if ( $ this -> _app_root === null ) { throw new FemtoException ( 'You must define the application route first, do so by calling $femto->setAppRoot($dir)' ) ; } try { $ this -> _request_uri = str_replace ( array ( '?' , $ _SERVER [ 'QUERY_STRING' ] ) , '' , $ _SERVER [ 'REQUEST_URI' ] ) ; $ ... | The Femto application launcher used in the index . php file |
56,936 | public function getConfig ( $ type , $ variable ) { if ( ! isset ( $ this -> _config [ $ type ] ) ) { $ config = $ this -> _loadFile ( $ type , 'config' ) ; if ( ! is_array ( $ config ) ) { throw new FemtoException ( "Unable to parse config of type '{$type}'" ) ; } $ this -> _config [ $ type ] = $ config ; } if ( isset... | Helper function used to retrieve config variables |
56,937 | public function useTemplate ( $ name , $ variables = false ) { $ this -> template = $ name ; $ this -> _template_vars = $ variables ? $ variables : array ( ) ; } | Can be called from pages to specifiy a template that they want to use |
56,938 | public function getUrlPart ( $ part_number ) { $ request_uri = array_filter ( explode ( '/' , $ this -> _request_uri ) , function ( $ part ) { return ! empty ( $ part ) ; } ) ; return ! empty ( $ request_uri [ $ part_number ] ) ? $ request_uri [ $ part_number ] : null ; } | Returns a part of the url or null if it doesn t exist |
56,939 | private function _loadPage ( $ page , $ variables = false ) { ob_start ( ) ; $ this -> page = $ page ; $ this -> _loadFile ( $ this -> page , 'page' , $ variables ) ; if ( $ this -> template !== null ) { $ this -> _template_content = ob_get_clean ( ) ; ob_start ( ) ; $ this -> _loadFile ( $ this -> template , 'template... | Tries to load a page |
56,940 | private function _getFilePath ( $ file , $ type ) { if ( ! in_array ( $ type , array ( 'page' , 'template' , 'fragment' , 'config' ) ) ) { throw new FemtoException ( "The type of file '{$type}' is not supported by Femto" ) ; } $ file = str_replace ( '..' , '' , $ file ) ; $ type = $ type === 'config' ? $ type : "{$type... | Helper function to return the file path for a file of a given type |
56,941 | public function create ( $ blueprint ) { $ name = $ blueprint -> name ; $ type = $ blueprint -> type ; if ( ! isset ( $ this -> count [ $ name ] ) ) { $ this -> count [ $ name ] = 0 ; } $ count = ++ $ this -> count [ $ name ] ; $ values = $ blueprint -> values ( ) ; $ strings = array_map ( function ( $ value ) use ( $ ... | Converts a blueprint array into a persisted object |
56,942 | function write ( ) { if ( strlen ( $ this -> query ) ) { $ this -> query .= " " ; } $ this -> query .= array_reduce ( func_get_args ( ) , array ( $ this , "reduce" ) ) ; return $ this ; } | Append to the query string |
56,943 | function param ( $ param , $ type = null ) { if ( $ param instanceof ExpressibleInterface ) { $ param = $ param -> get ( ) ; } if ( $ param instanceof Expr ) { return ( string ) $ param ; } $ this -> params [ ] = $ param ; $ this -> types [ ] = $ type ; return "\$" . count ( $ this -> params ) ; } | Write a param placeholder and push the param onto the param list |
56,944 | private function connect ( ) { $ memcache = new Memcached ( ) ; $ memcache -> addServer ( $ this -> host , $ this -> port ) ; if ( null !== $ this -> prefix ) { $ memcache -> setOption ( Memcached :: OPT_PREFIX_KEY , $ this -> prefix ) ; } $ this -> memcached = $ memcache ; } | Connect to Memcache . |
56,945 | private function setSplit ( $ key , $ value ) { $ values = str_split ( $ value , self :: VALUE_SPLIT_SIZE ) ; $ to_set = array ( ) ; $ to_set [ $ key ] = self :: VALUE_SPLIT . count ( $ values ) ; foreach ( $ values as $ part_nr => $ v ) { $ to_set [ $ key . $ part_nr ] = $ v ; } if ( false === $ this -> memcached -> s... | Split a value in different parts and add them one by one . |
56,946 | private function getSplit ( $ key , $ parts ) { $ keys = array ( ) ; for ( $ i = 0 ; $ i < $ parts ; $ i ++ ) { $ keys [ ] = $ key . $ i ; } $ values = $ this -> memcached -> getMulti ( $ keys ) ; if ( false === $ values ) { $ msg = sprintf ( 'Unable to retrieve split key "%s": %s.' , $ key , $ this -> memcached -> get... | Retrieve the individual parts of a split value . |
56,947 | private function removeSplit ( $ key , $ parts ) { $ keys = array ( ) ; $ keys [ ] = $ key ; for ( $ i = 0 ; $ i < $ parts ; $ i ++ ) { $ keys [ ] = $ key . $ i ; } if ( false === $ this -> memcached -> deleteMulti ( $ keys ) ) { $ msg = sprintf ( 'Unable to remove split values for key "%s": %s.' , $ key , $ this -> me... | Remove the individual items of a split value . |
56,948 | private function getNumberOfParts ( $ key , $ value ) { $ parts = substr ( $ value , strlen ( self :: VALUE_SPLIT ) ) ; if ( ! ctype_digit ( $ parts ) || $ parts > PHP_INT_MAX ) { throw new \ RuntimeException ( 'Number of parts in split value for key "' . $ key . '" is invalid.' ) ; } return ( int ) $ parts ; } | Returns the number if parts for the split value . |
56,949 | protected function setConfig ( array $ config = array ( ) ) { $ this -> config = $ config ; if ( isset ( $ config [ 'prefix' ] ) ) { $ this -> prefix = $ config [ 'prefix' ] ; } if ( isset ( $ config [ 'host' ] ) ) { $ this -> host = $ config [ 'host' ] ; } if ( isset ( $ config [ 'port' ] ) ) { $ this -> port = $ conf... | Set the configuration . |
56,950 | private function __disconnect ( ) { if ( is_null ( $ this -> memcache ) ) { return ; } $ this -> memcache -> close ( ) ; $ this -> memcache = null ; return true ; } | Disconnects from a sharded server host |
56,951 | public function setCacheDir ( $ dir ) { $ this -> cacheDir = $ dir ; if ( ! is_dir ( $ this -> cacheDir ) ) { $ this -> createDir ( $ this -> cacheDir ) ; } } | Sets cache directory path |
56,952 | public function assign ( $ name , $ value = null ) { if ( is_string ( $ name ) ) { return $ this -> data [ $ name ] = $ value ; } if ( is_array ( $ name ) ) { return $ this -> assignFromArray ( $ name ) ; } throw new \ InvalidArgumentException ( "Invalid data type for key, '" . gettype ( $ name ) . "' given." ) ; } | Assings a variable to the template file |
56,953 | protected function assignFromArray ( $ data ) { if ( ! is_array ( $ data ) ) { throw new \ InvalidArgumentException ( "Invalid data type: argument should be array, '" . gettype ( $ name ) . "' given." ) ; } foreach ( $ data as $ key => $ value ) { $ this -> assign ( $ key , $ value ) ; } } | Multiple variable assignment |
56,954 | public function store ( $ message , $ bucket ) { $ resolver = new Resolver ( $ this -> configDirectory ) ; $ driver = $ resolver -> getDriver ( ) ; if ( true === $ driver -> store ( $ message , $ bucket ) ) { return true ; } return false ; } | Store the notifications |
56,955 | public function fetch ( $ bucket ) { $ resolver = new Resolver ( $ this -> configDirectory ) ; $ driver = $ resolver -> getDriver ( ) ; return $ driver -> fetch ( $ bucket ) ; } | Fetch the notifications |
56,956 | public function publishPact ( $ providerName , $ consumerName , $ version , $ contract ) { $ request = null ; if ( $ contract instanceof \ JsonSerializable ) { $ request = $ this -> requestBuilder -> createPublishPactRequestFromObject ( $ this -> baseUrl , $ consumerName , $ providerName , $ version , $ contract ) ; } ... | Publishes pact to pact broker |
56,957 | public function tagVersion ( $ consumerName , $ version , $ tagName ) { $ request = $ this -> requestBuilder -> createTagVersionRequest ( $ this -> baseUrl , $ consumerName , $ version , $ tagName ) ; $ response = $ this -> client -> sendRequest ( $ request ) ; $ this -> checkIfResponseIsCorrect ( $ response ) ; return... | Tags version with specific name |
56,958 | public function retrievePact ( $ providerName , $ consumerName , $ version , $ tagName = null , ResponseFormatter $ responseFormatter = null ) { $ request = $ this -> requestBuilder -> createRetrievePactRequest ( $ this -> baseUrl , $ consumerName , $ providerName , $ version , $ tagName ) ; $ response = $ this -> clie... | Retrieve contract by version or tag name |
56,959 | public function retrieveLastAddedPact ( ResponseFormatter $ responseFormatter = null ) { $ request = $ this -> requestBuilder -> createRetrieveLastAddedPact ( $ this -> baseUrl ) ; $ response = $ this -> client -> sendRequest ( $ request ) ; $ this -> checkIfResponseIsCorrect ( $ response ) ; return new Contract ( $ re... | Retrieves last added contract to the broker for all providers . |
56,960 | private function checkIfResponseIsCorrect ( ResponseInterface $ response ) { if ( ! in_array ( $ response -> getStatusCode ( ) , [ 200 , 201 , 202 , 204 ] ) ) { throw new PactBrokerException ( 'Response_code: ' . $ response -> getStatusCode ( ) . ' Response_data:' . $ response -> getBody ( ) -> getContents ( ) ) ; } } | Check if response is correct |
56,961 | public function validate ( ... $ validate ) { if ( $ this -> validate === [ ] ) { $ this -> validate = $ validate ; } else { $ this -> validate = array_merge ( $ this -> validate , $ validate ) ; } return $ this ; } | Defines validate rules . |
56,962 | public function where ( $ column , String $ value = NULL , String $ logical = 'and' ) { $ this -> settings [ 'where' ] = true ; $ this -> settings [ 'whereValue' ] = $ value ; $ this -> settings [ 'whereColumn' ] = $ column ; Singleton :: class ( 'ZN\Database\DB' ) -> where ( $ column , $ value , $ logical ) ; return $... | Database Where Clause |
56,963 | public function action ( String $ url = NULL ) { $ this -> settings [ 'attr' ] [ 'action' ] = IS :: url ( $ url ) ? $ url : Request :: getSiteURL ( $ url ) ; return $ this ; } | Sets Form Action |
56,964 | public function enctype ( String $ enctype ) { if ( isset ( $ this -> enctypes [ $ enctype ] ) ) { $ enctype = $ this -> enctypes [ $ enctype ] ; } $ this -> _element ( __FUNCTION__ , $ enctype ) ; return $ this ; } | Sets Form Enctype |
56,965 | public function option ( $ key , String $ value = NULL ) { if ( is_array ( $ key ) ) { $ this -> settings [ 'option' ] = $ key ; } else { $ this -> settings [ 'option' ] [ $ key ] = $ value ; } return $ this ; } | Sets select options |
56,966 | protected function setJavascriptValidation ( $ name , $ lang , $ rule = NULL , $ param = [ ] ) { $ this -> getJavascriptValidationFunction [ $ name ] = $ function = $ name . md5 ( $ name ) ; $ this -> validate [ ] = $ rule ? : $ lang ; return $ this -> onkeyup ( $ function . '(this, ' . Base :: suffix ( implode ( ', ' ... | Protected set javascript validation |
56,967 | protected function onInvalidEventPattern ( $ pattern , $ key , $ check = [ ] , $ type = NULL ) { $ this -> validate [ ] = $ type ? : $ key ; return $ this -> onInvalidEventPatternWithoutValidate ( $ pattern , $ key , $ check ) ; } | Protected on invalid event pattern |
56,968 | protected function onInvalidEventPatternWithoutValidate ( $ pattern , $ key , $ check = [ ] ) { return $ this -> required ( ) -> pattern ( $ pattern ) -> onInvalidEventCustomValidity ( $ key , $ check ) ; } | Protected on invalid event pattern without validate |
56,969 | protected function onInvalidEventAttributeValidate ( $ key , $ check = [ ] , $ rule = NULL ) { $ this -> validate [ ] = $ rule ? : $ key ; return $ this -> required ( ) -> onInvalidEventCustomValidity ( $ key , $ check ) ; } | Protected on invalid event attribute validate |
56,970 | protected function onInvalidEventCustomValidity ( $ key , $ check = [ ] ) { $ this -> vMethodMessages .= $ this -> setCustomValidity ( $ key , $ check ) . ' ' ; return $ this ; } | Protected on invalid event custom validity |
56,971 | protected function getVMethodMessages ( ) { if ( $ this -> vMethodMessages !== NULL ) { $ this -> oninvalid ( 'setCustomValidity(\'' . rtrim ( $ this -> vMethodMessages ) . '\')' ) -> oninput ( 'setCustomValidity(\'\')' ) -> validate ( ... $ this -> validate ) ; $ this -> vMethodMessages = NULL ; } } | Protected get validate method messages |
56,972 | protected function setCustomValidity ( $ key , $ check = [ ] ) { $ message = NULL ; if ( is_scalar ( $ key ) ) { $ message = $ this -> getValidationLangValue ( $ key , $ check ) ; } else foreach ( $ key as $ k => $ c ) { $ message .= $ this -> getValidationLangValue ( $ k , $ c ) . ' ' ; } return rtrim ( $ message ) ; ... | Protected set custom validity |
56,973 | protected function _getrow ( $ type , $ value , & $ attributes ) { if ( $ row = ( $ this -> settings [ 'getrow' ] ?? NULL ) ) { $ rowval = $ row -> { $ attributes [ 'name' ] } ?? NULL ; if ( $ type === 'textarea' || $ type === 'select' ) { return $ value ? : $ rowval ; } $ attributes [ 'value' ] = $ value ? : $ rowval ... | Protected Get Row |
56,974 | public function getProspectService ( ) { if ( ! $ this -> prospectService ) { $ this -> prospectService = $ this -> getServiceLocator ( ) -> get ( 'playgroundflow_prospect_service' ) ; } return $ this -> prospectService ; } | Retrieve service prospect instance |
56,975 | public function getUserDomainService ( ) { if ( ! $ this -> userDomainService ) { $ this -> userDomainService = $ this -> getServiceLocator ( ) -> get ( 'playgroundflow_user_domain_service' ) ; } return $ this -> userDomainService ; } | Retrieve service userdomain instance |
56,976 | public function getLeaderboardService ( ) { if ( ! $ this -> leaderboardService ) { $ this -> leaderboardService = $ this -> getServiceLocator ( ) -> get ( 'playgroundreward_leaderboard_service' ) ; } return $ this -> leaderboardService ; } | Retrieve service leaderboardservice instance |
56,977 | public static function toArray ( $ mixed , $ depth = 1 , $ whitelist = [ ] , $ blacklist = [ ] ) { if ( $ depth < 0 ) { return NULL ; } if ( is_array ( $ mixed ) || $ mixed instanceof Traversable ) { $ anArray = [ ] ; foreach ( $ mixed as $ key => $ value ) { if ( is_array ( $ value ) || $ value instanceof Traversable ... | Serializes our Doctrine Entities |
56,978 | private static function arrayizor ( $ anObject , $ depth , $ whitelist = [ ] , $ blacklist = [ ] ) { $ nextDepth = $ depth - 1 ; $ clazzName = get_class ( $ anObject ) ; $ reflectionClass = new ReflectionClass ( $ anObject ) ; $ clazzProps = $ reflectionClass -> getProperties ( ) ; if ( is_a ( $ anObject , 'Doctrine\OR... | This does all the heavy lifting of actually converting to an array |
56,979 | public function prepare ( ContentInterface $ content , ThemeInterface $ theme , $ templateTypeName = null ) { $ this -> contextStack -> push ( $ this -> contextBuilder -> setContent ( $ content ) -> setTheme ( $ theme ) -> setTemplateTypeName ( $ templateTypeName ) -> createContext ( ) ) ; return $ this ; } | Prepare a rendering context from given content and theme . |
56,980 | public function output ( ) { if ( $ this -> status === null ) { $ this -> status = ( empty ( $ this -> body ) || $ this -> method === 'HEAD' ) ? HttpResponse :: HTTP_NO_CONTENT : HttpResponse :: HTTP_OK ; } if ( $ this -> method === 'HEAD' || ! HttpResponse :: canHaveBody ( $ this -> status ) ) { $ content_type = 'HEAD... | Outputs Response content |
56,981 | public function needsRehash ( string $ password ) : bool { return password_needs_rehash ( $ password , $ this -> hashType , $ this -> hashOptions ) ; } | Returns true if the password need to be rehashed due to the password being created with anything else than the passwords generated by this class . |
56,982 | public function bind ( $ abstract , $ concrete = null , $ shared = false ) { if ( is_array ( $ abstract ) ) { list ( $ abstract , $ alias ) = $ this -> extractAlias ( $ abstract ) ; $ this -> alias ( $ abstract , $ alias ) ; } if ( is_null ( $ concrete ) ) { $ concrete = $ abstract ; } if ( ! $ concrete instanceof \ Cl... | Register a binding with the ioc . |
56,983 | public function offsetSet ( $ key , $ value ) { if ( ! $ value instanceof \ Closure ) { $ value = function ( ) use ( $ value ) { return $ value ; } ; } $ this -> bind ( $ key , $ value ) ; } | Set the value at a given offset . |
56,984 | private function registerCommandBus ( ) { $ this -> app -> bindShared ( 'Flyingfoxx\CommandCenter\CommandBus' , function ( $ app ) { $ main = $ app -> make ( 'Flyingfoxx\CommandCenter\MainCommandBus' ) ; $ application = $ app -> make ( 'Flyingfoxx\CommandCenter\CommandApplication' ) ; $ translator = $ app -> make ( 'Fl... | Register the desired command bus implementation . |
56,985 | public function getParent ( ) { if ( ( $ this -> parent === null ) && $ this -> getParentId ( ) ) { $ this -> parent = $ this -> termFactory -> create ( $ this -> getParentId ( ) , $ this -> taxonomy ) ; } return $ this -> parent ; } | Get the parent term of this term . |
56,986 | public function getChildren ( ) { $ children = array ( ) ; $ wpTerms = get_terms ( $ this -> taxonomy -> getName ( ) , array ( 'hide_empty' => false , 'parent' => ( int ) $ this -> getId ( ) ) ) ; foreach ( $ wpTerms as $ termData ) { $ children [ ] = $ this -> termFactory -> create ( $ termData , $ this -> taxonomy ) ... | Return array of direct child terms of this term . |
56,987 | private function _getApiUri ( $ hostname , $ storeId , $ major , $ minor ) { return sprintf ( Radial_Core_Helper_Data :: URI_FORMAT , $ hostname , $ major , $ minor , $ storeId , self :: AD_VAL_SERVICE , self :: AD_VAL_OPERATION , '' , 'xml' ) ; } | Get the URI of the API endpoint for the AdVal request using the provided hostname store id and version . |
56,988 | public function getParamOrFallbackValue ( Zend_Controller_Request_Abstract $ request , $ param , $ useDefaultParam , $ configPath ) { $ paramValue = $ request -> getParam ( $ param ) ; $ useFallback = $ request -> getParam ( $ useDefaultParam ) ; if ( is_null ( $ paramValue ) || $ useFallback ) { return $ this -> getCo... | Get the value from the request or via the config fallback . |
56,989 | public function getConfigSource ( Zend_Controller_Request_Abstract $ request , $ useFallback = false ) { $ store = $ request -> getParam ( 'store' ) ; $ website = $ request -> getParam ( 'website' ) ; if ( $ store ) { $ storeObj = Mage :: app ( ) -> getStore ( $ store ) ; return $ useFallback ? $ storeObj -> getWebsite... | Get the source of configuration for the request . Should use the store or website specified in the request params . If neither is present should use the default store . |
56,990 | public function process ( ) { $ ajax = [ ] ; foreach ( $ this -> commands as $ cmd ) { if ( $ cmd instanceof DomCommandInterface && empty ( $ cmd -> getSelector ( ) ) ) { $ cmd -> setSelector ( 'body' ) ; } $ fa = [ 'f' => $ cmd -> getFunction ( ) , 'a' => $ cmd -> getArgs ( ) ] ; if ( $ cmd instanceof DomCommandInterf... | Builds the ajax command structure |
56,991 | private function extractDefaultResolver ( AggregateResolver $ aggregate ) : void { if ( $ this -> resolver instanceof DefaultResolver ) { return ; } $ resolver = $ aggregate -> fetchByType ( DefaultResolver :: class ) ; if ( $ resolver instanceof AggregateResolver ) { $ queue = $ resolver -> getIterator ( ) ; $ resolve... | Extract and compose the DefaultResolver found in an AggregateResolver . |
56,992 | private function mergeParams ( string $ name , $ vars ) { $ globalDefaults = isset ( $ this -> defaultParams [ TemplateRendererInterface :: TEMPLATE_ALL ] ) ? $ this -> defaultParams [ TemplateRendererInterface :: TEMPLATE_ALL ] : [ ] ; $ templateDefaults = isset ( $ this -> defaultParams [ $ name ] ) ? $ this -> defau... | Merge passed and default parameters . |
56,993 | private function mergeObjectParams ( $ params , array $ defaults ) { if ( ! is_object ( $ params ) ) { return ; } foreach ( $ defaults as $ key => $ value ) { if ( ! isset ( $ params -> { $ key } ) && ! method_exists ( $ params , $ key ) ) { $ params -> { $ key } = $ value ; } } return $ params ; } | Merge defaults with a view model object . |
56,994 | public function fieldTypesToFilter ( $ arrFields ) { foreach ( $ arrFields as $ key => & $ properties ) { if ( isset ( $ properties [ 'filter' ] ) || ! isset ( $ properties [ 'type' ] ) || ! isset ( $ this -> typesToFilter [ $ properties [ 'type' ] ] ) ) continue ; $ properties = $ properties + $ this -> typesToFilter ... | Return array of filters created out of the types of the fields . If the field already has any filter defined nothing will happen . |
56,995 | public function filterErrors ( $ arrData , $ arrFilters , $ bolStrict = true ) { return $ this -> getErrors ( $ this -> filter ( $ arrData , $ arrFilters , $ bolStrict ) ) ; } | Filters an array of values and returns an array with error messages |
56,996 | private function filterArray ( $ arrData , $ arrFilters ) { foreach ( $ arrFilters as $ key => & $ F ) { if ( is_int ( $ F ) ) $ F = array ( 'filter' => $ F ) ; elseif ( ! isset ( $ F [ 'filter' ] ) ) { unset ( $ arrFilters [ $ key ] ) ; continue ; } elseif ( is_string ( $ F [ 'filter' ] ) ) { try { $ intF = @ constant... | Filters an array of values |
56,997 | public function getError ( $ error , $ opts = array ( ) ) { if ( is_array ( $ error ) && isset ( $ error [ 'filter' ] ) ) { return $ this -> getErrorMessage ( $ error [ 'filter' ] , $ error + $ opts ) ; } elseif ( is_int ( $ error ) ) { return $ this -> getErrorMessage ( $ error , $ opts ) ; } else { return $ this -> g... | Returns a single error message for a validator |
56,998 | public function select ( $ filename ) { $ ext = substr ( strrchr ( $ filename , "." ) , 1 ) ; foreach ( $ this -> renders as $ renderer ) { if ( $ renderer -> can_use ( $ ext ) ) { return $ renderer ; } } throw new \ Exception ( 'Render not available for this extension.' ) ; } | Select a render by the extension of the file . |
56,999 | function getAccessMode ( ) { if ( ! $ this -> accessMode ) $ this -> accessMode = new AccessMode ( self :: DEFAULT_ACCESS_MODE ) ; return $ this -> accessMode ; } | Get Open Access Mode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.