Namshi\JOSE\JWS::__construct PHP Method

__construct() public method

Constructor.
See also: http://php.net/manual/en/function.json-encode.php
See also: http://php.net/manual/en/jsonserializable.jsonserialize.php
See also: https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-41#section-4
public __construct ( array $header = [], string $encryptionEngine = 'OpenSSL' )
$header array An associative array of headers. The value can be any type accepted by json_encode or a JSON serializable object
$encryptionEngine string }
    public function __construct($header = array(), $encryptionEngine = 'OpenSSL')
    {
        if (!in_array($encryptionEngine, $this->supportedEncryptionEngines)) {
            throw new InvalidArgumentException(sprintf('Encryption engine %s is not supported', $encryptionEngine));
        }
        if ('SecLib' === $encryptionEngine && version_compare(PHP_VERSION, '7.0.0-dev') >= 0) {
            throw new InvalidArgumentException("phpseclib 1.0.0(LTS), even the latest 2.0.0, doesn't support PHP7 yet");
        }
        $this->encryptionEngine = $encryptionEngine;
        parent::__construct(array(), $header);
    }