Skip to content

Commit 591a5bf

Browse files
committed
Apply modern array syntax
1 parent a3ac9af commit 591a5bf

10 files changed

Lines changed: 45 additions & 44 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
- Move `ribbon_text` definition to config file
2222
- Comply to [PSR-1: Basic Coding Standard](https://www.php-fig.org/psr/psr-1/) guidelines
2323
- Comply to [PSR-12: Extended Coding Style](https://www.php-fig.org/psr/psr-12/) guidelines
24+
- Apply modern array syntax to comply with [SimpleSAMLphp v1.17](https://simplesamlphp.org/docs/stable/simplesamlphp-upgrade-notes-1.17)
2425

2526
## [v3.0.0](https://github.com/rciam/simplesamlphp-module-themevanilla/compare/v2.3.1...v3.0.0) - 2019-09-20
2627

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,24 +127,24 @@ Also, you need to define the order of the 2 sections. You can set this in the
127127
file `config/module_discopower.php` from the variable `taborder`.
128128
For example:
129129
```
130-
'taborder' => array(
130+
'taborder' => [
131131
'idps_in_searchable_list',
132132
'idps_with_logos'
133-
)
133+
]
134134
```
135135

136136
Especially for the of the `idps_with_logos`, you need to specify the css class
137137
name, icon and label of the IdP login button using the `login_button`
138138
configuration as follows:
139139
```
140-
'tags' => array(
140+
'tags' => [
141141
'idps_with_logos',
142-
),
143-
'login_button' => array(
142+
],
143+
'login_button' => [
144144
'css_classname' => 'orcid',
145145
'icon_filename' => 'orcid.svg',
146146
'label' => 'ORCID',
147-
)
147+
]
148148
```
149149
To set style rules for the each button, the configured css_classname value must
150150
be defined in the `idps_buttons.scss` file. See more information bellow.

config-example/module_themevanilla.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,76 +8,76 @@
88
* cp modules/themevanilla/module_themevanilla.php config/
99
*/
1010

11-
$config = array(
12-
'cookiePolicy' => array(
13-
array(
11+
$config = [
12+
'cookiePolicy' => [
13+
[
1414
'type' => 'Session State',
1515
'provider' => 'aai.rciam.eu',
1616
'name' => 'rciam_proxy_authtoken, rciam_google_proxy_authtoken, rciam_google_proxy_authtoken, '
1717
. 'rciam_facebook_proxy_authtoken, rciam_linkedin_proxy_authtoken, rciam_orcid_proxy_authtoken',
1818
'thirdParty' => false,
1919
'category' => 'Session',
2020
'purpose' => 'Preserve user authentication token to prevent session fixation attacks',
21-
),
22-
array(
21+
],
22+
[
2323
'type' => 'Session State',
2424
'provider' => 'aai.rciam.eu',
2525
'name' => 'rciam_proxy_sid,rciam_google_proxy_sid, rciam_google_proxy_sid, rciam_facebook_proxy_sid, '
2626
. 'rciam_linkedin_proxy_sid, rciam_orcid_proxy_sid',
2727
'thirdParty' => false,
2828
'category' => 'Session',
2929
'purpose' => 'Preserve user session ID to retrieve session information',
30-
),
31-
array(
30+
],
31+
[
3232
'type' => 'Preferences',
3333
'provider' => 'aai.rciam.eu',
3434
'name' => 'rciam_poweridpdisco_lastidp',
3535
'thirdParty' => false,
3636
'category' => 'Persistent',
3737
'purpose' => 'Preserve preferred IdP selection for SimpleSAMLphp IdP discovery service',
38-
),
39-
array(
38+
],
39+
[
4040
'type' => 'Preferences',
4141
'provider' => 'aai.rciam.eu',
4242
'name' => 'rciam_poweridpdisco_remember',
4343
'thirdParty' => false,
4444
'category' => 'Persistent',
4545
'purpose' => 'Preserve preference whether to remember IdP selection for SimpleSAMLphp IdP discovery '
4646
. 'service',
47-
),
48-
array(
47+
],
48+
[
4949
'type' => 'Session State',
5050
'provider' => 'aai.rciam.eu',
5151
'name' => 'rciam_co_registry_sid',
5252
'thirdParty' => false,
5353
'category' => 'Session',
5454
'purpose' => 'Preserve user session ID to retrieve session information',
55-
),
56-
array(
55+
],
56+
[
5757
'type' => 'Preferences',
5858
'provider' => 'aai.rciam.eu',
5959
'name' => 'rciam_co_registry_tz',
6060
'thirdParty' => false,
6161
'category' => 'Persistent',
6262
'purpose' => 'Preserve preferred timezone selection for COmanage RCIAM Account Registry',
63-
),
64-
array(
63+
],
64+
[
6565
'type' => 'Preferences',
6666
'provider' => 'aai.rciam.eu',
6767
'name' => 'i18next',
6868
'thirdParty' => false,
6969
'category' => 'Session',
7070
'purpose' => 'Preserve preferred language for RCIAM AAI OpenID Connect Provider',
71-
),
72-
array(
71+
],
72+
[
7373
'type' => 'Session State',
7474
'provider' => 'aai.rciam.eu',
7575
'name' => 'JSESSIONID',
7676
'thirdParty' => false,
7777
'category' => 'Session',
7878
'purpose' => 'Preserve user session ID to retrieve session information',
79-
),
80-
),
79+
],
80+
],
8181
'enable_cookies_banner' => false,
8282
'ribbon_text' => '',
83-
);
83+
];

themes/ssp/consent/consentform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
$attributes = $this->data['attributes'];
5353

5454
$this->data['header'] = $this->t('{consent:consent:consent_header}');
55-
$this->data['jquery'] = array('core' => true);
55+
$this->data['jquery'] = ['core' => true];
5656

5757
$this->includeAtTemplateBase('includes/header.php');
5858
?>

themes/ssp/consent/logout_completed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
$this->data['header'] = $this->t('{logout:title}');
4-
$this->data['jquery'] = array('core' => true);
4+
$this->data['jquery'] = ['core' => true];
55
$this->includeAtTemplateBase('includes/header.php');
66

77
echo ('<h2>' . $this->data['header'] . '</h2>');

themes/ssp/consent/noconsent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
$this->data['header'] = $this->t('{consent:consent:noconsent_title}');
4-
$this->data['jquery'] = array('core' => true);
4+
$this->data['jquery'] = ['core' => true];
55

66
$this->includeAtTemplateBase('includes/header.php');
77

themes/ssp/default/error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
$this->data['header'] = $this->t($this->data['dictTitle']);
3-
$this->data['jquery'] = array('core' => true);
3+
$this->data['jquery'] = ['core' => true];
44

55
$this->data['head'] = <<<EOF
66
<meta name="robots" content="noindex, nofollow" />

themes/ssp/default/includes/footer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
if (count($languages) > 1) {
5454
echo '<div class="col-sm-3 ssp-footer__item">
5555
<div class="dropup ssp-footer__item__lang">';
56-
$langNames = array(
56+
$langNames = [
5757
'no' => 'Bokmål', // Norwegian Bokmål
5858
'nn' => 'Nynorsk', // Norwegian Nynorsk
5959
'se' => 'Sámegiella', // Northern Sami
@@ -93,9 +93,9 @@
9393
'af' => 'Afrikaans', // Afrikaans
9494
'zu' => 'IsiZulu', // Zulu
9595
'xh' => 'isiXhosa', // Xhosa
96-
);
96+
];
9797

98-
$textArray = array();
98+
$textArray = [];
9999
foreach ($languages as $lang => $current) {
100100
$lang = strtolower($lang);
101101
if ($current) {
@@ -105,7 +105,7 @@
105105
. htmlspecialchars(
106106
\SimpleSAML\Utils\HTTP::addURLParameters(
107107
\SimpleSAML\Utils\HTTP::getSelfURL(),
108-
array($this->getTranslator()->getLanguage()->getLanguageParameterName() => $lang)
108+
[$this->getTranslator()->getLanguage()->getLanguageParameterName() => $lang]
109109
)
110110
)
111111
. '">' . $langNames[$lang] . '</a></li>';

themes/ssp/default/includes/header.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@
66
/**
77
* Support the htmlinject hook, which allows modules to change header, pre and post body on all pages.
88
*/
9-
$this->data['htmlinject'] = array(
10-
'htmlContentPre' => array(),
11-
'htmlContentPost' => array(),
12-
'htmlContentHead' => array(),
13-
);
9+
$this->data['htmlinject'] = [
10+
'htmlContentPre' => [],
11+
'htmlContentPost' => [],
12+
'htmlContentHead' => [],
13+
];
1414

1515

16-
$jquery = array();
16+
$jquery = [];
1717
if (array_key_exists('jquery', $this->data)) {
1818
$jquery = $this->data['jquery'];
1919
}
2020

2121
if (array_key_exists('pageid', $this->data)) {
22-
$hookinfo = array(
22+
$hookinfo = [
2323
'pre' => &$this->data['htmlinject']['htmlContentPre'],
2424
'post' => &$this->data['htmlinject']['htmlContentPost'],
2525
'head' => &$this->data['htmlinject']['htmlContentHead'],
2626
'jquery' => &$jquery,
2727
'page' => $this->data['pageid']
28-
);
28+
];
2929

3030
SimpleSAML\Module::callHooks('htmlinject', $hookinfo);
3131
}

themes/ssp/userid/error.tpl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
$this->data['header'] = $this->t('{userid:error:header}');
3-
$this->data['jquery'] = array('core' => true);
3+
$this->data['jquery'] = ['core' => true];
44

55
$this->data['head'] = <<<EOF
66
<meta name="robots" content="noindex, nofollow" />
@@ -24,7 +24,7 @@
2424
?>
2525
</h2>
2626
<p><?= $this->t('{themevanilla:userid_error:friendly_description}', $translationParams) ?></p>
27-
<p><?= $this->t('{themevanilla:userid_error:resolution_description}', array('%RETRY_URL%' => $retryUrl)) ?></p>
27+
<p><?= $this->t('{themevanilla:userid_error:resolution_description}', ['%RETRY_URL%' => $retryUrl]) ?></p>
2828
</div>
2929
</div>
3030
<div class="row">

0 commit comments

Comments
 (0)