about summary refs log tree commit diff stats
path: root/vendor/phpunit/php-code-coverage/build
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-05-25 14:12:01 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-05-25 14:12:01 +0300
commit9600be1703ba3083c38386930fa940938394f53e (patch)
treea8fcbc476914881915eab236ee99f88459dfb09b /vendor/phpunit/php-code-coverage/build
parentcae514dddfc59f533a93a47afc283371d5949843 (diff)
downloadthe-epube-9600be1703ba3083c38386930fa940938394f53e.tar.gz
the-epube-9600be1703ba3083c38386930fa940938394f53e.tar.xz
add phpunit
Diffstat (limited to 'vendor/phpunit/php-code-coverage/build')
-rw-r--r--vendor/phpunit/php-code-coverage/build/scripts/extract-release-notes.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/phpunit/php-code-coverage/build/scripts/extract-release-notes.php b/vendor/phpunit/php-code-coverage/build/scripts/extract-release-notes.php
new file mode 100644
index 0000000..3901439
--- /dev/null
+++ b/vendor/phpunit/php-code-coverage/build/scripts/extract-release-notes.php
@@ -0,0 +1,47 @@
+#!/usr/bin/env php
+<?php declare(strict_types=1);
+if ($argc !== 2) {
+    print $argv[0] . ' <tag>' . PHP_EOL;
+
+    exit(1);
+}
+
+$version       = $argv[1];
+$versionSeries = explode('.', $version)[0] . '.' . explode('.', $version)[1];
+
+$file = __DIR__ . '/../../ChangeLog-' . $versionSeries . '.md';
+
+if (!is_file($file) || !is_readable($file)) {
+    print $file . ' cannot be read' . PHP_EOL;
+
+    exit(1);
+}
+
+$buffer = '';
+$append = false;
+
+foreach (file($file) as $line) {
+    if (str_starts_with($line, '## [' . $version . ']')) {
+        $append = true;
+
+        continue;
+    }
+
+    if ($append && (str_starts_with($line, '## ') || str_starts_with($line, '['))) {
+        break;
+    }
+
+    if ($append) {
+        $buffer .= $line;
+    }
+}
+
+$buffer = trim($buffer);
+
+if ($buffer === '') {
+    print 'Unable to extract release notes' . PHP_EOL;
+
+    exit(1);
+}
+
+print $buffer . PHP_EOL;