Skip to content

Commit

Permalink
Revert BC-breaking Webmozart-assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jun 3, 2019
1 parent 225665e commit 13f0d1e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,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
7 changes: 3 additions & 4 deletions hooks/hook_cron.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use SimpleSAML\Logger;
use Webmozart\Assert\Assert;

/**
* Hook to run a cron job.
Expand All @@ -11,9 +10,9 @@
*/
function metarefresh_hook_cron(&$croninfo)
{
Assert::isArray($croninfo);
Assert::keyExists($croninfo, 'summary');
Assert::keyExists($croninfo, 'tag');
assert(is_array($croninfo));
assert(array_key_exists('summary', $croninfo));
assert(array_key_exists('tag', $croninfo));

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

Expand Down
6 changes: 2 additions & 4 deletions hooks/hook_frontpage.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

use Webmozart\Assert\Assert;

/**
* Hook to add links to the frontpage.
*
Expand All @@ -10,8 +8,8 @@
*/
function metarefresh_hook_frontpage(&$links)
{
Assert::isArray($links);
Assert::keyExists($links, 'links');
assert(is_array($links));
assert(array_key_exists('links', $links));

$links['federation'][] = [
'href' => SimpleSAML\Module::getModuleURL('metarefresh/fetch.php'),
Expand Down
5 changes: 2 additions & 3 deletions lib/MetaLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use SimpleSAML\Configuration;
use SimpleSAML\Logger;
use Webmozart\Assert\Assert;

/**
* @package SimpleSAMLphp
Expand Down Expand Up @@ -420,7 +419,7 @@ private function addMetadata($filename, $metadata, $type, array $template = null
*/
public function writeARPfile(Configuration $config)
{
Assert::isInstanceOf($config, Configuration::class);
assert($config instanceof Configuration::class);

$arpfile = $config->getValue('arpfile');
$types = ['saml20-sp-remote'];
Expand Down Expand Up @@ -507,7 +506,7 @@ public function writeMetadataFiles($outputDir)
*/
public function writeMetadataSerialize($outputDir)
{
Assert::string($outputDir);
assert(is_string($outputDir));

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

Expand Down

0 comments on commit 13f0d1e

Please sign in to comment.