Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.

Commit

Permalink
Replace string version of assert
Browse files Browse the repository at this point in the history
  • Loading branch information
ghalse committed Jul 12, 2019
1 parent 9536a5c commit 6445c32
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/Auth/Process/Fticks.php
Expand Up @@ -54,16 +54,16 @@ private function log($msg)
/* local syslog call, avoiding SimpleSAMLphp's wrapping */
case 'local':
case 'syslog':
assert('array_key_exists("processname", $this->logconfig)');
assert('array_key_exists("facility", $this->logconfig)');
assert(array_key_exists("processname", $this->logconfig));
assert(array_key_exists("facility", $this->logconfig));
openlog($this->logconfig['processname'], LOG_PID, $this->logconfig['facility']);
syslog(array_key_exists('priority', $this->logconfig) ? $this->logconfig['priority'] : LOG_INFO, $msg);
break;

/* remote syslog call via UDP */
case 'remote':
assert('array_key_exists("processname", $this->logconfig)');
assert('array_key_exists("facility", $this->logconfig)');
assert(array_key_exists("processname", $this->logconfig));
assert(array_key_exists("facility", $this->logconfig));
/* assemble a syslog message per RFC 5424 */
$rfc5424_message = sprintf(
'<%d>',
Expand Down Expand Up @@ -118,7 +118,7 @@ private function generatePNhash(&$state)
{
/* get a user id */
if ($this->userId !== false) {
assert('array_key_exists("Attributes", $state)');
assert(array_key_exists("Attributes", $state));
if (array_key_exists($this->userId, $state['Attributes'])) {
if (is_array($state['Attributes'][$this->userId])) {
$uid = $state['Attributes'][$this->userId][0];
Expand Down Expand Up @@ -169,7 +169,7 @@ private function escapeFticks($value)
*/
public function __construct($config, $reserved)
{
assert('is_array($config)');
assert(is_array($config));
parent::__construct($config, $reserved);

if (array_key_exists('federation', $config)) {
Expand Down Expand Up @@ -271,11 +271,11 @@ public function __construct($config, $reserved)
*/
public function process(&$state)
{
assert('is_array($state)');
assert('array_key_exists("Destination", $state)');
assert('array_key_exists("entityid", $state["Destination"])');
assert('array_key_exists("Source", $state)');
assert('array_key_exists("entityid", $state["Source"])');
assert(is_array($state));
assert(array_key_exists("Destination", $state));
assert(array_key_exists("entityid", $state["Destination"]));
assert(array_key_exists("Source", $state));
assert(array_key_exists("entityid", $state["Source"]));

$fticks = [];

Expand Down Expand Up @@ -319,7 +319,7 @@ public function process(&$state)

/* realm */
if ($this->realm !== false) {
assert('array_key_exists("Attributes", $state)');
assert(array_key_exists("Attributes", $state));
if (array_key_exists($this->realm, $state['Attributes'])) {
if (is_array($state['Attributes'][$this->realm])) {
$fticks['REALM'] = $state['Attributes'][$this->realm][0];
Expand Down

0 comments on commit 6445c32

Please sign in to comment.