From 244d3657dd4cb3b9cd90076f112101f7ab213340 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 29 May 2019 18:13:01 +0200 Subject: [PATCH] Remove BC breaking Webmozart asserts --- composer.json | 3 +-- lib/Auth/Process/SmartID.php | 8 +++----- lib/Auth/Process/SmartName.php | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index cf54c36..6585c76 100644 --- a/composer.json +++ b/composer.json @@ -29,8 +29,7 @@ "require": { "php": ">=5.6", - "simplesamlphp/composer-module-installer": "~1.1", - "webmozart/assert": "~1.4" + "simplesamlphp/composer-module-installer": "~1.1" }, "require-dev": { "simplesamlphp/simplesamlphp": "^1.17", diff --git a/lib/Auth/Process/SmartID.php b/lib/Auth/Process/SmartID.php index c8d5909..abf22c3 100644 --- a/lib/Auth/Process/SmartID.php +++ b/lib/Auth/Process/SmartID.php @@ -2,8 +2,6 @@ namespace SimpleSAML\Module\smartattributes\Auth\Process; -use Webmozart\Assert\Assert; - class SmartID extends \SimpleSAML\Auth\ProcessingFilter { /** @@ -55,7 +53,7 @@ public function __construct($config, $reserved) { parent::__construct($config, $reserved); - Assert::isArray($config); + assert(is_array($config)); if (array_key_exists('candidates', $config)) { $this->candidates = $config['candidates']; @@ -126,8 +124,8 @@ private function addID($attributes, $request) */ public function process(&$request) { - Assert::isArray($request); - Assert::keyExists($request, 'Attributes'); + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); $id = $this->addID($request['Attributes'], $request); diff --git a/lib/Auth/Process/SmartName.php b/lib/Auth/Process/SmartName.php index 42be638..db7e5fc 100644 --- a/lib/Auth/Process/SmartName.php +++ b/lib/Auth/Process/SmartName.php @@ -2,8 +2,6 @@ namespace SimpleSAML\Module\smartattributes\Auth\Process; -use Webmozart\Assert\Assert; - /** * Filter to set name in a smart way, based on available name attributes. * @@ -82,8 +80,8 @@ private function getLocalUser($userid) */ public function process(&$request) { - Assert::isArray($request); - Assert::keyExists($request, 'Attributes'); + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); $attributes = &$request['Attributes'];