Skip to content

Commit 791e4ad

Browse files
authored
Merge pull request #8 from fkooman/master
pull in dependencies, modernize
2 parents 0eccaef + 4be03ed commit 791e4ad

28 files changed

+1808
-487
lines changed

.phan/config.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
return [
4+
'directory_list' => [
5+
'src',
6+
'web',
7+
'bin',
8+
],
9+
'exclude_analysis_directory_list' => [
10+
'vendor/',
11+
],
12+
];

.php_cs.dist

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__)
5+
;
6+
7+
return PhpCsFixer\Config::create()
8+
->setRules([
9+
'@PSR2' => true,
10+
'@Symfony' => true,
11+
'ordered_imports' => true,
12+
'array_syntax' => ['syntax' => 'short'],
13+
'ordered_class_elements' => true,
14+
])
15+
->setFinder($finder)
16+
;

bin/BackendTest.php

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
<?php
22

33
/**
4-
* Copyright 2013 François Kooman <[email protected]>
5-
*
6-
* Licensed under the Apache License, Version 2.0 (the "License");
7-
* you may not use this file except in compliance with the License.
8-
* You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
17-
*/
18-
19-
require_once dirname(__DIR__) . '/vendor/autoload.php';
4+
* Copyright 2013 François Kooman <[email protected]>.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
require_once dirname(__DIR__).'/vendor/autoload.php';
2019

2120
if ($argc < 2) {
22-
echo "specify userId as a parameter" . PHP_EOL;
21+
echo 'specify userId as a parameter'.PHP_EOL;
2322
exit(1);
2423
}
2524

26-
use fkooman\Config\Config;
25+
use fkooman\VootProvider\Config\Config;
2726

28-
$config = Config::fromIniFile(dirname(__DIR__) . '/config/voot.ini');
27+
$config = Config::fromIniFile(dirname(__DIR__).'/config/voot.ini');
2928

30-
$vootStorageBackend = "fkooman\\VootProvider\\" . $config->getValue('storageBackend');
29+
$vootStorageBackend = 'fkooman\\VootProvider\\'.$config->getValue('storageBackend');
3130

3231
try {
3332
$vootStorage = new $vootStorageBackend($config);
@@ -39,5 +38,5 @@
3938
var_dump($groupMembers);
4039
}
4140
} catch (Exception $e) {
42-
echo $e->getMessage() . PHP_EOL;
41+
echo $e->getMessage().PHP_EOL;
4342
}

bin/addUsers.php

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
11
<?php
22

33
/**
4-
* Copyright 2013 François Kooman <[email protected]>
5-
*
6-
* Licensed under the Apache License, Version 2.0 (the "License");
7-
* you may not use this file except in compliance with the License.
8-
* You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
17-
*/
18-
19-
require_once dirname(__DIR__) . '/vendor/autoload.php';
20-
21-
use fkooman\Config\Config;
4+
* Copyright 2013 François Kooman <[email protected]>.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
require_once dirname(__DIR__).'/vendor/autoload.php';
19+
20+
use fkooman\VootProvider\Config\Config;
2221
use fkooman\VootProvider\PdoVootStorage;
2322

24-
$config = Config::fromIniFile(dirname(__DIR__) . '/config/voot.ini');
23+
$config = Config::fromIniFile(dirname(__DIR__).'/config/voot.ini');
2524

2625
$storage = new PdoVootStorage($config);
2726

28-
$data = file_get_contents(dirname(__DIR__) . '/schema/user_attributes.json');
27+
$data = file_get_contents(dirname(__DIR__).'/schema/user_attributes.json');
2928
$d = json_decode($data, true);
3029

3130
foreach ($d as $v) {
3231
$storage->addUser($v['id'], $v['displayName'], $v['mail']);
3332
}
3433

35-
$data = file_get_contents(dirname(__DIR__) . '/schema/group_membership.json');
34+
$data = file_get_contents(dirname(__DIR__).'/schema/group_membership.json');
3635
$d = json_decode($data, true);
3736

3837
foreach ($d as $v) {
@@ -45,13 +44,13 @@
4544
function roleToInt($role)
4645
{
4746
switch ($role) {
48-
case "member":
47+
case 'member':
4948
return 10;
50-
case "admin":
49+
case 'admin':
5150
return 50;
52-
case "manager":
51+
case 'manager':
5352
return 20;
5453
default:
55-
die("invalid role");
54+
die('invalid role');
5655
}
5756
}

composer.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@
77
}
88
],
99
"autoload": {
10-
"psr-0": {
10+
"psr-4": {
1111
"fkooman\\VootProvider\\": "src/"
1212
}
1313
},
1414
"description": "VOOT Provider",
1515
"license": "Apache-2.0",
1616
"name": "fkooman/php-voot-provider",
1717
"require": {
18+
"ext-filter": "*",
19+
"ext-json": "*",
1820
"ext-ldap": "*",
19-
"fkooman/php-lib-config": "0.2.*",
20-
"fkooman/php-lib-rest": "0.3.*",
21-
"php": ">=5.3.3"
21+
"ext-pcre": "*",
22+
"ext-pdo": "*",
23+
"ext-spl": "*",
24+
"php": ">=5.4",
25+
"symfony/polyfill-php56": "^1.3"
2226
}
2327
}

0 commit comments

Comments
 (0)