<?php

namespace Libraries;

class CustomValidations {

    public function alpha_numeric_punct_all( $str, ?string &$error = null ) {

		if( false == \isVal( $str ) ) {

			$error = 'This field is required';
            return false;
        }

		if( true == preg_match( '/\A[A-Z0-9 ~!#$%\&\*\-_+=\/,|\\:.]+\z/i', $str ) ) {
			return true;
		}

		$error = 'This field is required only alphanumeric, spaces, and ~ ! # $ % & * - _ + = | : . , / this special characters';
		return false;
    }
 
}