src/Settings.php
private function validateInput( $settings ) {
        if ( !isset( $settings["serverUrl"] ) ||
             !isset( $settings["username"] ) ||
             !isset( $settings["password"] )
        ) {
            throw new \InvalidArgumentException( 'Username, password or serverUrl is incorrect' );
        }

        if ( !filter_var( $settings["serverUrl"], FILTER_VALIDATE_URL )
             || strpos( $settings["serverUrl"], "." ) === false
        ) {
            throw new \InvalidArgumentException( 'Invalid serverUrl has been provided' );
        }

        if ( !in_array( $settings['authMode'], [ 'OnlineFederation', 'Federation' ] ) ) {
            throw new \InvalidArgumentException( 'Provided authentication mode <' . $this->authMode . '> is not supported' );
        }
    }
private function validateInput( $settings ) {
        if ( !isset( $settings["serverUrl"] ) ||
             !isset( $settings["username"] ) ||
             !isset( $settings["password"] )
        ) {
            throw new \InvalidArgumentException( 'Username, password or serverUrl is incorrect' );
        }

        if ( !filter_var( $settings["serverUrl"], FILTER_VALIDATE_URL )
             || strpos( $settings["serverUrl"], "." ) === false
        ) {
            throw new \InvalidArgumentException( 'Invalid serverUrl has been provided' );
        }

        if ( !in_array( $settings['authMode'], [ 'OnlineFederation', 'Federation' ] ) ) {
            throw new \InvalidArgumentException( 'Provided authentication mode <' . $this->authMode . '> is not supported' );
        }
    }
private function validateInput ( $ settings ) { if ( ! isset ( $ settings [ "serverUrl" ] ) || ! isset ( $ settings [ "username" ] ) || ! isset ( $ settings [ "password" ] ) ) { throw new \ InvalidArgumentException ( 'Username, password or serverUrl is incorrect' ) ; } if ( ! filter_var ( $ settings [ "serverUrl" ] , FILTER_VALIDATE_URL ) || strpos ( $ settings [ "serverUrl" ] , "." ) === false ) { throw new \ InvalidArgumentException ( 'Invalid serverUrl has been provided' ) ; } if ( ! in_array ( $ settings [ 'authMode' ] , [ 'OnlineFederation' , 'Federation' ] ) ) { throw new \ InvalidArgumentException ( 'Provided authentication mode <' . $ this -> authMode . '> is not supported' ) ; } }
Validates settings input.

@param array $settings
Validates settings input .