Skip to content

Commit

Permalink
Don't force abstract/static.
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Jun 22, 2017
1 parent c60e6a0 commit 395886a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Sapient.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Class Sapient
* @package ParagonIE\Sapient
*/
abstract class Sapient
class Sapient
{
const HEADER_AUTH_NAME = 'Body-HMAC-SHA512256';
const HEADER_SIGNATURE_NAME = 'Body-Signature-Ed25519';
Expand Down Expand Up @@ -533,4 +533,20 @@ public static function verifySymmetricAuthenticatedResponse(
}
throw new InvalidMessageException('No valid signature given for this HTTP response');
}

/**
* Magic method in case this is called in an object context.
*
* @param string $name
* @param array $arguments
* @return mixed
* @throws \Error
*/
public function __call($name, $arguments)
{
if (\is_callable([$name, $arguments])) {
throw new \Error('Method not found: ' . $name);
}
return self::$name(...$arguments);
}
}

0 comments on commit 395886a

Please sign in to comment.