public static function create(string $path, string $type):int
    {
        try {
            switch ($type) {
                case "directory":
                    if (!is_dir($path)) {
                        mkdir($path);
                    }
                    break;
                case "file":
                    if (!is_file($path)) {
                        touch($path);
                    }
                    break;
            }
        } catch (\Exception $exception) {
            throw new \Exception("Server Error : Cannot create $type element => ".$exception);
        }

        return (1);
    }
public static function create(string $path, string $type):int
    {
        try {
            switch ($type) {
                case "directory":
                    if (!is_dir($path)) {
                        mkdir($path);
                    }
                    break;
                case "file":
                    if (!is_file($path)) {
                        touch($path);
                    }
                    break;
            }
        } catch (\Exception $exception) {
            throw new \Exception("Server Error : Cannot create $type element => ".$exception);
        }

        return (1);
    }
public static function create ( string $ path , string $ type ) : int { try { switch ( $ type ) { case "directory" : if ( ! is_dir ( $ path ) ) { mkdir ( $ path ) ; } break ; case "file" : if ( ! is_file ( $ path ) ) { touch ( $ path ) ; } break ; } } catch ( \ Exception $ exception ) { throw new \ Exception ( "Server Error : Cannot create $type element => " . $ exception ) ; } return ( 1 ) ; }
Create an element on the server
@param string $path Element Path
@param string $type Element type
@return int Result
@throws \Exception Generate Error
Create an element on the server