Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted array declarations #959

Merged
merged 8 commits into from
Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions attributemap/addurnprefix.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$attributemap = array(
$attributemap = [
'sn' => 'urn:mace:dir:attribute-def:sn',
'telephoneNumber' => 'urn:mace:dir:attribute-def:telephoneNumber',
'facsimileTelephoneNumber' => 'urn:mace:dir:attribute-def:facsimileTelephoneNumber',
Expand All @@ -17,4 +17,4 @@
'eduPersonEntitlement' => 'urn:mace:dir:attribute-def:eduPersonEntitlement',
'eduPersonOrgDN' => 'urn:mace:dir:attribute-def:eduPersonOrgDN',
'eduPersonOrgUnitDN' => 'urn:mace:dir:attribute-def:eduPersonOrgUnitDN',
);
];
4 changes: 2 additions & 2 deletions attributemap/deprecatedSchacNS.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
define('SCHAC_NEW_NS', 'urn:schac:attribute-def:');
}

$attributemap = array(
$attributemap = [
SCHAC_NEW_NS.'schacCountryOfCitizenship' => SCHAC_OLD_NS.'schacCountryOfCitizenship',
SCHAC_NEW_NS.'schacCountryOfResidence' => SCHAC_OLD_NS.'schacCountryOfResidence',
SCHAC_NEW_NS.'schacDateOfBirth' => SCHAC_OLD_NS.'schacDateOfBirth',
Expand All @@ -32,4 +32,4 @@
SCHAC_NEW_NS.'schacUserPresenceID' => SCHAC_OLD_NS.'schacUserPresenceID',
SCHAC_NEW_NS.'schacUserPrivateAttribute' => SCHAC_OLD_NS.'schacUserPrivateAttribute',
SCHAC_NEW_NS.'schacUserStatus' => SCHAC_OLD_NS.'schacUserStatus',
);
];
4 changes: 2 additions & 2 deletions attributemap/facebook2name.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [

// Generated Facebook Attributes
'facebook_user' => 'eduPersonPrincipalName', // username OR uid @ facebook.com
Expand All @@ -15,4 +15,4 @@
'facebook.profile_url' => 'labeledURI',
'facebook.locale' => 'preferredLanguage',
'facebook.about_me' => 'description',
);
];
4 changes: 2 additions & 2 deletions attributemap/feide-oid.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$attributemap = array(
$attributemap = [
'mobile' => 'urn:mace:dir:attribute-def:mobile',
'displayName' => 'urn:oid:2.16.840.1.113730.3.1.241',
);
];
4 changes: 2 additions & 2 deletions attributemap/linkedin2name.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [

// See http://developer.linkedin.com/docs/DOC-1061 for LinkedIn Profile fields.
// NB: JSON response requires the conversion of field names from hyphened to camelCase.
Expand All @@ -15,4 +15,4 @@
'linkedin.id' => 'uid', // alpha + mixed case user id
'linkedin.headline' => 'title',
'linkedin.summary' => 'description',
);
];
4 changes: 2 additions & 2 deletions attributemap/name2claim.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php // Maps AD LDAP to Claims from http://msdn.microsoft.com/en-us/library/hh159803.aspx
$attributemap = array(
$attributemap = [
'c' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country',
'givenName' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname',
'mail' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress',
Expand All @@ -10,4 +10,4 @@
'st' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince',
'streetaddress' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress',
'telephonenumber' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone',
);
];
4 changes: 2 additions & 2 deletions attributemap/name2oid.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [
'aRecord' => 'urn:oid:0.9.2342.19200300.100.1.26',
'aliasedEntryName' => 'urn:oid:2.5.4.1',
'aliasedObjectName' => 'urn:oid:2.5.4.1',
Expand Down Expand Up @@ -189,4 +189,4 @@
'userid' => 'urn:oid:0.9.2342.19200300.100.1.1',
'x121Address' => 'urn:oid:2.5.4.24',
'x500UniqueIdentifier' => 'urn:oid:2.5.4.45',
);
];
4 changes: 2 additions & 2 deletions attributemap/name2urn.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [
'aRecord' => 'urn:mace:dir:attribute-def:aRecord',
'aliasedEntryName' => 'urn:mace:dir:attribute-def:aliasedEntryName',
'aliasedObjectName' => 'urn:mace:dir:attribute-def:aliasedObjectName',
Expand Down Expand Up @@ -186,4 +186,4 @@
'userid' => 'urn:mace:dir:attribute-def:userid',
'x121Address' => 'urn:mace:dir:attribute-def:x121Address',
'x500UniqueIdentifier' => 'urn:mace:dir:attribute-def:x500UniqueIdentifier',
);
];
4 changes: 2 additions & 2 deletions attributemap/newSchacNS.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
define('SCHAC_NEW_NS', 'urn:schac:attribute-def:');
}

