idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
45,100 | function getAllInterfaces ( $ includeSelf ) { if ( NULL === $ this -> interfacesAll ) { $ this -> interfacesAllInclSelf = $ this -> interfacesAll = $ this -> buildAllInterfacesWithoutSelf ( ) ; if ( NULL !== $ this -> selfInterfaceName ) { $ selfInterface = $ this -> classIndex -> classGetReflection ( $ this -> selfInt... | Gets all interfaces directly or indirectly implemented by this class . |
45,101 | public function hasVisibleChildren ( ) { foreach ( $ this -> children as $ child ) { if ( ! ( $ child instanceof \ Zepi \ Web \ General \ Entity \ HiddenMenuEntry ) ) { return true ; } } return false ; } | Returns true if the menu entry has one or more children which are visible . Otherwise returns false . |
45,102 | public function shouldHide ( ) { if ( ! $ this -> hideWhenEmpty ) { return false ; } foreach ( $ this -> children as $ child ) { if ( ! $ child -> shouldHide ( ) ) { return false ; } } return true ; } | Returns true if the menu entry should be hidden |
45,103 | public function addChild ( MenuEntry $ child ) { if ( isset ( $ this -> children [ $ child -> getKey ( ) ] ) ) { return false ; } $ this -> children [ $ child -> getKey ( ) ] = $ child ; $ child -> setParent ( $ this ) ; return true ; } | Adds a MenuEntry as child and add this MenuEntry as parent of the child . |
45,104 | public function getBestTarget ( ) { if ( $ this -> hasParent ( ) && ( $ this -> target == '' || $ this -> target == '#' ) ) { return $ this -> parent -> getBestTarget ( ) ; } return $ this -> target ; } | Returns the best available target if the menu entry has no target the target of the parent object will be returned . |
45,105 | public function setActive ( $ isActive ) { $ this -> isActive = ( bool ) $ isActive ; if ( $ this -> parent !== null ) { $ this -> parent -> setActive ( $ isActive ) ; } } | Sets the menu entry as active |
45,106 | protected function getFieldGetter ( \ ReflectionClass $ reflectionClass , $ fieldName ) { foreach ( array ( 'get' , 'is' , 'has' ) as $ prefix ) { $ getter = $ prefix . ucfirst ( $ fieldName ) ; $ reflectionMethod = $ reflectionClass -> getMethod ( $ getter ) ; if ( $ reflectionMethod && $ reflectionMethod -> isPublic ... | Returns the Reflection Method of the getter of the field |
45,107 | public function build ( $ propOverride = array ( ) ) { $ this -> debug -> info ( __METHOD__ , $ this -> attribs [ 'name' ] ) ; if ( $ propOverride == 'tagOnly' ) { $ propOverride = array ( 'tagOnly' => true ) ; } elseif ( ! \ is_array ( $ propOverride ) ) { $ this -> debug -> warn ( 'invalid propOverride' , $ propOverr... | Build html control |
45,108 | public function doValidate ( ) { $ isValid = true ; if ( $ this -> props [ 'validate' ] ) { $ isValid = \ call_user_func ( $ this -> props [ 'validate' ] , $ this ) ; } return $ isValid ; } | Extend me to perform custom validation |
45,109 | public function flag ( $ reason = null ) { $ this -> props [ 'isValid' ] = false ; $ this -> classAdd ( $ this -> props [ 'attribsContainer' ] , 'has-error' ) ; if ( $ this -> attribs [ 'type' ] == 'file' && isset ( $ this -> form -> currentValues [ $ this -> attribs [ 'name' ] ] ) ) { $ fileInfo = $ this -> form -> cu... | Flag a field as invalid |
45,110 | public function focus ( ) { if ( \ in_array ( $ this -> attribs [ 'type' ] , array ( 'checkbox' , 'radio' ) ) ) { $ keys = \ array_keys ( $ this -> props [ 'options' ] ) ; $ this -> props [ 'options' ] [ $ keys [ 0 ] ] [ 'autofocus' ] = true ; } else { $ this -> attribs [ 'autofocus' ] = true ; } } | Sets autofocus attribute |
45,111 | public function getId ( ) { $ id = $ this -> props [ 'attribs' ] [ 'id' ] ; $ sepChar = '_' ; $ repChar = '_' ; if ( ! $ id && $ this -> props [ 'attribs' ] [ 'name' ] ) { $ id = \ preg_replace ( '/\W/' , $ repChar , $ this -> props [ 'attribs' ] [ 'name' ] ) ; $ id = \ preg_replace ( '/' . $ repChar . '+/' , $ repChar... | Returns ID attribute If ID attribute is non - existant ID will be derived from name and prefix |
45,112 | public function getUniqueId ( $ increment = true ) { $ id = $ this -> getId ( ) ; if ( $ id ) { $ sepChar = '_' ; if ( isset ( self :: $ idCounts [ $ id ] ) ) { if ( $ increment ) { self :: $ idCounts [ $ id ] ++ ; } if ( self :: $ idCounts [ $ id ] > 1 ) { $ id .= $ sepChar . self :: $ idCounts [ $ id ] ; } } else { s... | Returns unique ID . |
45,113 | public function isRequired ( ) { $ isRequired = $ this -> attribs [ 'required' ] ; if ( \ is_string ( $ isRequired ) ) { $ replaced = \ preg_replace ( '/{{(.*?)}}/' , '$this->form->getField("$1")->val()' , $ isRequired ) ; $ evalString = '$isRequired = (bool) ' . $ replaced . ';' ; eval ( $ evalString ) ; } return $ is... | Is field required? |
45,114 | public function setProps ( $ props = array ( ) ) { $ props = $ this -> moveShortcuts ( $ props ) ; $ type = isset ( $ props [ 'attribs' ] [ 'type' ] ) ? $ props [ 'attribs' ] [ 'type' ] : null ; $ typeChanging = $ type && ( ! isset ( $ this -> attribs [ 'type' ] ) || $ type !== $ this -> attribs [ 'type' ] ) ; $ propsT... | Set field properties |
45,115 | private function setValue ( $ value , $ store ) { if ( \ in_array ( $ this -> attribs [ 'type' ] , array ( 'checkbox' , 'select' ) ) ) { if ( \ is_null ( $ value ) ) { $ value = array ( ) ; } $ this -> props [ 'values' ] = ( array ) $ value ; } else { $ this -> attribs [ 'value' ] = $ value ; } if ( $ store ) { if ( $ ... | Set field s value |
45,116 | public function val ( $ val = null , $ store = true ) { if ( \ func_num_args ( ) ) { $ this -> setValue ( $ val , $ store ) ; } else { if ( $ this -> props [ 'getValFormatted' ] && ! \ in_array ( 'getValFormatted' , $ this -> callStack ) ) { $ this -> callStack [ ] = 'getValFormatted' ; $ return = \ call_user_func ( $ ... | Get or set field s value If getting will return + formatted value if field has getValFormatted callable + raw value otherwise |
45,117 | protected function validateCrs ( ) { $ nonEmpty = array ( ) ; $ enabled = array ( ) ; $ required = array ( ) ; $ optsValid = array ( ) ; foreach ( $ this -> props [ 'options' ] as $ opt ) { if ( empty ( $ opt [ 'attribs' ] [ 'disabled' ] ) && ! isset ( $ opt [ 'optgroup' ] ) ) { $ enabled [ ] = $ opt [ 'attribs' ] [ 'v... | Validate Checkbox Radio Select |
45,118 | public function read ( $ id ) { $ class = $ this -> getEntityClassFromType ( $ this -> apiRecordType ) ; $ entity = $ this -> getEntityManager ( ) -> find ( $ class , $ id ) ; if ( ! $ entity ) { return new Response ( '' , Response :: HTTP_NOT_FOUND ) ; } return new JsonResponse ( $ this -> getApiWriter ( ) -> writeObj... | Note that route must be set up to include an id parameter |
45,119 | protected function getTS3Connection ( ) { $ serverqry = TeamSpeak3_Helper_Uri :: getSessParam ( "_serverqry" ) ; if ( ! $ serverqry ) { throw new Exception ( "TeamSpeak3_Node_Abstract object does not exist in your current session" ) ; } $ this -> ts3 = unserialize ( $ serverqry ) ; } | Loads the TeamSpeak3_Node_Abstract object stored in the current session . |
45,120 | protected function assignLastEvent ( ) { $ this -> tpl -> assign ( "eventMesg" , TeamSpeak3_Helper_Uri :: getSessParam ( "_eventmesg" ) ) ; $ this -> tpl -> assign ( "eventType" , TeamSpeak3_Helper_Uri :: getSessParam ( "_eventtype" , "user" ) ) ; unset ( $ _SESSION [ "_eventmesg" ] ) ; unset ( $ _SESSION [ "_eventtype... | Assigns available event messages to the template and deletes them from the session . |
45,121 | protected function redirect ( $ module , $ action = "index" , $ params = array ( ) ) { $ module = $ this -> app -> getModuleKey ( ) . "=" . $ module ; $ action = $ action != "index" ? '&' . $ this -> app -> getActionKey ( ) . "=" . $ action : "" ; foreach ( $ params as $ key => $ val ) { $ action .= "&" . $ key . "=" .... | Redirects the client to a specified module and action . |
45,122 | public function dispatch ( ) { $ moduleName = $ this -> app -> getModuleName ( ) ; $ actionName = $ this -> app -> getActionName ( ) ; $ layoutFile = $ moduleName . ( $ actionName != "index" ? "_" . $ actionName : "" ) . ".tpl.php" ; $ this -> tpl -> render ( $ layoutFile ) ; } | Renders a page for the module . |
45,123 | public function error ( $ str , $ status = 1 , $ new_line = true ) { fwrite ( $ this -> error , $ str . ( true === $ new_line ? PHP_EOL : '' ) ) ; fflush ( $ this -> error ) ; if ( $ status > 0 ) exit ( $ status ) ; } | Write a message on STDERR and exit with an error status |
45,124 | public function write ( $ str , $ new_line = true ) { fwrite ( $ this -> stream , $ str . ( true === $ new_line ? PHP_EOL : '' ) ) ; fflush ( $ this -> stream ) ; } | Write a message on STDOUT |
45,125 | public function prompt ( $ str ) { self :: write ( $ str , false ) ; $ this -> user_response = trim ( fgets ( $ this -> input , 4096 ) ) ; } | Write a message on STDOUT and wait for a user input on STDIN |
45,126 | protected function renderElement ( ElementInterface $ element ) { $ collection = $ this -> getAttributesCollection ( $ element ) ; $ this -> addElementChildren ( $ element , $ collection ) ; $ this -> addElementDependencies ( $ element , $ collection ) ; $ this -> addElementRules ( $ element , $ collection ) ; return $... | Renders single form element with additional attributes |
45,127 | protected function addElementChildren ( ElementInterface $ element , AttributeCollection $ collection ) { $ children = $ element -> getChildren ( ) ; if ( $ children -> count ( ) ) { $ attribute = new Attribute ( 'aoFields' , $ this -> renderChildren ( $ children ) , Attribute :: TYPE_ARRAY ) ; $ collection -> add ( $ ... | Adds javascript children to element |
45,128 | protected function addElementDependencies ( ElementInterface $ element , AttributeCollection $ collection ) { if ( $ element -> hasOption ( 'dependencies' ) && count ( $ element -> getOption ( 'dependencies' ) ) ) { $ dependencies = $ this -> formatter -> formatDependencies ( $ element -> getOption ( 'dependencies' ) )... | Adds javascript dependencies to element |
45,129 | protected function addElementRules ( ElementInterface $ element , AttributeCollection $ collection ) { if ( $ element -> hasOption ( 'rules' ) && count ( $ element -> getOption ( 'rules' ) ) ) { $ rules = $ this -> formatter -> formatRules ( $ element -> getOption ( 'rules' ) ) ; $ collection -> add ( new Attribute ( '... | Adds javascript rules to element |
45,130 | protected function getAttributesCollection ( ElementInterface $ element ) : AttributeCollection { $ collection = new AttributeCollection ( ) ; $ element -> prepareAttributesCollection ( $ collection ) ; return $ collection ; } | Returns attributes collection for element |
45,131 | protected function renderChildren ( ElementCollection $ children ) { $ attributes = [ ] ; $ children -> forAll ( function ( ElementInterface $ child ) use ( & $ attributes ) { $ attributes [ ] = $ this -> renderElement ( $ child ) ; } ) ; return $ attributes ; } | Renders all children elements |
45,132 | public static function Fw2m ( $ gamb , $ phib , $ psi , $ eps , array & $ r ) { IAU :: Ir ( $ r ) ; IAU :: Rz ( $ gamb , $ r ) ; IAU :: Rx ( $ phib , $ r ) ; IAU :: Rz ( - $ psi , $ r ) ; IAU :: Rx ( - $ eps , $ r ) ; return ; } | - - - - - - - - i a u F w 2 m - - - - - - - - |
45,133 | public static function getFacadeRoot ( ) { $ accessor = static :: getFacadeAccessor ( ) ; $ instance = Application :: getInstance ( ) -> make ( $ accessor ) ; if ( $ instance == null ) { throw new Exception ( 'Facade get null for: ' . $ accessor ) ; } return $ instance ; } | Get the root object behind the facade . |
45,134 | public function recover ( ) { if ( static :: $ count <= Config :: get ( 'errors.throttle' , 10 ) ) { logger ( \ Fuel :: L_ERROR , $ this -> code . ' - ' . $ this -> message . ' in ' . $ this -> file . ' on line ' . $ this -> line ) ; if ( \ Fuel :: $ env != \ Fuel :: PRODUCTION and ( $ this -> code & error_reporting ( ... | Allow the error handler from recovering from error types defined in the config |
45,135 | public static function shutdown_handler ( ) { $ last_error = error_get_last ( ) ; if ( $ last_error AND in_array ( $ last_error [ 'type' ] , static :: $ fatal_levels ) ) { $ severity = static :: $ levels [ $ last_error [ 'type' ] ] ; logger ( \ Fuel :: L_ERROR , $ severity . ' - ' . $ last_error [ 'message' ] . ' in ' ... | Native PHP shutdown handler |
45,136 | public static function exception_handler ( \ Exception $ e ) { if ( method_exists ( $ e , 'handle' ) ) { return $ e -> handle ( ) ; } $ severity = ( ! isset ( static :: $ levels [ $ e -> getCode ( ) ] ) ) ? $ e -> getCode ( ) : static :: $ levels [ $ e -> getCode ( ) ] ; logger ( \ Fuel :: L_ERROR , $ severity . ' - ' ... | PHP Exception handler |
45,137 | public static function error_handler ( $ severity , $ message , $ filepath , $ line ) { if ( error_reporting ( ) !== 0 ) { $ fatal = ( bool ) ( ! in_array ( $ severity , \ Config :: get ( 'errors.continue_on' , array ( ) ) ) ) ; if ( $ fatal ) { throw new \ PhpErrorException ( $ message , $ severity , 0 , $ filepath , ... | PHP Error handler |
45,138 | public static function show_php_error ( \ Exception $ e ) { $ fatal = ( bool ) ( ! in_array ( $ e -> getCode ( ) , \ Config :: get ( 'errors.continue_on' , array ( ) ) ) ) ; $ data = static :: prepare_exception ( $ e , $ fatal ) ; if ( $ fatal ) { $ data [ 'contents' ] = ob_get_contents ( ) ; while ( ob_get_level ( ) >... | Shows an error . It will stop script execution if the error code is not in the errors . continue_on whitelist . |
45,139 | public static function notice ( $ msg , $ always_show = false ) { $ trace = array_merge ( array ( 'file' => '(unknown)' , 'line' => '(unknown)' ) , \ Arr :: get ( debug_backtrace ( ) , 1 ) ) ; logger ( \ Fuel :: L_DEBUG , 'Notice - ' . $ msg . ' in ' . $ trace [ 'file' ] . ' on line ' . $ trace [ 'line' ] ) ; if ( \ Fu... | Shows a small notice error only when not in production or when forced . This is used by several libraries to notify the developer of certain things . |
45,140 | public function userWithPass ( $ username , $ password ) { $ header = base64_encode ( sprintf ( '%s:%s' , $ username , $ password ) ) ; $ this -> headers [ 'Authorization' ] = 'Basic ' . $ header ; } | Set the username and password for send request |
45,141 | public function responseIsSuccessfully ( ) { Assertions :: assertEquals ( 200 , $ this -> response -> getStatusCode ( ) , sprintf ( 'Response with error "%s".' , $ this -> response -> getBody ( ) ) ) ; Assertions :: assertNull ( $ this -> response -> getRpcErrorCode ( ) , sprintf ( 'Response with error "%s".' , $ this ... | Check response is successfully |
45,142 | public function responseIsSuccessfullyWithContainScalarResult ( $ result ) { Assertions :: assertEquals ( 200 , $ this -> response -> getStatusCode ( ) , sprintf ( 'Response with error "%s"' , $ this -> response -> getBody ( ) ) ) ; Assertions :: assertTrue ( is_null ( $ this -> response -> getRpcErrorCode ( ) ) , spri... | Check success response with scalar result |
45,143 | public function responseIsSuccessfullyWithContainListResult ( TableNode $ table , $ count = null ) { $ this -> responseIsSuccessfully ( ) ; $ rpcResult = $ this -> response -> getRpcResult ( ) ; Assertions :: assertTrue ( is_array ( $ rpcResult ) , sprintf ( 'The RPC response must be a array, but "%s" given.' , gettype... | Check response successfully with list result |
45,144 | public function iSendARequest ( $ method , TableNode $ params ) { $ id = $ this -> getRequestId ( ) ? $ this -> getRequestId ( ) : uniqid ( ) ; $ params = $ params -> getRowsHash ( ) ; $ requestParameters = [ ] ; foreach ( $ params as $ parameterKey => $ parameterValue ) { $ property = new PropertyPath ( $ parameterKey... | Sends Json rpc request to specific method . |
45,145 | public function theServerShouldReturnStatusCode ( $ status ) { Assertions :: assertNotNull ( $ this -> response , 'Missing response. Can you not send request?' ) ; Assertions :: assertEquals ( $ status , $ this -> response -> getStatusCode ( ) , 'Invalid HTTP status code.' ) ; } | The server should return status code |
45,146 | public function theServerShouldReturnHeaders ( TableNode $ headers ) { Assertions :: assertNotNull ( $ this -> response , 'Missing response. Can you not send request?' ) ; $ responseHeaders = [ ] ; foreach ( $ this -> response -> getHeaders ( ) as $ name => $ value ) { $ responseHeaders [ strtolower ( $ name ) ] = $ va... | The server should return headers |
45,147 | public function theResponseShouldContainErrorWithMessage ( $ id , $ message ) { Assertions :: assertEquals ( intval ( $ id ) , $ this -> response -> getRpcErrorCode ( ) ) ; Assertions :: assertEquals ( $ message , $ this -> response -> getRpcErrorMessage ( ) ) ; } | Parse json - rpc error response |
45,148 | public function theResponseShouldContainErrorData ( $ id , $ message , TableNode $ table ) { Assertions :: assertEquals ( 200 , $ this -> response -> getStatusCode ( ) ) ; $ this -> theResponseShouldContainErrorWithMessage ( $ id , $ message ) ; $ error = $ this -> getFieldFromBody ( 'error' , $ this -> response -> get... | Check json - rpc error data |
45,149 | protected function getFieldFromBody ( $ key , $ body ) { $ rpc = json_decode ( $ body , true ) ; return isset ( $ rpc [ $ key ] ) ? $ rpc [ $ key ] : null ; } | Get field from body |
45,150 | public function authenticate ( $ username , $ password ) { $ authRequest = new Request ( 'GET' , $ this -> userbaseUrl ) ; $ client = new GuzzleClient ( [ 'verify' => $ this -> tlsCertVerification , 'headers' => [ 'User-Agent' => 'HubUserbaseClient (Guzzle)' , ] , 'auth' => [ $ username , $ password ] , ] ) ; try { $ r... | Authenticate with UserBase . |
45,151 | public function reorderPages ( ) { if ( ! $ this -> request -> isAll ( [ 'ajax' , 'post' ] ) ) { throw new MethodNotAllowedException ( ) ; } if ( empty ( $ this -> request -> data ) ) { throw new BadRequestException ( ) ; } $ this -> request -> data = Hash :: map ( $ this -> request -> data , '{n}' , function ( $ page ... | reorderPages action AJAX POST |
45,152 | public function indexAction ( Request $ request ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ qb = $ em -> getRepository ( StockChangeLog :: class ) -> createQueryBuilder ( 's' ) ; $ this -> addQueryBuilderSort ( $ qb , 'stockchangelog' ) ; $ paginator = $ this -> get ( 'knp_paginator' ) -> paginate ( $ qb... | Lists all StockChangeLog entities . |
45,153 | public function showAction ( StockChangeLog $ stockchangelog ) { $ editForm = $ this -> createForm ( new StockChangeLogType ( ) , $ stockchangelog , array ( 'action' => $ this -> generateUrl ( 'admin_shop_changelog_update' , array ( 'id' => $ stockchangelog -> getid ( ) ) ) , 'method' => 'PUT' , ) ) ; $ deleteForm = $ ... | Finds and displays a StockChangeLog entity . |
45,154 | public function newAction ( ) { $ stockchangelog = new StockChangeLog ( ) ; $ form = $ this -> createForm ( new StockChangeLogType ( ) , $ stockchangelog ) ; return array ( 'stockchangelog' => $ stockchangelog , 'form' => $ form -> createView ( ) , ) ; } | Displays a form to create a new StockChangeLog entity . |
45,155 | public function createAction ( Request $ request ) { $ stockchangelog = new StockChangeLog ( ) ; $ form = $ this -> createForm ( new StockChangeLogType ( ) , $ stockchangelog ) ; if ( $ form -> handleRequest ( $ request ) -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ stockc... | Creates a new StockChangeLog entity . |
45,156 | public function updateAction ( StockChangeLog $ stockchangelog , Request $ request ) { $ editForm = $ this -> createForm ( new StockChangeLogType ( ) , $ stockchangelog , array ( 'action' => $ this -> generateUrl ( 'admin_shop_changelog_update' , array ( 'id' => $ stockchangelog -> getid ( ) ) ) , 'method' => 'PUT' , )... | Edits an existing StockChangeLog entity . |
45,157 | public static function Atciqn ( $ rc , $ dc , $ pr , $ pd , $ px , $ rv , iauASTROM & $ astrom , $ n , array $ b , & $ ri , & $ di ) { foreach ( $ b as $ i ) if ( $ i instanceof iauLDBODY == false ) throw new \ InvalidArgumentException ( "All \$b elements must be iauLDBODY type" ) ; $ pco = [ ] ; $ pnat = [ ] ; $ ppr =... | - - - - - - - - - - i a u A t c i q n - - - - - - - - - - |
45,158 | public function getTag ( $ tag ) { return isset ( $ this -> tags [ $ tag ] ) ? $ this -> tags [ $ tag ] : null ; } | Get the value of a tag or null if it doesn t exist . |
45,159 | public function setHeader ( $ action , $ method = 'POST' , array $ attributes = array ( ) ) { $ this -> setAction ( $ action ) ; $ this -> setMethod ( $ method ) ; $ this -> setAttributes ( $ attributes ) ; return $ this ; } | Set the action method and any additional attributes of the Form . |
45,160 | public function header ( ) { $ attributes = array ( 'action' => $ this -> action , 'method' => $ this -> method ) ; $ attributes = array_merge ( $ attributes , $ this -> attributes ) ; return Html :: openTag ( 'form' , $ attributes ) ; } | Render the header of this Form as Html . |
45,161 | public function render ( RendererInterface $ renderer = null ) { $ renderer = $ renderer ? : $ this -> getDefaultRenderer ( ) ; $ form = $ this -> header ( ) ; foreach ( $ this -> rows as $ row ) { $ form .= $ row -> render ( $ renderer ) ; } $ form .= '</form>' ; return $ form ; } | Render the entire Form . |
45,162 | public function row ( $ name , RendererInterface $ renderer = null ) { $ renderer = $ renderer ? : $ this -> getDefaultRenderer ( ) ; return $ this -> getRow ( $ name ) -> render ( $ renderer ) ; } | Render a row . If no renderer is supplied the default renderer on this form will be used . |
45,163 | public function input ( $ name , RendererInterface $ renderer = null ) { $ renderer = $ renderer ? : $ this -> getDefaultRenderer ( ) ; return $ this -> getRow ( $ name ) -> input ( $ renderer ) ; } | Render the input of a row . If no renderer is supplied the default renderer on this form will be used . |
45,164 | public function setValues ( array $ values = array ( ) , $ ignore_unknown = false ) { foreach ( $ values as $ name => $ value ) { try { $ this -> getRow ( $ name ) -> setValue ( $ value ) ; } catch ( \ InvalidArgumentException $ e ) { if ( ! $ ignore_unknown ) { throw $ e ; } } } return $ this ; } | Set the value of multiple rows . |
45,165 | public function getValues ( ) { $ values = array ( ) ; foreach ( $ this -> rows as $ name => $ row ) { $ values [ $ name ] = $ row -> getValue ( ) ; } return $ values ; } | Get the values of all rows . |
45,166 | public function buildValidator ( ) { if ( $ this -> validator_built ) { return $ this -> validator ; } foreach ( $ this -> rows as $ name => $ row ) { foreach ( $ row -> getRules ( ) as $ rule ) { $ this -> validator -> addRule ( $ name , $ rule ) ; } $ row -> disableRules ( ) ; } $ this -> validator_built = true ; ret... | Add the rules from all rows to form a complete Validator for this form . The Validator can only be built once - no additional rules may be added after building . |
45,167 | protected function flattenArray ( array $ values , $ previous = '' ) { $ result = array ( ) ; foreach ( $ values as $ key => $ value ) { if ( $ previous ) { $ key = $ previous . '[' . $ key . ']' ; } if ( is_array ( $ value ) ) { $ result = $ result + $ this -> flattenArray ( $ value , $ key ) ; } else { $ result [ $ k... | Flatten a multidimensional array into a one - dimensional array using square brackets to show the structure of the original array . |
45,168 | public function getServiceData ( $ snmpConnection ) { $ phpFpmData = $ snmpConnection -> realWalkToArray ( 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."Php-Fpm"' , true ) ; $ return = Array ( ) ; $ return [ 'num_listen_queue' ] = $ phpFpmData [ 1 ] ; $ return [ 'num_accepted_connections' ] = $ phpFpmData [ 2 ] ; $ return [ '... | Return PHP - FPM service Data |
45,169 | public function create ( BannerInterface $ banner ) { return $ this -> formFactory -> create ( 'silvestra_banner' , $ banner , array ( 'action' => $ this -> router -> getContext ( ) -> getPathInfo ( ) ) ) ; } | Create banner form . |
45,170 | public static function init ( $ build_options ) { self :: $ variables_def = $ build_options ; foreach ( $ build_options as $ name => $ def ) { if ( ! isset ( $ def [ 1 ] ) ) { self :: $ variables_def [ $ name ] [ 1 ] = '' ; } if ( ! isset ( $ def [ 2 ] ) && ! is_bool ( self :: $ variables_def [ $ name ] [ 1 ] ) ) { sel... | init the globals variables by reading the given array which describes all this variables . |
45,171 | public function isEmpty ( ) : bool { return $ this -> isNull ( ) || ( is_array ( $ this -> value ) && count ( $ this -> value ) === 0 ) || ( is_string ( $ this -> value ) && strlen ( $ this -> value ) === 0 ) ; } | checks if value is empty |
45,172 | public function containsAnyOf ( array $ elements ) : bool { if ( ! is_scalar ( $ this -> value ) || null === $ this -> value ) { return false ; } foreach ( $ elements as $ needle ) { if ( is_bool ( $ needle ) && $ this -> value === $ needle ) { return true ; } elseif ( ! is_bool ( $ needle ) && ( $ this -> value === $ ... | checks that value contains any of the given elements |
45,173 | public function isOneOf ( array $ allowedValues , bool $ strict = false ) : bool { if ( ! is_array ( $ this -> value ) ) { return in_array ( $ this -> value , $ allowedValues , $ strict ) ; } foreach ( $ this -> value as $ value ) { if ( ! in_array ( $ value , $ allowedValues , $ strict ) ) { return false ; } } return ... | checks that value is one of the allowed values |
45,174 | public static function defineCheck ( string $ method , callable $ function ) { if ( function_exists ( $ method ) ) { throw new \ InvalidArgumentException ( 'Can not overwrite internal PHP function ' . $ method . '().' ) ; } self :: $ checks [ $ method ] = $ function ; } | adds a check method |
45,175 | public static function Obl06 ( $ date1 , $ date2 ) { $ t ; $ eps0 ; $ t = ( ( $ date1 - DJ00 ) + $ date2 ) / DJC ; $ eps0 = ( 84381.406 + ( - 46.836769 + ( - 0.0001831 + ( 0.00200340 + ( - 0.000000576 + ( - 0.0000000434 ) * $ t ) * $ t ) * $ t ) * $ t ) * $ t ) * DAS2R ; return $ eps0 ; } | - - - - - - - - - i a u O b l 0 6 - - - - - - - - - |
45,176 | protected function createService ( $ name ) { $ name = $ this -> configureName ( 'service' , $ name ) ; if ( $ this -> serviceNameExists ( $ name ) === true ) { return $ this -> error ( 'Service already exists' ) ; } $ this -> createServiceDirectory ( ) ; $ this -> createBaseServiceAbstract ( ) ; $ this -> createServic... | Create the service |
45,177 | protected function createBaseServiceAbstract ( ) { if ( ! $ this -> files -> exists ( $ this -> getServiceDirectory ( ) . 'BaseServiceAbstract.php' ) ) { $ stub = str_replace ( [ '{{ServiceDirectory}}' ] , $ this -> getServiceDirectoryFromConfig ( ) , $ this -> files -> get ( __DIR__ . '/../stubs/base-abstract.stub' ) ... | Create base service abstract class file |
45,178 | protected function createBaseInterfaceFile ( ) { if ( ! $ this -> files -> exists ( $ this -> getRepositoryDirectory ( ) . 'BaseRepositoryInterface.php' ) ) { $ stub = str_replace ( [ '{{Namespace}}' ] , $ this -> getRepositoryDirectoryFromConfig ( ) , $ this -> files -> get ( __DIR__ . '/../stubs/base-interface.stub' ... | Create base interface file |
45,179 | protected function createServiceFile ( $ name , $ with_interface ) { $ dir_option = rtrim ( str_replace ( '/' , '\\' , $ this -> getDirOption ( ) ) , '/\\' ) ; $ dir_option = $ dir_option ? '\\' . $ dir_option : '' ; $ classname = $ this -> configureName ( 'service' , $ name ) ; if ( $ with_interface === true ) { $ int... | Create the service class file |
45,180 | protected function createInterfaceFile ( $ interface ) { $ dir_option = rtrim ( str_replace ( '/' , '\\' , $ this -> getDirOption ( ) ) , '/\\' ) ; $ dir_option = $ dir_option ? '\\' . $ dir_option : '' ; $ interface = $ this -> configureName ( 'repository' , $ interface ) ; dd ( $ interface ) ; $ stub = str_replace ( ... | Create the interface file |
45,181 | protected function createTraitFile ( $ trait ) { $ dir_option = rtrim ( str_replace ( '/' , '\\' , $ this -> getDirOption ( ) ) , '/\\' ) ; $ dir_option = $ dir_option ? '\\' . $ dir_option : '' ; $ trait = $ this -> configureName ( 'trait' , $ trait ) ; $ stub = str_replace ( [ '{{Namespace}}' , '{{TraitName}}' ] , [ ... | Create the trait file |
45,182 | protected function serviceNameExists ( $ name ) { if ( $ this -> files -> exists ( $ this -> getServiceDirectory ( ) . $ this -> getDirOption ( ) . $ name . '.php' ) ) { return true ; } return false ; } | Validate if service already exists |
45,183 | protected function repositoryNameExists ( $ interface ) { if ( $ this -> files -> exists ( $ this -> getRepositoryDirectory ( ) . $ this -> getDirOption ( ) . $ interface . 'php' ) ) { return true ; } return false ; } | Validate if repository interface already exists |
45,184 | protected function traitNameExists ( $ trait ) { if ( $ this -> files -> exists ( $ this -> getTraitDirectory ( ) . $ this -> getDirOption ( ) . $ trait . '.php' ) ) { return true ; } return false ; } | Validate if trait already exists |
45,185 | protected function getServiceDirectory ( ) { if ( $ config = $ this -> configFileMissing ( ) ) { return $ this -> error ( $ config ) ; } return 'app/' . rtrim ( $ this -> getConfigServiceDirectory ( ) , '/\\' ) . '/' ; } | Return the full service directory |
45,186 | protected function getRepositoryDirectory ( ) { if ( $ config = $ this -> configFileMissing ( ) ) { return $ this -> error ( $ config ) ; } return 'app/' . rtrim ( $ this -> getConfigRepositoryDirectory ( ) , '/\\' ) . '/' ; } | Return the full repository directory |
45,187 | protected function getTraitDirectory ( ) { if ( $ config = $ this -> configFileMissing ( ) ) { return $ this -> error ( $ config ) ; } return 'app/' . rtrim ( $ this -> getConfigTraitDirectory ( ) , '/\\' ) . '/' ; } | Return the full trait directory |
45,188 | protected function getDirOption ( $ return_array = false ) { if ( $ dir = $ this -> option ( 'dir' ) ) { $ directories = explode ( '/' , $ dir ) ; if ( is_array ( $ directories ) && $ directories ) { $ directories = array_map ( function ( $ directory ) { return ucfirst ( str :: plural ( strtolower ( $ directory ) ) ) ;... | Return the directory option |
45,189 | protected function configureName ( $ type , $ name ) { $ config = $ this -> laravel [ 'config' ] [ 'repository' ] ; if ( $ config [ "{$type}_to_plural" ] === true ) { $ name = Str :: plural ( $ name ) ; } if ( $ config [ "case_sensitive" ] === false ) { $ name = Str :: studly ( strtolower ( $ name ) ) ; } return $ name... | Configure the name according to user preferred settings |
45,190 | protected function createTraitDirectory ( ) { if ( ! $ this -> files -> isDirectory ( $ this -> getTraitDirectory ( ) ) ) { $ this -> files -> makeDirectory ( $ this -> getTraitDirectory ( ) ) ; } $ this -> createDirectory ( 'trait' ) ; } | Create trait directory |
45,191 | protected function createInterfaceDirectory ( ) { if ( ! $ this -> files -> isDirectory ( $ this -> getRepositoryDirectory ( ) ) ) { $ this -> files -> makeDirectory ( $ this -> getRepositoryDirectory ( ) ) ; } $ this -> createDirectory ( 'repository' ) ; } | Create interface directory |
45,192 | protected function createServiceDirectory ( ) { if ( ! $ this -> files -> isDirectory ( $ this -> getServiceDirectory ( ) ) ) { $ this -> files -> makeDirectory ( $ this -> getServiceDirectory ( ) ) ; } $ this -> createDirectory ( 'service' ) ; } | Create service directory |
45,193 | protected function getAttributes ( array $ merge = [ ] ) { return array_merge ( [ 'prefix' => $ this -> prefix , 'as' => $ this -> routeName , 'middleware' => $ this -> middlewares , 'namespace' => $ this -> namespace , ] , $ merge ) ; } | Get route attributes . |
45,194 | protected function loadAttributes ( $ key , array $ default = [ ] ) { $ attributes = config ( $ key , $ default ) ; if ( isset ( $ attributes [ 'prefix' ] ) ) $ this -> addPrefix ( $ attributes [ 'prefix' ] ) ; if ( isset ( $ attributes [ 'namespace' ] ) ) $ this -> setNamespace ( $ attributes [ 'namespace' ] ) ; if ( ... | Load attributes from config file . |
45,195 | public function document ( $ projectSlug , $ ref = null , $ path = '' ) { $ project = $ this -> factory -> getProject ( $ projectSlug ) ; if ( is_null ( $ ref ) ) { $ ref = $ project -> getDefaultRef ( ) ; } $ project -> setRef ( $ ref ) ; $ document = $ project -> getDocument ( $ path ) ; $ content = $ document -> ren... | Render the documentation page for the given project and version . |
45,196 | public static function setSource ( $ source = null ) { if ( ! is_resource ( $ source ) && ! is_null ( $ source ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid source provided; must be a null or an resource, "%s" given.' , is_object ( $ source ) ? get_class ( $ source ) : gettype ( $ source ) ) ) ; } stati... | Sets data source . |
45,197 | public static function make ( ) { $ stream = new Stream ( ) ; $ source = static :: getSource ( ) ; $ stream -> copy ( $ source ) ; if ( ! static :: $ source ) { fclose ( $ source ) ; } return $ stream ; } | Makes a stream and and fills it with input data . |
45,198 | public function getOutput ( string $ glue = null ) { if ( ! is_null ( $ glue ) ) { return implode ( $ glue , $ this -> output ) ; } return $ this -> output ; } | Get the full output array |
45,199 | public function getOutputLine ( int $ line ) : string { return array_key_exists ( $ line , $ this -> output ) ? $ this -> output [ $ line ] : null ; } | Get a specific line from the output array |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.