Mercurial > hg > cmmr2012-drupal-site
comparison vendor/sebastian/resource-operations/build/generate.php @ 2:5311817fb629
Theme updates
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 13:19:18 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1:0b0e5f3b1e83 | 2:5311817fb629 |
---|---|
1 #!/usr/bin/env php | |
2 <?php | |
3 /* | |
4 * This file is part of resource-operations. | |
5 * | |
6 * (c) Sebastian Bergmann <sebastian@phpunit.de> | |
7 * | |
8 * For the full copyright and license information, please view the LICENSE | |
9 * file that was distributed with this source code. | |
10 */ | |
11 | |
12 $functions = require __DIR__ . '/arginfo.php'; | |
13 $resourceFunctions = []; | |
14 | |
15 foreach ($functions as $function => $arguments) { | |
16 foreach ($arguments as $argument) { | |
17 if ($argument == 'resource') { | |
18 $resourceFunctions[] = $function; | |
19 } | |
20 } | |
21 } | |
22 | |
23 $resourceFunctions = array_unique($resourceFunctions); | |
24 sort($resourceFunctions); | |
25 | |
26 $buffer = <<<EOT | |
27 <?php | |
28 /* | |
29 * This file is part of resource-operations. | |
30 * | |
31 * (c) Sebastian Bergmann <sebastian@phpunit.de> | |
32 * | |
33 * For the full copyright and license information, please view the LICENSE | |
34 * file that was distributed with this source code. | |
35 */ | |
36 | |
37 namespace SebastianBergmann\ResourceOperations; | |
38 | |
39 class ResourceOperations | |
40 { | |
41 /** | |
42 * @return string[] | |
43 */ | |
44 public static function getFunctions() | |
45 { | |
46 return [ | |
47 | |
48 EOT; | |
49 | |
50 foreach ($resourceFunctions as $function) { | |
51 $buffer .= sprintf(" '%s',\n", $function); | |
52 } | |
53 | |
54 $buffer .= <<< EOT | |
55 ]; | |
56 } | |
57 } | |
58 | |
59 EOT; | |
60 | |
61 file_put_contents(__DIR__ . '/../src/ResourceOperations.php', $buffer); | |
62 |