$attributemap = array(
$attributemap = [
SCHAC_OLD_NS.'schacCountryOfCitizenship' => SCHAC_NEW_NS.'schacCountryOfCitizenship',
SCHAC_OLD_NS.'schacCountryOfResidence' => SCHAC_NEW_NS.'schacCountryOfResidence',
SCHAC_OLD_NS.'schacDateOfBirth' => SCHAC_NEW_NS.'schacDateOfBirth',
Expand All @@ -32,4 +32,4 @@
SCHAC_OLD_NS.'schacUserPresenceID' => SCHAC_NEW_NS.'schacUserPresenceID',
SCHAC_OLD_NS.'schacUserPrivateAttribute' => SCHAC_NEW_NS.'schacUserPrivateAttribute',
SCHAC_OLD_NS.'schacUserStatus' => SCHAC_NEW_NS.'schacUserStatus',
);
];
4 changes: 2 additions & 2 deletions attributemap/oid-feide.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$attributemap = array(
$attributemap = [
'urn:oid:0.9.2342.19200300.100.1.41' => 'mobile',
'urn:oid:1.3.6.1.4.1.5923.1.1.1.6' => 'eduPersonPrincipalName',
'urn:oid:0.9.2342.19200300.100.1.3' => 'mail',
Expand All @@ -9,4 +9,4 @@
'urn:oid:2.5.4.4' => 'sn',
'urn:oid:2.5.4.42' => 'givenName',
'urn:oid:2.16.756.1.2.5.1.1.1' => 'eduPerson',
);
];
4 changes: 2 additions & 2 deletions attributemap/oid2name.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [
'urn:oid:0.9.2342.19200300.100.1.1' => 'uid',
'urn:oid:0.9.2342.19200300.100.1.10' => 'manager',
'urn:oid:0.9.2342.19200300.100.1.11' => 'documentIdentifier',
Expand Down Expand Up @@ -167,4 +167,4 @@
'urn:oid:2.5.4.7' => 'l',
'urn:oid:2.5.4.8' => 'st',
'urn:oid:2.5.4.9' => 'street',
);
];
4 changes: 2 additions & 2 deletions attributemap/oid2urn.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [
'urn:oid:0.9.2342.19200300.100.1.1' => 'urn:mace:dir:attribute-def:uid',
'urn:oid:0.9.2342.19200300.100.1.10' => 'urn:mace:dir:attribute-def:manager',
'urn:oid:0.9.2342.19200300.100.1.11' => 'urn:mace:dir:attribute-def:documentIdentifier',
Expand Down Expand Up @@ -164,4 +164,4 @@
'urn:oid:2.5.4.7' => 'urn:mace:dir:attribute-def:l',
'urn:oid:2.5.4.8' => 'urn:mace:dir:attribute-def:st',
'urn:oid:2.5.4.9' => 'urn:mace:dir:attribute-def:street',
);
];
4 changes: 2 additions & 2 deletions attributemap/openid2name.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [
// Simple Registration + AX Schema
'http://axschema.org/namePerson/friendly' => 'displayName', // Alias/Username -> displayName
'openid.sreg.nickname' => 'displayName',
Expand Down Expand Up @@ -30,4 +30,4 @@
'http://axschema.org/contact/phone/fax' => 'facsimileTelephoneNumber', // Phone (fax)

// Further attributes can be found at http://www.axschema.org/types/
);
];
4 changes: 2 additions & 2 deletions attributemap/removeurnprefix.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$attributemap = array(
$attributemap = [
'urn:mace:dir:attribute-def:sn' => 'sn',
'urn:mace:dir:attribute-def:telephoneNumber' => 'telephoneNumber',
'urn:mace:dir:attribute-def:facsimileTelephoneNumber' => 'facsimileTelephoneNumber',
Expand All @@ -17,4 +17,4 @@
'urn:mace:dir:attribute-def:eduPersonEntitlement' => 'eduPersonEntitlement',
'urn:mace:dir:attribute-def:eduPersonOrgDN' => 'eduPersonOrgDN',
'urn:mace:dir:attribute-def:eduPersonOrgUnitDN' => 'eduPersonOrgUnitDN',
);
];
4 changes: 2 additions & 2 deletions attributemap/test.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

