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