core/components/Formatter.php
public function autoFormat($value)
    {
        // email validation
        if ((new EmailValidator())->validate($value)) {
            return $this->asEmail($value);
        }
        
        // url validator
        if ((new UrlValidator())->validate($value)) {
            return $this->asUrl($value);
        }
        
        // boolean type
        if (is_bool($value)) {
            return $this->asBoolean($value);
        }
        
        return $value;
    }
public function autoFormat($value)
    {
        // email validation
        if ((new EmailValidator())->validate($value)) {
            return $this->asEmail($value);
        }
        
        // url validator
        if ((new UrlValidator())->validate($value)) {
            return $this->asUrl($value);
        }
        
        // boolean type
        if (is_bool($value)) {
            return $this->asBoolean($value);
        }
        
        return $value;
    }
public function autoFormat ( $ value ) { // email validation if ( ( new EmailValidator ( ) ) -> validate ( $ value ) ) { return $ this -> asEmail ( $ value ) ; } // url validator if ( ( new UrlValidator ( ) ) -> validate ( $ value ) ) { return $ this -> asUrl ( $ value ) ; } // boolean type if ( is_bool ( $ value ) ) { return $ this -> asBoolean ( $ value ) ; } return $ value ; }
Auto format the value to a given format like url, email.

The following rules will apply to auto format the value:

+ boolean: asBool
+ email: asEmail
+ url: asUrl

@param mixed $value Returns the formated value otherwise the original input value.
@since 1.0.9
Auto format the value to a given format like url email .