Skip to content

Commit 13f0d1e

Browse files
committed
Revert BC-breaking Webmozart-assertions
1 parent 225665e commit 13f0d1e

4 files changed

Lines changed: 8 additions & 13 deletions

File tree

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
},
2929
"require": {
3030
"php": ">=5.6",
31-
"simplesamlphp/composer-module-installer": "~1.1",
32-
"webmozart/assert": "~1.4"
31+
"simplesamlphp/composer-module-installer": "~1.1"
3332
},
3433
"require-dev": {
3534
"simplesamlphp/simplesamlphp": "^1.17",

hooks/hook_cron.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use SimpleSAML\Logger;
4-
use Webmozart\Assert\Assert;
54

65
/**
76
* Hook to run a cron job.
@@ -11,9 +10,9 @@
1110
*/
1211
function metarefresh_hook_cron(&$croninfo)
1312
{
14-
Assert::isArray($croninfo);
15-
Assert::keyExists($croninfo, 'summary');
16-
Assert::keyExists($croninfo, 'tag');
13+
assert(is_array($croninfo));
14+
assert(array_key_exists('summary', $croninfo));
15+
assert(array_key_exists('tag', $croninfo));
1716

1817
Logger::info('cron [metarefresh]: Running cron in cron tag ['.$croninfo['tag'].'] ');
1918

hooks/hook_frontpage.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
use Webmozart\Assert\Assert;
4-
53
/**
64
* Hook to add links to the frontpage.
75
*
@@ -10,8 +8,8 @@
108
*/
119
function metarefresh_hook_frontpage(&$links)
1210
{
13-
Assert::isArray($links);
14-
Assert::keyExists($links, 'links');
11+
assert(is_array($links));
12+
assert(array_key_exists('links', $links));
1513

1614
$links['federation'][] = [
1715
'href' => SimpleSAML\Module::getModuleURL('metarefresh/fetch.php'),

lib/MetaLoader.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use RobRichards\XMLSecLibs\XMLSecurityDSig;
66
use SimpleSAML\Configuration;
77
use SimpleSAML\Logger;
8-
use Webmozart\Assert\Assert;
98

109
/**
1110
* @package SimpleSAMLphp
@@ -420,7 +419,7 @@ private function addMetadata($filename, $metadata, $type, array $template = null
420419
*/
421420
public function writeARPfile(Configuration $config)
422421
{
423-
Assert::isInstanceOf($config, Configuration::class);
422+
assert($config instanceof Configuration::class);
424423

425424
$arpfile = $config->getValue('arpfile');
426425
$types = ['saml20-sp-remote'];
@@ -507,7 +506,7 @@ public function writeMetadataFiles($outputDir)
507506
*/
508507
public function writeMetadataSerialize($outputDir)
509508
{
510-
Assert::string($outputDir);
509+
assert(is_string($outputDir));
511510

512511
$metaHandler = new \SimpleSAML\Metadata\MetaDataStorageHandlerSerialize(['directory' => $outputDir]);
513512

0 commit comments

Comments
 (0)