$attributemap = array(
$attributemap = [
'mobile' => 'urn:mace:dir:attribute-def:mobile'
);
];
4 changes: 2 additions & 2 deletions attributemap/twitter2name.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [

// Generated Twitter Attributes
'twitter_screen_n_realm' => 'eduPersonPrincipalName', // screen_name@twitter.com
Expand All @@ -11,4 +11,4 @@
'twitter.url' => 'labeledURI',
'twitter.lang' => 'preferredLanguage',
'twitter.description' => 'description',
);
];
4 changes: 2 additions & 2 deletions attributemap/urn2name.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [
'urn:mace:dir:attribute-def:aRecord' => 'aRecord',
'urn:mace:dir:attribute-def:aliasedEntryName' => 'aliasedEntryName',
'urn:mace:dir:attribute-def:aliasedObjectName' => 'aliasedObjectName',
Expand Down Expand Up @@ -186,4 +186,4 @@
'urn:mace:terena.org:attribute-def:schacUserStatus' => 'schacUserStatus',
'urn:oasis:names:tc:SAML:attribute:pairwise-id' => 'pairwise-id',
'urn:oasis:names:tc:SAML:attribute:subject-id' => 'subject-id',
);
];
4 changes: 2 additions & 2 deletions attributemap/urn2oid.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [
'urn:mace:dir:attribute-def:aRecord' => 'urn:oid:0.9.2342.19200300.100.1.26',
'urn:mace:dir:attribute-def:aliasedEntryName' => 'urn:oid:2.5.4.1',
'urn:mace:dir:attribute-def:aliasedObjectName' => 'urn:oid:2.5.4.1',
Expand Down Expand Up @@ -185,4 +185,4 @@
'urn:mace:terena.org:attribute-def:schacUserPresenceID' => 'urn:oid:1.3.6.1.4.1.25178.1.2.12',
'urn:mace:terena.org:attribute-def:schacUserPrivateAttribute' => 'urn:oid:1.3.6.1.4.1.25178.1.2.18',
'urn:mace:terena.org:attribute-def:schacUserStatus' => 'urn:oid:1.3.6.1.4.1.25178.1.2.19',
);
];
4 changes: 2 additions & 2 deletions attributemap/windowslive2name.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$attributemap = array(
$attributemap = [

// Generated Windows Live ID Attributes
'windowslive_user' => 'eduPersonPrincipalName', // uid @ windowslive.com
Expand All @@ -19,4 +19,4 @@
'windowslive.mail' => 'mail',
'windowslive.preferredLanguage' => 'preferredLanguage',

);
];
2 changes: 1 addition & 1 deletion bin/importPdoMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$mdshp->initDatabase();

