public static function create($file)
    {
        if (is_string($file)) {
            $file = new Reader($file);
        }

        $signature = new self($file);
        $signature->addAlgorithm(new Algorithm\MD5());
        $signature->addAlgorithm(new Algorithm\SHA1());
        $signature->addAlgorithm(new Algorithm\SHA256());
        $signature->addAlgorithm(new Algorithm\SHA512());

        if (extension_loaded('openssl')) {
            $signature->addAlgorithm(new Algorithm\OpenSSL());
        }

        return $signature;
    }
public static function create($file)
    {
        if (is_string($file)) {
            $file = new Reader($file);
        }

        $signature = new self($file);
        $signature->addAlgorithm(new Algorithm\MD5());
        $signature->addAlgorithm(new Algorithm\SHA1());
        $signature->addAlgorithm(new Algorithm\SHA256());
        $signature->addAlgorithm(new Algorithm\SHA512());

        if (extension_loaded('openssl')) {
            $signature->addAlgorithm(new Algorithm\OpenSSL());
        }

        return $signature;
    }
public static function create ( $ file ) { if ( is_string ( $ file ) ) { $ file = new Reader ( $ file ) ; } $ signature = new self ( $ file ) ; $ signature -> addAlgorithm ( new Algorithm \ MD5 ( ) ) ; $ signature -> addAlgorithm ( new Algorithm \ SHA1 ( ) ) ; $ signature -> addAlgorithm ( new Algorithm \ SHA256 ( ) ) ; $ signature -> addAlgorithm ( new Algorithm \ SHA512 ( ) ) ; if ( extension_loaded ( 'openssl' ) ) { $ signature -> addAlgorithm ( new Algorithm \ OpenSSL ( ) ) ; } return $ signature ; }
Creates a new instance with default algorithms registered.

This method will create a new file reader (or use a given one) for use
with a new `Signature` instance that will also be created. The bundled
algorithm classes will then be registered with the new instance so that
MD5, SHA1, and other signature types are recognized.

use Phine\Phar\Signature;

$signature = Signature::create('example.phar');

@param Reader|string $file The archive file path or reader.

@return Signature The new instance.

@api
Creates a new instance with default algorithms registered .