upgrade zend (#1559)
[openemr.git] / vendor / sebastian / resource-operations / build / generate.php
blob957044034d654840144e2c49b432fd0bc0ca17e6
1 #!/usr/bin/env php
2 <?php
3 /*
4 * This file is part of resource-operations.
6 * (c) Sebastian Bergmann <sebastian@phpunit.de>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 $functions = require __DIR__ . '/arginfo.php';
13 $resourceFunctions = [];
15 foreach ($functions as $function => $arguments) {
16 foreach ($arguments as $argument) {
17 if ($argument == 'resource') {
18 $resourceFunctions[] = $function;
23 $resourceFunctions = array_unique($resourceFunctions);
24 sort($resourceFunctions);
26 $buffer = <<<EOT
27 <?php
29 * This file is part of resource-operations.
31 * (c) Sebastian Bergmann <sebastian@phpunit.de>
33 * For the full copyright and license information, please view the LICENSE
34 * file that was distributed with this source code.
37 namespace SebastianBergmann\ResourceOperations;
39 class ResourceOperations
41 /**
42 * @return string[]
44 public static function getFunctions()
46 return [
48 EOT;
50 foreach ($resourceFunctions as $function) {
51 $buffer .= sprintf(" '%s',\n", $function);
54 $buffer .= <<< EOT
59 EOT;
61 file_put_contents(__DIR__ . '/../src/ResourceOperations.php', $buffer);