foreach (glob("metadata/*.php") as $filename) {
$metadata = array();
$metadata = [];
require_once $filename;
$set = basename($filename, ".php");
echo "importing set '$set'...".PHP_EOL;
Expand Down
6 changes: 3 additions & 3 deletions bin/memcacheSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// We use the stats interface to determine which servers exists
$stats = \SimpleSAML\Memcache::getRawStats();

$keys = array();
$keys = [];
foreach ($stats as $group) {
foreach ($group as $server => $state) {

Expand Down Expand Up @@ -109,7 +109,7 @@ function getServerKeys($server)
}

// Read list of slabs
$slabs = array();
$slabs = [];
while (($line = fgets($socket)) !== false) {
$line = rtrim($line);
if ($line === 'END') {
Expand All @@ -125,7 +125,7 @@ function getServerKeys($server)
}

// Dump keys in slabs
$keys = array();
$keys = [];
foreach ($slabs as $slab) {

if (fwrite($socket, "stats cachedump ".$slab." 1000000\r\n") === false) {
Expand Down
86 changes: 43 additions & 43 deletions config-templates/acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,56 @@
* This file defines "named" access control lists, which can
* be reused in several places.
*/
$config = array(
'adminlist' => array(
//array('allow', 'equals', 'mail', 'admin1@example.org'),
//array('allow', 'has', 'groups', 'admin'),
$config = [
'adminlist' => [
//['allow', 'equals', 'mail', 'admin1@example.org'],
//['allow', 'has', 'groups', 'admin'],
// The default action is to deny access.
),
],

'example-simple' => array(
array('allow', 'equals', 'mail', 'admin1@example.org'),
array('allow', 'equals', 'mail', 'admin2@example.org'),
'example-simple' => [
['allow', 'equals', 'mail', 'admin1@example.org'],
['allow', 'equals', 'mail', 'admin2@example.org'],
// The default action is to deny access.
),
],

'example-deny-some' => array(
array('deny', 'equals', 'mail', 'eviluser@example.org'),
array('allow'), // Allow everybody else.
),
'example-deny-some' => [
['deny', 'equals', 'mail', 'eviluser@example.org'],
['allow'], // Allow everybody else.
],

'example-maildomain' => array(
array('allow', 'equals-preg', 'mail', '/@example\.org$/'),
'example-maildomain' => [
['allow', 'equals-preg', 'mail', '/@example\.org$/'],
// The default action is to deny access.
),
],

'example-allow-employees' => array(
array('allow', 'has', 'eduPersonAffiliation', 'employee'),
'example-allow-employees' => [
['allow', 'has', 'eduPersonAffiliation', 'employee'],
// The default action is to deny access.
),
],

'example-allow-employees-not-students' => array(
array('deny', 'has', 'eduPersonAffiliation', 'student'),
array('allow', 'has', 'eduPersonAffiliation', 'employee'),
'example-allow-employees-not-students' => [
['deny', 'has', 'eduPersonAffiliation', 'student'],
['allow', 'has', 'eduPersonAffiliation', 'employee'],
// The default action is to deny access.
),

'example-deny-student-except-one' => array(
array('deny', 'and',
array('has', 'eduPersonAffiliation', 'student'),
array('not', 'equals', 'mail', 'user@example.org'),
),
array('allow'),
),

'example-allow-or' => array(
array('allow', 'or',
array('equals', 'eduPersonAffiliation', 'student', 'member'),
array('equals', 'mail', 'someuser@example2.org'),
),
),

'example-allow-all' => array(
array('allow'),
),
);
],

'example-deny-student-except-one' => [
['deny', 'and',
['has', 'eduPersonAffiliation', 'student'],
['not', 'equals', 'mail', 'user@example.org'],
],
['allow'],
],

'example-allow-or' => [
['allow', 'or',
['equals', 'eduPersonAffiliation', 'student', 'member'],
['equals', 'mail', 'someuser@example2.org'],
],
],

'example-allow-all' => [
['allow'],
],
];
4 changes: 2 additions & 2 deletions config-templates/authmemcookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This is the configuration file for the Auth MemCookie example.
*/

$config = array(
$config = [
/*
* The authentication source that should be used.
*
Expand Down Expand Up @@ -70,4 +70,4 @@
* 'memcache.port' => 11211,
*/
'memcache.port' => 11211,
);
];
Loading