public function extraValidation($data, $performPhoneValidation=true) {

        $this->messages = new MessageBag;

        // is the cell number where text messages will be sent ok?
        if (
            (!$this->userRepository->validatePhoneNumber($data['phone_number']))
            && ($performPhoneValidation)
        )
        {
            // Prepare the response array, and then return to the edit form with error messages

            // first, add the error message to the message bag
            $this->messages->add('phone_number', 'There is a problem with your phone number. Please re-enter it.');

            return $this->baseFormProcessing->prepareResponseArray('validation_failed', 500, $data, $this->messages);
        }



        // does the password contain the word "password"?
        if (!$this->userRepository->validatePasswordNotUseWordPassword($data['password'])) {
            // Prepare the response array, and then return to the edit form with error messages

            // first, add the error message to the message bag
            $this->messages->add('password', 'Please do not use the word \'password\' in your password. This is *really* b-a-d for security.');

            return $this->baseFormProcessing->prepareResponseArray('validation_failed', 500, $data, $this->messages);
        }


        // does the password contain the user's name?
        if (!$this->userRepository->validatePasswordNotUseUsername($data['name'], $data['password'])) {
            // Prepare the response array, and then return to the edit form with error messages

            // first, add the error message to the message bag
            $this->messages->add('password', 'Please do not use your name in the password. This is *really* b-a-d for security.');

            return $this->baseFormProcessing->prepareResponseArray('validation_failed', 500, $data, $this->messages);
        }


        // Extra validation is ok

        // Prepare the response array, and then return to the command
        return $this->baseFormProcessing->prepareResponseArray('extra_validation_successful', 200, $data);
    }
public function extraValidation($data, $performPhoneValidation=true) {

        $this->messages = new MessageBag;

        // is the cell number where text messages will be sent ok?
        if (
            (!$this->userRepository->validatePhoneNumber($data['phone_number']))
            && ($performPhoneValidation)
        )
        {
            // Prepare the response array, and then return to the edit form with error messages

            // first, add the error message to the message bag
            $this->messages->add('phone_number', 'There is a problem with your phone number. Please re-enter it.');

            return $this->baseFormProcessing->prepareResponseArray('validation_failed', 500, $data, $this->messages);
        }



        // does the password contain the word "password"?
        if (!$this->userRepository->validatePasswordNotUseWordPassword($data['password'])) {
            // Prepare the response array, and then return to the edit form with error messages

            // first, add the error message to the message bag
            $this->messages->add('password', 'Please do not use the word \'password\' in your password. This is *really* b-a-d for security.');

            return $this->baseFormProcessing->prepareResponseArray('validation_failed', 500, $data, $this->messages);
        }


        // does the password contain the user's name?
        if (!$this->userRepository->validatePasswordNotUseUsername($data['name'], $data['password'])) {
            // Prepare the response array, and then return to the edit form with error messages

            // first, add the error message to the message bag
            $this->messages->add('password', 'Please do not use your name in the password. This is *really* b-a-d for security.');

            return $this->baseFormProcessing->prepareResponseArray('validation_failed', 500, $data, $this->messages);
        }


        // Extra validation is ok

        // Prepare the response array, and then return to the command
        return $this->baseFormProcessing->prepareResponseArray('extra_validation_successful', 200, $data);
    }
public function extraValidation ( $ data , $ performPhoneValidation = true ) { $ this -> messages = new MessageBag ; // is the cell number where text messages will be sent ok? if ( ( ! $ this -> userRepository -> validatePhoneNumber ( $ data [ 'phone_number' ] ) ) && ( $ performPhoneValidation ) ) { // Prepare the response array, and then return to the edit form with error messages // first, add the error message to the message bag $ this -> messages -> add ( 'phone_number' , 'There is a problem with your phone number. Please re-enter it.' ) ; return $ this -> baseFormProcessing -> prepareResponseArray ( 'validation_failed' , 500 , $ data , $ this -> messages ) ; } // does the password contain the word "password"? if ( ! $ this -> userRepository -> validatePasswordNotUseWordPassword ( $ data [ 'password' ] ) ) { // Prepare the response array, and then return to the edit form with error messages // first, add the error message to the message bag $ this -> messages -> add ( 'password' , 'Please do not use the word \'password\' in your password. This is *really* b-a-d for security.' ) ; return $ this -> baseFormProcessing -> prepareResponseArray ( 'validation_failed' , 500 , $ data , $ this -> messages ) ; } // does the password contain the user's name? if ( ! $ this -> userRepository -> validatePasswordNotUseUsername ( $ data [ 'name' ] , $ data [ 'password' ] ) ) { // Prepare the response array, and then return to the edit form with error messages // first, add the error message to the message bag $ this -> messages -> add ( 'password' , 'Please do not use your name in the password. This is *really* b-a-d for security.' ) ; return $ this -> baseFormProcessing -> prepareResponseArray ( 'validation_failed' , 500 , $ data , $ this -> messages ) ; } // Extra validation is ok // Prepare the response array, and then return to the command return $ this -> baseFormProcessing -> prepareResponseArray ( 'extra_validation_successful' , 200 , $ data ) ; }
Perform extra validation

@param  array  $data
@param  bool   $performPhoneValidation
@return array
Perform extra validation