Skip to content

Commit

Permalink
Remove BC breaking Webmozart asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed May 29, 2019
1 parent 4e98678 commit 244d365
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 3 additions & 5 deletions lib/Auth/Process/SmartID.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace SimpleSAML\Module\smartattributes\Auth\Process;

use Webmozart\Assert\Assert;

class SmartID extends \SimpleSAML\Auth\ProcessingFilter
{
/**
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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);

Expand Down
6 changes: 2 additions & 4 deletions lib/Auth/Process/SmartName.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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'];

Expand Down

0 comments on commit 244d365

Please sign in to comment.