Skip to content
Snippets Groups Projects

Using of short array syntax

Merged Pavel Břoušek requested to merge github/fork/BaranekD/arrays into master
3 files
+ 9
8
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -35,7 +35,7 @@ class Perunauthorize extends \SimpleSAML\Auth\ProcessingFilter
@@ -35,7 +35,7 @@ class Perunauthorize extends \SimpleSAML\Auth\ProcessingFilter
* user \ to escape special chars, like '.' etc.
* user \ to escape special chars, like '.' etc.
*
*
*/
*/
protected $valid_attribute_values = array();
protected $valid_attribute_values = [];
/**
/**
* Initialize this filter.
* Initialize this filter.
@@ -66,7 +66,7 @@ class Perunauthorize extends \SimpleSAML\Auth\ProcessingFilter
@@ -66,7 +66,7 @@ class Perunauthorize extends \SimpleSAML\Auth\ProcessingFilter
foreach ($config as $attribute => $values) {
foreach ($config as $attribute => $values) {
if (is_string($values)) {
if (is_string($values)) {
$values = array($values);
$values = [$values];
}
}
if (!is_array($values)) {
if (!is_array($values)) {
throw new Exception('Filter Pauthorize: Attribute values is neither string nor array: ' .
throw new Exception('Filter Pauthorize: Attribute values is neither string nor array: ' .
@@ -101,7 +101,7 @@ class Perunauthorize extends \SimpleSAML\Auth\ProcessingFilter
@@ -101,7 +101,7 @@ class Perunauthorize extends \SimpleSAML\Auth\ProcessingFilter
foreach ($patterns as $pattern) {
foreach ($patterns as $pattern) {
$values = $attributes[$name];
$values = $attributes[$name];
if (!is_array($values)) {
if (!is_array($values)) {
$values = array($values);
$values = [$values];
}
}
foreach ($values as $value) {
foreach ($values as $value) {
if ($this->regex) {
if ($this->regex) {
@@ -146,6 +146,6 @@ class Perunauthorize extends \SimpleSAML\Auth\ProcessingFilter
@@ -146,6 +146,6 @@ class Perunauthorize extends \SimpleSAML\Auth\ProcessingFilter
'perunauthorize/perunauthorize_403.php'
'perunauthorize/perunauthorize_403.php'
);
);
HTTP::redirectTrustedURL($url, array('StateId' => $id));
HTTP::redirectTrustedURL($url, ['StateId' => $id]);
}
}
}
}
Loading