+[](https://phpunit.de/?ref=github)
-# PHPUnit
-
-[](https://packagist.org/packages/phpunit/phpunit)
[](https://github.com/sebastianbergmann/phpunit/actions)
-[](https://shepherd.dev/github/sebastianbergmann/phpunit)
-[](https://codecov.io/gh/sebastianbergmann/phpunit)
+[](https://codecov.io/gh/sebastianbergmann/phpunit)
+[](https://packagist.org/packages/phpunit/phpunit)
+[](https://packagist.org/packages/phpunit/phpunit/stats)
+[](https://packagist.org/packages/phpunit/phpunit/stats)
+[](https://packagist.org/packages/phpunit/phpunit/stats)
+
+# PHPUnit
-PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks.
+PHPUnit is a programmer-oriented testing framework for PHP.
+It is an instance of the xUnit architecture for unit testing frameworks.
## Installation
-We distribute a [PHP Archive (PHAR)](https://php.net/phar) that has all required (as well as some optional) dependencies of PHPUnit bundled in a single file:
+We distribute a [PHP Archive (PHAR)](https://php.net/phar) that has all required dependencies of PHPUnit bundled in a single file:
```bash
$ wget https://phar.phpunit.de/phpunit-X.Y.phar
@@ -21,17 +24,86 @@ $ php phpunit-X.Y.phar --version
Please replace `X.Y` with the version of PHPUnit you are interested in.
-Alternatively, you may use [Composer](https://getcomposer.org/) to download and install PHPUnit as well as its dependencies. Please refer to the "[Getting Started](https://phpunit.de/getting-started-with-phpunit.html)" guide for details on how to install PHPUnit.
+Alternatively, you may use [Composer](https://getcomposer.org/) to download and install PHPUnit as well as its dependencies.
+Please refer to the [documentation](https://phpunit.de/documentation.html?ref=github) for details on how to install PHPUnit.
## Contribute
Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/main/.github/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects.
-## List of Contributors
+A big "Thank you!" to everyone who has contributed to PHPUnit!
+You can find a detailed list of contributors on every PHPUnit related package on GitHub.
+
+Here is a list of all components that are primarily developed and maintained by [Sebastian Bergmann](https://sebastian-bergmann.de/open-source.html?ref=github):
+
+* [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit)
+* [phpunit/php-code-coverage](https://github.com/sebastianbergmann/php-code-coverage)
+* [phpunit/php-file-iterator](https://github.com/sebastianbergmann/php-file-iterator)
+* [phpunit/php-invoker](https://github.com/sebastianbergmann/php-invoker)
+* [phpunit/php-text-template](https://github.com/sebastianbergmann/php-text-template)
+* [phpunit/php-timer](https://github.com/sebastianbergmann/php-timer)
+* [sebastian/cli-parser](https://github.com/sebastianbergmann/cli-parser)
+* [sebastian/comparator](https://github.com/sebastianbergmann/comparator)
+* [sebastian/complexity](https://github.com/sebastianbergmann/complexity)
+* [sebastian/diff](https://github.com/sebastianbergmann/diff)
+* [sebastian/environment](https://github.com/sebastianbergmann/environment)
+* [sebastian/exporter](https://github.com/sebastianbergmann/exporter)
+* [sebastian/global-state](https://github.com/sebastianbergmann/global-state)
+* [sebastian/lines-of-code](https://github.com/sebastianbergmann/lines-of-code)
+* [sebastian/object-enumerator](https://github.com/sebastianbergmann/object-enumerator)
+* [sebastian/object-reflector](https://github.com/sebastianbergmann/object-reflector)
+* [sebastian/recursion-context](https://github.com/sebastianbergmann/recursion-context)
+* [sebastian/type](https://github.com/sebastianbergmann/type)
+* [sebastian/version](https://github.com/sebastianbergmann/version)
+
+A very special thanks to everyone who has contributed to the [PHPUnit Manual](https://github.com/sebastianbergmann/phpunit-documentation-english).
+
+In addition to the components listed above, PHPUnit depends on the components listed below:
+
+* [myclabs/deep-copy](https://github.com/myclabs/DeepCopy)
+* [nikic/php-parser](https://github.com/nikic/php-parser)
+* [phar-io/manifest](https://github.com/phar-io/manifest)
+* [phar-io/version](https://github.com/phar-io/version)
+* [staabm/side-effects-detector](https://github.com/staabm/side-effects-detector)
+* [theseer/tokenizer](https://github.com/theseer/tokenizer)
+
+These tools are used to develop PHPUnit:
+
+* [Composer](https://getcomposer.org/)
+* [Phive](https://phar.io/)
+* [PHP Autoload Builder](https://github.com/theseer/Autoload/)
+* [PHP-CS-Fixer](https://cs.symfony.com/)
+* [PHP-Scoper](https://github.com/humbug/php-scoper)
+* [PHPStan](https://phpstan.org/)
+
+## Sponsors
+
+It has taken [Sebastian Bergmann](https://sebastian-bergmann.de/open-source.html?ref=github) thousands of hours to develop, test, and support PHPUnit.
+[**You can sponsor his Open Source work through GitHub Sponsors**](https://github.com/sponsors/sebastianbergmann), for example.
+
+These businesses support Sebastian Bergmann's work on PHPUnit:
-Thanks to everyone who has contributed to PHPUnit! You can find a detailed list of contributors on every PHPUnit related package on GitHub. This list shows only the major components:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-* [PHPUnit](https://github.com/sebastianbergmann/phpunit/graphs/contributors)
-* [php-code-coverage](https://github.com/sebastianbergmann/php-code-coverage/graphs/contributors)
+Would you like to see your logo here as well as on the [PHPUnit website](https://phpunit.de/sponsors.html?ref=github)?
+Contact Sebastian Bergmann at [sponsoring@phpunit.de](mailto:sponsoring@phpunit.de) to learn more about how you can support his work on PHPUnit.
-A very special thanks to everyone who has contributed to the [documentation](https://github.com/sebastianbergmann/phpunit-documentation-english/graphs/contributors).
+Whether you are a CEO, CFO, CTO, or a developer: your company surely depends on Open Source software.
+[It is time to pay your share](https://opensourcepledge.com/) and support maintainers like [Sebastian Bergmann](https://sebastian-bergmann.de/open-source.html?ref=github).
diff --git a/SECURITY.md b/SECURITY.md
index 965e5ed2d58..5f55c41947b 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -24,7 +24,7 @@ PHPUnit is a framework for writing as well as a command-line tool for running te
**If you upload PHPUnit to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.**
-Please note that if you upload PHPUnit to a webserver "bad things" may happen. [You have been warned.](https://thephp.cc/articles/phpunit-a-security-risk)
+Please note that if you upload PHPUnit to a webserver "bad things" may happen. [You have been warned.](https://thephp.cc/articles/phpunit-a-security-risk?ref=phpunit)
PHPUnit is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using PHPUnit in an HTTP or web context or with untrusted input data is performed. PHPUnit might also contain functionality that intentionally exposes internal application data for debugging purposes.
diff --git a/build.xml b/build.xml
index 0c4fc1dd408..db8da284df1 100644
--- a/build.xml
+++ b/build.xml
@@ -1,78 +1,100 @@
-
-
-
+
+
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
-
-
-
+
+
+
+
+
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
-
-
+
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
-
-
+
@@ -117,6 +139,8 @@
+
+
@@ -163,20 +187,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -261,6 +271,13 @@
+
+
+
+
+
+
+
@@ -275,6 +292,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -317,26 +346,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -347,11 +372,16 @@
+
+
+
+
+
@@ -363,6 +393,10 @@
+
+
+
+
@@ -374,7 +408,6 @@
-
@@ -386,50 +419,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/build/config/github-ci-fail.xml b/build/config/github-ci-fail.xml
deleted file mode 100644
index 94d1cda5331..00000000000
--- a/build/config/github-ci-fail.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- ../../tests/fail
-
-
-
-
-
-
-
diff --git a/build/config/php-scoper.php b/build/config/php-scoper.php
index b9fbb781343..979bdaccd72 100644
--- a/build/config/php-scoper.php
+++ b/build/config/php-scoper.php
@@ -8,9 +8,12 @@
* file that was distributed with this source code.
*/
return [
+ 'prefix' => 'PHPUnitPHAR',
+
'exclude-namespaces' => [
'PHPUnit',
],
+
'expose-constants' => [
'/^__PHPUNIT_.+$/'
],
diff --git a/build/scripts/extract-release-notes.php b/build/scripts/extract-release-notes.php
new file mode 100755
index 00000000000..9383ff3abba
--- /dev/null
+++ b/build/scripts/extract-release-notes.php
@@ -0,0 +1,54 @@
+#!/usr/bin/env php
+' . 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);
+}
+
+printf(
+ '%s%s---%s[How to install or update PHPUnit](https://docs.phpunit.de/en/%s/installation.html)%s',
+ $buffer,
+ PHP_EOL,
+ PHP_EOL,
+ $versionSeries,
+ PHP_EOL,
+);
diff --git a/build/scripts/generate-global-assert-wrappers.php b/build/scripts/generate-global-assert-wrappers.php
index b7c654fafe6..d53bac1c421 100755
--- a/build/scripts/generate-global-assert-wrappers.php
+++ b/build/scripts/generate-global-assert-wrappers.php
@@ -64,6 +64,11 @@
$usedClasses[] = $returnType->getName();
+ // skip, so we can later on append a signature including precise analysis types
+ if ($method->getName() === 'callback') {
+ continue;
+ }
+
$constraintMethods .= \sprintf(
"if (!function_exists('PHPUnit\Framework\\" . $method->getName() . "')) {\n%s\n{\n return Assert::%s(...\\func_get_args());\n}\n}\n\n",
\str_replace('final public static ', '', \trim($lines[$method->getStartLine() - 1])),
@@ -105,6 +110,19 @@
$buffer .= $constraintMethods;
$buffer .= <<<'EOT'
+if (!function_exists('PHPUnit\Framework\callback')) {
+ /**
+ * @template CallbackInput of mixed
+ *
+ * @param callable(CallbackInput $callback): bool $callback
+ *
+ * @return Callback
+ */
+ function callback(callable $callback): Callback
+ {
+ return Assert::callback($callback);
+ }
+}
if (!function_exists('PHPUnit\Framework\any')) {
/**
@@ -182,46 +200,6 @@ function atMost(int $allowedInvocations): InvokedAtMostCountMatcher
}
}
-if (!function_exists('PHPUnit\Framework\returnValue')) {
- function returnValue(mixed $value): ReturnStub
- {
- return new ReturnStub($value);
- }
-}
-
-if (!function_exists('PHPUnit\Framework\returnValueMap')) {
- function returnValueMap(array $valueMap): ReturnValueMapStub
- {
- return new ReturnValueMapStub($valueMap);
- }
-}
-
-if (!function_exists('PHPUnit\Framework\returnArgument')) {
- function returnArgument(int $argumentIndex): ReturnArgumentStub
- {
- return new ReturnArgumentStub($argumentIndex);
- }
-}
-
-if (!function_exists('PHPUnit\Framework\returnCallback')) {
- function returnCallback(callable $callback): ReturnCallbackStub
- {
- return new ReturnCallbackStub($callback);
- }
-}
-
-if (!function_exists('PHPUnit\Framework\returnSelf')) {
- /**
- * Returns the current object.
- *
- * This method is useful when mocking a fluent interface.
- */
- function returnSelf(): ReturnSelfStub
- {
- return new ReturnSelfStub;
- }
-}
-
if (!function_exists('PHPUnit\Framework\throwException')) {
function throwException(\Throwable $exception): ExceptionStub
{
@@ -229,18 +207,6 @@ function throwException(\Throwable $exception): ExceptionStub
}
}
-if (!function_exists('PHPUnit\Framework\onConsecutiveCalls')) {
- /**
- * @param mixed $value , ...
- */
- function onConsecutiveCalls(): ConsecutiveCallsStub
- {
- $arguments = \func_get_args();
-
- return new ConsecutiveCallsStub($arguments);
- }
-}
-
EOT;
\file_put_contents(__DIR__ . '/../../src/Framework/Assert/Functions.php', $buffer);
diff --git a/build/scripts/phar-set-timestamps/composer.json b/build/scripts/phar-set-timestamps/composer.json
new file mode 100644
index 00000000000..4369496d0e6
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/composer.json
@@ -0,0 +1,8 @@
+{
+ "require": {
+ "seld/phar-utils": "^1.2"
+ },
+ "config": {
+ "optimize-autoloader": true
+ }
+}
diff --git a/build/scripts/phar-set-timestamps/composer.lock b/build/scripts/phar-set-timestamps/composer.lock
new file mode 100644
index 00000000000..e3c10072c6e
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/composer.lock
@@ -0,0 +1,67 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "a2828bc624be51258ae32a2f2dbd5696",
+ "packages": [
+ {
+ "name": "seld/phar-utils",
+ "version": "1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Seldaek/phar-utils.git",
+ "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c",
+ "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Seld\\PharUtils\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be"
+ }
+ ],
+ "description": "PHAR file format utilities, for when PHP phars you up",
+ "keywords": [
+ "phar"
+ ],
+ "support": {
+ "issues": "https://github.com/Seldaek/phar-utils/issues",
+ "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1"
+ },
+ "time": "2022-08-31T10:31:18+00:00"
+ }
+ ],
+ "packages-dev": [],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": [],
+ "plugin-api-version": "2.6.0"
+}
diff --git a/build/scripts/phar-set-timestamps/run.php b/build/scripts/phar-set-timestamps/run.php
new file mode 100755
index 00000000000..d845e2b9f3b
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/run.php
@@ -0,0 +1,54 @@
+#!/usr/bin/env php
+&1');
+
+ if (is_string($tag) && strpos($tag, 'fatal') === false) {
+ $tmp = @shell_exec('git log -1 --format=%at ' . trim($tag) . ' 2>&1');
+
+ if (is_string($tag) && is_numeric(trim($tmp))) {
+ $epoch = (int) trim($tmp);
+
+ printf(
+ 'Setting timestamp of files in PHAR to %d (based on when tag %s was created)' . PHP_EOL,
+ $epoch,
+ trim($tag)
+ );
+ }
+
+ unset($tmp);
+ }
+
+ unset($tag);
+}
+
+if (!isset($epoch)) {
+ $epoch = time();
+
+ printf(
+ 'Setting timestamp of files in PHAR to %d (based on current time)' . PHP_EOL,
+ $epoch
+ );
+}
+
+$timestamp = new DateTime;
+$timestamp->setTimestamp($epoch);
+
+$util = new Timestamps($argv[1]);
+$util->updateTimestamps($timestamp);
+$util->save($argv[1], Phar::SHA512);
diff --git a/build/scripts/phar-set-timestamps/vendor/autoload.php b/build/scripts/phar-set-timestamps/vendor/autoload.php
new file mode 100644
index 00000000000..bb1037c7c3b
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/autoload.php
@@ -0,0 +1,25 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ * $loader = new \Composer\Autoload\ClassLoader();
+ *
+ * // register classes with namespaces
+ * $loader->add('Symfony\Component', __DIR__.'/component');
+ * $loader->add('Symfony', __DIR__.'/framework');
+ *
+ * // activate the autoloader
+ * $loader->register();
+ *
+ * // to enable searching the include path (eg. for PEAR packages)
+ * $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier
+ * @author Jordi Boggiano
+ * @see https://www.php-fig.org/psr/psr-0/
+ * @see https://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+ /** @var \Closure(string):void */
+ private static $includeFile;
+
+ /** @var string|null */
+ private $vendorDir;
+
+ // PSR-4
+ /**
+ * @var array>
+ */
+ private $prefixLengthsPsr4 = array();
+ /**
+ * @var array>
+ */
+ private $prefixDirsPsr4 = array();
+ /**
+ * @var list
+ */
+ private $fallbackDirsPsr4 = array();
+
+ // PSR-0
+ /**
+ * List of PSR-0 prefixes
+ *
+ * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
+ *
+ * @var array>>
+ */
+ private $prefixesPsr0 = array();
+ /**
+ * @var list
+ */
+ private $fallbackDirsPsr0 = array();
+
+ /** @var bool */
+ private $useIncludePath = false;
+
+ /**
+ * @var array
+ */
+ private $classMap = array();
+
+ /** @var bool */
+ private $classMapAuthoritative = false;
+
+ /**
+ * @var array
+ */
+ private $missingClasses = array();
+
+ /** @var string|null */
+ private $apcuPrefix;
+
+ /**
+ * @var array
+ */
+ private static $registeredLoaders = array();
+
+ /**
+ * @param string|null $vendorDir
+ */
+ public function __construct($vendorDir = null)
+ {
+ $this->vendorDir = $vendorDir;
+ self::initializeIncludeClosure();
+ }
+
+ /**
+ * @return array>
+ */
+ public function getPrefixes()
+ {
+ if (!empty($this->prefixesPsr0)) {
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
+ }
+
+ return array();
+ }
+
+ /**
+ * @return array>
+ */
+ public function getPrefixesPsr4()
+ {
+ return $this->prefixDirsPsr4;
+ }
+
+ /**
+ * @return list
+ */
+ public function getFallbackDirs()
+ {
+ return $this->fallbackDirsPsr0;
+ }
+
+ /**
+ * @return list
+ */
+ public function getFallbackDirsPsr4()
+ {
+ return $this->fallbackDirsPsr4;
+ }
+
+ /**
+ * @return array Array of classname => path
+ */
+ public function getClassMap()
+ {
+ return $this->classMap;
+ }
+
+ /**
+ * @param array $classMap Class to filename map
+ *
+ * @return void
+ */
+ public function addClassMap(array $classMap)
+ {
+ if ($this->classMap) {
+ $this->classMap = array_merge($this->classMap, $classMap);
+ } else {
+ $this->classMap = $classMap;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix, either
+ * appending or prepending to the ones previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param list|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @return void
+ */
+ public function add($prefix, $paths, $prepend = false)
+ {
+ $paths = (array) $paths;
+ if (!$prefix) {
+ if ($prepend) {
+ $this->fallbackDirsPsr0 = array_merge(
+ $paths,
+ $this->fallbackDirsPsr0
+ );
+ } else {
+ $this->fallbackDirsPsr0 = array_merge(
+ $this->fallbackDirsPsr0,
+ $paths
+ );
+ }
+
+ return;
+ }
+
+ $first = $prefix[0];
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
+ $this->prefixesPsr0[$first][$prefix] = $paths;
+
+ return;
+ }
+ if ($prepend) {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $paths,
+ $this->prefixesPsr0[$first][$prefix]
+ );
+ } else {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $this->prefixesPsr0[$first][$prefix],
+ $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace, either
+ * appending or prepending to the ones previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param list|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function addPsr4($prefix, $paths, $prepend = false)
+ {
+ $paths = (array) $paths;
+ if (!$prefix) {
+ // Register directories for the root namespace.
+ if ($prepend) {
+ $this->fallbackDirsPsr4 = array_merge(
+ $paths,
+ $this->fallbackDirsPsr4
+ );
+ } else {
+ $this->fallbackDirsPsr4 = array_merge(
+ $this->fallbackDirsPsr4,
+ $paths
+ );
+ }
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+ // Register directories for a new namespace.
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = $paths;
+ } elseif ($prepend) {
+ // Prepend directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $paths,
+ $this->prefixDirsPsr4[$prefix]
+ );
+ } else {
+ // Append directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $this->prefixDirsPsr4[$prefix],
+ $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix,
+ * replacing any others previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param list|string $paths The PSR-0 base directories
+ *
+ * @return void
+ */
+ public function set($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr0 = (array) $paths;
+ } else {
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace,
+ * replacing any others previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param list|string $paths The PSR-4 base directories
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function setPsr4($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr4 = (array) $paths;
+ } else {
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Turns on searching the include path for class files.
+ *
+ * @param bool $useIncludePath
+ *
+ * @return void
+ */
+ public function setUseIncludePath($useIncludePath)
+ {
+ $this->useIncludePath = $useIncludePath;
+ }
+
+ /**
+ * Can be used to check if the autoloader uses the include path to check
+ * for classes.
+ *
+ * @return bool
+ */
+ public function getUseIncludePath()
+ {
+ return $this->useIncludePath;
+ }
+
+ /**
+ * Turns off searching the prefix and fallback directories for classes
+ * that have not been registered with the class map.
+ *
+ * @param bool $classMapAuthoritative
+ *
+ * @return void
+ */
+ public function setClassMapAuthoritative($classMapAuthoritative)
+ {
+ $this->classMapAuthoritative = $classMapAuthoritative;
+ }
+
+ /**
+ * Should class lookup fail if not found in the current class map?
+ *
+ * @return bool
+ */
+ public function isClassMapAuthoritative()
+ {
+ return $this->classMapAuthoritative;
+ }
+
+ /**
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+ *
+ * @param string|null $apcuPrefix
+ *
+ * @return void
+ */
+ public function setApcuPrefix($apcuPrefix)
+ {
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+ }
+
+ /**
+ * The APCu prefix in use, or null if APCu caching is not enabled.
+ *
+ * @return string|null
+ */
+ public function getApcuPrefix()
+ {
+ return $this->apcuPrefix;
+ }
+
+ /**
+ * Registers this instance as an autoloader.
+ *
+ * @param bool $prepend Whether to prepend the autoloader or not
+ *
+ * @return void
+ */
+ public function register($prepend = false)
+ {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+
+ if (null === $this->vendorDir) {
+ return;
+ }
+
+ if ($prepend) {
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
+ } else {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ self::$registeredLoaders[$this->vendorDir] = $this;
+ }
+ }
+
+ /**
+ * Unregisters this instance as an autoloader.
+ *
+ * @return void
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+
+ if (null !== $this->vendorDir) {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ }
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $class The name of the class
+ * @return true|null True if loaded, null otherwise
+ */
+ public function loadClass($class)
+ {
+ if ($file = $this->findFile($class)) {
+ $includeFile = self::$includeFile;
+ $includeFile($file);
+
+ return true;
+ }
+
+ return null;
+ }
+
+ /**
+ * Finds the path to the file where the class is defined.
+ *
+ * @param string $class The name of the class
+ *
+ * @return string|false The path if found, false otherwise
+ */
+ public function findFile($class)
+ {
+ // class map lookup
+ if (isset($this->classMap[$class])) {
+ return $this->classMap[$class];
+ }
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+ return false;
+ }
+ if (null !== $this->apcuPrefix) {
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+ if ($hit) {
+ return $file;
+ }
+ }
+
+ $file = $this->findFileWithExtension($class, '.php');
+
+ // Search for Hack files if we are running on HHVM
+ if (false === $file && defined('HHVM_VERSION')) {
+ $file = $this->findFileWithExtension($class, '.hh');
+ }
+
+ if (null !== $this->apcuPrefix) {
+ apcu_add($this->apcuPrefix.$class, $file);
+ }
+
+ if (false === $file) {
+ // Remember that this class does not exist.
+ $this->missingClasses[$class] = true;
+ }
+
+ return $file;
+ }
+
+ /**
+ * Returns the currently registered loaders keyed by their corresponding vendor directories.
+ *
+ * @return array
+ */
+ public static function getRegisteredLoaders()
+ {
+ return self::$registeredLoaders;
+ }
+
+ /**
+ * @param string $class
+ * @param string $ext
+ * @return string|false
+ */
+ private function findFileWithExtension($class, $ext)
+ {
+ // PSR-4 lookup
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+ $first = $class[0];
+ if (isset($this->prefixLengthsPsr4[$first])) {
+ $subPath = $class;
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
+ $subPath = substr($subPath, 0, $lastPos);
+ $search = $subPath . '\\';
+ if (isset($this->prefixDirsPsr4[$search])) {
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
+ if (file_exists($file = $dir . $pathEnd)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-4 fallback dirs
+ foreach ($this->fallbackDirsPsr4 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 lookup
+ if (false !== $pos = strrpos($class, '\\')) {
+ // namespaced class name
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+ } else {
+ // PEAR-like class name
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+ }
+
+ if (isset($this->prefixesPsr0[$first])) {
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+ if (0 === strpos($class, $prefix)) {
+ foreach ($dirs as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-0 fallback dirs
+ foreach ($this->fallbackDirsPsr0 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 include paths.
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+ return $file;
+ }
+
+ return false;
+ }
+
+ /**
+ * @return void
+ */
+ private static function initializeIncludeClosure()
+ {
+ if (self::$includeFile !== null) {
+ return;
+ }
+
+ /**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ */
+ self::$includeFile = \Closure::bind(static function($file) {
+ include $file;
+ }, null, null);
+ }
+}
diff --git a/build/scripts/phar-set-timestamps/vendor/composer/InstalledVersions.php b/build/scripts/phar-set-timestamps/vendor/composer/InstalledVersions.php
new file mode 100644
index 00000000000..51e734a774b
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/composer/InstalledVersions.php
@@ -0,0 +1,359 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+
+/**
+ * This class is copied in every Composer installed project and available to all
+ *
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
+ *
+ * To require its presence, you can require `composer-runtime-api ^2.0`
+ *
+ * @final
+ */
+class InstalledVersions
+{
+ /**
+ * @var mixed[]|null
+ * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null
+ */
+ private static $installed;
+
+ /**
+ * @var bool|null
+ */
+ private static $canGetVendors;
+
+ /**
+ * @var array[]
+ * @psalm-var array}>
+ */
+ private static $installedByVendor = array();
+
+ /**
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
+ *
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackages()
+ {
+ $packages = array();
+ foreach (self::getInstalled() as $installed) {
+ $packages[] = array_keys($installed['versions']);
+ }
+
+ if (1 === \count($packages)) {
+ return $packages[0];
+ }
+
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+ }
+
+ /**
+ * Returns a list of all package names with a specific type e.g. 'library'
+ *
+ * @param string $type
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackagesByType($type)
+ {
+ $packagesByType = array();
+
+ foreach (self::getInstalled() as $installed) {
+ foreach ($installed['versions'] as $name => $package) {
+ if (isset($package['type']) && $package['type'] === $type) {
+ $packagesByType[] = $name;
+ }
+ }
+ }
+
+ return $packagesByType;
+ }
+
+ /**
+ * Checks whether the given package is installed
+ *
+ * This also returns true if the package name is provided or replaced by another package
+ *
+ * @param string $packageName
+ * @param bool $includeDevRequirements
+ * @return bool
+ */
+ public static function isInstalled($packageName, $includeDevRequirements = true)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (isset($installed['versions'][$packageName])) {
+ return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks whether the given package satisfies a version constraint
+ *
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
+ *
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
+ *
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
+ * @param string $packageName
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
+ * @return bool
+ */
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
+ {
+ $constraint = $parser->parseConstraints((string) $constraint);
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+ return $provided->matches($constraint);
+ }
+
+ /**
+ * Returns a version constraint representing all the range(s) which are installed for a given package
+ *
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
+ * whether a given version of a package is installed, and not just whether it exists
+ *
+ * @param string $packageName
+ * @return string Version constraint usable with composer/semver
+ */
+ public static function getVersionRanges($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ $ranges = array();
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
+ }
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+ }
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+ }
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+ }
+
+ return implode(' || ', $ranges);
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getPrettyVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['pretty_version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
+ */
+ public static function getReference($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['reference'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['reference'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
+ */
+ public static function getInstallPath($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @return array
+ * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
+ */
+ public static function getRootPackage()
+ {
+ $installed = self::getInstalled();
+
+ return $installed[0]['root'];
+ }
+
+ /**
+ * Returns the raw installed.php data for custom implementations
+ *
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
+ * @return array[]
+ * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}
+ */
+ public static function getRawData()
+ {
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ self::$installed = include __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ return self::$installed;
+ }
+
+ /**
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
+ *
+ * @return array[]
+ * @psalm-return list}>
+ */
+ public static function getAllRawData()
+ {
+ return self::getInstalled();
+ }
+
+ /**
+ * Lets you reload the static array from another file
+ *
+ * This is only useful for complex integrations in which a project needs to use
+ * this class but then also needs to execute another project's autoloader in process,
+ * and wants to ensure both projects have access to their version of installed.php.
+ *
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
+ * the data it needs from this class, then call reload() with
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
+ * the project in which it runs can then also use this class safely, without
+ * interference between PHPUnit's dependencies and the project's dependencies.
+ *
+ * @param array[] $data A vendor/composer/installed.php data set
+ * @return void
+ *
+ * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data
+ */
+ public static function reload($data)
+ {
+ self::$installed = $data;
+ self::$installedByVendor = array();
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return list}>
+ */
+ private static function getInstalled()
+ {
+ if (null === self::$canGetVendors) {
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+ }
+
+ $installed = array();
+
+ if (self::$canGetVendors) {
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+ if (isset(self::$installedByVendor[$vendorDir])) {
+ $installed[] = self::$installedByVendor[$vendorDir];
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
+ $required = require $vendorDir.'/composer/installed.php';
+ $installed[] = self::$installedByVendor[$vendorDir] = $required;
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
+ self::$installed = $installed[count($installed) - 1];
+ }
+ }
+ }
+ }
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
+ $required = require __DIR__ . '/installed.php';
+ self::$installed = $required;
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ if (self::$installed !== array()) {
+ $installed[] = self::$installed;
+ }
+
+ return $installed;
+ }
+}
diff --git a/build/scripts/phar-set-timestamps/vendor/composer/LICENSE b/build/scripts/phar-set-timestamps/vendor/composer/LICENSE
new file mode 100644
index 00000000000..f27399a042d
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/composer/LICENSE
@@ -0,0 +1,21 @@
+
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/build/scripts/phar-set-timestamps/vendor/composer/autoload_classmap.php b/build/scripts/phar-set-timestamps/vendor/composer/autoload_classmap.php
new file mode 100644
index 00000000000..e6a22096ae5
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/composer/autoload_classmap.php
@@ -0,0 +1,12 @@
+ $vendorDir . '/composer/InstalledVersions.php',
+ 'Seld\\PharUtils\\Linter' => $vendorDir . '/seld/phar-utils/src/Linter.php',
+ 'Seld\\PharUtils\\Timestamps' => $vendorDir . '/seld/phar-utils/src/Timestamps.php',
+);
diff --git a/build/scripts/phar-set-timestamps/vendor/composer/autoload_namespaces.php b/build/scripts/phar-set-timestamps/vendor/composer/autoload_namespaces.php
new file mode 100644
index 00000000000..15a2ff3ad6d
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/composer/autoload_namespaces.php
@@ -0,0 +1,9 @@
+ array($vendorDir . '/seld/phar-utils/src'),
+);
diff --git a/build/scripts/phar-set-timestamps/vendor/composer/autoload_real.php b/build/scripts/phar-set-timestamps/vendor/composer/autoload_real.php
new file mode 100644
index 00000000000..69cfbf7e33c
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/composer/autoload_real.php
@@ -0,0 +1,38 @@
+register(true);
+
+ return $loader;
+ }
+}
diff --git a/build/scripts/phar-set-timestamps/vendor/composer/autoload_static.php b/build/scripts/phar-set-timestamps/vendor/composer/autoload_static.php
new file mode 100644
index 00000000000..201af17c152
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/composer/autoload_static.php
@@ -0,0 +1,38 @@
+
+ array (
+ 'Seld\\PharUtils\\' => 15,
+ ),
+ );
+
+ public static $prefixDirsPsr4 = array (
+ 'Seld\\PharUtils\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/seld/phar-utils/src',
+ ),
+ );
+
+ public static $classMap = array (
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+ 'Seld\\PharUtils\\Linter' => __DIR__ . '/..' . '/seld/phar-utils/src/Linter.php',
+ 'Seld\\PharUtils\\Timestamps' => __DIR__ . '/..' . '/seld/phar-utils/src/Timestamps.php',
+ );
+
+ public static function getInitializer(ClassLoader $loader)
+ {
+ return \Closure::bind(function () use ($loader) {
+ $loader->prefixLengthsPsr4 = ComposerStaticInit386a05f6676643b8b2eb49288e20d079::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInit386a05f6676643b8b2eb49288e20d079::$prefixDirsPsr4;
+ $loader->classMap = ComposerStaticInit386a05f6676643b8b2eb49288e20d079::$classMap;
+
+ }, null, ClassLoader::class);
+ }
+}
diff --git a/build/scripts/phar-set-timestamps/vendor/composer/installed.json b/build/scripts/phar-set-timestamps/vendor/composer/installed.json
new file mode 100644
index 00000000000..44d066d18b1
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/composer/installed.json
@@ -0,0 +1,57 @@
+{
+ "packages": [
+ {
+ "name": "seld/phar-utils",
+ "version": "1.2.1",
+ "version_normalized": "1.2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Seldaek/phar-utils.git",
+ "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c",
+ "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "time": "2022-08-31T10:31:18+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Seld\\PharUtils\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be"
+ }
+ ],
+ "description": "PHAR file format utilities, for when PHP phars you up",
+ "keywords": [
+ "phar"
+ ],
+ "support": {
+ "issues": "https://github.com/Seldaek/phar-utils/issues",
+ "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1"
+ },
+ "install-path": "../seld/phar-utils"
+ }
+ ],
+ "dev": true,
+ "dev-package-names": []
+}
diff --git a/build/scripts/phar-set-timestamps/vendor/composer/installed.php b/build/scripts/phar-set-timestamps/vendor/composer/installed.php
new file mode 100644
index 00000000000..6f559f8743b
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/composer/installed.php
@@ -0,0 +1,32 @@
+ array(
+ 'name' => '__root__',
+ 'pretty_version' => '8.5.x-dev',
+ 'version' => '8.5.9999999.9999999-dev',
+ 'reference' => 'aca96fcd8b6799ead1066524b2b91c5184ece78f',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'dev' => true,
+ ),
+ 'versions' => array(
+ '__root__' => array(
+ 'pretty_version' => '8.5.x-dev',
+ 'version' => '8.5.9999999.9999999-dev',
+ 'reference' => 'aca96fcd8b6799ead1066524b2b91c5184ece78f',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'seld/phar-utils' => array(
+ 'pretty_version' => '1.2.1',
+ 'version' => '1.2.1.0',
+ 'reference' => 'ea2f4014f163c1be4c601b9b7bd6af81ba8d701c',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../seld/phar-utils',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ ),
+);
diff --git a/build/scripts/phar-set-timestamps/vendor/composer/platform_check.php b/build/scripts/phar-set-timestamps/vendor/composer/platform_check.php
new file mode 100644
index 00000000000..7621d4ff97f
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/composer/platform_check.php
@@ -0,0 +1,26 @@
+= 50300)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 5.3.0". You are running ' . PHP_VERSION . '.';
+}
+
+if ($issues) {
+ if (!headers_sent()) {
+ header('HTTP/1.1 500 Internal Server Error');
+ }
+ if (!ini_get('display_errors')) {
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
+ } elseif (!headers_sent()) {
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+ }
+ }
+ trigger_error(
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
+ E_USER_ERROR
+ );
+}
diff --git a/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/.gitignore b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/.gitignore
new file mode 100644
index 00000000000..42cd73d9573
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/.gitignore
@@ -0,0 +1 @@
+/vendor/
\ No newline at end of file
diff --git a/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/LICENSE b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/LICENSE
new file mode 100644
index 00000000000..c1b62a35fa3
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2015 Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/README.md b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/README.md
new file mode 100644
index 00000000000..27edf743276
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/README.md
@@ -0,0 +1,45 @@
+PHAR Utils
+==========
+
+PHAR file format utilities, for when PHP phars you up.
+
+Installation
+------------
+
+`composer require seld/phar-utils`
+
+API
+---
+
+### `Seld\PharUtils\Timestamps`
+
+- `__construct($pharFile)`
+
+ > Load a phar file in memory.
+
+- `updateTimestamps($timestamp = null)`
+
+ > Updates each file's unix timestamps in the PHAR so the PHAR signature
+ > can be produced in a reproducible manner.
+
+- `save($path, $signatureAlgo = '')`
+
+ > Saves the updated phar file with an updated signature.
+ > Algo must be one of `Phar::MD5`, `Phar::SHA1`, `Phar::SHA256`
+ > or `Phar::SHA512`
+
+### `Seld\PharUtils\Linter`
+
+- `Linter::lint($pharFile)`
+
+ > Lints all php files inside a given phar with the current PHP version.
+
+Requirements
+------------
+
+PHP 5.3 and above
+
+License
+-------
+
+PHAR Utils is licensed under the MIT License - see the LICENSE file for details
diff --git a/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/composer.json b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/composer.json
new file mode 100644
index 00000000000..8b1f7f2b68a
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/composer.json
@@ -0,0 +1,26 @@
+{
+ "name": "seld/phar-utils",
+ "description": "PHAR file format utilities, for when PHP phars you up",
+ "type": "library",
+ "keywords": ["phar"],
+ "license": "MIT",
+ "require": {
+ "php": ">=5.3"
+ },
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be"
+ }
+ ],
+ "autoload": {
+ "psr-4": {
+ "Seld\\PharUtils\\": "src/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ }
+}
diff --git a/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/composer.lock b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/composer.lock
new file mode 100644
index 00000000000..21e33c7a217
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/composer.lock
@@ -0,0 +1,19 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
+ ],
+ "hash": "e5afe72073d9266712c8e1ddc1648513",
+ "packages": [],
+ "packages-dev": [],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": ">=5.3"
+ },
+ "platform-dev": []
+}
diff --git a/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/src/Linter.php b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/src/Linter.php
new file mode 100644
index 00000000000..935d04e8411
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/src/Linter.php
@@ -0,0 +1,115 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Seld\PharUtils;
+
+class Linter
+{
+ /**
+ * Lints all php files inside a given phar with the current PHP version
+ *
+ * @param string $path Phar file path
+ * @param list $excludedPaths Paths which should be skipped by the linter
+ */
+ public static function lint($path, array $excludedPaths = array())
+ {
+ $php = defined('PHP_BINARY') ? PHP_BINARY : 'php';
+
+ if ($isWindows = defined('PHP_WINDOWS_VERSION_BUILD')) {
+ $tmpFile = @tempnam(sys_get_temp_dir(), '');
+
+ if (!$tmpFile || !is_writable($tmpFile)) {
+ throw new \RuntimeException('Unable to create temp file');
+ }
+
+ $php = self::escapeWindowsPath($php);
+ $tmpFile = self::escapeWindowsPath($tmpFile);
+
+ // PHP 8 encloses the command in double-quotes
+ if (PHP_VERSION_ID >= 80000) {
+ $format = '%s -l %s';
+ } else {
+ $format = '"%s -l %s"';
+ }
+
+ $command = sprintf($format, $php, $tmpFile);
+ } else {
+ $command = "'".$php."' -l";
+ }
+
+ $descriptorspec = array(
+ 0 => array('pipe', 'r'),
+ 1 => array('pipe', 'w'),
+ 2 => array('pipe', 'w')
+ );
+
+ // path to phar + phar:// + trailing slash
+ $baseLen = strlen(realpath($path)) + 7 + 1;
+ foreach (new \RecursiveIteratorIterator(new \Phar($path)) as $file) {
+ if ($file->isDir()) {
+ continue;
+ }
+ if (substr($file, -4) === '.php') {
+ $filename = (string) $file;
+ if (in_array(substr($filename, $baseLen), $excludedPaths, true)) {
+ continue;
+ }
+ if ($isWindows) {
+ file_put_contents($tmpFile, file_get_contents($filename));
+ }
+
+ $process = proc_open($command, $descriptorspec, $pipes);
+ if (is_resource($process)) {
+ if (!$isWindows) {
+ fwrite($pipes[0], file_get_contents($filename));
+ }
+ fclose($pipes[0]);
+
+ $stdout = stream_get_contents($pipes[1]);
+ fclose($pipes[1]);
+ $stderr = stream_get_contents($pipes[2]);
+ fclose($pipes[2]);
+
+ $exitCode = proc_close($process);
+
+ if ($exitCode !== 0) {
+ if ($isWindows) {
+ $stderr = str_replace($tmpFile, $filename, $stderr);
+ }
+ throw new \UnexpectedValueException('Failed linting '.$file.': '.$stderr);
+ }
+ } else {
+ throw new \RuntimeException('Could not start linter process');
+ }
+ }
+ }
+
+ if ($isWindows) {
+ @unlink($tmpFile);
+ }
+ }
+
+ /**
+ * Escapes a Windows file path
+ *
+ * @param string $path
+ * @return string The escaped path
+ */
+ private static function escapeWindowsPath($path)
+ {
+ // Quote if path contains spaces or brackets
+ if (strpbrk($path, " ()") !== false) {
+ $path = '"'.$path.'"';
+ }
+
+ return $path;
+ }
+}
diff --git a/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/src/Timestamps.php b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/src/Timestamps.php
new file mode 100644
index 00000000000..8077d5b851d
--- /dev/null
+++ b/build/scripts/phar-set-timestamps/vendor/seld/phar-utils/src/Timestamps.php
@@ -0,0 +1,196 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Seld\PharUtils;
+
+class Timestamps
+{
+ private $contents;
+
+ /**
+ * @param string $file path to the phar file to use
+ */
+ public function __construct($file)
+ {
+ $this->contents = file_get_contents($file);
+ }
+
+ /**
+ * Updates each file's unix timestamps in the PHAR
+ *
+ * The PHAR signature can then be produced in a reproducible manner.
+ *
+ * @param int|\DateTimeInterface|string $timestamp Date string or DateTime or unix timestamp to use
+ */
+ public function updateTimestamps($timestamp = null)
+ {
+ if ($timestamp instanceof \DateTime || $timestamp instanceof \DateTimeInterface) {
+ $timestamp = $timestamp->getTimestamp();
+ } elseif (is_string($timestamp)) {
+ $timestamp = strtotime($timestamp);
+ } elseif (!is_int($timestamp)) {
+ $timestamp = strtotime('1984-12-24T00:00:00Z');
+ }
+
+ // detect manifest offset / end of stub
+ if (!preg_match('{__HALT_COMPILER\(\);(?: +\?>)?\r?\n}', $this->contents, $match, PREG_OFFSET_CAPTURE)) {
+ throw new \RuntimeException('Could not detect the stub\'s end in the phar');
+ }
+
+ // set starting position and skip past manifest length
+ $pos = $match[0][1] + strlen($match[0][0]);
+ $stubEnd = $pos + $this->readUint($pos, 4);
+ $pos += 4;
+
+ $numFiles = $this->readUint($pos, 4);
+ $pos += 4;
+
+ // skip API version (YOLO)
+ $pos += 2;
+
+ // skip PHAR flags
+ $pos += 4;
+
+ $aliasLength = $this->readUint($pos, 4);
+ $pos += 4 + $aliasLength;
+
+ $metadataLength = $this->readUint($pos, 4);
+ $pos += 4 + $metadataLength;
+
+ while ($pos < $stubEnd) {
+ $filenameLength = $this->readUint($pos, 4);
+ $pos += 4 + $filenameLength;
+
+ // skip filesize
+ $pos += 4;
+
+ // update timestamp to a fixed value
+ $timeStampBytes = pack('L', $timestamp);
+ $this->contents[$pos + 0] = $timeStampBytes[0];
+ $this->contents[$pos + 1] = $timeStampBytes[1];
+ $this->contents[$pos + 2] = $timeStampBytes[2];
+ $this->contents[$pos + 3] = $timeStampBytes[3];
+
+ // skip timestamp, compressed file size, crc32 checksum and file flags
+ $pos += 4*4;
+
+ $metadataLength = $this->readUint($pos, 4);
+ $pos += 4 + $metadataLength;
+
+ $numFiles--;
+ }
+
+ if ($numFiles !== 0) {
+ throw new \LogicException('All files were not processed, something must have gone wrong');
+ }
+ }
+
+ /**
+ * Saves the updated phar file, optionally with an updated signature.
+ *
+ * @param string $path
+ * @param int $signatureAlgo One of Phar::MD5, Phar::SHA1, Phar::SHA256 or Phar::SHA512
+ * @return bool
+ */
+ public function save($path, $signatureAlgo)
+ {
+ $pos = $this->determineSignatureBegin();
+
+ $algos = array(
+ \Phar::MD5 => 'md5',
+ \Phar::SHA1 => 'sha1',
+ \Phar::SHA256 => 'sha256',
+ \Phar::SHA512 => 'sha512',
+ );
+
+ if (!isset($algos[$signatureAlgo])) {
+ throw new \UnexpectedValueException('Invalid hash algorithm given: '.$signatureAlgo.' expected one of Phar::MD5, Phar::SHA1, Phar::SHA256 or Phar::SHA512');
+ }
+ $algo = $algos[$signatureAlgo];
+
+ // re-sign phar
+ // signature
+ $signature = hash($algo, substr($this->contents, 0, $pos), true)
+ // sig type
+ . pack('L', $signatureAlgo)
+ // ohai Greg & Marcus
+ . 'GBMB';
+
+ $this->contents = substr($this->contents, 0, $pos) . $signature;
+
+ return file_put_contents($path, $this->contents);
+ }
+
+ private function readUint($pos, $bytes)
+ {
+ $res = unpack('V', substr($this->contents, $pos, $bytes));
+
+ return $res[1];
+ }
+
+ /**
+ * Determine the beginning of the signature.
+ *
+ * @return int
+ */
+ private function determineSignatureBegin()
+ {
+ // detect signature position
+ if (!preg_match('{__HALT_COMPILER\(\);(?: +\?>)?\r?\n}', $this->contents, $match, PREG_OFFSET_CAPTURE)) {
+ throw new \RuntimeException('Could not detect the stub\'s end in the phar');
+ }
+
+ // set starting position and skip past manifest length
+ $pos = $match[0][1] + strlen($match[0][0]);
+ $manifestEnd = $pos + 4 + $this->readUint($pos, 4);
+
+ $pos += 4;
+ $numFiles = $this->readUint($pos, 4);
+
+ $pos += 4;
+
+ // skip API version (YOLO)
+ $pos += 2;
+
+ // skip PHAR flags
+ $pos += 4;
+
+ $aliasLength = $this->readUint($pos, 4);
+ $pos += 4 + $aliasLength;
+
+ $metadataLength = $this->readUint($pos, 4);
+ $pos += 4 + $metadataLength;
+
+ $compressedSizes = 0;
+ while (($numFiles > 0) && ($pos < $manifestEnd - 24)) {
+ $filenameLength = $this->readUint($pos, 4);
+ $pos += 4 + $filenameLength;
+
+ // skip filesize and timestamp
+ $pos += 2*4;
+
+ $compressedSizes += $this->readUint($pos, 4);
+ // skip compressed file size, crc32 checksum and file flags
+ $pos += 3*4;
+
+ $metadataLength = $this->readUint($pos, 4);
+ $pos += 4 + $metadataLength;
+
+ $numFiles--;
+ }
+
+ if ($numFiles !== 0) {
+ throw new \LogicException('All files were not processed, something must have gone wrong');
+ }
+
+ return $manifestEnd + $compressedSizes;
+ }
+}
diff --git a/build/scripts/phar-version.php b/build/scripts/phar-version.php
index 1a91016553e..948c3b21b09 100755
--- a/build/scripts/phar-version.php
+++ b/build/scripts/phar-version.php
@@ -8,8 +8,8 @@
\file_put_contents(
__DIR__ . '/../tmp/phar/phpunit/Runner/Version.php',
\str_replace(
- 'private static $pharVersion = \'\';',
- 'private static $pharVersion = \'' . $argv[1] . '\';',
+ 'private static string $pharVersion = \'\';',
+ 'private static string $pharVersion = \'' . $argv[1] . '\';',
\file_get_contents(__DIR__ . '/../tmp/phar/phpunit/Runner/Version.php')
),
\LOCK_EX
diff --git a/build/templates/binary-phar-autoload.php.in b/build/templates/binary-phar-autoload.php.in
index 4dfcbb20b5d..ce8b60ed8d9 100644
--- a/build/templates/binary-phar-autoload.php.in
+++ b/build/templates/binary-phar-autoload.php.in
@@ -15,12 +15,12 @@ if (!version_compare(PHP_VERSION, PHP_VERSION, '=')) {
die(1);
}
-if (version_compare('8.2.0', PHP_VERSION, '>')) {
+if (version_compare('8.3.0', PHP_VERSION, '>')) {
fwrite(
STDERR,
sprintf(
'PHPUnit X.Y.Z by Sebastian Bergmann and contributors.' . PHP_EOL . PHP_EOL .
- 'This version of PHPUnit requires PHP >= 8.2.' . PHP_EOL .
+ 'This version of PHPUnit requires PHP >= 8.3.' . PHP_EOL .
'You are using PHP %s (%s).' . PHP_EOL,
PHP_VERSION,
PHP_BINARY
@@ -30,7 +30,7 @@ if (version_compare('8.2.0', PHP_VERSION, '>')) {
die(1);
}
-$requiredExtensions = ['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'];
+$requiredExtensions = ['ctype', 'dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'];
$unavailableExtensions = array_filter(
$requiredExtensions,
@@ -61,9 +61,11 @@ if (__FILE__ === realpath($_SERVER['SCRIPT_NAME'])) {
$execute = false;
}
-$options = getopt('', array('manifest', 'sbom'));
+$options = getopt('', array('composer-lock', 'manifest', 'sbom'));
-if (isset($options['manifest'])) {
+if (isset($options['composer-lock'])) {
+ $printComposerLock = true;
+} elseif (isset($options['manifest'])) {
$printManifest = true;
} elseif (isset($options['sbom'])) {
$printSbom = true;
@@ -99,6 +101,12 @@ foreach ([___CLASSLIST___] as $file) {
require __PHPUNIT_PHAR_ROOT__ . '/phpunit/Framework/Assert/Functions.php';
if ($execute) {
+ if (isset($printComposerLock)) {
+ print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/composer.lock');
+
+ exit;
+ }
+
if (isset($printManifest)) {
print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt');
diff --git a/build/test-extension/manifest.xml b/build/test-extension/manifest.xml
index c9f4caf1c03..d3c05ba2d2d 100644
--- a/build/test-extension/manifest.xml
+++ b/build/test-extension/manifest.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/composer.json b/composer.json
index 5cb0b9ba550..a4eba5d77ea 100644
--- a/composer.json
+++ b/composer.json
@@ -22,43 +22,40 @@
},
"prefer-stable": true,
"require": {
- "php": ">=8.2",
+ "php": ">=8.3",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"ext-xmlwriter": "*",
- "myclabs/deep-copy": "^1.10.1",
- "phar-io/manifest": "^2.0.3",
- "phar-io/version": "^3.0.2",
- "phpunit/php-code-coverage": "^10.1.5",
- "phpunit/php-file-iterator": "^4.0",
- "phpunit/php-invoker": "^4.0",
- "phpunit/php-text-template": "^3.0",
- "phpunit/php-timer": "^6.0",
- "sebastian/cli-parser": "^2.0",
- "sebastian/code-unit": "^2.0",
- "sebastian/comparator": "^5.0",
- "sebastian/diff": "^5.0",
- "sebastian/environment": "^6.0",
- "sebastian/exporter": "^5.1",
- "sebastian/global-state": "^6.0.1",
- "sebastian/object-enumerator": "^5.0",
- "sebastian/recursion-context": "^5.0",
- "sebastian/type": "^4.0",
- "sebastian/version": "^4.0"
+ "myclabs/deep-copy": "^1.13.1",
+ "phar-io/manifest": "^2.0.4",
+ "phar-io/version": "^3.2.1",
+ "phpunit/php-code-coverage": "^12.2.1",
+ "phpunit/php-file-iterator": "^6.0.0",
+ "phpunit/php-invoker": "^6.0.0",
+ "phpunit/php-text-template": "^5.0.0",
+ "phpunit/php-timer": "^8.0.0",
+ "sebastian/cli-parser": "^4.0.0",
+ "sebastian/comparator": "^7.0.1",
+ "sebastian/diff": "^7.0.0",
+ "sebastian/environment": "^8.0.0",
+ "sebastian/exporter": "^7.0.0",
+ "sebastian/global-state": "^8.0.0",
+ "sebastian/object-enumerator": "^7.0.0",
+ "sebastian/type": "^6.0.2",
+ "sebastian/version": "^6.0.0",
+ "staabm/side-effects-detector": "^1.0.5"
},
"config": {
"platform": {
- "php": "8.2.0"
+ "php": "8.3.0"
},
+ "classmap-authoritative": true,
"optimize-autoloader": true,
"sort-packages": true
},
- "suggest": {
- "ext-soap": "To be able to generate mocks based on WSDL files"
- },
"bin": [
"phpunit"
],
@@ -72,10 +69,41 @@
},
"autoload-dev": {
"classmap": [
- "tests/"
+ "tests/_files"
],
"files": [
- "tests/_files/CoverageNamespacedFunctionTest.php",
+ "tests/_files/deprecation-trigger/trigger_deprecation.php",
+ "tests/unit/Event/AbstractEventTestCase.php",
+ "tests/unit/TextUI/AbstractSouceFilterTestCase.php",
+ "tests/unit/Framework/MockObject/TestDoubleTestCase.php",
+ "tests/unit/Metadata/Parser/AttributeParserTestCase.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyArrayTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyBoolTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyCallableTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyFloatTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyInstancesOfTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyIntTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyIterableTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyNullTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyNumericTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyObjectTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyResourceTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyClosedResourceTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyScalarTest.php",
+ "tests/unit/Framework/Assert/assertContainsOnlyStringTest.php",
+ "tests/unit/Framework/Assert/assertDirectoryExistsTest.php",
+ "tests/unit/Framework/Assert/assertFileExistsTest.php",
+ "tests/unit/Framework/Assert/assertIsNumericTest.php",
+ "tests/unit/Framework/Assert/assertIsObjectTest.php",
+ "tests/unit/Framework/Assert/assertIsReadableTest.php",
+ "tests/unit/Framework/Assert/assertIsResourceTest.php",
+ "tests/unit/Framework/Assert/assertIsScalarTest.php",
+ "tests/unit/Framework/Assert/assertIsStringTest.php",
+ "tests/unit/Framework/Assert/assertIsWritableTest.php",
+ "tests/unit/Framework/Assert/assertMatchesRegularExpressionTest.php",
+ "tests/unit/Framework/Assert/assertNullTest.php",
+ "tests/unit/Framework/Assert/assertSameSizeTest.php",
+ "tests/unit/Framework/Assert/assertSameTest.php",
"tests/_files/CoveredFunction.php",
"tests/_files/Generator.php",
"tests/_files/NamespaceCoveredFunction.php"
@@ -83,7 +111,7 @@
},
"extra": {
"branch-alias": {
- "dev-main": "11.0-dev"
+ "dev-main": "12.2-dev"
}
}
}
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 00000000000..ee481207f35
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,1515 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "08406d092d8297e7c8fa686a024113e4",
+ "packages": [
+ {
+ "name": "myclabs/deep-copy",
+ "version": "1.13.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/myclabs/DeepCopy.git",
+ "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c",
+ "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "conflict": {
+ "doctrine/collections": "<1.6.8",
+ "doctrine/common": "<2.13.3 || >=3 <3.2.2"
+ },
+ "require-dev": {
+ "doctrine/collections": "^1.6.8",
+ "doctrine/common": "^2.13.3 || ^3.2.2",
+ "phpspec/prophecy": "^1.10",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/DeepCopy/deep_copy.php"
+ ],
+ "psr-4": {
+ "DeepCopy\\": "src/DeepCopy/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Create deep copies (clones) of your objects",
+ "keywords": [
+ "clone",
+ "copy",
+ "duplicate",
+ "object",
+ "object graph"
+ ],
+ "support": {
+ "issues": "https://github.com/myclabs/DeepCopy/issues",
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1"
+ },
+ "funding": [
+ {
+ "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2025-04-29T12:36:36+00:00"
+ },
+ {
+ "name": "nikic/php-parser",
+ "version": "v5.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nikic/PHP-Parser.git",
+ "reference": "447a020a1f875a434d62f2a401f53b82a396e494"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494",
+ "reference": "447a020a1f875a434d62f2a401f53b82a396e494",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-json": "*",
+ "ext-tokenizer": "*",
+ "php": ">=7.4"
+ },
+ "require-dev": {
+ "ircmaxell/php-yacc": "^0.0.7",
+ "phpunit/phpunit": "^9.0"
+ },
+ "bin": [
+ "bin/php-parse"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpParser\\": "lib/PhpParser"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Nikita Popov"
+ }
+ ],
+ "description": "A PHP parser written in PHP",
+ "keywords": [
+ "parser",
+ "php"
+ ],
+ "support": {
+ "issues": "https://github.com/nikic/PHP-Parser/issues",
+ "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0"
+ },
+ "time": "2024-12-30T11:07:19+00:00"
+ },
+ {
+ "name": "phar-io/manifest",
+ "version": "2.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phar-io/manifest.git",
+ "reference": "54750ef60c58e43759730615a392c31c80e23176"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176",
+ "reference": "54750ef60c58e43759730615a392c31c80e23176",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-phar": "*",
+ "ext-xmlwriter": "*",
+ "phar-io/version": "^3.0.1",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
+ "support": {
+ "issues": "https://github.com/phar-io/manifest/issues",
+ "source": "https://github.com/phar-io/manifest/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-03T12:33:53+00:00"
+ },
+ {
+ "name": "phar-io/version",
+ "version": "3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phar-io/version.git",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "Library for handling version information and constraints",
+ "support": {
+ "issues": "https://github.com/phar-io/version/issues",
+ "source": "https://github.com/phar-io/version/tree/3.2.1"
+ },
+ "time": "2022-02-21T01:04:05+00:00"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "12.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "448f2c504d86dbff3949dcd02c95aa85db2c7617"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/448f2c504d86dbff3949dcd02c95aa85db2c7617",
+ "reference": "448f2c504d86dbff3949dcd02c95aa85db2c7617",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-xmlwriter": "*",
+ "nikic/php-parser": "^5.4.0",
+ "php": ">=8.3",
+ "phpunit/php-file-iterator": "^6.0",
+ "phpunit/php-text-template": "^5.0",
+ "sebastian/complexity": "^5.0",
+ "sebastian/environment": "^8.0",
+ "sebastian/lines-of-code": "^4.0",
+ "sebastian/version": "^6.0",
+ "theseer/tokenizer": "^1.2.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.1"
+ },
+ "suggest": {
+ "ext-pcov": "PHP extension that provides line coverage",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "12.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
+ "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.2.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ },
+ {
+ "url": "https://liberapay.com/sebastianbergmann",
+ "type": "liberapay"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/sebastianbergmann",
+ "type": "thanks_dev"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2025-05-04T05:25:05+00:00"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "6.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "961bc913d42fe24a257bfff826a5068079ac7782"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/961bc913d42fe24a257bfff826a5068079ac7782",
+ "reference": "961bc913d42fe24a257bfff826a5068079ac7782",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "6.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
+ "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:58:37+00:00"
+ },
+ {
+ "name": "phpunit/php-invoker",
+ "version": "6.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-invoker.git",
+ "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406",
+ "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "ext-pcntl": "*",
+ "phpunit/phpunit": "^12.0"
+ },
+ "suggest": {
+ "ext-pcntl": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "6.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Invoke callables with a timeout",
+ "homepage": "https://github.com/sebastianbergmann/php-invoker/",
+ "keywords": [
+ "process"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
+ "security": "https://github.com/sebastianbergmann/php-invoker/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-invoker/tree/6.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:58:58+00:00"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53",
+ "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
+ "security": "https://github.com/sebastianbergmann/php-text-template/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:59:16+00:00"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "8.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc",
+ "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "8.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-timer/issues",
+ "security": "https://github.com/sebastianbergmann/php-timer/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-timer/tree/8.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:59:38+00:00"
+ },
+ {
+ "name": "sebastian/cli-parser",
+ "version": "4.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/cli-parser.git",
+ "reference": "6d584c727d9114bcdc14c86711cd1cad51778e7c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/6d584c727d9114bcdc14c86711cd1cad51778e7c",
+ "reference": "6d584c727d9114bcdc14c86711cd1cad51778e7c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for parsing CLI options",
+ "homepage": "https://github.com/sebastianbergmann/cli-parser",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
+ "security": "https://github.com/sebastianbergmann/cli-parser/security/policy",
+ "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:53:50+00:00"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "7.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "b478f34614f934e0291598d0c08cbaba9644bee5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/b478f34614f934e0291598d0c08cbaba9644bee5",
+ "reference": "b478f34614f934e0291598d0c08cbaba9644bee5",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-mbstring": "*",
+ "php": ">=8.3",
+ "sebastian/diff": "^7.0",
+ "sebastian/exporter": "^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "suggest": {
+ "ext-bcmath": "For comparing BcMath\\Number objects"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "7.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "https://github.com/sebastianbergmann/comparator",
+ "keywords": [
+ "comparator",
+ "compare",
+ "equality"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/comparator/issues",
+ "security": "https://github.com/sebastianbergmann/comparator/security/policy",
+ "source": "https://github.com/sebastianbergmann/comparator/tree/7.0.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-03-07T07:00:32+00:00"
+ },
+ {
+ "name": "sebastian/complexity",
+ "version": "5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/complexity.git",
+ "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb",
+ "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^5.0",
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for calculating the complexity of PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/complexity",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/complexity/issues",
+ "security": "https://github.com/sebastianbergmann/complexity/security/policy",
+ "source": "https://github.com/sebastianbergmann/complexity/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:55:25+00:00"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "7.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "7ab1ea946c012266ca32390913653d844ecd085f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f",
+ "reference": "7ab1ea946c012266ca32390913653d844ecd085f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0",
+ "symfony/process": "^7.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "7.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff",
+ "udiff",
+ "unidiff",
+ "unified diff"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/diff/issues",
+ "security": "https://github.com/sebastianbergmann/diff/security/policy",
+ "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:55:46+00:00"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "8.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "8afe311eca49171bf95405cc0078be9a3821f9f2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8afe311eca49171bf95405cc0078be9a3821f9f2",
+ "reference": "8afe311eca49171bf95405cc0078be9a3821f9f2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "suggest": {
+ "ext-posix": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "8.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "https://github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/environment/issues",
+ "security": "https://github.com/sebastianbergmann/environment/security/policy",
+ "source": "https://github.com/sebastianbergmann/environment/tree/8.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:56:08+00:00"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "7.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "76432aafc58d50691a00d86d0632f1217a47b688"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/76432aafc58d50691a00d86d0632f1217a47b688",
+ "reference": "76432aafc58d50691a00d86d0632f1217a47b688",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "php": ">=8.3",
+ "sebastian/recursion-context": "^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "7.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "https://www.github.com/sebastianbergmann/exporter",
+ "keywords": [
+ "export",
+ "exporter"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/exporter/issues",
+ "security": "https://github.com/sebastianbergmann/exporter/security/policy",
+ "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:56:42+00:00"
+ },
+ {
+ "name": "sebastian/global-state",
+ "version": "8.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/global-state.git",
+ "reference": "570a2aeb26d40f057af686d63c4e99b075fb6cbc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/570a2aeb26d40f057af686d63c4e99b075fb6cbc",
+ "reference": "570a2aeb26d40f057af686d63c4e99b075fb6cbc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3",
+ "sebastian/object-reflector": "^5.0",
+ "sebastian/recursion-context": "^7.0"
+ },
+ "require-dev": {
+ "ext-dom": "*",
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "8.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Snapshotting of global state",
+ "homepage": "https://www.github.com/sebastianbergmann/global-state",
+ "keywords": [
+ "global state"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/global-state/issues",
+ "security": "https://github.com/sebastianbergmann/global-state/security/policy",
+ "source": "https://github.com/sebastianbergmann/global-state/tree/8.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:56:59+00:00"
+ },
+ {
+ "name": "sebastian/lines-of-code",
+ "version": "4.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/lines-of-code.git",
+ "reference": "97ffee3bcfb5805568d6af7f0f893678fc076d2f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/97ffee3bcfb5805568d6af7f0f893678fc076d2f",
+ "reference": "97ffee3bcfb5805568d6af7f0f893678fc076d2f",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^5.0",
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for counting the lines of code in PHP source code",
+ "homepage": "https://github.com/sebastianbergmann/lines-of-code",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
+ "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy",
+ "source": "https://github.com/sebastianbergmann/lines-of-code/tree/4.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:57:28+00:00"
+ },
+ {
+ "name": "sebastian/object-enumerator",
+ "version": "7.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-enumerator.git",
+ "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894",
+ "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3",
+ "sebastian/object-reflector": "^5.0",
+ "sebastian/recursion-context": "^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "7.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Traverses array structures and object graphs to enumerate all referenced objects",
+ "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
+ "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy",
+ "source": "https://github.com/sebastianbergmann/object-enumerator/tree/7.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:57:48+00:00"
+ },
+ {
+ "name": "sebastian/object-reflector",
+ "version": "5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-reflector.git",
+ "reference": "4bfa827c969c98be1e527abd576533293c634f6a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a",
+ "reference": "4bfa827c969c98be1e527abd576533293c634f6a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Allows reflection of object attributes, including inherited and non-public ones",
+ "homepage": "https://github.com/sebastianbergmann/object-reflector/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
+ "security": "https://github.com/sebastianbergmann/object-reflector/security/policy",
+ "source": "https://github.com/sebastianbergmann/object-reflector/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T04:58:17+00:00"
+ },
+ {
+ "name": "sebastian/recursion-context",
+ "version": "7.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "c405ae3a63e01b32eb71577f8ec1604e39858a7c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c405ae3a63e01b32eb71577f8ec1604e39858a7c",
+ "reference": "c405ae3a63e01b32eb71577f8ec1604e39858a7c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "7.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "https://github.com/sebastianbergmann/recursion-context",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
+ "security": "https://github.com/sebastianbergmann/recursion-context/security/policy",
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/7.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T05:00:01+00:00"
+ },
+ {
+ "name": "sebastian/type",
+ "version": "6.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/type.git",
+ "reference": "1d7cd6e514384c36d7a390347f57c385d4be6069"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/1d7cd6e514384c36d7a390347f57c385d4be6069",
+ "reference": "1d7cd6e514384c36d7a390347f57c385d4be6069",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "6.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the types of the PHP type system",
+ "homepage": "https://github.com/sebastianbergmann/type",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/type/issues",
+ "security": "https://github.com/sebastianbergmann/type/security/policy",
+ "source": "https://github.com/sebastianbergmann/type/tree/6.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-03-18T13:37:31+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "6.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c",
+ "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "6.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/version/issues",
+ "security": "https://github.com/sebastianbergmann/version/security/policy",
+ "source": "https://github.com/sebastianbergmann/version/tree/6.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-07T05:00:38+00:00"
+ },
+ {
+ "name": "staabm/side-effects-detector",
+ "version": "1.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/staabm/side-effects-detector.git",
+ "reference": "d8334211a140ce329c13726d4a715adbddd0a163"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163",
+ "reference": "d8334211a140ce329c13726d4a715adbddd0a163",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": "^7.4 || ^8.0"
+ },
+ "require-dev": {
+ "phpstan/extension-installer": "^1.4.3",
+ "phpstan/phpstan": "^1.12.6",
+ "phpunit/phpunit": "^9.6.21",
+ "symfony/var-dumper": "^5.4.43",
+ "tomasvotruba/type-coverage": "1.0.0",
+ "tomasvotruba/unused-public": "1.0.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "lib/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "A static analysis tool to detect side effects in PHP code",
+ "keywords": [
+ "static analysis"
+ ],
+ "support": {
+ "issues": "https://github.com/staabm/side-effects-detector/issues",
+ "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/staabm",
+ "type": "github"
+ }
+ ],
+ "time": "2024-10-20T05:08:20+00:00"
+ },
+ {
+ "name": "theseer/tokenizer",
+ "version": "1.2.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/theseer/tokenizer.git",
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
+ "support": {
+ "issues": "https://github.com/theseer/tokenizer/issues",
+ "source": "https://github.com/theseer/tokenizer/tree/1.2.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-03T12:36:25+00:00"
+ }
+ ],
+ "packages-dev": [],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": {},
+ "prefer-stable": true,
+ "prefer-lowest": false,
+ "platform": {
+ "php": ">=8.3",
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-xml": "*",
+ "ext-xmlwriter": "*"
+ },
+ "platform-dev": {},
+ "platform-overrides": {
+ "php": "8.3.0"
+ },
+ "plugin-api-version": "2.6.0"
+}
diff --git a/phpstan.neon b/phpstan.neon
new file mode 100644
index 00000000000..bb657e19fa4
--- /dev/null
+++ b/phpstan.neon
@@ -0,0 +1,65 @@
+parameters:
+ level: 6
+
+ paths:
+ - src
+
+ excludePaths:
+ # exclude partial traits, which are only used in runtime generated code
+ - src/Framework/MockObject/Runtime/Api
+
+ checkTooWideReturnTypesInProtectedAndPublicMethods: true
+ reportAlwaysTrueInLastCondition: true
+ reportPossiblyNonexistentConstantArrayOffset: true
+ reportPossiblyNonexistentGeneralArrayOffset: true
+ treatPhpDocTypesAsCertain: false
+
+ strictRules:
+ allRules: false
+ booleansInConditions: true
+ closureUsesThis: true
+ disallowedBacktick: true
+ disallowedEmpty: true
+ disallowedImplicitArrayCreation: true
+ disallowedLooseComparison: true
+ disallowedShortTernary: true
+ illegalConstructorMethodCall: true
+ matchingInheritedMethodNames: true
+ noVariableVariables: true
+ numericOperandsInArithmeticOperators: true
+ overwriteVariablesWithLoop: true
+ requireParentConstructorCall: true
+ strictArrayFilter: true
+ strictFunctionCalls: true
+ switchConditionsMatchingType: true
+ uselessCast: true
+
+ ergebnis:
+ allRules: false
+ final:
+ enabled: true
+ classesNotRequiredToBeAbstractOrFinal:
+ - PHPUnit\Framework\Constraint\Count
+ - PHPUnit\Framework\AssertionFailedError
+ - PHPUnit\Framework\Exception
+ - PHPUnit\Framework\TestSuite
+ privateInFinalClass:
+ enabled: true
+
+ type_coverage:
+ declare: 100
+ return: 100
+ param: 100
+ property: 100
+ constant: 100
+
+ ignoreErrors:
+ # ignore errors caused by defensive programming
+ - '#Call to function assert\(\) with true will always evaluate to true.#'
+ - '#Instanceof between .* and .* will always evaluate to true.#'
+ - '#Strict comparison using !== between .*non-empty-string.* and .* will always evaluate to true.#'
+ - '#Strict comparison using !== between .*non-falsy-string.* and .* will always evaluate to true.#'
+ - identifier: argument.named
+
+includes:
+ - phar://phpstan.phar/conf/bleedingEdge.neon
diff --git a/phpunit b/phpunit
index 860a1910329..84afaf14c1a 100755
--- a/phpunit
+++ b/phpunit
@@ -24,11 +24,11 @@ if (!version_compare(PHP_VERSION, PHP_VERSION, '=')) {
die(1);
}
-if (version_compare('8.2.0', PHP_VERSION, '>')) {
+if (version_compare('8.3.0', PHP_VERSION, '>')) {
fwrite(
STDERR,
sprintf(
- 'This version of PHPUnit requires PHP >= 8.2.' . PHP_EOL .
+ 'This version of PHPUnit requires PHP >= 8.3.' . PHP_EOL .
'You are using PHP %s (%s).' . PHP_EOL,
PHP_VERSION,
PHP_BINARY
@@ -38,31 +38,6 @@ if (version_compare('8.2.0', PHP_VERSION, '>')) {
die(1);
}
-$requiredExtensions = ['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'];
-
-$unavailableExtensions = array_filter(
- $requiredExtensions,
- static function ($extension) {
- return !extension_loaded($extension);
- }
-);
-
-if ([] !== $unavailableExtensions) {
- fwrite(
- STDERR,
- sprintf(
- 'PHPUnit requires the "%s" extensions, but the "%s" %s not available.' . PHP_EOL,
- implode('", "', $requiredExtensions),
- implode('", "', $unavailableExtensions),
- count($unavailableExtensions) === 1 ? 'extension is' : 'extensions are'
- )
- );
-
- die(1);
-}
-
-unset($requiredExtensions, $unavailableExtensions);
-
if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}
@@ -96,4 +71,34 @@ if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
require PHPUNIT_COMPOSER_INSTALL;
+$requiredExtensions = ['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'];
+
+$unavailableExtensions = array_filter(
+ $requiredExtensions,
+ static function ($extension) {
+ return !extension_loaded($extension);
+ }
+);
+
+// Workaround for https://github.com/sebastianbergmann/phpunit/issues/5662
+if (!function_exists('ctype_alnum')) {
+ $unavailableExtensions[] = 'ctype';
+}
+
+if ([] !== $unavailableExtensions) {
+ fwrite(
+ STDERR,
+ sprintf(
+ 'PHPUnit requires the "%s" extensions, but the "%s" %s not available.' . PHP_EOL,
+ implode('", "', $requiredExtensions),
+ implode('", "', $unavailableExtensions),
+ count($unavailableExtensions) === 1 ? 'extension is' : 'extensions are'
+ )
+ );
+
+ die(1);
+}
+
+unset($requiredExtensions, $unavailableExtensions);
+
exit((new PHPUnit\TextUI\Application)->run($_SERVER['argv']));
diff --git a/phpunit.xml b/phpunit.xml
index cabc86fa32b..17257d4d34a 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -15,21 +15,31 @@
tests/end-to-end/baselinetests/end-to-end/cli
+ tests/end-to-end/data-provider
+ tests/end-to-end/deprecation-triggertests/end-to-end/eventtests/end-to-end/execution-order
- tests/end-to-end/extension
+ tests/end-to-end/extension-cli
+ tests/end-to-end/extension-xmltests/end-to-end/generic
- tests/end-to-end/logging
+ tests/end-to-end/groups-from-configuration
+ tests/end-to-end/logging/junit
+ tests/end-to-end/logging/teamcity
+ tests/end-to-end/logging/testdox
+ tests/end-to-end/metadatatests/end-to-end/migrationtests/end-to-end/mock-objectstests/end-to-end/phpttests/end-to-end/regression
+ tests/end-to-end/self-direct-indirecttests/end-to-end/testdoxtests/end-to-end/event/_filestests/end-to-end/execution-order/_files
+ tests/end-to-end/groups-from-configuration/_filestests/end-to-end/logging/_filestests/end-to-end/migration/_files
+ tests/end-to-end/self-direct-indirect/_filestests/end-to-end/testdox/_files
diff --git a/phpunit.xsd b/phpunit.xsd
index aa8721eb5d5..1f66c40b654 100644
--- a/phpunit.xsd
+++ b/phpunit.xsd
@@ -2,7 +2,7 @@
- This Schema file defines the rules by which the XML configuration file of PHPUnit 11.0 may be structured.
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 12.2 may be structured.
@@ -23,9 +23,9 @@
+
-
@@ -35,6 +35,9 @@
+
+
+
@@ -60,7 +63,6 @@
-
@@ -170,14 +172,16 @@
-
+
+
+
@@ -196,7 +200,6 @@
-
@@ -205,18 +208,22 @@
+
-
+
+
+
+
@@ -260,6 +267,7 @@
+
@@ -267,6 +275,7 @@
+
@@ -319,4 +328,12 @@
+
+
+
+
+
+
+
+
diff --git a/schema/10.1.xsd b/schema/10.1.xsd
new file mode 100644
index 00000000000..1b190c21b90
--- /dev/null
+++ b/schema/10.1.xsd
@@ -0,0 +1,312 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 10.1 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/10.2.xsd b/schema/10.2.xsd
new file mode 100644
index 00000000000..269b7a3aeb4
--- /dev/null
+++ b/schema/10.2.xsd
@@ -0,0 +1,319 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 10.2 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/10.3.xsd b/schema/10.3.xsd
new file mode 100644
index 00000000000..03a54ee0b08
--- /dev/null
+++ b/schema/10.3.xsd
@@ -0,0 +1,321 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 10.3 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/10.4.xsd b/schema/10.4.xsd
new file mode 100644
index 00000000000..bd22b2ca2a7
--- /dev/null
+++ b/schema/10.4.xsd
@@ -0,0 +1,322 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 10.4 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/10.5.xsd b/schema/10.5.xsd
new file mode 100644
index 00000000000..eab82db2b91
--- /dev/null
+++ b/schema/10.5.xsd
@@ -0,0 +1,326 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 10.5 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/11.0.xsd b/schema/11.0.xsd
new file mode 100644
index 00000000000..a6e7cb8cd16
--- /dev/null
+++ b/schema/11.0.xsd
@@ -0,0 +1,323 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 11.0 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/11.1.xsd b/schema/11.1.xsd
new file mode 100644
index 00000000000..6172e834933
--- /dev/null
+++ b/schema/11.1.xsd
@@ -0,0 +1,333 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 11.1 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/11.2.xsd b/schema/11.2.xsd
new file mode 100644
index 00000000000..d7c7dcac065
--- /dev/null
+++ b/schema/11.2.xsd
@@ -0,0 +1,331 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 11.2 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/11.3.xsd b/schema/11.3.xsd
new file mode 100644
index 00000000000..3b30de4d6f7
--- /dev/null
+++ b/schema/11.3.xsd
@@ -0,0 +1,335 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 11.3 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/11.4.xsd b/schema/11.4.xsd
new file mode 100644
index 00000000000..52db363026a
--- /dev/null
+++ b/schema/11.4.xsd
@@ -0,0 +1,334 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 11.4 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/11.5.xsd b/schema/11.5.xsd
new file mode 100644
index 00000000000..f19049d8519
--- /dev/null
+++ b/schema/11.5.xsd
@@ -0,0 +1,336 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 11.5 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/12.0.xsd b/schema/12.0.xsd
new file mode 100644
index 00000000000..c993640f9fb
--- /dev/null
+++ b/schema/12.0.xsd
@@ -0,0 +1,335 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 12.0 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/12.1.xsd b/schema/12.1.xsd
new file mode 100644
index 00000000000..51f225d45ab
--- /dev/null
+++ b/schema/12.1.xsd
@@ -0,0 +1,339 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 12.1 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/8.5.xsd b/schema/8.5.xsd
index 5881bafec62..75e22289471 100644
--- a/schema/8.5.xsd
+++ b/schema/8.5.xsd
@@ -244,7 +244,7 @@
-
+
@@ -309,8 +309,10 @@
-
-
+
+
+
+
diff --git a/schema/9.0.xsd b/schema/9.0.xsd
new file mode 100644
index 00000000000..6db04c09789
--- /dev/null
+++ b/schema/9.0.xsd
@@ -0,0 +1,315 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 9.0 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/9.1.xsd b/schema/9.1.xsd
new file mode 100644
index 00000000000..b10d30b4619
--- /dev/null
+++ b/schema/9.1.xsd
@@ -0,0 +1,317 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 9.0 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/9.2.xsd b/schema/9.2.xsd
index 883f21bc0d1..d770e8b03bd 100644
--- a/schema/9.2.xsd
+++ b/schema/9.2.xsd
@@ -163,7 +163,7 @@
-
+
@@ -248,7 +248,7 @@
-
+
@@ -282,7 +282,7 @@
-
+
@@ -310,7 +310,7 @@
-
+
diff --git a/schema/9.3.xsd b/schema/9.3.xsd
new file mode 100644
index 00000000000..638f663ac7b
--- /dev/null
+++ b/schema/9.3.xsd
@@ -0,0 +1,327 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 9.3 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/9.4.xsd b/schema/9.4.xsd
new file mode 100644
index 00000000000..75a91e832f8
--- /dev/null
+++ b/schema/9.4.xsd
@@ -0,0 +1,328 @@
+
+
+
+
+ This Schema file defines the rules by which the XML configuration file of PHPUnit 9.4 may be structured.
+
+
+
+
+
+ Root Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The main type specifying the document structure
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/schema/9.5.xsd b/schema/9.5.xsd
index a25d683a434..eabefac30b0 100644
--- a/schema/9.5.xsd
+++ b/schema/9.5.xsd
@@ -213,7 +213,7 @@
-
+
@@ -279,8 +279,10 @@
-
-
+
+
+
+
diff --git a/src/Event/Dispatcher/CollectingDispatcher.php b/src/Event/Dispatcher/CollectingDispatcher.php
index 39433fe3fc6..c431b93e6a5 100644
--- a/src/Event/Dispatcher/CollectingDispatcher.php
+++ b/src/Event/Dispatcher/CollectingDispatcher.php
@@ -10,6 +10,8 @@
namespace PHPUnit\Event;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class CollectingDispatcher implements Dispatcher
diff --git a/src/Event/Dispatcher/DeferringDispatcher.php b/src/Event/Dispatcher/DeferringDispatcher.php
index 8c67d2df8e9..6895facb386 100644
--- a/src/Event/Dispatcher/DeferringDispatcher.php
+++ b/src/Event/Dispatcher/DeferringDispatcher.php
@@ -10,6 +10,8 @@
namespace PHPUnit\Event;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class DeferringDispatcher implements SubscribableDispatcher
diff --git a/src/Event/Dispatcher/DirectDispatcher.php b/src/Event/Dispatcher/DirectDispatcher.php
index 042b24180c2..b5cbc8e31c1 100644
--- a/src/Event/Dispatcher/DirectDispatcher.php
+++ b/src/Event/Dispatcher/DirectDispatcher.php
@@ -9,6 +9,7 @@
*/
namespace PHPUnit\Event;
+use const PHP_EOL;
use function array_key_exists;
use function dirname;
use function sprintf;
@@ -16,6 +17,8 @@
use Throwable;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class DirectDispatcher implements SubscribableDispatcher
@@ -23,12 +26,12 @@ final class DirectDispatcher implements SubscribableDispatcher
private readonly TypeMap $typeMap;
/**
- * @psalm-var array>
+ * @var array>
*/
private array $subscribers = [];
/**
- * @psalm-var list
+ * @var list
*/
private array $tracers = [];
@@ -86,9 +89,11 @@ public function dispatch(Event $event): void
foreach ($this->tracers as $tracer) {
try {
$tracer->trace($event);
+ // @codeCoverageIgnoreStart
} catch (Throwable $t) {
$this->handleThrowable($t);
}
+ // @codeCoverageIgnoreEnd
}
if (!array_key_exists($eventClassName, $this->subscribers)) {
@@ -97,6 +102,7 @@ public function dispatch(Event $event): void
foreach ($this->subscribers[$eventClassName] as $subscriber) {
try {
+ /** @phpstan-ignore method.notFound */
$subscriber->notify($event);
} catch (Throwable $t) {
$this->handleThrowable($t);
@@ -110,7 +116,7 @@ public function dispatch(Event $event): void
public function handleThrowable(Throwable $t): void
{
if ($this->isThrowableFromThirdPartySubscriber($t)) {
- Facade::emitter()->testRunnerTriggeredWarning(
+ Facade::emitter()->testRunnerTriggeredPhpunitWarning(
sprintf(
'Exception in third-party event subscriber: %s%s%s',
$t->getMessage(),
@@ -122,7 +128,9 @@ public function handleThrowable(Throwable $t): void
return;
}
+ // @codeCoverageIgnoreStart
throw $t;
+ // @codeCoverageIgnoreEnd
}
private function isThrowableFromThirdPartySubscriber(Throwable $t): bool
diff --git a/src/Event/Dispatcher/Dispatcher.php b/src/Event/Dispatcher/Dispatcher.php
index 35691be71dc..e7086539539 100644
--- a/src/Event/Dispatcher/Dispatcher.php
+++ b/src/Event/Dispatcher/Dispatcher.php
@@ -10,6 +10,8 @@
namespace PHPUnit\Event;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This interface is not covered by the backward compatibility promise for PHPUnit
*/
interface Dispatcher
diff --git a/src/Event/Dispatcher/SubscribableDispatcher.php b/src/Event/Dispatcher/SubscribableDispatcher.php
index 067c0cc6e60..c4393da1249 100644
--- a/src/Event/Dispatcher/SubscribableDispatcher.php
+++ b/src/Event/Dispatcher/SubscribableDispatcher.php
@@ -10,6 +10,8 @@
namespace PHPUnit\Event;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This interface is not covered by the backward compatibility promise for PHPUnit
*/
interface SubscribableDispatcher extends Dispatcher
diff --git a/src/Event/Emitter/DispatchingEmitter.php b/src/Event/Emitter/DispatchingEmitter.php
index d47538b5b5e..ec881ccbbb9 100644
--- a/src/Event/Emitter/DispatchingEmitter.php
+++ b/src/Event/Emitter/DispatchingEmitter.php
@@ -10,8 +10,10 @@
namespace PHPUnit\Event;
use function assert;
+use function memory_reset_peak_usage;
use PHPUnit\Event\Code\ClassMethod;
use PHPUnit\Event\Code\ComparisonFailure;
+use PHPUnit\Event\Code\IssueTrigger\IssueTrigger;
use PHPUnit\Event\Code\NoTestCaseObjectOnCallStackException;
use PHPUnit\Event\Code\TestMethod;
use PHPUnit\Event\Code\TestMethodBuilder;
@@ -25,11 +27,11 @@
use PHPUnit\Event\TestSuite\Sorted as TestSuiteSorted;
use PHPUnit\Event\TestSuite\Started as TestSuiteStarted;
use PHPUnit\Event\TestSuite\TestSuite;
-use PHPUnit\Framework\Constraint;
use PHPUnit\TextUI\Configuration\Configuration;
-use PHPUnit\Util\Exporter;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class DispatchingEmitter implements Emitter
@@ -38,7 +40,6 @@ final class DispatchingEmitter implements Emitter
private readonly Telemetry\System $system;
private readonly Telemetry\Snapshot $startSnapshot;
private Telemetry\Snapshot $previousSnapshot;
- private bool $exportObjects = false;
public function __construct(Dispatcher $dispatcher, Telemetry\System $system)
{
@@ -46,17 +47,7 @@ public function __construct(Dispatcher $dispatcher, Telemetry\System $system)
$this->system = $system;
$this->startSnapshot = $system->snapshot();
- $this->previousSnapshot = $system->snapshot();
- }
-
- public function exportObjects(): void
- {
- $this->exportObjects = true;
- }
-
- public function exportsObjects(): bool
- {
- return $this->exportObjects;
+ $this->previousSnapshot = $this->startSnapshot;
}
/**
@@ -101,6 +92,8 @@ public function testRunnerConfigured(Configuration $configuration): void
}
/**
+ * @param non-empty-string $filename
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
@@ -115,6 +108,10 @@ public function testRunnerBootstrapFinished(string $filename): void
}
/**
+ * @param non-empty-string $filename
+ * @param non-empty-string $name
+ * @param non-empty-string $version
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
@@ -131,8 +128,8 @@ public function testRunnerLoadedExtensionFromPhar(string $filename, string $name
}
/**
- * @psalm-param class-string $className
- * @psalm-param array $parameters
+ * @param class-string $className
+ * @param array $parameters
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
@@ -271,6 +268,24 @@ public function testRunnerTriggeredGarbageCollection(): void
);
}
+ public function testRunnerStartedChildProcess(): void
+ {
+ $this->dispatcher->dispatch(
+ new TestRunner\ChildProcessStarted($this->telemetryInfo()),
+ );
+ }
+
+ public function testRunnerFinishedChildProcess(string $stdout, string $stderr): void
+ {
+ $this->dispatcher->dispatch(
+ new TestRunner\ChildProcessFinished(
+ $this->telemetryInfo(),
+ $stdout,
+ $stderr,
+ ),
+ );
+ }
+
/**
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
@@ -318,95 +333,95 @@ public function testPreparationStarted(Code\Test $test): void
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testPreparationFailed(Code\Test $test): void
+ public function testPreparationErrored(Code\Test $test, Throwable $throwable): void
{
$this->dispatcher->dispatch(
- new Test\PreparationFailed(
+ new Test\PreparationErrored(
$this->telemetryInfo(),
$test,
+ $throwable,
),
);
}
/**
- * @psalm-param class-string $testClassName
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testBeforeFirstTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void
+ public function testPreparationFailed(Code\Test $test, Throwable $throwable): void
{
$this->dispatcher->dispatch(
- new Test\BeforeFirstTestMethodCalled(
+ new Test\PreparationFailed(
$this->telemetryInfo(),
- $testClassName,
- $calledMethod,
+ $test,
+ $throwable,
),
);
}
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testBeforeFirstTestMethodErrored(string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable): void
+ public function beforeFirstTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void
{
$this->dispatcher->dispatch(
- new Test\BeforeFirstTestMethodErrored(
+ new Test\BeforeFirstTestMethodCalled(
$this->telemetryInfo(),
$testClassName,
$calledMethod,
- $throwable,
),
);
}
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testBeforeFirstTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void
+ public function beforeFirstTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void
{
$this->dispatcher->dispatch(
- new Test\BeforeFirstTestMethodFinished(
+ new Test\BeforeFirstTestMethodErrored(
$this->telemetryInfo(),
$testClassName,
- ...$calledMethods,
+ $calledMethod,
+ $throwable,
),
);
}
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testBeforeTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void
+ public function beforeFirstTestMethodFailed(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void
{
$this->dispatcher->dispatch(
- new Test\BeforeTestMethodCalled(
+ new Test\BeforeFirstTestMethodFailed(
$this->telemetryInfo(),
$testClassName,
$calledMethod,
+ $throwable,
),
);
}
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testBeforeTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void
+ public function beforeFirstTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void
{
$this->dispatcher->dispatch(
- new Test\BeforeTestMethodFinished(
+ new Test\BeforeFirstTestMethodFinished(
$this->telemetryInfo(),
$testClassName,
...$calledMethods,
@@ -415,35 +430,32 @@ public function testBeforeTestMethodFinished(string $testClassName, Code\ClassMe
}
/**
- * @psalm-param class-string $testClassName
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testPreConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void
+ public function beforeTestMethodCalled(TestMethod $test, ClassMethod $calledMethod): void
{
$this->dispatcher->dispatch(
- new Test\PreConditionCalled(
+ new Test\BeforeTestMethodCalled(
$this->telemetryInfo(),
- $testClassName,
+ $test,
$calledMethod,
),
);
}
/**
- * @psalm-param class-string $testClassName
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testPreConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void
+ public function beforeTestMethodErrored(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void
{
$this->dispatcher->dispatch(
- new Test\PreConditionFinished(
+ new Test\BeforeTestMethodErrored(
$this->telemetryInfo(),
- $testClassName,
- ...$calledMethods,
+ $test,
+ $calledMethod,
+ $throwable,
),
);
}
@@ -452,28 +464,29 @@ public function testPreConditionFinished(string $testClassName, Code\ClassMethod
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testPrepared(Code\Test $test): void
+ public function beforeTestMethodFailed(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void
{
$this->dispatcher->dispatch(
- new Test\Prepared(
+ new Test\BeforeTestMethodFailed(
$this->telemetryInfo(),
$test,
+ $calledMethod,
+ $throwable,
),
);
}
/**
- * @psalm-param class-string $className
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testRegisteredComparator(string $className): void
+ public function beforeTestMethodFinished(TestMethod $test, ClassMethod ...$calledMethods): void
{
$this->dispatcher->dispatch(
- new Test\ComparatorRegistered(
+ new Test\BeforeTestMethodFinished(
$this->telemetryInfo(),
- $className,
+ $test,
+ ...$calledMethods,
),
);
}
@@ -482,15 +495,13 @@ public function testRegisteredComparator(string $className): void
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testAssertionSucceeded(mixed $value, Constraint\Constraint $constraint, string $message): void
+ public function preConditionCalled(TestMethod $test, ClassMethod $calledMethod): void
{
$this->dispatcher->dispatch(
- new Test\AssertionSucceeded(
+ new Test\PreConditionCalled(
$this->telemetryInfo(),
- Exporter::export($value, $this->exportObjects),
- $constraint->toString($this->exportObjects),
- $constraint->count(),
- $message,
+ $test,
+ $calledMethod,
),
);
}
@@ -499,77 +510,75 @@ public function testAssertionSucceeded(mixed $value, Constraint\Constraint $cons
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testAssertionFailed(mixed $value, Constraint\Constraint $constraint, string $message): void
+ public function preConditionErrored(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void
{
$this->dispatcher->dispatch(
- new Test\AssertionFailed(
+ new Test\PreConditionErrored(
$this->telemetryInfo(),
- Exporter::export($value, $this->exportObjects),
- $constraint->toString($this->exportObjects),
- $constraint->count(),
- $message,
+ $test,
+ $calledMethod,
+ $throwable,
),
);
}
/**
- * @psalm-param class-string $className
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testCreatedMockObject(string $className): void
+ public function preConditionFailed(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void
{
$this->dispatcher->dispatch(
- new Test\MockObjectCreated(
+ new Test\PreConditionFailed(
$this->telemetryInfo(),
- $className,
+ $test,
+ $calledMethod,
+ $throwable,
),
);
}
/**
- * @psalm-param list $interfaces
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testCreatedMockObjectForIntersectionOfInterfaces(array $interfaces): void
+ public function preConditionFinished(TestMethod $test, ClassMethod ...$calledMethods): void
{
$this->dispatcher->dispatch(
- new Test\MockObjectForIntersectionOfInterfacesCreated(
+ new Test\PreConditionFinished(
$this->telemetryInfo(),
- $interfaces,
+ $test,
+ ...$calledMethods,
),
);
}
/**
- * @psalm-param trait-string $traitName
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testCreatedMockObjectForTrait(string $traitName): void
+ public function testPrepared(Code\Test $test): void
{
+ memory_reset_peak_usage();
+
$this->dispatcher->dispatch(
- new Test\MockObjectForTraitCreated(
+ new Test\Prepared(
$this->telemetryInfo(),
- $traitName,
+ $test,
),
);
}
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testCreatedMockObjectForAbstractClass(string $className): void
+ public function testRegisteredComparator(string $className): void
{
$this->dispatcher->dispatch(
- new Test\MockObjectForAbstractClassCreated(
+ new Test\ComparatorRegistered(
$this->telemetryInfo(),
$className,
),
@@ -577,63 +586,56 @@ public function testCreatedMockObjectForAbstractClass(string $className): void
}
/**
- * @psalm-param class-string $originalClassName
- * @psalm-param class-string $mockClassName
+ * @param class-string $className
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testCreatedMockObjectFromWsdl(string $wsdlFile, string $originalClassName, string $mockClassName, array $methods, bool $callOriginalConstructor, array $options): void
+ public function testCreatedMockObject(string $className): void
{
$this->dispatcher->dispatch(
- new Test\MockObjectFromWsdlCreated(
+ new Test\MockObjectCreated(
$this->telemetryInfo(),
- $wsdlFile,
- $originalClassName,
- $mockClassName,
- $methods,
- $callOriginalConstructor,
- $options,
+ $className,
),
);
}
/**
- * @psalm-param class-string $className
+ * @param list $interfaces
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testCreatedPartialMockObject(string $className, string ...$methodNames): void
+ public function testCreatedMockObjectForIntersectionOfInterfaces(array $interfaces): void
{
$this->dispatcher->dispatch(
- new Test\PartialMockObjectCreated(
+ new Test\MockObjectForIntersectionOfInterfacesCreated(
$this->telemetryInfo(),
- $className,
- ...$methodNames,
+ $interfaces,
),
);
}
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testCreatedTestProxy(string $className, array $constructorArguments): void
+ public function testCreatedPartialMockObject(string $className, string ...$methodNames): void
{
$this->dispatcher->dispatch(
- new Test\TestProxyCreated(
+ new Test\PartialMockObjectCreated(
$this->telemetryInfo(),
$className,
- Exporter::export($constructorArguments, $this->exportObjects),
+ ...$methodNames,
),
);
}
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
@@ -649,7 +651,7 @@ public function testCreatedStub(string $className): void
}
/**
- * @psalm-param list $interfaces
+ * @param list $interfaces
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
@@ -755,6 +757,8 @@ public function testSkipped(Code\Test $test, string $message): void
}
/**
+ * @param non-empty-string $message
+ *
* @throws InvalidArgumentException
* @throws NoTestCaseObjectOnCallStackException
* @throws UnknownEventTypeException
@@ -783,10 +787,36 @@ public function testTriggeredPhpunitDeprecation(?Code\Test $test, string $messag
}
/**
+ * @param non-empty-string $message
+ *
+ * @throws InvalidArgumentException
+ * @throws NoTestCaseObjectOnCallStackException
+ * @throws UnknownEventTypeException
+ */
+ public function testTriggeredPhpunitNotice(?Code\Test $test, string $message): void
+ {
+ if ($test === null) {
+ $test = TestMethodBuilder::fromCallStack();
+ }
+
+ $this->dispatcher->dispatch(
+ new Test\PhpunitNoticeTriggered(
+ $this->telemetryInfo(),
+ $test,
+ $message,
+ ),
+ );
+ }
+
+ /**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testTriggeredPhpDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest): void
+ public function testTriggeredPhpDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest, IssueTrigger $trigger): void
{
$this->dispatcher->dispatch(
new Test\PhpDeprecationTriggered(
@@ -798,15 +828,21 @@ public function testTriggeredPhpDeprecation(Code\Test $test, string $message, st
$suppressed,
$ignoredByBaseline,
$ignoredByTest,
+ $trigger,
),
);
}
/**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ * @param non-empty-string $stackTrace
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testTriggeredDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest): void
+ public function testTriggeredDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest, IssueTrigger $trigger, string $stackTrace): void
{
$this->dispatcher->dispatch(
new Test\DeprecationTriggered(
@@ -818,11 +854,17 @@ public function testTriggeredDeprecation(Code\Test $test, string $message, strin
$suppressed,
$ignoredByBaseline,
$ignoredByTest,
+ $trigger,
+ $stackTrace,
),
);
}
/**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
@@ -841,6 +883,10 @@ public function testTriggeredError(Code\Test $test, string $message, string $fil
}
/**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
@@ -860,6 +906,10 @@ public function testTriggeredNotice(Code\Test $test, string $message, string $fi
}
/**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
@@ -879,6 +929,10 @@ public function testTriggeredPhpNotice(Code\Test $test, string $message, string
}
/**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
@@ -898,6 +952,10 @@ public function testTriggeredWarning(Code\Test $test, string $message, string $f
}
/**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
@@ -917,6 +975,8 @@ public function testTriggeredPhpWarning(Code\Test $test, string $message, string
}
/**
+ * @param non-empty-string $message
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
@@ -932,6 +992,8 @@ public function testTriggeredPhpunitError(Code\Test $test, string $message): voi
}
/**
+ * @param non-empty-string $message
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
@@ -947,7 +1009,7 @@ public function testTriggeredPhpunitWarning(Code\Test $test, string $message): v
}
/**
- * @psalm-param non-empty-string $output
+ * @param non-empty-string $output
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
@@ -963,6 +1025,8 @@ public function testPrintedUnexpectedOutput(string $output): void
}
/**
+ * @param non-negative-int $numberOfAssertionsPerformed
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
@@ -978,80 +1042,136 @@ public function testFinished(Code\Test $test, int $numberOfAssertionsPerformed):
}
/**
- * @psalm-param class-string $testClassName
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testPostConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void
+ public function postConditionCalled(TestMethod $test, ClassMethod $calledMethod): void
{
$this->dispatcher->dispatch(
new Test\PostConditionCalled(
$this->telemetryInfo(),
- $testClassName,
+ $test,
$calledMethod,
),
);
}
/**
- * @psalm-param class-string $testClassName
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testPostConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void
+ public function postConditionErrored(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void
+ {
+ $this->dispatcher->dispatch(
+ new Test\PostConditionErrored(
+ $this->telemetryInfo(),
+ $test,
+ $calledMethod,
+ $throwable,
+ ),
+ );
+ }
+
+ /**
+ * @throws InvalidArgumentException
+ * @throws UnknownEventTypeException
+ */
+ public function postConditionFailed(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void
+ {
+ $this->dispatcher->dispatch(
+ new Test\PostConditionFailed(
+ $this->telemetryInfo(),
+ $test,
+ $calledMethod,
+ $throwable,
+ ),
+ );
+ }
+
+ /**
+ * @throws InvalidArgumentException
+ * @throws UnknownEventTypeException
+ */
+ public function postConditionFinished(TestMethod $test, ClassMethod ...$calledMethods): void
{
$this->dispatcher->dispatch(
new Test\PostConditionFinished(
$this->telemetryInfo(),
- $testClassName,
+ $test,
...$calledMethods,
),
);
}
/**
- * @psalm-param class-string $testClassName
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testAfterTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void
+ public function afterTestMethodCalled(TestMethod $test, ClassMethod $calledMethod): void
{
$this->dispatcher->dispatch(
new Test\AfterTestMethodCalled(
$this->telemetryInfo(),
- $testClassName,
+ $test,
$calledMethod,
),
);
}
/**
- * @psalm-param class-string $testClassName
- *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testAfterTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void
+ public function afterTestMethodErrored(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void
+ {
+ $this->dispatcher->dispatch(
+ new Test\AfterTestMethodErrored(
+ $this->telemetryInfo(),
+ $test,
+ $calledMethod,
+ $throwable,
+ ),
+ );
+ }
+
+ /**
+ * @throws InvalidArgumentException
+ * @throws UnknownEventTypeException
+ */
+ public function afterTestMethodFailed(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void
+ {
+ $this->dispatcher->dispatch(
+ new Test\AfterTestMethodFailed(
+ $this->telemetryInfo(),
+ $test,
+ $calledMethod,
+ $throwable,
+ ),
+ );
+ }
+
+ /**
+ * @throws InvalidArgumentException
+ * @throws UnknownEventTypeException
+ */
+ public function afterTestMethodFinished(TestMethod $test, ClassMethod ...$calledMethods): void
{
$this->dispatcher->dispatch(
new Test\AfterTestMethodFinished(
$this->telemetryInfo(),
- $testClassName,
+ $test,
...$calledMethods,
),
);
}
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testAfterLastTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void
+ public function afterLastTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void
{
$this->dispatcher->dispatch(
new Test\AfterLastTestMethodCalled(
@@ -1063,12 +1183,48 @@ public function testAfterLastTestMethodCalled(string $testClassName, Code\ClassM
}
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testAfterLastTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void
+ public function afterLastTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void
+ {
+ $this->dispatcher->dispatch(
+ new Test\AfterLastTestMethodErrored(
+ $this->telemetryInfo(),
+ $testClassName,
+ $calledMethod,
+ $throwable,
+ ),
+ );
+ }
+
+ /**
+ * @param class-string $testClassName
+ *
+ * @throws InvalidArgumentException
+ * @throws UnknownEventTypeException
+ */
+ public function afterLastTestMethodFailed(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void
+ {
+ $this->dispatcher->dispatch(
+ new Test\AfterLastTestMethodFailed(
+ $this->telemetryInfo(),
+ $testClassName,
+ $calledMethod,
+ $throwable,
+ ),
+ );
+ }
+
+ /**
+ * @param class-string $testClassName
+ *
+ * @throws InvalidArgumentException
+ * @throws UnknownEventTypeException
+ */
+ public function afterLastTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void
{
$this->dispatcher->dispatch(
new Test\AfterLastTestMethodFinished(
@@ -1097,7 +1253,40 @@ public function testSuiteFinished(TestSuite $testSuite): void
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testRunnerTriggeredDeprecation(string $message): void
+ public function testRunnerStartedStaticAnalysisForCodeCoverage(): void
+ {
+ $this->dispatcher->dispatch(
+ new TestRunner\StaticAnalysisForCodeCoverageStarted(
+ $this->telemetryInfo(),
+ ),
+ );
+ }
+
+ /**
+ * @param non-negative-int $cacheHits
+ * @param non-negative-int $cacheMisses
+ *
+ * @throws InvalidArgumentException
+ * @throws UnknownEventTypeException
+ */
+ public function testRunnerFinishedStaticAnalysisForCodeCoverage(int $cacheHits, int $cacheMisses): void
+ {
+ $this->dispatcher->dispatch(
+ new TestRunner\StaticAnalysisForCodeCoverageFinished(
+ $this->telemetryInfo(),
+ $cacheHits,
+ $cacheMisses,
+ ),
+ );
+ }
+
+ /**
+ * @param non-empty-string $message
+ *
+ * @throws InvalidArgumentException
+ * @throws UnknownEventTypeException
+ */
+ public function testRunnerTriggeredPhpunitDeprecation(string $message): void
{
$this->dispatcher->dispatch(
new TestRunner\DeprecationTriggered(
@@ -1108,10 +1297,28 @@ public function testRunnerTriggeredDeprecation(string $message): void
}
/**
+ * @param non-empty-string $message
+ *
+ * @throws InvalidArgumentException
+ * @throws UnknownEventTypeException
+ */
+ public function testRunnerTriggeredPhpunitNotice(string $message): void
+ {
+ $this->dispatcher->dispatch(
+ new TestRunner\NoticeTriggered(
+ $this->telemetryInfo(),
+ $message,
+ ),
+ );
+ }
+
+ /**
+ * @param non-empty-string $message
+ *
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
- public function testRunnerTriggeredWarning(string $message): void
+ public function testRunnerTriggeredPhpunitWarning(string $message): void
{
$this->dispatcher->dispatch(
new TestRunner\WarningTriggered(
diff --git a/src/Event/Emitter/Emitter.php b/src/Event/Emitter/Emitter.php
index 65752daec7a..340e81767b1 100644
--- a/src/Event/Emitter/Emitter.php
+++ b/src/Event/Emitter/Emitter.php
@@ -11,33 +11,40 @@
use PHPUnit\Event\Code\ClassMethod;
use PHPUnit\Event\Code\ComparisonFailure;
+use PHPUnit\Event\Code\IssueTrigger\IssueTrigger;
+use PHPUnit\Event\Code\TestMethod;
use PHPUnit\Event\Code\Throwable;
use PHPUnit\Event\TestSuite\TestSuite;
-use PHPUnit\Framework\Constraint;
use PHPUnit\TextUI\Configuration\Configuration;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
interface Emitter
{
- public function exportObjects(): void;
-
- public function exportsObjects(): bool;
-
public function applicationStarted(): void;
public function testRunnerStarted(): void;
public function testRunnerConfigured(Configuration $configuration): void;
+ /**
+ * @param non-empty-string $filename
+ */
public function testRunnerBootstrapFinished(string $filename): void;
+ /**
+ * @param non-empty-string $filename
+ * @param non-empty-string $name
+ * @param non-empty-string $version
+ */
public function testRunnerLoadedExtensionFromPhar(string $filename, string $name, string $version): void;
/**
- * @psalm-param class-string $className
- * @psalm-param array $parameters
+ * @param class-string $className
+ * @param array $parameters
*/
public function testRunnerBootstrappedExtension(string $className, array $parameters): void;
@@ -59,103 +66,84 @@ public function testRunnerDisabledGarbageCollection(): void;
public function testRunnerTriggeredGarbageCollection(): void;
+ /**
+ * @param non-empty-string $message
+ */
public function testSuiteSkipped(TestSuite $testSuite, string $message): void;
public function testSuiteStarted(TestSuite $testSuite): void;
public function testPreparationStarted(Code\Test $test): void;
- public function testPreparationFailed(Code\Test $test): void;
+ public function testPreparationErrored(Code\Test $test, Throwable $throwable): void;
- /**
- * @psalm-param class-string $testClassName
- */
- public function testBeforeFirstTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void;
+ public function testPreparationFailed(Code\Test $test, Throwable $throwable): void;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
- public function testBeforeFirstTestMethodErrored(string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable): void;
+ public function beforeFirstTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
- public function testBeforeFirstTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void;
+ public function beforeFirstTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
- public function testBeforeTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void;
+ public function beforeFirstTestMethodFailed(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
- public function testBeforeTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void;
+ public function beforeFirstTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void;
- /**
- * @psalm-param class-string $testClassName
- */
- public function testPreConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void;
+ public function beforeTestMethodCalled(TestMethod $test, ClassMethod $calledMethod): void;
- /**
- * @psalm-param class-string $testClassName
- */
- public function testPreConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void;
+ public function beforeTestMethodErrored(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void;
- public function testPrepared(Code\Test $test): void;
+ public function beforeTestMethodFailed(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void;
- /**
- * @psalm-param class-string $className
- */
- public function testRegisteredComparator(string $className): void;
+ public function beforeTestMethodFinished(TestMethod $test, ClassMethod ...$calledMethods): void;
- public function testAssertionSucceeded(mixed $value, Constraint\Constraint $constraint, string $message): void;
+ public function preConditionCalled(TestMethod $test, ClassMethod $calledMethod): void;
- public function testAssertionFailed(mixed $value, Constraint\Constraint $constraint, string $message): void;
+ public function preConditionErrored(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void;
- /**
- * @psalm-param class-string $className
- */
- public function testCreatedMockObject(string $className): void;
+ public function preConditionFailed(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void;
- /**
- * @psalm-param list $interfaces
- */
- public function testCreatedMockObjectForIntersectionOfInterfaces(array $interfaces): void;
+ public function preConditionFinished(TestMethod $test, ClassMethod ...$calledMethods): void;
- /**
- * @psalm-param trait-string $traitName
- */
- public function testCreatedMockObjectForTrait(string $traitName): void;
+ public function testPrepared(Code\Test $test): void;
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*/
- public function testCreatedMockObjectForAbstractClass(string $className): void;
+ public function testRegisteredComparator(string $className): void;
/**
- * @psalm-param class-string $originalClassName
- * @psalm-param class-string $mockClassName
+ * @param class-string $className
*/
- public function testCreatedMockObjectFromWsdl(string $wsdlFile, string $originalClassName, string $mockClassName, array $methods, bool $callOriginalConstructor, array $options): void;
+ public function testCreatedMockObject(string $className): void;
/**
- * @psalm-param class-string $className
+ * @param list $interfaces
*/
- public function testCreatedPartialMockObject(string $className, string ...$methodNames): void;
+ public function testCreatedMockObjectForIntersectionOfInterfaces(array $interfaces): void;
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*/
- public function testCreatedTestProxy(string $className, array $constructorArguments): void;
+ public function testCreatedPartialMockObject(string $className, string ...$methodNames): void;
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*/
public function testCreatedStub(string $className): void;
/**
- * @psalm-param list $interfaces
+ * @param list $interfaces
*/
public function testCreatedStubForIntersectionOfInterfaces(array $interfaces): void;
@@ -165,74 +153,162 @@ public function testFailed(Code\Test $test, Throwable $throwable, ?ComparisonFai
public function testPassed(Code\Test $test): void;
+ /**
+ * @param non-empty-string $message
+ */
public function testConsideredRisky(Code\Test $test, string $message): void;
public function testMarkedAsIncomplete(Code\Test $test, Throwable $throwable): void;
+ /**
+ * @param non-empty-string $message
+ */
public function testSkipped(Code\Test $test, string $message): void;
+ /**
+ * @param non-empty-string $message
+ */
public function testTriggeredPhpunitDeprecation(?Code\Test $test, string $message): void;
- public function testTriggeredPhpDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest): void;
+ /**
+ * @param non-empty-string $message
+ */
+ public function testTriggeredPhpunitNotice(?Code\Test $test, string $message): void;
- public function testTriggeredDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest): void;
+ /**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ */
+ public function testTriggeredPhpDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest, IssueTrigger $trigger): void;
+
+ /**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ * @param non-empty-string $stackTrace
+ */
+ public function testTriggeredDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest, IssueTrigger $trigger, string $stackTrace): void;
+ /**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ */
public function testTriggeredError(Code\Test $test, string $message, string $file, int $line, bool $suppressed): void;
+ /**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ */
public function testTriggeredNotice(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void;
+ /**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ */
public function testTriggeredPhpNotice(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void;
+ /**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ */
public function testTriggeredWarning(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void;
+ /**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ */
public function testTriggeredPhpWarning(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void;
+ /**
+ * @param non-empty-string $message
+ */
public function testTriggeredPhpunitError(Code\Test $test, string $message): void;
+ /**
+ * @param non-empty-string $message
+ */
public function testTriggeredPhpunitWarning(Code\Test $test, string $message): void;
/**
- * @psalm-param non-empty-string $output
+ * @param non-empty-string $output
*/
public function testPrintedUnexpectedOutput(string $output): void;
+ /**
+ * @param non-negative-int $numberOfAssertionsPerformed
+ */
public function testFinished(Code\Test $test, int $numberOfAssertionsPerformed): void;
+ public function postConditionCalled(TestMethod $test, ClassMethod $calledMethod): void;
+
+ public function postConditionErrored(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void;
+
+ public function postConditionFailed(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void;
+
+ public function postConditionFinished(TestMethod $test, ClassMethod ...$calledMethods): void;
+
+ public function afterTestMethodCalled(TestMethod $test, ClassMethod $calledMethod): void;
+
+ public function afterTestMethodErrored(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void;
+
+ public function afterTestMethodFailed(TestMethod $test, ClassMethod $calledMethod, Throwable $throwable): void;
+
+ public function afterTestMethodFinished(TestMethod $test, ClassMethod ...$calledMethods): void;
+
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
- public function testPostConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void;
+ public function afterLastTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
- public function testPostConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void;
+ public function afterLastTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
- public function testAfterTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void;
+ public function afterLastTestMethodFailed(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
- public function testAfterTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void;
+ public function afterLastTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void;
+
+ public function testSuiteFinished(TestSuite $testSuite): void;
+
+ public function testRunnerStartedChildProcess(): void;
+
+ public function testRunnerFinishedChildProcess(string $stdout, string $stderr): void;
+
+ public function testRunnerStartedStaticAnalysisForCodeCoverage(): void;
/**
- * @psalm-param class-string $testClassName
+ * @param non-negative-int $cacheHits
+ * @param non-negative-int $cacheMisses
*/
- public function testAfterLastTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void;
+ public function testRunnerFinishedStaticAnalysisForCodeCoverage(int $cacheHits, int $cacheMisses): void;
/**
- * @psalm-param class-string $testClassName
+ * @param non-empty-string $message
*/
- public function testAfterLastTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void;
-
- public function testSuiteFinished(TestSuite $testSuite): void;
+ public function testRunnerTriggeredPhpunitDeprecation(string $message): void;
- public function testRunnerTriggeredDeprecation(string $message): void;
+ /**
+ * @param non-empty-string $message
+ */
+ public function testRunnerTriggeredPhpunitNotice(string $message): void;
- public function testRunnerTriggeredWarning(string $message): void;
+ /**
+ * @param non-empty-string $message
+ */
+ public function testRunnerTriggeredPhpunitWarning(string $message): void;
public function testRunnerEnabledGarbageCollection(): void;
diff --git a/src/Event/Events/Application/Finished.php b/src/Event/Events/Application/Finished.php
index 1f1791b0910..6e94da2a957 100644
--- a/src/Event/Events/Application/Finished.php
+++ b/src/Event/Events/Application/Finished.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -39,6 +39,9 @@ public function shellExitCode(): int
return $this->shellExitCode;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Application/Started.php b/src/Event/Events/Application/Started.php
index 21124322364..a9aa959a72a 100644
--- a/src/Event/Events/Application/Started.php
+++ b/src/Event/Events/Application/Started.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -40,6 +40,9 @@ public function runtime(): Runtime
return $this->runtime;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Event.php b/src/Event/Events/Event.php
index 8aa014b0abc..443ca7294a5 100644
--- a/src/Event/Events/Event.php
+++ b/src/Event/Events/Event.php
@@ -16,5 +16,8 @@ interface Event
{
public function telemetryInfo(): Telemetry\Info;
+ /**
+ * @return non-empty-string
+ */
public function asString(): string;
}
diff --git a/src/Event/Events/EventCollection.php b/src/Event/Events/EventCollection.php
index ecefb3763c6..7c691269294 100644
--- a/src/Event/Events/EventCollection.php
+++ b/src/Event/Events/EventCollection.php
@@ -21,7 +21,7 @@
final class EventCollection implements Countable, IteratorAggregate
{
/**
- * @psalm-var list
+ * @var list
*/
private array $events = [];
@@ -33,7 +33,7 @@ public function add(Event ...$events): void
}
/**
- * @psalm-return list
+ * @return list
*/
public function asArray(): array
{
diff --git a/src/Event/Events/EventCollectionIterator.php b/src/Event/Events/EventCollectionIterator.php
index 7a09fa405c3..d121dea6e40 100644
--- a/src/Event/Events/EventCollectionIterator.php
+++ b/src/Event/Events/EventCollectionIterator.php
@@ -20,7 +20,7 @@
final class EventCollectionIterator implements Iterator
{
/**
- * @psalm-var list
+ * @var list
*/
private readonly array $events;
private int $position = 0;
diff --git a/src/Event/Events/Test/Assertion/AssertionFailed.php b/src/Event/Events/Test/Assertion/AssertionFailed.php
deleted file mode 100644
index acc023565e5..00000000000
--- a/src/Event/Events/Test/Assertion/AssertionFailed.php
+++ /dev/null
@@ -1,74 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use function sprintf;
-use PHPUnit\Event\Event;
-use PHPUnit\Event\Telemetry;
-
-/**
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-final readonly class AssertionFailed implements Event
-{
- private Telemetry\Info $telemetryInfo;
- private string $value;
- private string $constraint;
- private int $count;
- private string $message;
-
- public function __construct(Telemetry\Info $telemetryInfo, string $value, string $constraint, int $count, string $message)
- {
- $this->telemetryInfo = $telemetryInfo;
- $this->value = $value;
- $this->constraint = $constraint;
- $this->count = $count;
- $this->message = $message;
- }
-
- public function telemetryInfo(): Telemetry\Info
- {
- return $this->telemetryInfo;
- }
-
- public function value(): string
- {
- return $this->value;
- }
-
- public function count(): int
- {
- return $this->count;
- }
-
- public function message(): string
- {
- return $this->message;
- }
-
- public function asString(): string
- {
- $message = '';
-
- if (!empty($this->message)) {
- $message = sprintf(
- ', Message: %s',
- $this->message,
- );
- }
-
- return sprintf(
- 'Assertion Failed (Constraint: %s, Value: %s%s)',
- $this->constraint,
- $this->value,
- $message,
- );
- }
-}
diff --git a/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php b/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php
deleted file mode 100644
index a14cd5f5e78..00000000000
--- a/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use PHPUnit\Event\Subscriber;
-
-/**
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-interface AssertionFailedSubscriber extends Subscriber
-{
- public function notify(AssertionFailed $event): void;
-}
diff --git a/src/Event/Events/Test/Assertion/AssertionSucceeded.php b/src/Event/Events/Test/Assertion/AssertionSucceeded.php
deleted file mode 100644
index 5163b298396..00000000000
--- a/src/Event/Events/Test/Assertion/AssertionSucceeded.php
+++ /dev/null
@@ -1,74 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use function sprintf;
-use PHPUnit\Event\Event;
-use PHPUnit\Event\Telemetry;
-
-/**
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-final readonly class AssertionSucceeded implements Event
-{
- private Telemetry\Info $telemetryInfo;
- private string $value;
- private string $constraint;
- private int $count;
- private string $message;
-
- public function __construct(Telemetry\Info $telemetryInfo, string $value, string $constraint, int $count, string $message)
- {
- $this->telemetryInfo = $telemetryInfo;
- $this->value = $value;
- $this->constraint = $constraint;
- $this->count = $count;
- $this->message = $message;
- }
-
- public function telemetryInfo(): Telemetry\Info
- {
- return $this->telemetryInfo;
- }
-
- public function value(): string
- {
- return $this->value;
- }
-
- public function count(): int
- {
- return $this->count;
- }
-
- public function message(): string
- {
- return $this->message;
- }
-
- public function asString(): string
- {
- $message = '';
-
- if (!empty($this->message)) {
- $message = sprintf(
- ', Message: %s',
- $this->message,
- );
- }
-
- return sprintf(
- 'Assertion Succeeded (Constraint: %s, Value: %s%s)',
- $this->constraint,
- $this->value,
- $message,
- );
- }
-}
diff --git a/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php b/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php
deleted file mode 100644
index 535860a382d..00000000000
--- a/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use PHPUnit\Event\Subscriber;
-
-/**
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-interface AssertionSucceededSubscriber extends Subscriber
-{
- public function notify(AssertionSucceeded $event): void;
-}
diff --git a/src/Event/Events/Test/ComparatorRegistered.php b/src/Event/Events/Test/ComparatorRegistered.php
index dfbb5909fe9..893601c36f0 100644
--- a/src/Event/Events/Test/ComparatorRegistered.php
+++ b/src/Event/Events/Test/ComparatorRegistered.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -23,12 +23,12 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $className;
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*/
public function __construct(Telemetry\Info $telemetryInfo, string $className)
{
@@ -42,13 +42,16 @@ public function telemetryInfo(): Telemetry\Info
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function className(): string
{
return $this->className;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalled.php b/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalled.php
index 9924ffb9af3..8643b206836 100644
--- a/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalled.php
+++ b/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalled.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -24,13 +24,13 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $testClassName;
private Code\ClassMethod $calledMethod;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod)
{
@@ -45,7 +45,7 @@ public function telemetryInfo(): Telemetry\Info
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function testClassName(): string
{
@@ -57,6 +57,9 @@ public function calledMethod(): Code\ClassMethod
return $this->calledMethod;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/HookMethod/AfterLastTestMethodErrored.php b/src/Event/Events/Test/HookMethod/AfterLastTestMethodErrored.php
new file mode 100644
index 00000000000..3dffce257c2
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/AfterLastTestMethodErrored.php
@@ -0,0 +1,87 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class AfterLastTestMethodErrored implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+
+ /**
+ * @var class-string
+ */
+ private string $testClassName;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ /**
+ * @param class-string $testClassName
+ */
+ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->testClassName = $testClassName;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ /**
+ * @return class-string
+ */
+ public function testClassName(): string
+ {
+ return $this->testClassName;
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'After Last Test Method Errored (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/AfterLastTestMethodErroredSubscriber.php b/src/Event/Events/Test/HookMethod/AfterLastTestMethodErroredSubscriber.php
new file mode 100644
index 00000000000..b994fdeb2f1
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/AfterLastTestMethodErroredSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface AfterLastTestMethodErroredSubscriber extends Subscriber
+{
+ public function notify(AfterLastTestMethodErrored $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/AfterLastTestMethodFailed.php b/src/Event/Events/Test/HookMethod/AfterLastTestMethodFailed.php
new file mode 100644
index 00000000000..70b16853927
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/AfterLastTestMethodFailed.php
@@ -0,0 +1,87 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class AfterLastTestMethodFailed implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+
+ /**
+ * @var class-string
+ */
+ private string $testClassName;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ /**
+ * @param class-string $testClassName
+ */
+ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->testClassName = $testClassName;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ /**
+ * @return class-string
+ */
+ public function testClassName(): string
+ {
+ return $this->testClassName;
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'After Last Test Method Failed (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/AfterLastTestMethodFailedSubscriber.php b/src/Event/Events/Test/HookMethod/AfterLastTestMethodFailedSubscriber.php
new file mode 100644
index 00000000000..3b011bd9935
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/AfterLastTestMethodFailedSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface AfterLastTestMethodFailedSubscriber extends Subscriber
+{
+ public function notify(AfterLastTestMethodFailed $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinished.php b/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinished.php
index 1ba74612bcf..c4a2dd9555c 100644
--- a/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinished.php
+++ b/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinished.php
@@ -16,7 +16,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -25,17 +25,17 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $testClassName;
/**
- * @psalm-var list
+ * @var list
*/
private array $calledMethods;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods)
{
@@ -50,7 +50,7 @@ public function telemetryInfo(): Telemetry\Info
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function testClassName(): string
{
@@ -58,13 +58,16 @@ public function testClassName(): string
}
/**
- * @psalm-return list
+ * @return list
*/
public function calledMethods(): array
{
return $this->calledMethods;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$buffer = 'After Last Test Method Finished:';
diff --git a/src/Event/Events/Test/HookMethod/AfterTestMethodCalled.php b/src/Event/Events/Test/HookMethod/AfterTestMethodCalled.php
index d096b965857..93c4e12cb64 100644
--- a/src/Event/Events/Test/HookMethod/AfterTestMethodCalled.php
+++ b/src/Event/Events/Test/HookMethod/AfterTestMethodCalled.php
@@ -15,27 +15,20 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class AfterTestMethodCalled implements Event
{
private Telemetry\Info $telemetryInfo;
-
- /**
- * @psalm-var class-string
- */
- private string $testClassName;
+ private Code\TestMethod $test;
private Code\ClassMethod $calledMethod;
- /**
- * @psalm-param class-string $testClassName
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod)
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod)
{
$this->telemetryInfo = $telemetryInfo;
- $this->testClassName = $testClassName;
+ $this->test = $test;
$this->calledMethod = $calledMethod;
}
@@ -44,12 +37,19 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
/**
- * @psalm-return class-string
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
*/
public function testClassName(): string
{
- return $this->testClassName;
+ return $this->test->className();
}
public function calledMethod(): Code\ClassMethod
@@ -57,6 +57,9 @@ public function calledMethod(): Code\ClassMethod
return $this->calledMethod;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/HookMethod/AfterTestMethodErrored.php b/src/Event/Events/Test/HookMethod/AfterTestMethodErrored.php
new file mode 100644
index 00000000000..fd277e2d0eb
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/AfterTestMethodErrored.php
@@ -0,0 +1,87 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class AfterTestMethodErrored implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->test = $test;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
+ /**
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
+ */
+ public function testClassName(): string
+ {
+ return $this->test->className();
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'After Test Method Errored (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/AfterTestMethodErroredSubscriber.php b/src/Event/Events/Test/HookMethod/AfterTestMethodErroredSubscriber.php
new file mode 100644
index 00000000000..622f91625d9
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/AfterTestMethodErroredSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface AfterTestMethodErroredSubscriber extends Subscriber
+{
+ public function notify(AfterTestMethodErrored $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/AfterTestMethodFailed.php b/src/Event/Events/Test/HookMethod/AfterTestMethodFailed.php
new file mode 100644
index 00000000000..e405066f7ef
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/AfterTestMethodFailed.php
@@ -0,0 +1,77 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class AfterTestMethodFailed implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->test = $test;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'After Test Method Failed (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/AfterTestMethodFailedSubscriber.php b/src/Event/Events/Test/HookMethod/AfterTestMethodFailedSubscriber.php
new file mode 100644
index 00000000000..16134322a63
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/AfterTestMethodFailedSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface AfterTestMethodFailedSubscriber extends Subscriber
+{
+ public function notify(AfterTestMethodFailed $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php b/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php
index 5431d5f94d3..f897198e0df 100644
--- a/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php
+++ b/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php
@@ -16,31 +16,24 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class AfterTestMethodFinished implements Event
{
private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
/**
- * @psalm-var class-string
- */
- private string $testClassName;
-
- /**
- * @psalm-var list
+ * @var list
*/
private array $calledMethods;
- /**
- * @psalm-param class-string $testClassName
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods)
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod ...$calledMethods)
{
$this->telemetryInfo = $telemetryInfo;
- $this->testClassName = $testClassName;
+ $this->test = $test;
$this->calledMethods = $calledMethods;
}
@@ -49,22 +42,32 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
/**
- * @psalm-return class-string
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
*/
public function testClassName(): string
{
- return $this->testClassName;
+ return $this->test->className();
}
/**
- * @psalm-return list
+ * @return list
*/
public function calledMethods(): array
{
return $this->calledMethods;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$buffer = 'After Test Method Finished:';
diff --git a/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalled.php b/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalled.php
index 58381ec2448..3c6ee0102ca 100644
--- a/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalled.php
+++ b/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalled.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -24,13 +24,13 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $testClassName;
private Code\ClassMethod $calledMethod;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod)
{
@@ -45,7 +45,7 @@ public function telemetryInfo(): Telemetry\Info
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function testClassName(): string
{
@@ -57,6 +57,9 @@ public function calledMethod(): Code\ClassMethod
return $this->calledMethod;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodErrored.php b/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodErrored.php
index afe1002f021..f142b1bd526 100644
--- a/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodErrored.php
+++ b/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodErrored.php
@@ -9,6 +9,7 @@
*/
namespace PHPUnit\Event\Test;
+use const PHP_EOL;
use function sprintf;
use PHPUnit\Event\Code;
use PHPUnit\Event\Code\Throwable;
@@ -16,7 +17,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -25,14 +26,14 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $testClassName;
private Code\ClassMethod $calledMethod;
private Throwable $throwable;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable)
{
@@ -48,7 +49,7 @@ public function telemetryInfo(): Telemetry\Info
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function testClassName(): string
{
@@ -65,11 +66,14 @@ public function throwable(): Throwable
return $this->throwable;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->throwable->message();
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
diff --git a/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFailed.php b/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFailed.php
new file mode 100644
index 00000000000..c400838f9c9
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFailed.php
@@ -0,0 +1,87 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class BeforeFirstTestMethodFailed implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+
+ /**
+ * @var class-string
+ */
+ private string $testClassName;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ /**
+ * @param class-string $testClassName
+ */
+ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->testClassName = $testClassName;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ /**
+ * @return class-string
+ */
+ public function testClassName(): string
+ {
+ return $this->testClassName;
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'Before First Test Method Failed (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFailedSubscriber.php b/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFailedSubscriber.php
new file mode 100644
index 00000000000..4e0b7eff7b9
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFailedSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface BeforeFirstTestMethodFailedSubscriber extends Subscriber
+{
+ public function notify(BeforeFirstTestMethodFailed $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFinished.php b/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFinished.php
index b23857feb25..5a2cb762784 100644
--- a/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFinished.php
+++ b/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFinished.php
@@ -16,7 +16,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -25,17 +25,17 @@
private Telemetry\Info$telemetryInfo;
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $testClassName;
/**
- * @psalm-var list
+ * @var list
*/
private array $calledMethods;
/**
- * @psalm-param class-string $testClassName
+ * @param class-string $testClassName
*/
public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods)
{
@@ -50,7 +50,7 @@ public function telemetryInfo(): Telemetry\Info
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function testClassName(): string
{
@@ -58,13 +58,16 @@ public function testClassName(): string
}
/**
- * @psalm-return list
+ * @return list
*/
public function calledMethods(): array
{
return $this->calledMethods;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$buffer = 'Before First Test Method Finished:';
diff --git a/src/Event/Events/Test/HookMethod/BeforeTestMethodCalled.php b/src/Event/Events/Test/HookMethod/BeforeTestMethodCalled.php
index f3b9846a636..2927a6851f2 100644
--- a/src/Event/Events/Test/HookMethod/BeforeTestMethodCalled.php
+++ b/src/Event/Events/Test/HookMethod/BeforeTestMethodCalled.php
@@ -15,27 +15,20 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class BeforeTestMethodCalled implements Event
{
private Telemetry\Info $telemetryInfo;
-
- /**
- * @psalm-var class-string
- */
- private string $testClassName;
+ private Code\TestMethod $test;
private Code\ClassMethod $calledMethod;
- /**
- * @psalm-param class-string $testClassName
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod)
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod)
{
$this->telemetryInfo = $telemetryInfo;
- $this->testClassName = $testClassName;
+ $this->test = $test;
$this->calledMethod = $calledMethod;
}
@@ -44,12 +37,19 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
/**
- * @psalm-return class-string
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
*/
public function testClassName(): string
{
- return $this->testClassName;
+ return $this->test->className();
}
public function calledMethod(): Code\ClassMethod
@@ -57,6 +57,9 @@ public function calledMethod(): Code\ClassMethod
return $this->calledMethod;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/HookMethod/BeforeTestMethodErrored.php b/src/Event/Events/Test/HookMethod/BeforeTestMethodErrored.php
new file mode 100644
index 00000000000..7e18a0c652b
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/BeforeTestMethodErrored.php
@@ -0,0 +1,87 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class BeforeTestMethodErrored implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->test = $test;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
+ /**
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
+ */
+ public function testClassName(): string
+ {
+ return $this->test->className();
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'Before Test Method Errored (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/BeforeTestMethodErroredSubscriber.php b/src/Event/Events/Test/HookMethod/BeforeTestMethodErroredSubscriber.php
new file mode 100644
index 00000000000..e53771c4944
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/BeforeTestMethodErroredSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface BeforeTestMethodErroredSubscriber extends Subscriber
+{
+ public function notify(BeforeTestMethodErrored $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/BeforeTestMethodFailed.php b/src/Event/Events/Test/HookMethod/BeforeTestMethodFailed.php
new file mode 100644
index 00000000000..95b46e4107e
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/BeforeTestMethodFailed.php
@@ -0,0 +1,77 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class BeforeTestMethodFailed implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->test = $test;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'Before Test Method Failed (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/BeforeTestMethodFailedSubscriber.php b/src/Event/Events/Test/HookMethod/BeforeTestMethodFailedSubscriber.php
new file mode 100644
index 00000000000..0f9f071cea5
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/BeforeTestMethodFailedSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface BeforeTestMethodFailedSubscriber extends Subscriber
+{
+ public function notify(BeforeTestMethodFailed $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/BeforeTestMethodFinished.php b/src/Event/Events/Test/HookMethod/BeforeTestMethodFinished.php
index 034abd817ab..971ad06bbf5 100644
--- a/src/Event/Events/Test/HookMethod/BeforeTestMethodFinished.php
+++ b/src/Event/Events/Test/HookMethod/BeforeTestMethodFinished.php
@@ -16,31 +16,24 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class BeforeTestMethodFinished implements Event
{
private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
/**
- * @psalm-var class-string
- */
- private string $testClassName;
-
- /**
- * @psalm-var list
+ * @var list
*/
private array $calledMethods;
- /**
- * @psalm-param class-string $testClassName
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods)
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod ...$calledMethods)
{
$this->telemetryInfo = $telemetryInfo;
- $this->testClassName = $testClassName;
+ $this->test = $test;
$this->calledMethods = $calledMethods;
}
@@ -49,22 +42,32 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
/**
- * @psalm-return class-string
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
*/
public function testClassName(): string
{
- return $this->testClassName;
+ return $this->test->className();
}
/**
- * @psalm-return list
+ * @return list
*/
public function calledMethods(): array
{
return $this->calledMethods;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$buffer = 'Before Test Method Finished:';
diff --git a/src/Event/Events/Test/HookMethod/PostConditionCalled.php b/src/Event/Events/Test/HookMethod/PostConditionCalled.php
index ac7a1e3f1c1..2035f64322e 100644
--- a/src/Event/Events/Test/HookMethod/PostConditionCalled.php
+++ b/src/Event/Events/Test/HookMethod/PostConditionCalled.php
@@ -15,27 +15,20 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class PostConditionCalled implements Event
{
private Telemetry\Info $telemetryInfo;
-
- /**
- * @psalm-var class-string
- */
- private string $testClassName;
+ private Code\TestMethod $test;
private Code\ClassMethod $calledMethod;
- /**
- * @psalm-param class-string $testClassName
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod)
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod)
{
$this->telemetryInfo = $telemetryInfo;
- $this->testClassName = $testClassName;
+ $this->test = $test;
$this->calledMethod = $calledMethod;
}
@@ -44,12 +37,19 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
/**
- * @psalm-return class-string
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
*/
public function testClassName(): string
{
- return $this->testClassName;
+ return $this->test->className();
}
public function calledMethod(): Code\ClassMethod
@@ -57,6 +57,9 @@ public function calledMethod(): Code\ClassMethod
return $this->calledMethod;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/HookMethod/PostConditionErrored.php b/src/Event/Events/Test/HookMethod/PostConditionErrored.php
new file mode 100644
index 00000000000..29cfe0d64df
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/PostConditionErrored.php
@@ -0,0 +1,87 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class PostConditionErrored implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->test = $test;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
+ /**
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
+ */
+ public function testClassName(): string
+ {
+ return $this->test->className();
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'Post Condition Method Errored (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/PostConditionErroredSubscriber.php b/src/Event/Events/Test/HookMethod/PostConditionErroredSubscriber.php
new file mode 100644
index 00000000000..7bd2c54ce70
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/PostConditionErroredSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface PostConditionErroredSubscriber extends Subscriber
+{
+ public function notify(PostConditionErrored $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/PostConditionFailed.php b/src/Event/Events/Test/HookMethod/PostConditionFailed.php
new file mode 100644
index 00000000000..cb48689730f
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/PostConditionFailed.php
@@ -0,0 +1,77 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class PostConditionFailed implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->test = $test;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'Post Condition Method Failed (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/PostConditionFailedSubscriber.php b/src/Event/Events/Test/HookMethod/PostConditionFailedSubscriber.php
new file mode 100644
index 00000000000..e6ff7557aa0
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/PostConditionFailedSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface PostConditionFailedSubscriber extends Subscriber
+{
+ public function notify(PostConditionFailed $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/PostConditionFinished.php b/src/Event/Events/Test/HookMethod/PostConditionFinished.php
index 52d9676e81e..0910a2a8bfd 100644
--- a/src/Event/Events/Test/HookMethod/PostConditionFinished.php
+++ b/src/Event/Events/Test/HookMethod/PostConditionFinished.php
@@ -16,31 +16,24 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class PostConditionFinished implements Event
{
private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
/**
- * @psalm-var class-string
- */
- private string $testClassName;
-
- /**
- * @psalm-var list
+ * @var list
*/
private array $calledMethods;
- /**
- * @psalm-param class-string $testClassName
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods)
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod ...$calledMethods)
{
$this->telemetryInfo = $telemetryInfo;
- $this->testClassName = $testClassName;
+ $this->test = $test;
$this->calledMethods = $calledMethods;
}
@@ -49,22 +42,32 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
/**
- * @psalm-return class-string
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
*/
public function testClassName(): string
{
- return $this->testClassName;
+ return $this->test->className();
}
/**
- * @psalm-return list
+ * @return list
*/
public function calledMethods(): array
{
return $this->calledMethods;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$buffer = 'Post Condition Method Finished:';
diff --git a/src/Event/Events/Test/HookMethod/PreConditionCalled.php b/src/Event/Events/Test/HookMethod/PreConditionCalled.php
index 41ab3855f78..80a10ee15b2 100644
--- a/src/Event/Events/Test/HookMethod/PreConditionCalled.php
+++ b/src/Event/Events/Test/HookMethod/PreConditionCalled.php
@@ -15,27 +15,20 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class PreConditionCalled implements Event
{
private Telemetry\Info$telemetryInfo;
-
- /**
- * @psalm-var class-string
- */
- private string $testClassName;
+ private Code\TestMethod $test;
private Code\ClassMethod $calledMethod;
- /**
- * @psalm-param class-string $testClassName
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod)
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod)
{
$this->telemetryInfo = $telemetryInfo;
- $this->testClassName = $testClassName;
+ $this->test = $test;
$this->calledMethod = $calledMethod;
}
@@ -44,12 +37,19 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
/**
- * @psalm-return class-string
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
*/
public function testClassName(): string
{
- return $this->testClassName;
+ return $this->test->className();
}
public function calledMethod(): Code\ClassMethod
@@ -57,6 +57,9 @@ public function calledMethod(): Code\ClassMethod
return $this->calledMethod;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/HookMethod/PreConditionErrored.php b/src/Event/Events/Test/HookMethod/PreConditionErrored.php
new file mode 100644
index 00000000000..f2773d98103
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/PreConditionErrored.php
@@ -0,0 +1,87 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class PreConditionErrored implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->test = $test;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
+ /**
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
+ */
+ public function testClassName(): string
+ {
+ return $this->test->className();
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'Pre Condition Method Errored (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/PreConditionErroredSubscriber.php b/src/Event/Events/Test/HookMethod/PreConditionErroredSubscriber.php
new file mode 100644
index 00000000000..3465040bbeb
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/PreConditionErroredSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface PreConditionErroredSubscriber extends Subscriber
+{
+ public function notify(PreConditionErrored $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/PreConditionFailed.php b/src/Event/Events/Test/HookMethod/PreConditionFailed.php
new file mode 100644
index 00000000000..bf94de21179
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/PreConditionFailed.php
@@ -0,0 +1,77 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class PreConditionFailed implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
+ private Code\ClassMethod $calledMethod;
+ private Throwable $throwable;
+
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod $calledMethod, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->test = $test;
+ $this->calledMethod = $calledMethod;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
+ public function calledMethod(): Code\ClassMethod
+ {
+ return $this->calledMethod;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'Pre Condition Method Failed (%s::%s)%s',
+ $this->calledMethod->className(),
+ $this->calledMethod->methodName(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/HookMethod/PreConditionFailedSubscriber.php b/src/Event/Events/Test/HookMethod/PreConditionFailedSubscriber.php
new file mode 100644
index 00000000000..26ce7cdce2c
--- /dev/null
+++ b/src/Event/Events/Test/HookMethod/PreConditionFailedSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface PreConditionFailedSubscriber extends Subscriber
+{
+ public function notify(PreConditionFailed $event): void;
+}
diff --git a/src/Event/Events/Test/HookMethod/PreConditionFinished.php b/src/Event/Events/Test/HookMethod/PreConditionFinished.php
index f6e3ac80e05..8a708ee05cd 100644
--- a/src/Event/Events/Test/HookMethod/PreConditionFinished.php
+++ b/src/Event/Events/Test/HookMethod/PreConditionFinished.php
@@ -16,31 +16,24 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class PreConditionFinished implements Event
{
private Telemetry\Info $telemetryInfo;
+ private Code\TestMethod $test;
/**
- * @psalm-var class-string
- */
- private string $testClassName;
-
- /**
- * @psalm-var list
+ * @var list
*/
private array $calledMethods;
- /**
- * @psalm-param class-string $testClassName
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods)
+ public function __construct(Telemetry\Info $telemetryInfo, Code\TestMethod $test, Code\ClassMethod ...$calledMethods)
{
$this->telemetryInfo = $telemetryInfo;
- $this->testClassName = $testClassName;
+ $this->test = $test;
$this->calledMethods = $calledMethods;
}
@@ -49,22 +42,32 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ public function test(): Code\TestMethod
+ {
+ return $this->test;
+ }
+
/**
- * @psalm-return class-string
+ * @return class-string
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6140
*/
public function testClassName(): string
{
- return $this->testClassName;
+ return $this->test->className();
}
/**
- * @psalm-return list
+ * @return list
*/
public function calledMethods(): array
{
return $this->calledMethods;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$buffer = 'Pre Condition Method Finished:';
diff --git a/src/Event/Events/Test/Issue/ConsideredRisky.php b/src/Event/Events/Test/Issue/ConsideredRisky.php
index 742efede266..306c04e7d50 100644
--- a/src/Event/Events/Test/Issue/ConsideredRisky.php
+++ b/src/Event/Events/Test/Issue/ConsideredRisky.php
@@ -16,7 +16,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -26,12 +26,12 @@
private Code\Test $test;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $message;
/**
- * @psalm-param non-empty-string $message
+ * @param non-empty-string $message
*/
public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, string $message)
{
@@ -51,13 +51,16 @@ public function test(): Code\Test
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function message(): string
{
return $this->message;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/Issue/DeprecationTriggered.php b/src/Event/Events/Test/Issue/DeprecationTriggered.php
index 4d7c9792ac3..09ec56fc8c7 100644
--- a/src/Event/Events/Test/Issue/DeprecationTriggered.php
+++ b/src/Event/Events/Test/Issue/DeprecationTriggered.php
@@ -10,13 +10,15 @@
namespace PHPUnit\Event\Test;
use const PHP_EOL;
+use function implode;
use function sprintf;
+use PHPUnit\Event\Code\IssueTrigger\IssueTrigger;
use PHPUnit\Event\Code\Test;
use PHPUnit\Event\Event;
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -26,29 +28,36 @@
private Test $test;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $message;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $file;
/**
- * @psalm-var positive-int
+ * @var positive-int
*/
private int $line;
private bool $suppressed;
private bool $ignoredByBaseline;
private bool $ignoredByTest;
+ private IssueTrigger $trigger;
/**
- * @psalm-param non-empty-string $message
- * @psalm-param non-empty-string $file
- * @psalm-param positive-int $line
+ * @var non-empty-string
*/
- public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest)
+ private string $stackTrace;
+
+ /**
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
+ * @param non-empty-string $stackTrace
+ */
+ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest, IssueTrigger $trigger, string $stackTrace)
{
$this->telemetryInfo = $telemetryInfo;
$this->test = $test;
@@ -58,6 +67,8 @@ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $m
$this->suppressed = $suppressed;
$this->ignoredByBaseline = $ignoredByBaseline;
$this->ignoredByTest = $ignoredByTest;
+ $this->trigger = $trigger;
+ $this->stackTrace = $stackTrace;
}
public function telemetryInfo(): Telemetry\Info
@@ -71,7 +82,7 @@ public function test(): Test
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function message(): string
{
@@ -79,7 +90,7 @@ public function message(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function file(): string
{
@@ -87,7 +98,7 @@ public function file(): string
}
/**
- * @psalm-return positive-int
+ * @return positive-int
*/
public function line(): int
{
@@ -109,28 +120,49 @@ public function ignoredByTest(): bool
return $this->ignoredByTest;
}
+ public function trigger(): IssueTrigger
+ {
+ return $this->trigger;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function stackTrace(): string
+ {
+ return $this->stackTrace;
+ }
+
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->message;
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
- $status = '';
+ $details = [$this->test->id(), $this->trigger->asString()];
+
+ if ($this->suppressed) {
+ $details[] = 'suppressed using operator';
+ }
if ($this->ignoredByTest) {
- $status = 'Test-Ignored ';
- } elseif ($this->ignoredByBaseline) {
- $status = 'Baseline-Ignored ';
- } elseif ($this->suppressed) {
- $status = 'Suppressed ';
+ $details[] = 'ignored by test';
+ }
+
+ if ($this->ignoredByBaseline) {
+ $details[] = 'ignored by baseline';
}
return sprintf(
- 'Test Triggered %sDeprecation (%s)%s',
- $status,
- $this->test->id(),
+ 'Test Triggered Deprecation (%s) in %s:%d%s',
+ implode(', ', $details),
+ $this->file,
+ $this->line,
$message,
);
}
diff --git a/src/Event/Events/Test/Issue/ErrorTriggered.php b/src/Event/Events/Test/Issue/ErrorTriggered.php
index f98cb0b4b82..7faefc634ce 100644
--- a/src/Event/Events/Test/Issue/ErrorTriggered.php
+++ b/src/Event/Events/Test/Issue/ErrorTriggered.php
@@ -10,13 +10,14 @@
namespace PHPUnit\Event\Test;
use const PHP_EOL;
+use function implode;
use function sprintf;
use PHPUnit\Event\Code\Test;
use PHPUnit\Event\Event;
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -26,25 +27,25 @@
private Test $test;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $message;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $file;
/**
- * @psalm-var positive-int
+ * @var positive-int
*/
private int $line;
private bool $suppressed;
/**
- * @psalm-param non-empty-string $message
- * @psalm-param non-empty-string $file
- * @psalm-param positive-int $line
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
*/
public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed)
{
@@ -67,7 +68,7 @@ public function test(): Test
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function message(): string
{
@@ -75,7 +76,7 @@ public function message(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function file(): string
{
@@ -83,7 +84,7 @@ public function file(): string
}
/**
- * @psalm-return positive-int
+ * @return positive-int
*/
public function line(): int
{
@@ -95,18 +96,28 @@ public function wasSuppressed(): bool
return $this->suppressed;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->message;
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
+ $details = [$this->test->id()];
+
+ if ($this->suppressed) {
+ $details[] = 'suppressed using operator';
+ }
+
return sprintf(
- 'Test Triggered %sError (%s)%s',
- $this->wasSuppressed() ? 'Suppressed ' : '',
- $this->test->id(),
+ 'Test Triggered Error (%s) in %s:%d%s',
+ implode(', ', $details),
+ $this->file,
+ $this->line,
$message,
);
}
diff --git a/src/Event/Events/Test/Issue/NoticeTriggered.php b/src/Event/Events/Test/Issue/NoticeTriggered.php
index cf507ade038..237e1f18ac8 100644
--- a/src/Event/Events/Test/Issue/NoticeTriggered.php
+++ b/src/Event/Events/Test/Issue/NoticeTriggered.php
@@ -10,13 +10,14 @@
namespace PHPUnit\Event\Test;
use const PHP_EOL;
+use function implode;
use function sprintf;
use PHPUnit\Event\Code\Test;
use PHPUnit\Event\Event;
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -26,26 +27,26 @@
private Test $test;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $message;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $file;
/**
- * @psalm-var positive-int
+ * @var positive-int
*/
private int $line;
private bool $suppressed;
private bool $ignoredByBaseline;
/**
- * @psalm-param non-empty-string $message
- * @psalm-param non-empty-string $file
- * @psalm-param positive-int $line
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
*/
public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline)
{
@@ -69,7 +70,7 @@ public function test(): Test
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function message(): string
{
@@ -77,7 +78,7 @@ public function message(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function file(): string
{
@@ -85,7 +86,7 @@ public function file(): string
}
/**
- * @psalm-return positive-int
+ * @return positive-int
*/
public function line(): int
{
@@ -102,26 +103,32 @@ public function ignoredByBaseline(): bool
return $this->ignoredByBaseline;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->message;
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
- $status = '';
+ $details = [$this->test->id()];
+
+ if ($this->suppressed) {
+ $details[] = 'suppressed using operator';
+ }
if ($this->ignoredByBaseline) {
- $status = 'Baseline-Ignored ';
- } elseif ($this->suppressed) {
- $status = 'Suppressed ';
+ $details[] = 'ignored by baseline';
}
return sprintf(
- 'Test Triggered %sNotice (%s)%s',
- $status,
- $this->test->id(),
+ 'Test Triggered Notice (%s) in %s:%d%s',
+ implode(', ', $details),
+ $this->file,
+ $this->line,
$message,
);
}
diff --git a/src/Event/Events/Test/Issue/PhpDeprecationTriggered.php b/src/Event/Events/Test/Issue/PhpDeprecationTriggered.php
index f7205e55c9f..5b9878ad40f 100644
--- a/src/Event/Events/Test/Issue/PhpDeprecationTriggered.php
+++ b/src/Event/Events/Test/Issue/PhpDeprecationTriggered.php
@@ -10,13 +10,15 @@
namespace PHPUnit\Event\Test;
use const PHP_EOL;
+use function implode;
use function sprintf;
+use PHPUnit\Event\Code\IssueTrigger\IssueTrigger;
use PHPUnit\Event\Code\Test;
use PHPUnit\Event\Event;
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -26,29 +28,30 @@
private Test $test;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $message;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $file;
/**
- * @psalm-var positive-int
+ * @var positive-int
*/
private int $line;
private bool $suppressed;
private bool $ignoredByBaseline;
private bool $ignoredByTest;
+ private IssueTrigger $trigger;
/**
- * @psalm-param non-empty-string $message
- * @psalm-param non-empty-string $file
- * @psalm-param positive-int $line
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
*/
- public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest)
+ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest, IssueTrigger $trigger)
{
$this->telemetryInfo = $telemetryInfo;
$this->test = $test;
@@ -58,6 +61,7 @@ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $m
$this->suppressed = $suppressed;
$this->ignoredByBaseline = $ignoredByBaseline;
$this->ignoredByTest = $ignoredByTest;
+ $this->trigger = $trigger;
}
public function telemetryInfo(): Telemetry\Info
@@ -71,7 +75,7 @@ public function test(): Test
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function message(): string
{
@@ -79,7 +83,7 @@ public function message(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function file(): string
{
@@ -87,7 +91,7 @@ public function file(): string
}
/**
- * @psalm-return positive-int
+ * @return positive-int
*/
public function line(): int
{
@@ -109,28 +113,41 @@ public function ignoredByTest(): bool
return $this->ignoredByTest;
}
+ public function trigger(): IssueTrigger
+ {
+ return $this->trigger;
+ }
+
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->message;
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
- $status = '';
+ $details = [$this->test->id(), $this->trigger->asString()];
+
+ if ($this->suppressed) {
+ $details[] = 'suppressed using operator';
+ }
if ($this->ignoredByTest) {
- $status = 'Test-Ignored ';
- } elseif ($this->ignoredByBaseline) {
- $status = 'Baseline-Ignored ';
- } elseif ($this->suppressed) {
- $status = 'Suppressed ';
+ $details[] = 'ignored by test';
+ }
+
+ if ($this->ignoredByBaseline) {
+ $details[] = 'ignored by baseline';
}
return sprintf(
- 'Test Triggered %sPHP Deprecation (%s)%s',
- $status,
- $this->test->id(),
+ 'Test Triggered PHP Deprecation (%s) in %s:%d%s',
+ implode(', ', $details),
+ $this->file,
+ $this->line,
$message,
);
}
diff --git a/src/Event/Events/Test/Issue/PhpNoticeTriggered.php b/src/Event/Events/Test/Issue/PhpNoticeTriggered.php
index 41f77767809..ad976cfcff2 100644
--- a/src/Event/Events/Test/Issue/PhpNoticeTriggered.php
+++ b/src/Event/Events/Test/Issue/PhpNoticeTriggered.php
@@ -10,13 +10,14 @@
namespace PHPUnit\Event\Test;
use const PHP_EOL;
+use function implode;
use function sprintf;
use PHPUnit\Event\Code\Test;
use PHPUnit\Event\Event;
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -26,26 +27,26 @@
private Test $test;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $message;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $file;
/**
- * @psalm-var positive-int
+ * @var positive-int
*/
private int $line;
private bool $suppressed;
private bool $ignoredByBaseline;
/**
- * @psalm-param non-empty-string $message
- * @psalm-param non-empty-string $file
- * @psalm-param positive-int $line
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
*/
public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline)
{
@@ -69,7 +70,7 @@ public function test(): Test
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function message(): string
{
@@ -77,7 +78,7 @@ public function message(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function file(): string
{
@@ -85,7 +86,7 @@ public function file(): string
}
/**
- * @psalm-return positive-int
+ * @return positive-int
*/
public function line(): int
{
@@ -102,26 +103,32 @@ public function ignoredByBaseline(): bool
return $this->ignoredByBaseline;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->message;
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
- $status = '';
+ $details = [$this->test->id()];
+
+ if ($this->suppressed) {
+ $details[] = 'suppressed using operator';
+ }
if ($this->ignoredByBaseline) {
- $status = 'Baseline-Ignored ';
- } elseif ($this->suppressed) {
- $status = 'Suppressed ';
+ $details[] = 'ignored by baseline';
}
return sprintf(
- 'Test Triggered %sPHP Notice (%s)%s',
- $status,
- $this->test->id(),
+ 'Test Triggered PHP Notice (%s) in %s:%d%s',
+ implode(', ', $details),
+ $this->file,
+ $this->line,
$message,
);
}
diff --git a/src/Event/Events/Test/Issue/PhpWarningTriggered.php b/src/Event/Events/Test/Issue/PhpWarningTriggered.php
index 6365ba237a8..3d65125f753 100644
--- a/src/Event/Events/Test/Issue/PhpWarningTriggered.php
+++ b/src/Event/Events/Test/Issue/PhpWarningTriggered.php
@@ -10,13 +10,14 @@
namespace PHPUnit\Event\Test;
use const PHP_EOL;
+use function implode;
use function sprintf;
use PHPUnit\Event\Code\Test;
use PHPUnit\Event\Event;
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -26,26 +27,26 @@
private Test $test;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $message;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $file;
/**
- * @psalm-var positive-int
+ * @var positive-int
*/
private int $line;
private bool $suppressed;
private bool $ignoredByBaseline;
/**
- * @psalm-param non-empty-string $message
- * @psalm-param non-empty-string $file
- * @psalm-param positive-int $line
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
*/
public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline)
{
@@ -69,7 +70,7 @@ public function test(): Test
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function message(): string
{
@@ -77,7 +78,7 @@ public function message(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function file(): string
{
@@ -85,7 +86,7 @@ public function file(): string
}
/**
- * @psalm-return positive-int
+ * @return positive-int
*/
public function line(): int
{
@@ -102,26 +103,32 @@ public function ignoredByBaseline(): bool
return $this->ignoredByBaseline;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->message;
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
- $status = '';
+ $details = [$this->test->id()];
+
+ if ($this->suppressed) {
+ $details[] = 'suppressed using operator';
+ }
if ($this->ignoredByBaseline) {
- $status = 'Baseline-Ignored ';
- } elseif ($this->suppressed) {
- $status = 'Suppressed ';
+ $details[] = 'ignored by baseline';
}
return sprintf(
- 'Test Triggered %sPHP Warning (%s)%s',
- $status,
- $this->test->id(),
+ 'Test Triggered PHP Warning (%s) in %s:%d%s',
+ implode(', ', $details),
+ $this->file,
+ $this->line,
$message,
);
}
diff --git a/src/Event/Events/Test/Issue/PhpunitDeprecationTriggered.php b/src/Event/Events/Test/Issue/PhpunitDeprecationTriggered.php
index bd91860738f..4e1603f355b 100644
--- a/src/Event/Events/Test/Issue/PhpunitDeprecationTriggered.php
+++ b/src/Event/Events/Test/Issue/PhpunitDeprecationTriggered.php
@@ -16,7 +16,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -24,8 +24,15 @@
{
private Telemetry\Info $telemetryInfo;
private Test $test;
+
+ /**
+ * @var non-empty-string
+ */
private string $message;
+ /**
+ * @param non-empty-string $message
+ */
public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message)
{
$this->telemetryInfo = $telemetryInfo;
@@ -43,16 +50,22 @@ public function test(): Test
return $this->test;
}
+ /**
+ * @return non-empty-string
+ */
public function message(): string
{
return $this->message;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->message;
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
diff --git a/src/Event/Events/Test/Issue/PhpunitErrorTriggered.php b/src/Event/Events/Test/Issue/PhpunitErrorTriggered.php
index f9aec03f2dd..abd5e8a1f0b 100644
--- a/src/Event/Events/Test/Issue/PhpunitErrorTriggered.php
+++ b/src/Event/Events/Test/Issue/PhpunitErrorTriggered.php
@@ -17,7 +17,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -25,8 +25,15 @@
{
private Telemetry\Info $telemetryInfo;
private Test $test;
+
+ /**
+ * @var non-empty-string
+ */
private string $message;
+ /**
+ * @param non-empty-string $message
+ */
public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message)
{
$this->telemetryInfo = $telemetryInfo;
@@ -44,16 +51,22 @@ public function test(): Test
return $this->test;
}
+ /**
+ * @return non-empty-string
+ */
public function message(): string
{
return $this->message;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = trim($this->message);
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
diff --git a/src/Event/Events/Test/Issue/PhpunitNoticeTriggered.php b/src/Event/Events/Test/Issue/PhpunitNoticeTriggered.php
new file mode 100644
index 00000000000..33984ba426b
--- /dev/null
+++ b/src/Event/Events/Test/Issue/PhpunitNoticeTriggered.php
@@ -0,0 +1,79 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use function trim;
+use PHPUnit\Event\Code\Test;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class PhpunitNoticeTriggered implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private Test $test;
+
+ /**
+ * @var non-empty-string
+ */
+ private string $message;
+
+ /**
+ * @param non-empty-string $message
+ */
+ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->test = $test;
+ $this->message = $message;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function test(): Test
+ {
+ return $this->test;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function message(): string
+ {
+ return $this->message;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = trim($this->message);
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'Test Triggered PHPUnit Notice (%s)%s',
+ $this->test->id(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/Issue/PhpunitNoticeTriggeredSubscriber.php b/src/Event/Events/Test/Issue/PhpunitNoticeTriggeredSubscriber.php
new file mode 100644
index 00000000000..0935c6dd350
--- /dev/null
+++ b/src/Event/Events/Test/Issue/PhpunitNoticeTriggeredSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface PhpunitNoticeTriggeredSubscriber extends Subscriber
+{
+ public function notify(PhpunitNoticeTriggered $event): void;
+}
diff --git a/src/Event/Events/Test/Issue/PhpunitWarningTriggered.php b/src/Event/Events/Test/Issue/PhpunitWarningTriggered.php
index 1bfcb4d90f4..48847d2202e 100644
--- a/src/Event/Events/Test/Issue/PhpunitWarningTriggered.php
+++ b/src/Event/Events/Test/Issue/PhpunitWarningTriggered.php
@@ -16,7 +16,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -24,8 +24,15 @@
{
private Telemetry\Info $telemetryInfo;
private Test $test;
+
+ /**
+ * @var non-empty-string
+ */
private string $message;
+ /**
+ * @param non-empty-string $message
+ */
public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message)
{
$this->telemetryInfo = $telemetryInfo;
@@ -43,16 +50,22 @@ public function test(): Test
return $this->test;
}
+ /**
+ * @return non-empty-string
+ */
public function message(): string
{
return $this->message;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->message;
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
diff --git a/src/Event/Events/Test/Issue/WarningTriggered.php b/src/Event/Events/Test/Issue/WarningTriggered.php
index b2c5caca2bc..7b3e313bf26 100644
--- a/src/Event/Events/Test/Issue/WarningTriggered.php
+++ b/src/Event/Events/Test/Issue/WarningTriggered.php
@@ -10,13 +10,14 @@
namespace PHPUnit\Event\Test;
use const PHP_EOL;
+use function implode;
use function sprintf;
use PHPUnit\Event\Code\Test;
use PHPUnit\Event\Event;
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -26,26 +27,26 @@
private Test $test;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $message;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $file;
/**
- * @psalm-var positive-int
+ * @var positive-int
*/
private int $line;
private bool $suppressed;
private bool $ignoredByBaseline;
/**
- * @psalm-param non-empty-string $message
- * @psalm-param non-empty-string $file
- * @psalm-param positive-int $line
+ * @param non-empty-string $message
+ * @param non-empty-string $file
+ * @param positive-int $line
*/
public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline)
{
@@ -69,7 +70,7 @@ public function test(): Test
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function message(): string
{
@@ -77,7 +78,7 @@ public function message(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function file(): string
{
@@ -85,7 +86,7 @@ public function file(): string
}
/**
- * @psalm-return positive-int
+ * @return positive-int
*/
public function line(): int
{
@@ -102,26 +103,32 @@ public function ignoredByBaseline(): bool
return $this->ignoredByBaseline;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->message;
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
- $status = '';
+ $details = [$this->test->id()];
+
+ if ($this->suppressed) {
+ $details[] = 'suppressed using operator';
+ }
if ($this->ignoredByBaseline) {
- $status = 'Baseline-Ignored ';
- } elseif ($this->suppressed) {
- $status = 'Suppressed ';
+ $details[] = 'ignored by baseline';
}
return sprintf(
- 'Test Triggered %sWarning (%s)%s',
- $status,
- $this->test->id(),
+ 'Test Triggered Warning (%s) in %s:%d%s',
+ implode(', ', $details),
+ $this->file,
+ $this->line,
$message,
);
}
diff --git a/src/Event/Events/Test/Lifecycle/DataProviderMethodCalled.php b/src/Event/Events/Test/Lifecycle/DataProviderMethodCalled.php
index 5581f7dda04..5631e1cf2b1 100644
--- a/src/Event/Events/Test/Lifecycle/DataProviderMethodCalled.php
+++ b/src/Event/Events/Test/Lifecycle/DataProviderMethodCalled.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\Telemetry\Info;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -47,6 +47,9 @@ public function dataProviderMethod(): ClassMethod
return $this->dataProviderMethod;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/Lifecycle/DataProviderMethodFinished.php b/src/Event/Events/Test/Lifecycle/DataProviderMethodFinished.php
index f12c0f2b9e4..ec26779949b 100644
--- a/src/Event/Events/Test/Lifecycle/DataProviderMethodFinished.php
+++ b/src/Event/Events/Test/Lifecycle/DataProviderMethodFinished.php
@@ -11,13 +11,12 @@
use const PHP_EOL;
use function sprintf;
-use PHPUnit\Event\Code;
use PHPUnit\Event\Code\ClassMethod;
use PHPUnit\Event\Event;
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -27,7 +26,7 @@
private ClassMethod $testMethod;
/**
- * @psalm-var list
+ * @var list
*/
private array $calledMethods;
@@ -49,13 +48,16 @@ public function testMethod(): ClassMethod
}
/**
- * @psalm-return list
+ * @return list
*/
public function calledMethods(): array
{
return $this->calledMethods;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$buffer = sprintf(
diff --git a/src/Event/Events/Test/Lifecycle/Finished.php b/src/Event/Events/Test/Lifecycle/Finished.php
index 72032cf7137..3cc9a52ffd8 100644
--- a/src/Event/Events/Test/Lifecycle/Finished.php
+++ b/src/Event/Events/Test/Lifecycle/Finished.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -23,8 +23,15 @@
{
private Telemetry\Info $telemetryInfo;
private Code\Test $test;
+
+ /**
+ * @var non-negative-int
+ */
private int $numberOfAssertionsPerformed;
+ /**
+ * @param non-negative-int $numberOfAssertionsPerformed
+ */
public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, int $numberOfAssertionsPerformed)
{
$this->telemetryInfo = $telemetryInfo;
@@ -42,11 +49,17 @@ public function test(): Code\Test
return $this->test;
}
+ /**
+ * @return non-negative-int
+ */
public function numberOfAssertionsPerformed(): int
{
return $this->numberOfAssertionsPerformed;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/Lifecycle/PreparationErrored.php b/src/Event/Events/Test/Lifecycle/PreparationErrored.php
new file mode 100644
index 00000000000..866bf5f1c4b
--- /dev/null
+++ b/src/Event/Events/Test/Lifecycle/PreparationErrored.php
@@ -0,0 +1,69 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use const PHP_EOL;
+use function sprintf;
+use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class PreparationErrored implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private Code\Test $test;
+ private Throwable $throwable;
+
+ public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, Throwable $throwable)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->test = $test;
+ $this->throwable = $throwable;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function test(): Code\Test
+ {
+ return $this->test;
+ }
+
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
+ return sprintf(
+ 'Test Preparation Errored (%s)%s',
+ $this->test->id(),
+ $message,
+ );
+ }
+}
diff --git a/src/Event/Events/Test/Lifecycle/PreparationErroredSubscriber.php b/src/Event/Events/Test/Lifecycle/PreparationErroredSubscriber.php
new file mode 100644
index 00000000000..2cb43d2e838
--- /dev/null
+++ b/src/Event/Events/Test/Lifecycle/PreparationErroredSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Test;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface PreparationErroredSubscriber extends Subscriber
+{
+ public function notify(PreparationErrored $event): void;
+}
diff --git a/src/Event/Events/Test/Lifecycle/PreparationFailed.php b/src/Event/Events/Test/Lifecycle/PreparationFailed.php
index 7380be938f4..7a8b1d67fcc 100644
--- a/src/Event/Events/Test/Lifecycle/PreparationFailed.php
+++ b/src/Event/Events/Test/Lifecycle/PreparationFailed.php
@@ -9,13 +9,15 @@
*/
namespace PHPUnit\Event\Test;
+use const PHP_EOL;
use function sprintf;
use PHPUnit\Event\Code;
+use PHPUnit\Event\Code\Throwable;
use PHPUnit\Event\Event;
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -23,11 +25,13 @@
{
private Telemetry\Info $telemetryInfo;
private Code\Test $test;
+ private Throwable $throwable;
- public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test)
+ public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, Throwable $throwable)
{
$this->telemetryInfo = $telemetryInfo;
$this->test = $test;
+ $this->throwable = $throwable;
}
public function telemetryInfo(): Telemetry\Info
@@ -40,11 +44,26 @@ public function test(): Code\Test
return $this->test;
}
+ public function throwable(): Throwable
+ {
+ return $this->throwable;
+ }
+
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
+ $message = $this->throwable->message();
+
+ if ($message !== '') {
+ $message = PHP_EOL . $message;
+ }
+
return sprintf(
- 'Test Preparation Failed (%s)',
+ 'Test Preparation Failed (%s)%s',
$this->test->id(),
+ $message,
);
}
}
diff --git a/src/Event/Events/Test/Lifecycle/PreparationStarted.php b/src/Event/Events/Test/Lifecycle/PreparationStarted.php
index 6e975a622ee..7c548b08b0c 100644
--- a/src/Event/Events/Test/Lifecycle/PreparationStarted.php
+++ b/src/Event/Events/Test/Lifecycle/PreparationStarted.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -40,6 +40,9 @@ public function test(): Code\Test
return $this->test;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/Lifecycle/Prepared.php b/src/Event/Events/Test/Lifecycle/Prepared.php
index 9e7cc694934..d83f1d59570 100644
--- a/src/Event/Events/Test/Lifecycle/Prepared.php
+++ b/src/Event/Events/Test/Lifecycle/Prepared.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -40,6 +40,9 @@ public function test(): Code\Test
return $this->test;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/Outcome/Errored.php b/src/Event/Events/Test/Outcome/Errored.php
index 2a2c81e9189..ef0684989f9 100644
--- a/src/Event/Events/Test/Outcome/Errored.php
+++ b/src/Event/Events/Test/Outcome/Errored.php
@@ -18,7 +18,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -50,11 +50,14 @@ public function throwable(): Throwable
return $this->throwable;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = trim($this->throwable->message());
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
diff --git a/src/Event/Events/Test/Outcome/Failed.php b/src/Event/Events/Test/Outcome/Failed.php
index 6a6b8904c02..bcc5867f04d 100644
--- a/src/Event/Events/Test/Outcome/Failed.php
+++ b/src/Event/Events/Test/Outcome/Failed.php
@@ -19,7 +19,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -54,7 +54,7 @@ public function throwable(): Throwable
}
/**
- * @psalm-assert-if-true !null $this->comparisonFailure
+ * @phpstan-assert-if-true !null $this->comparisonFailure
*/
public function hasComparisonFailure(): bool
{
@@ -73,11 +73,14 @@ public function comparisonFailure(): ComparisonFailure
return $this->comparisonFailure;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = trim($this->throwable->message());
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
diff --git a/src/Event/Events/Test/Outcome/MarkedIncomplete.php b/src/Event/Events/Test/Outcome/MarkedIncomplete.php
index 0b7a5cf8c4d..a69b48a427b 100644
--- a/src/Event/Events/Test/Outcome/MarkedIncomplete.php
+++ b/src/Event/Events/Test/Outcome/MarkedIncomplete.php
@@ -18,7 +18,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -50,11 +50,14 @@ public function throwable(): Throwable
return $this->throwable;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = trim($this->throwable->message());
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
diff --git a/src/Event/Events/Test/Outcome/Passed.php b/src/Event/Events/Test/Outcome/Passed.php
index 8eed03daf24..38f2d9816ec 100644
--- a/src/Event/Events/Test/Outcome/Passed.php
+++ b/src/Event/Events/Test/Outcome/Passed.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -40,6 +40,9 @@ public function test(): Code\Test
return $this->test;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/Outcome/Skipped.php b/src/Event/Events/Test/Outcome/Skipped.php
index 2070c0cfbd2..fe605fff47d 100644
--- a/src/Event/Events/Test/Outcome/Skipped.php
+++ b/src/Event/Events/Test/Outcome/Skipped.php
@@ -16,7 +16,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -48,11 +48,14 @@ public function message(): string
return $this->message;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
$message = $this->message;
- if (!empty($message)) {
+ if ($message !== '') {
$message = PHP_EOL . $message;
}
diff --git a/src/Event/Events/Test/PrintedUnexpectedOutput.php b/src/Event/Events/Test/PrintedUnexpectedOutput.php
index e2479fbbfb1..4a0ceab39ac 100644
--- a/src/Event/Events/Test/PrintedUnexpectedOutput.php
+++ b/src/Event/Events/Test/PrintedUnexpectedOutput.php
@@ -9,12 +9,13 @@
*/
namespace PHPUnit\Event\Test;
+use const PHP_EOL;
use function sprintf;
use PHPUnit\Event\Event;
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -23,12 +24,12 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $output;
/**
- * @psalm-param non-empty-string $output
+ * @param non-empty-string $output
*/
public function __construct(Telemetry\Info $telemetryInfo, string $output)
{
@@ -42,13 +43,16 @@ public function telemetryInfo(): Telemetry\Info
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function output(): string
{
return $this->output;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/TestDouble/MockObjectCreated.php b/src/Event/Events/Test/TestDouble/MockObjectCreated.php
index 357d930aa3f..8e91237c4f7 100644
--- a/src/Event/Events/Test/TestDouble/MockObjectCreated.php
+++ b/src/Event/Events/Test/TestDouble/MockObjectCreated.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -23,12 +23,12 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $className;
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*/
public function __construct(Telemetry\Info $telemetryInfo, string $className)
{
@@ -42,13 +42,16 @@ public function telemetryInfo(): Telemetry\Info
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function className(): string
{
return $this->className;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/TestDouble/MockObjectForAbstractClassCreated.php b/src/Event/Events/Test/TestDouble/MockObjectForAbstractClassCreated.php
deleted file mode 100644
index 115f1be106d..00000000000
--- a/src/Event/Events/Test/TestDouble/MockObjectForAbstractClassCreated.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use function sprintf;
-use PHPUnit\Event\Event;
-use PHPUnit\Event\Telemetry;
-
-/**
- * @psalm-immutable
- *
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-final readonly class MockObjectForAbstractClassCreated implements Event
-{
- private Telemetry\Info $telemetryInfo;
-
- /**
- * @psalm-var class-string
- */
- private string $className;
-
- /**
- * @psalm-param class-string $className
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $className)
- {
- $this->telemetryInfo = $telemetryInfo;
- $this->className = $className;
- }
-
- public function telemetryInfo(): Telemetry\Info
- {
- return $this->telemetryInfo;
- }
-
- /**
- * @psalm-return class-string
- */
- public function className(): string
- {
- return $this->className;
- }
-
- public function asString(): string
- {
- return sprintf(
- 'Mock Object Created (%s)',
- $this->className,
- );
- }
-}
diff --git a/src/Event/Events/Test/TestDouble/MockObjectForAbstractClassCreatedSubscriber.php b/src/Event/Events/Test/TestDouble/MockObjectForAbstractClassCreatedSubscriber.php
deleted file mode 100644
index c335d1917d7..00000000000
--- a/src/Event/Events/Test/TestDouble/MockObjectForAbstractClassCreatedSubscriber.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use PHPUnit\Event\Subscriber;
-
-/**
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-interface MockObjectForAbstractClassCreatedSubscriber extends Subscriber
-{
- public function notify(MockObjectForAbstractClassCreated $event): void;
-}
diff --git a/src/Event/Events/Test/TestDouble/MockObjectForIntersectionOfInterfacesCreated.php b/src/Event/Events/Test/TestDouble/MockObjectForIntersectionOfInterfacesCreated.php
index 08176afc0ef..3548189e8ca 100644
--- a/src/Event/Events/Test/TestDouble/MockObjectForIntersectionOfInterfacesCreated.php
+++ b/src/Event/Events/Test/TestDouble/MockObjectForIntersectionOfInterfacesCreated.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -24,12 +24,12 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var list
+ * @var list
*/
private array $interfaces;
/**
- * @psalm-param list $interfaces
+ * @param list $interfaces
*/
public function __construct(Telemetry\Info $telemetryInfo, array $interfaces)
{
@@ -50,6 +50,9 @@ public function interfaces(): array
return $this->interfaces;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/TestDouble/MockObjectForTraitCreated.php b/src/Event/Events/Test/TestDouble/MockObjectForTraitCreated.php
deleted file mode 100644
index fe58c57d715..00000000000
--- a/src/Event/Events/Test/TestDouble/MockObjectForTraitCreated.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use function sprintf;
-use PHPUnit\Event\Event;
-use PHPUnit\Event\Telemetry;
-
-/**
- * @psalm-immutable
- *
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-final readonly class MockObjectForTraitCreated implements Event
-{
- private Telemetry\Info $telemetryInfo;
-
- /**
- * @psalm-var trait-string
- */
- private string $traitName;
-
- /**
- * @psalm-param trait-string $traitName
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $traitName)
- {
- $this->telemetryInfo = $telemetryInfo;
- $this->traitName = $traitName;
- }
-
- public function telemetryInfo(): Telemetry\Info
- {
- return $this->telemetryInfo;
- }
-
- /**
- * @psalm-return trait-string
- */
- public function traitName(): string
- {
- return $this->traitName;
- }
-
- public function asString(): string
- {
- return sprintf(
- 'Mock Object Created (%s)',
- $this->traitName,
- );
- }
-}
diff --git a/src/Event/Events/Test/TestDouble/MockObjectForTraitCreatedSubscriber.php b/src/Event/Events/Test/TestDouble/MockObjectForTraitCreatedSubscriber.php
deleted file mode 100644
index a7e7dd07c1c..00000000000
--- a/src/Event/Events/Test/TestDouble/MockObjectForTraitCreatedSubscriber.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use PHPUnit\Event\Subscriber;
-
-/**
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-interface MockObjectForTraitCreatedSubscriber extends Subscriber
-{
- public function notify(MockObjectForTraitCreated $event): void;
-}
diff --git a/src/Event/Events/Test/TestDouble/MockObjectFromWsdlCreated.php b/src/Event/Events/Test/TestDouble/MockObjectFromWsdlCreated.php
deleted file mode 100644
index 5eda4b8a37d..00000000000
--- a/src/Event/Events/Test/TestDouble/MockObjectFromWsdlCreated.php
+++ /dev/null
@@ -1,109 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use function sprintf;
-use PHPUnit\Event\Event;
-use PHPUnit\Event\Telemetry;
-
-/**
- * @psalm-immutable
- *
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-final readonly class MockObjectFromWsdlCreated implements Event
-{
- private Telemetry\Info $telemetryInfo;
- private string $wsdlFile;
-
- /**
- * @psalm-var class-string
- */
- private string $originalClassName;
-
- /**
- * @psalm-var class-string
- */
- private string $mockClassName;
-
- /**
- * @psalm-var list
- */
- private array $methods;
- private bool $callOriginalConstructor;
- private array $options;
-
- /**
- * @psalm-param class-string $originalClassName
- * @psalm-param class-string $mockClassName
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $wsdlFile, string $originalClassName, string $mockClassName, array $methods, bool $callOriginalConstructor, array $options)
- {
- $this->telemetryInfo = $telemetryInfo;
- $this->wsdlFile = $wsdlFile;
- $this->originalClassName = $originalClassName;
- $this->mockClassName = $mockClassName;
- $this->methods = $methods;
- $this->callOriginalConstructor = $callOriginalConstructor;
- $this->options = $options;
- }
-
- public function telemetryInfo(): Telemetry\Info
- {
- return $this->telemetryInfo;
- }
-
- public function wsdlFile(): string
- {
- return $this->wsdlFile;
- }
-
- /**
- * @psalm-return class-string
- */
- public function originalClassName(): string
- {
- return $this->originalClassName;
- }
-
- /**
- * @psalm-return class-string
- */
- public function mockClassName(): string
- {
- return $this->mockClassName;
- }
-
- /**
- * @psalm-return list
- */
- public function methods(): array
- {
- return $this->methods;
- }
-
- public function callOriginalConstructor(): bool
- {
- return $this->callOriginalConstructor;
- }
-
- public function options(): array
- {
- return $this->options;
- }
-
- public function asString(): string
- {
- return sprintf(
- 'Mock Object Created (%s)',
- $this->wsdlFile,
- );
- }
-}
diff --git a/src/Event/Events/Test/TestDouble/MockObjectFromWsdlCreatedSubscriber.php b/src/Event/Events/Test/TestDouble/MockObjectFromWsdlCreatedSubscriber.php
deleted file mode 100644
index fb0524b21a0..00000000000
--- a/src/Event/Events/Test/TestDouble/MockObjectFromWsdlCreatedSubscriber.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use PHPUnit\Event\Subscriber;
-
-/**
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-interface MockObjectFromWsdlCreatedSubscriber extends Subscriber
-{
- public function notify(MockObjectFromWsdlCreated $event): void;
-}
diff --git a/src/Event/Events/Test/TestDouble/PartialMockObjectCreated.php b/src/Event/Events/Test/TestDouble/PartialMockObjectCreated.php
index a6c97dc266e..625747816ce 100644
--- a/src/Event/Events/Test/TestDouble/PartialMockObjectCreated.php
+++ b/src/Event/Events/Test/TestDouble/PartialMockObjectCreated.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -23,17 +23,17 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $className;
/**
- * @psalm-var list
+ * @var list
*/
private array $methodNames;
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*/
public function __construct(Telemetry\Info $telemetryInfo, string $className, string ...$methodNames)
{
@@ -48,7 +48,7 @@ public function telemetryInfo(): Telemetry\Info
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function className(): string
{
@@ -56,13 +56,16 @@ public function className(): string
}
/**
- * @psalm-return list
+ * @return list
*/
public function methodNames(): array
{
return $this->methodNames;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/TestDouble/TestProxyCreated.php b/src/Event/Events/Test/TestDouble/TestProxyCreated.php
deleted file mode 100644
index 4cd4545b976..00000000000
--- a/src/Event/Events/Test/TestDouble/TestProxyCreated.php
+++ /dev/null
@@ -1,66 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use function sprintf;
-use PHPUnit\Event\Event;
-use PHPUnit\Event\Telemetry;
-
-/**
- * @psalm-immutable
- *
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-final readonly class TestProxyCreated implements Event
-{
- private Telemetry\Info $telemetryInfo;
-
- /**
- * @psalm-var class-string
- */
- private string $className;
- private string $constructorArguments;
-
- /**
- * @psalm-param class-string $className
- */
- public function __construct(Telemetry\Info $telemetryInfo, string $className, string $constructorArguments)
- {
- $this->telemetryInfo = $telemetryInfo;
- $this->className = $className;
- $this->constructorArguments = $constructorArguments;
- }
-
- public function telemetryInfo(): Telemetry\Info
- {
- return $this->telemetryInfo;
- }
-
- /**
- * @psalm-return class-string
- */
- public function className(): string
- {
- return $this->className;
- }
-
- public function constructorArguments(): string
- {
- return $this->constructorArguments;
- }
-
- public function asString(): string
- {
- return sprintf(
- 'Test Proxy Created (%s)',
- $this->className,
- );
- }
-}
diff --git a/src/Event/Events/Test/TestDouble/TestProxyCreatedSubscriber.php b/src/Event/Events/Test/TestDouble/TestProxyCreatedSubscriber.php
deleted file mode 100644
index 8af83844a80..00000000000
--- a/src/Event/Events/Test/TestDouble/TestProxyCreatedSubscriber.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Test;
-
-use PHPUnit\Event\Subscriber;
-
-/**
- * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
- */
-interface TestProxyCreatedSubscriber extends Subscriber
-{
- public function notify(TestProxyCreated $event): void;
-}
diff --git a/src/Event/Events/Test/TestDouble/TestStubCreated.php b/src/Event/Events/Test/TestDouble/TestStubCreated.php
index 424d9f44f20..667fbad4b68 100644
--- a/src/Event/Events/Test/TestDouble/TestStubCreated.php
+++ b/src/Event/Events/Test/TestDouble/TestStubCreated.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -28,7 +28,7 @@
private string $className;
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*/
public function __construct(Telemetry\Info $telemetryInfo, string $className)
{
@@ -49,6 +49,9 @@ public function className(): string
return $this->className;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/Test/TestDouble/TestStubForIntersectionOfInterfacesCreated.php b/src/Event/Events/Test/TestDouble/TestStubForIntersectionOfInterfacesCreated.php
index fb4dccdd5a3..bba93d9e02a 100644
--- a/src/Event/Events/Test/TestDouble/TestStubForIntersectionOfInterfacesCreated.php
+++ b/src/Event/Events/Test/TestDouble/TestStubForIntersectionOfInterfacesCreated.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -24,12 +24,12 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var list
+ * @var list
*/
private array $interfaces;
/**
- * @psalm-param list $interfaces
+ * @param list $interfaces
*/
public function __construct(Telemetry\Info $telemetryInfo, array $interfaces)
{
@@ -50,6 +50,9 @@ public function interfaces(): array
return $this->interfaces;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestRunner/BootstrapFinished.php b/src/Event/Events/TestRunner/BootstrapFinished.php
index c92b7a647e1..8e46a00a836 100644
--- a/src/Event/Events/TestRunner/BootstrapFinished.php
+++ b/src/Event/Events/TestRunner/BootstrapFinished.php
@@ -14,15 +14,22 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class BootstrapFinished implements Event
{
private Telemetry\Info $telemetryInfo;
+
+ /**
+ * @var non-empty-string
+ */
private string $filename;
+ /**
+ * @param non-empty-string $filename
+ */
public function __construct(Telemetry\Info $telemetryInfo, string $filename)
{
$this->telemetryInfo = $telemetryInfo;
@@ -34,11 +41,17 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function filename(): string
{
return $this->filename;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestRunner/ChildProcessFinished.php b/src/Event/Events/TestRunner/ChildProcessFinished.php
new file mode 100644
index 00000000000..705a0c63425
--- /dev/null
+++ b/src/Event/Events/TestRunner/ChildProcessFinished.php
@@ -0,0 +1,55 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\TestRunner;
+
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class ChildProcessFinished implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private string $stdout;
+ private string $stderr;
+
+ public function __construct(Telemetry\Info $telemetryInfo, string $stdout, string $stderr)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->stdout = $stdout;
+ $this->stderr = $stderr;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function stdout(): string
+ {
+ return $this->stdout;
+ }
+
+ public function stderr(): string
+ {
+ return $this->stderr;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ return 'Child Process Finished';
+ }
+}
diff --git a/src/Event/Events/TestRunner/ChildProcessFinishedSubscriber.php b/src/Event/Events/TestRunner/ChildProcessFinishedSubscriber.php
new file mode 100644
index 00000000000..45fefa1827b
--- /dev/null
+++ b/src/Event/Events/TestRunner/ChildProcessFinishedSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\TestRunner;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface ChildProcessFinishedSubscriber extends Subscriber
+{
+ public function notify(ChildProcessFinished $event): void;
+}
diff --git a/src/Event/Events/TestRunner/ChildProcessStarted.php b/src/Event/Events/TestRunner/ChildProcessStarted.php
new file mode 100644
index 00000000000..2c20471e27f
--- /dev/null
+++ b/src/Event/Events/TestRunner/ChildProcessStarted.php
@@ -0,0 +1,41 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\TestRunner;
+
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class ChildProcessStarted implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+
+ public function __construct(Telemetry\Info $telemetryInfo)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ return 'Child Process Started';
+ }
+}
diff --git a/src/Event/Events/TestRunner/ChildProcessStartedSubscriber.php b/src/Event/Events/TestRunner/ChildProcessStartedSubscriber.php
new file mode 100644
index 00000000000..4ba549ce8a0
--- /dev/null
+++ b/src/Event/Events/TestRunner/ChildProcessStartedSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\TestRunner;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface ChildProcessStartedSubscriber extends Subscriber
+{
+ public function notify(ChildProcessStarted $event): void;
+}
diff --git a/src/Event/Events/TestRunner/Configured.php b/src/Event/Events/TestRunner/Configured.php
index 4bbbc24be55..e0d14360a3b 100644
--- a/src/Event/Events/TestRunner/Configured.php
+++ b/src/Event/Events/TestRunner/Configured.php
@@ -37,6 +37,9 @@ public function configuration(): Configuration
return $this->configuration;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return 'Test Runner Configured';
diff --git a/src/Event/Events/TestRunner/DeprecationTriggered.php b/src/Event/Events/TestRunner/DeprecationTriggered.php
index 0ee029959fd..5cfef8f78cb 100644
--- a/src/Event/Events/TestRunner/DeprecationTriggered.php
+++ b/src/Event/Events/TestRunner/DeprecationTriggered.php
@@ -14,15 +14,22 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class DeprecationTriggered implements Event
{
private Telemetry\Info $telemetryInfo;
+
+ /**
+ * @var non-empty-string
+ */
private string $message;
+ /**
+ * @param non-empty-string $message
+ */
public function __construct(Telemetry\Info $telemetryInfo, string $message)
{
$this->telemetryInfo = $telemetryInfo;
@@ -34,11 +41,17 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function message(): string
{
return $this->message;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestRunner/EventFacadeSealed.php b/src/Event/Events/TestRunner/EventFacadeSealed.php
index bbcc3904c78..bd4f5f60305 100644
--- a/src/Event/Events/TestRunner/EventFacadeSealed.php
+++ b/src/Event/Events/TestRunner/EventFacadeSealed.php
@@ -13,7 +13,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -31,6 +31,9 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return 'Event Facade Sealed';
diff --git a/src/Event/Events/TestRunner/ExecutionAborted.php b/src/Event/Events/TestRunner/ExecutionAborted.php
index 635a3b4308a..6107e099b57 100644
--- a/src/Event/Events/TestRunner/ExecutionAborted.php
+++ b/src/Event/Events/TestRunner/ExecutionAborted.php
@@ -13,7 +13,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -31,6 +31,9 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return 'Test Runner Execution Aborted';
diff --git a/src/Event/Events/TestRunner/ExecutionFinished.php b/src/Event/Events/TestRunner/ExecutionFinished.php
index c1d725aea3f..25789fe7ca1 100644
--- a/src/Event/Events/TestRunner/ExecutionFinished.php
+++ b/src/Event/Events/TestRunner/ExecutionFinished.php
@@ -13,7 +13,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -31,6 +31,9 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return 'Test Runner Execution Finished';
diff --git a/src/Event/Events/TestRunner/ExecutionStarted.php b/src/Event/Events/TestRunner/ExecutionStarted.php
index a3aa38a6018..e38a2a4d99f 100644
--- a/src/Event/Events/TestRunner/ExecutionStarted.php
+++ b/src/Event/Events/TestRunner/ExecutionStarted.php
@@ -15,7 +15,7 @@
use PHPUnit\Event\TestSuite\TestSuite;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -40,6 +40,9 @@ public function testSuite(): TestSuite
return $this->testSuite;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestRunner/ExtensionBootstrapped.php b/src/Event/Events/TestRunner/ExtensionBootstrapped.php
index 1760fa3a08c..4ae1a6d5bd4 100644
--- a/src/Event/Events/TestRunner/ExtensionBootstrapped.php
+++ b/src/Event/Events/TestRunner/ExtensionBootstrapped.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -23,18 +23,18 @@
private Telemetry\Info $telemetryInfo;
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $className;
/**
- * @psalm-var array
+ * @var array
*/
private array $parameters;
/**
- * @psalm-param class-string $className
- * @psalm-param array $parameters
+ * @param class-string $className
+ * @param array $parameters
*/
public function __construct(Telemetry\Info $telemetryInfo, string $className, array $parameters)
{
@@ -49,7 +49,7 @@ public function telemetryInfo(): Telemetry\Info
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function className(): string
{
@@ -57,13 +57,16 @@ public function className(): string
}
/**
- * @psalm-return array
+ * @return array
*/
public function parameters(): array
{
return $this->parameters;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestRunner/ExtensionLoadedFromPhar.php b/src/Event/Events/TestRunner/ExtensionLoadedFromPhar.php
index 2e11f04d3f7..2ce358d5c75 100644
--- a/src/Event/Events/TestRunner/ExtensionLoadedFromPhar.php
+++ b/src/Event/Events/TestRunner/ExtensionLoadedFromPhar.php
@@ -14,17 +14,34 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class ExtensionLoadedFromPhar implements Event
{
private Telemetry\Info $telemetryInfo;
+
+ /**
+ * @var non-empty-string
+ */
private string $filename;
+
+ /**
+ * @var non-empty-string
+ */
private string $name;
+
+ /**
+ * @var non-empty-string
+ */
private string $version;
+ /**
+ * @param non-empty-string $filename
+ * @param non-empty-string $name
+ * @param non-empty-string $version
+ */
public function __construct(Telemetry\Info $telemetryInfo, string $filename, string $name, string $version)
{
$this->telemetryInfo = $telemetryInfo;
@@ -38,21 +55,33 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function filename(): string
{
return $this->filename;
}
+ /**
+ * @return non-empty-string
+ */
public function name(): string
{
return $this->name;
}
+ /**
+ * @return non-empty-string
+ */
public function version(): string
{
return $this->version;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestRunner/Finished.php b/src/Event/Events/TestRunner/Finished.php
index 9133acc4418..2abc685bb9e 100644
--- a/src/Event/Events/TestRunner/Finished.php
+++ b/src/Event/Events/TestRunner/Finished.php
@@ -13,7 +13,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -31,6 +31,9 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return 'Test Runner Finished';
diff --git a/src/Event/Events/TestRunner/GarbageCollectionDisabled.php b/src/Event/Events/TestRunner/GarbageCollectionDisabled.php
index 2690f69c565..4324a5c157c 100644
--- a/src/Event/Events/TestRunner/GarbageCollectionDisabled.php
+++ b/src/Event/Events/TestRunner/GarbageCollectionDisabled.php
@@ -13,7 +13,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -31,6 +31,9 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return 'Test Runner Disabled Garbage Collection';
diff --git a/src/Event/Events/TestRunner/GarbageCollectionEnabled.php b/src/Event/Events/TestRunner/GarbageCollectionEnabled.php
index cabeed434c0..1c4e088874f 100644
--- a/src/Event/Events/TestRunner/GarbageCollectionEnabled.php
+++ b/src/Event/Events/TestRunner/GarbageCollectionEnabled.php
@@ -13,7 +13,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -31,6 +31,9 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return 'Test Runner Enabled Garbage Collection';
diff --git a/src/Event/Events/TestRunner/GarbageCollectionTriggered.php b/src/Event/Events/TestRunner/GarbageCollectionTriggered.php
index ade9ea5e861..d6a1ce643a9 100644
--- a/src/Event/Events/TestRunner/GarbageCollectionTriggered.php
+++ b/src/Event/Events/TestRunner/GarbageCollectionTriggered.php
@@ -13,7 +13,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -31,6 +31,9 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return 'Test Runner Triggered Garbage Collection';
diff --git a/src/Event/Events/TestRunner/NoticeTriggered.php b/src/Event/Events/TestRunner/NoticeTriggered.php
new file mode 100644
index 00000000000..a5bfa04f386
--- /dev/null
+++ b/src/Event/Events/TestRunner/NoticeTriggered.php
@@ -0,0 +1,52 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\TestRunner;
+
+use function sprintf;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class NoticeTriggered implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+ private string $message;
+
+ public function __construct(Telemetry\Info $telemetryInfo, string $message)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->message = $message;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ public function message(): string
+ {
+ return $this->message;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ return sprintf(
+ 'Test Runner Triggered Notice (%s)',
+ $this->message,
+ );
+ }
+}
diff --git a/src/Event/Events/TestRunner/NoticeTriggeredSubscriber.php b/src/Event/Events/TestRunner/NoticeTriggeredSubscriber.php
new file mode 100644
index 00000000000..be76b2c639e
--- /dev/null
+++ b/src/Event/Events/TestRunner/NoticeTriggeredSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\TestRunner;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface NoticeTriggeredSubscriber extends Subscriber
+{
+ public function notify(NoticeTriggered $event): void;
+}
diff --git a/src/Event/Events/TestRunner/Started.php b/src/Event/Events/TestRunner/Started.php
index ec18d665482..a5840110850 100644
--- a/src/Event/Events/TestRunner/Started.php
+++ b/src/Event/Events/TestRunner/Started.php
@@ -13,7 +13,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -31,6 +31,9 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return 'Test Runner Started';
diff --git a/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageFinished.php b/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageFinished.php
new file mode 100644
index 00000000000..d484528ec9c
--- /dev/null
+++ b/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageFinished.php
@@ -0,0 +1,78 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\TestRunner;
+
+use function sprintf;
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class StaticAnalysisForCodeCoverageFinished implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+
+ /**
+ * @var non-negative-int
+ */
+ private int $cacheHits;
+
+ /**
+ * @var non-negative-int
+ */
+ private int $cacheMisses;
+
+ /**
+ * @param non-negative-int $cacheHits
+ * @param non-negative-int $cacheMisses
+ */
+ public function __construct(Telemetry\Info $telemetryInfo, int $cacheHits, int $cacheMisses)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ $this->cacheHits = $cacheHits;
+ $this->cacheMisses = $cacheMisses;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ /**
+ * @return non-negative-int
+ */
+ public function cacheHits(): int
+ {
+ return $this->cacheHits;
+ }
+
+ /**
+ * @return non-negative-int
+ */
+ public function cacheMisses(): int
+ {
+ return $this->cacheMisses;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ return sprintf(
+ 'Static Analysis for Code Coverage Finished (%d cache hits, %d cache misses)',
+ $this->cacheHits,
+ $this->cacheMisses,
+ );
+ }
+}
diff --git a/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageFinishedSubscriber.php b/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageFinishedSubscriber.php
new file mode 100644
index 00000000000..eaf4f34856e
--- /dev/null
+++ b/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageFinishedSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\TestRunner;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface StaticAnalysisForCodeCoverageFinishedSubscriber extends Subscriber
+{
+ public function notify(StaticAnalysisForCodeCoverageFinished $event): void;
+}
diff --git a/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageStarted.php b/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageStarted.php
new file mode 100644
index 00000000000..d121097272e
--- /dev/null
+++ b/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageStarted.php
@@ -0,0 +1,41 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\TestRunner;
+
+use PHPUnit\Event\Event;
+use PHPUnit\Event\Telemetry;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class StaticAnalysisForCodeCoverageStarted implements Event
+{
+ private Telemetry\Info $telemetryInfo;
+
+ public function __construct(Telemetry\Info $telemetryInfo)
+ {
+ $this->telemetryInfo = $telemetryInfo;
+ }
+
+ public function telemetryInfo(): Telemetry\Info
+ {
+ return $this->telemetryInfo;
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function asString(): string
+ {
+ return 'Static Analysis for Code Coverage Started';
+ }
+}
diff --git a/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageStartedSubscriber.php b/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageStartedSubscriber.php
new file mode 100644
index 00000000000..642bf712c80
--- /dev/null
+++ b/src/Event/Events/TestRunner/StaticAnalysisForCodeCoverageStartedSubscriber.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\TestRunner;
+
+use PHPUnit\Event\Subscriber;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+interface StaticAnalysisForCodeCoverageStartedSubscriber extends Subscriber
+{
+ public function notify(StaticAnalysisForCodeCoverageStarted $event): void;
+}
diff --git a/src/Event/Events/TestRunner/WarningTriggered.php b/src/Event/Events/TestRunner/WarningTriggered.php
index be424027545..e9df01be971 100644
--- a/src/Event/Events/TestRunner/WarningTriggered.php
+++ b/src/Event/Events/TestRunner/WarningTriggered.php
@@ -14,15 +14,22 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class WarningTriggered implements Event
{
private Telemetry\Info $telemetryInfo;
+
+ /**
+ * @var non-empty-string
+ */
private string $message;
+ /**
+ * @param non-empty-string $message
+ */
public function __construct(Telemetry\Info $telemetryInfo, string $message)
{
$this->telemetryInfo = $telemetryInfo;
@@ -34,11 +41,17 @@ public function telemetryInfo(): Telemetry\Info
return $this->telemetryInfo;
}
+ /**
+ * @return non-empty-string
+ */
public function message(): string
{
return $this->message;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestSuite/Filtered.php b/src/Event/Events/TestSuite/Filtered.php
index 29b6c8ee616..96d626ce4ef 100644
--- a/src/Event/Events/TestSuite/Filtered.php
+++ b/src/Event/Events/TestSuite/Filtered.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -39,6 +39,9 @@ public function testSuite(): TestSuite
return $this->testSuite;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestSuite/Finished.php b/src/Event/Events/TestSuite/Finished.php
index e729b72b661..a24ca869296 100644
--- a/src/Event/Events/TestSuite/Finished.php
+++ b/src/Event/Events/TestSuite/Finished.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -39,6 +39,9 @@ public function testSuite(): TestSuite
return $this->testSuite;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestSuite/Loaded.php b/src/Event/Events/TestSuite/Loaded.php
index 9f2aaa7479d..d278c0ddc04 100644
--- a/src/Event/Events/TestSuite/Loaded.php
+++ b/src/Event/Events/TestSuite/Loaded.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -39,6 +39,9 @@ public function testSuite(): TestSuite
return $this->testSuite;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestSuite/Skipped.php b/src/Event/Events/TestSuite/Skipped.php
index c1692e4a3c8..efe9c1fff1a 100644
--- a/src/Event/Events/TestSuite/Skipped.php
+++ b/src/Event/Events/TestSuite/Skipped.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -46,6 +46,9 @@ public function message(): string
return $this->message;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Events/TestSuite/Sorted.php b/src/Event/Events/TestSuite/Sorted.php
index e0dbf1b94c5..a73461db8bf 100644
--- a/src/Event/Events/TestSuite/Sorted.php
+++ b/src/Event/Events/TestSuite/Sorted.php
@@ -13,7 +13,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -52,6 +52,9 @@ public function resolveDependencies(): bool
return $this->resolveDependencies;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return 'Test Suite Sorted';
diff --git a/src/Event/Events/TestSuite/Started.php b/src/Event/Events/TestSuite/Started.php
index 25ba7be9657..36fee1f0065 100644
--- a/src/Event/Events/TestSuite/Started.php
+++ b/src/Event/Events/TestSuite/Started.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -39,6 +39,9 @@ public function testSuite(): TestSuite
return $this->testSuite;
}
+ /**
+ * @return non-empty-string
+ */
public function asString(): string
{
return sprintf(
diff --git a/src/Event/Exception/NoTestCaseObjectOnCallStackException.php b/src/Event/Exception/NoTestCaseObjectOnCallStackException.php
index 6e5b03422dc..35b4c25af75 100644
--- a/src/Event/Exception/NoTestCaseObjectOnCallStackException.php
+++ b/src/Event/Exception/NoTestCaseObjectOnCallStackException.php
@@ -13,6 +13,8 @@
use RuntimeException;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class NoTestCaseObjectOnCallStackException extends RuntimeException implements Exception
diff --git a/src/Event/Facade.php b/src/Event/Facade.php
index bda44484acd..64d39c535a5 100644
--- a/src/Event/Facade.php
+++ b/src/Event/Facade.php
@@ -9,12 +9,14 @@
*/
namespace PHPUnit\Event;
-use function gc_status;
+use function assert;
+use function interface_exists;
use PHPUnit\Event\Telemetry\HRTime;
-use PHPUnit\Event\Telemetry\Php81GarbageCollectorStatusProvider;
-use PHPUnit\Event\Telemetry\Php83GarbageCollectorStatusProvider;
+use PHPUnit\Event\Telemetry\SystemGarbageCollectorStatusProvider;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class Facade
@@ -22,7 +24,6 @@ final class Facade
private static ?self $instance = null;
private Emitter $emitter;
private ?TypeMap $typeMap = null;
- private ?Emitter $suspended = null;
private ?DeferringDispatcher $deferringDispatcher = null;
private bool $sealed = false;
@@ -81,8 +82,12 @@ public function registerTracer(Tracer\Tracer $tracer): void
$this->deferredDispatcher()->registerTracer($tracer);
}
- /** @noinspection PhpUnused */
- public function initForIsolation(HRTime $offset, bool $exportObjects): CollectingDispatcher
+ /**
+ * @codeCoverageIgnore
+ *
+ * @noinspection PhpUnused
+ */
+ public function initForIsolation(HRTime $offset): CollectingDispatcher
{
$dispatcher = new CollectingDispatcher;
@@ -91,14 +96,10 @@ public function initForIsolation(HRTime $offset, bool $exportObjects): Collectin
new Telemetry\System(
new Telemetry\SystemStopWatchWithOffset($offset),
new Telemetry\SystemMemoryMeter,
- $this->garbageCollectorStatusProvider(),
+ new SystemGarbageCollectorStatusProvider,
),
);
- if ($exportObjects) {
- $this->emitter->exportObjects();
- }
-
$this->sealed = true;
return $dispatcher;
@@ -106,10 +107,6 @@ public function initForIsolation(HRTime $offset, bool $exportObjects): Collectin
public function forward(EventCollection $events): void
{
- if ($this->suspended !== null) {
- return;
- }
-
$dispatcher = $this->deferredDispatcher();
foreach ($events as $event) {
@@ -139,7 +136,7 @@ private function createTelemetrySystem(): Telemetry\System
return new Telemetry\System(
new Telemetry\SystemStopWatch,
new Telemetry\SystemMemoryMeter,
- $this->garbageCollectorStatusProvider(),
+ new SystemGarbageCollectorStatusProvider,
);
}
@@ -177,15 +174,20 @@ private function registerDefaultTypes(TypeMap $typeMap): void
Test\DataProviderMethodFinished::class,
Test\MarkedIncomplete::class,
Test\AfterLastTestMethodCalled::class,
+ Test\AfterLastTestMethodErrored::class,
+ Test\AfterLastTestMethodFailed::class,
Test\AfterLastTestMethodFinished::class,
Test\AfterTestMethodCalled::class,
+ Test\AfterTestMethodErrored::class,
+ Test\AfterTestMethodFailed::class,
Test\AfterTestMethodFinished::class,
- Test\AssertionSucceeded::class,
- Test\AssertionFailed::class,
Test\BeforeFirstTestMethodCalled::class,
Test\BeforeFirstTestMethodErrored::class,
+ Test\BeforeFirstTestMethodFailed::class,
Test\BeforeFirstTestMethodFinished::class,
Test\BeforeTestMethodCalled::class,
+ Test\BeforeTestMethodErrored::class,
+ Test\BeforeTestMethodFailed::class,
Test\BeforeTestMethodFinished::class,
Test\ComparatorRegistered::class,
Test\ConsideredRisky::class,
@@ -199,27 +201,29 @@ private function registerDefaultTypes(TypeMap $typeMap): void
Test\PhpDeprecationTriggered::class,
Test\PhpNoticeTriggered::class,
Test\PhpunitDeprecationTriggered::class,
+ Test\PhpunitNoticeTriggered::class,
Test\PhpunitErrorTriggered::class,
Test\PhpunitWarningTriggered::class,
Test\PhpWarningTriggered::class,
Test\PostConditionCalled::class,
+ Test\PostConditionErrored::class,
+ Test\PostConditionFailed::class,
Test\PostConditionFinished::class,
Test\PreConditionCalled::class,
+ Test\PreConditionErrored::class,
+ Test\PreConditionFailed::class,
Test\PreConditionFinished::class,
Test\PreparationStarted::class,
Test\Prepared::class,
+ Test\PreparationErrored::class,
Test\PreparationFailed::class,
Test\PrintedUnexpectedOutput::class,
Test\Skipped::class,
Test\WarningTriggered::class,
Test\MockObjectCreated::class,
- Test\MockObjectForAbstractClassCreated::class,
Test\MockObjectForIntersectionOfInterfacesCreated::class,
- Test\MockObjectForTraitCreated::class,
- Test\MockObjectFromWsdlCreated::class,
Test\PartialMockObjectCreated::class,
- Test\TestProxyCreated::class,
Test\TestStubCreated::class,
Test\TestStubForIntersectionOfInterfacesCreated::class,
@@ -234,10 +238,15 @@ private function registerDefaultTypes(TypeMap $typeMap): void
TestRunner\Finished::class,
TestRunner\Started::class,
TestRunner\DeprecationTriggered::class,
+ TestRunner\NoticeTriggered::class,
TestRunner\WarningTriggered::class,
TestRunner\GarbageCollectionDisabled::class,
TestRunner\GarbageCollectionTriggered::class,
TestRunner\GarbageCollectionEnabled::class,
+ TestRunner\ChildProcessFinished::class,
+ TestRunner\ChildProcessStarted::class,
+ TestRunner\StaticAnalysisForCodeCoverageFinished::class,
+ TestRunner\StaticAnalysisForCodeCoverageStarted::class,
TestSuite\Filtered::class,
TestSuite\Finished::class,
@@ -248,19 +257,11 @@ private function registerDefaultTypes(TypeMap $typeMap): void
];
foreach ($defaultEvents as $eventClass) {
- $typeMap->addMapping(
- $eventClass . 'Subscriber',
- $eventClass,
- );
- }
- }
+ $subscriberInterface = $eventClass . 'Subscriber';
- private function garbageCollectorStatusProvider(): Telemetry\GarbageCollectorStatusProvider
- {
- if (!isset(gc_status()['running'])) {
- return new Php81GarbageCollectorStatusProvider;
- }
+ assert(interface_exists($subscriberInterface));
- return new Php83GarbageCollectorStatusProvider;
+ $typeMap->addMapping($subscriberInterface, $eventClass);
+ }
}
}
diff --git a/src/Event/TypeMap.php b/src/Event/TypeMap.php
index b421732072b..e525e446d70 100644
--- a/src/Event/TypeMap.php
+++ b/src/Event/TypeMap.php
@@ -17,18 +17,20 @@
use function sprintf;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class TypeMap
{
/**
- * @psalm-var array
+ * @var array
*/
private array $mapping = [];
/**
- * @psalm-param class-string $subscriberInterface
- * @psalm-param class-string $eventClass
+ * @param class-string $subscriberInterface
+ * @param class-string $eventClass
*
* @throws EventAlreadyAssignedException
* @throws InvalidEventException
@@ -66,9 +68,9 @@ public function isKnownEventType(Event $event): bool
}
/**
- * @psalm-return class-string
- *
* @throws MapError
+ *
+ * @return class-string
*/
public function map(Subscriber $subscriber): string
{
@@ -87,7 +89,7 @@ public function map(Subscriber $subscriber): string
}
/**
- * @psalm-param class-string $subscriberInterface
+ * @param class-string $subscriberInterface
*
* @throws UnknownSubscriberException
*/
@@ -104,7 +106,7 @@ private function ensureSubscriberInterfaceExists(string $subscriberInterface): v
}
/**
- * @psalm-param class-string $eventClass
+ * @param class-string $eventClass
*
* @throws UnknownEventException
*/
@@ -121,7 +123,7 @@ private function ensureEventClassExists(string $eventClass): void
}
/**
- * @psalm-param class-string $subscriberInterface
+ * @param class-string $subscriberInterface
*
* @throws InvalidSubscriberException
*/
@@ -138,7 +140,7 @@ private function ensureSubscriberInterfaceExtendsInterface(string $subscriberInt
}
/**
- * @psalm-param class-string $eventClass
+ * @param class-string $eventClass
*
* @throws InvalidEventException
*/
@@ -155,7 +157,7 @@ private function ensureEventClassImplementsEventInterface(string $eventClass): v
}
/**
- * @psalm-param class-string $subscriberInterface
+ * @param class-string $subscriberInterface
*
* @throws SubscriberTypeAlreadyRegisteredException
*/
@@ -172,7 +174,7 @@ private function ensureSubscriberWasNotAlreadyRegistered(string $subscriberInter
}
/**
- * @psalm-param class-string $eventClass
+ * @param class-string $eventClass
*
* @throws EventAlreadyAssignedException
*/
diff --git a/src/Event/Value/ClassMethod.php b/src/Event/Value/ClassMethod.php
index 5eb58ba72a8..2a94033a5db 100644
--- a/src/Event/Value/ClassMethod.php
+++ b/src/Event/Value/ClassMethod.php
@@ -10,25 +10,25 @@
namespace PHPUnit\Event\Code;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class ClassMethod
{
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $className;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
private string $methodName;
/**
- * @psalm-param class-string $className
- * @psalm-param non-empty-string $methodName
+ * @param class-string $className
+ * @param non-empty-string $methodName
*/
public function __construct(string $className, string $methodName)
{
@@ -37,7 +37,7 @@ public function __construct(string $className, string $methodName)
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function className(): string
{
@@ -45,7 +45,7 @@ public function className(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function methodName(): string
{
diff --git a/src/Event/Value/ComparisonFailure.php b/src/Event/Value/ComparisonFailure.php
index 9b88901a31f..c31f93e65cd 100644
--- a/src/Event/Value/ComparisonFailure.php
+++ b/src/Event/Value/ComparisonFailure.php
@@ -10,7 +10,7 @@
namespace PHPUnit\Event\Code;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
diff --git a/src/Event/Value/ComparisonFailureBuilder.php b/src/Event/Value/ComparisonFailureBuilder.php
index be411a9d983..53fe0d09aec 100644
--- a/src/Event/Value/ComparisonFailureBuilder.php
+++ b/src/Event/Value/ComparisonFailureBuilder.php
@@ -16,9 +16,11 @@
use Throwable;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
-final class ComparisonFailureBuilder
+final readonly class ComparisonFailureBuilder
{
public static function from(Throwable $t): ?ComparisonFailure
{
@@ -26,19 +28,19 @@ public static function from(Throwable $t): ?ComparisonFailure
return null;
}
- if (!$t->getComparisonFailure()) {
+ if ($t->getComparisonFailure() === null) {
return null;
}
$expectedAsString = $t->getComparisonFailure()->getExpectedAsString();
- if (empty($expectedAsString)) {
+ if ($expectedAsString === '') {
$expectedAsString = self::mapScalarValueToString($t->getComparisonFailure()->getExpected());
}
$actualAsString = $t->getComparisonFailure()->getActualAsString();
- if (empty($actualAsString)) {
+ if ($actualAsString === '') {
$actualAsString = self::mapScalarValueToString($t->getComparisonFailure()->getActual());
}
diff --git a/src/Event/Value/Runtime/OperatingSystem.php b/src/Event/Value/Runtime/OperatingSystem.php
index 628c439221e..508d809f103 100644
--- a/src/Event/Value/Runtime/OperatingSystem.php
+++ b/src/Event/Value/Runtime/OperatingSystem.php
@@ -13,7 +13,7 @@
use const PHP_OS_FAMILY;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
diff --git a/src/Event/Value/Runtime/PHP.php b/src/Event/Value/Runtime/PHP.php
index e81953d1f52..46004f98c65 100644
--- a/src/Event/Value/Runtime/PHP.php
+++ b/src/Event/Value/Runtime/PHP.php
@@ -21,7 +21,7 @@
use function sort;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -36,7 +36,7 @@
private string $sapi;
/**
- * @psalm-var list
+ * @var list
*/
private array $extensions;
@@ -96,7 +96,7 @@ public function versionId(): int
}
/**
- * @psalm-return list
+ * @return list
*/
public function extensions(): array
{
diff --git a/src/Event/Value/Runtime/PHPUnit.php b/src/Event/Value/Runtime/PHPUnit.php
index c4006bc15c8..7f85133d2cc 100644
--- a/src/Event/Value/Runtime/PHPUnit.php
+++ b/src/Event/Value/Runtime/PHPUnit.php
@@ -12,7 +12,7 @@
use PHPUnit\Runner\Version;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
diff --git a/src/Event/Value/Runtime/Runtime.php b/src/Event/Value/Runtime/Runtime.php
index 406393c2698..552ec98878f 100644
--- a/src/Event/Value/Runtime/Runtime.php
+++ b/src/Event/Value/Runtime/Runtime.php
@@ -12,7 +12,7 @@
use function sprintf;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
diff --git a/src/Event/Value/Telemetry/Duration.php b/src/Event/Value/Telemetry/Duration.php
index 40ded7b1b73..230150a159b 100644
--- a/src/Event/Value/Telemetry/Duration.php
+++ b/src/Event/Value/Telemetry/Duration.php
@@ -14,7 +14,7 @@
use PHPUnit\Event\InvalidArgumentException;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
diff --git a/src/Event/Value/Telemetry/GarbageCollectorStatus.php b/src/Event/Value/Telemetry/GarbageCollectorStatus.php
index e1eec1bf7f7..f8bb77a74ec 100644
--- a/src/Event/Value/Telemetry/GarbageCollectorStatus.php
+++ b/src/Event/Value/Telemetry/GarbageCollectorStatus.php
@@ -9,10 +9,8 @@
*/
namespace PHPUnit\Event\Telemetry;
-use PHPUnit\Event\RuntimeException;
-
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -22,16 +20,16 @@
private int $collected;
private int $threshold;
private int $roots;
- private ?float $applicationTime;
- private ?float $collectorTime;
- private ?float $destructorTime;
- private ?float $freeTime;
- private ?bool $running;
- private ?bool $protected;
- private ?bool $full;
- private ?int $bufferSize;
-
- public function __construct(int $runs, int $collected, int $threshold, int $roots, ?float $applicationTime, ?float $collectorTime, ?float $destructorTime, ?float $freeTime, ?bool $running, ?bool $protected, ?bool $full, ?int $bufferSize)
+ private float $applicationTime;
+ private float $collectorTime;
+ private float $destructorTime;
+ private float $freeTime;
+ private bool $running;
+ private bool $protected;
+ private bool $full;
+ private int $bufferSize;
+
+ public function __construct(int $runs, int $collected, int $threshold, int $roots, float $applicationTime, float $collectorTime, float $destructorTime, float $freeTime, bool $running, bool $protected, bool $full, int $bufferSize)
{
$this->runs = $runs;
$this->collected = $collected;
@@ -67,114 +65,43 @@ public function roots(): int
return $this->roots;
}
- /**
- * @psalm-assert-if-true !null $this->applicationTime
- * @psalm-assert-if-true !null $this->collectorTime
- * @psalm-assert-if-true !null $this->destructorTime
- * @psalm-assert-if-true !null $this->freeTime
- * @psalm-assert-if-true !null $this->running
- * @psalm-assert-if-true !null $this->protected
- * @psalm-assert-if-true !null $this->full
- * @psalm-assert-if-true !null $this->bufferSize
- */
- public function hasExtendedInformation(): bool
- {
- return $this->running !== null;
- }
-
- /**
- * @throws RuntimeException on PHP < 8.3
- */
public function applicationTime(): float
{
- if ($this->applicationTime === null) {
- throw new RuntimeException('Information not available');
- }
-
return $this->applicationTime;
}
- /**
- * @throws RuntimeException on PHP < 8.3
- */
public function collectorTime(): float
{
- if ($this->collectorTime === null) {
- throw new RuntimeException('Information not available');
- }
-
return $this->collectorTime;
}
- /**
- * @throws RuntimeException on PHP < 8.3
- */
public function destructorTime(): float
{
- if ($this->destructorTime === null) {
- throw new RuntimeException('Information not available');
- }
-
return $this->destructorTime;
}
- /**
- * @throws RuntimeException on PHP < 8.3
- */
public function freeTime(): float
{
- if ($this->freeTime === null) {
- throw new RuntimeException('Information not available');
- }
-
return $this->freeTime;
}
- /**
- * @throws RuntimeException on PHP < 8.3
- */
public function isRunning(): bool
{
- if ($this->running === null) {
- throw new RuntimeException('Information not available');
- }
-
return $this->running;
}
- /**
- * @throws RuntimeException on PHP < 8.3
- */
public function isProtected(): bool
{
- if ($this->protected === null) {
- throw new RuntimeException('Information not available');
- }
-
return $this->protected;
}
- /**
- * @throws RuntimeException on PHP < 8.3
- */
public function isFull(): bool
{
- if ($this->full === null) {
- throw new RuntimeException('Information not available');
- }
-
return $this->full;
}
- /**
- * @throws RuntimeException on PHP < 8.3
- */
public function bufferSize(): int
{
- if ($this->bufferSize === null) {
- throw new RuntimeException('Information not available');
- }
-
return $this->bufferSize;
}
}
diff --git a/src/Event/Value/Telemetry/GarbageCollectorStatusProvider.php b/src/Event/Value/Telemetry/GarbageCollectorStatusProvider.php
index 15651208e78..09bede2e539 100644
--- a/src/Event/Value/Telemetry/GarbageCollectorStatusProvider.php
+++ b/src/Event/Value/Telemetry/GarbageCollectorStatusProvider.php
@@ -10,6 +10,8 @@
namespace PHPUnit\Event\Telemetry;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This interface is not covered by the backward compatibility promise for PHPUnit
*/
interface GarbageCollectorStatusProvider
diff --git a/src/Event/Value/Telemetry/HRTime.php b/src/Event/Value/Telemetry/HRTime.php
index 96e0e559a5a..8a7b97ebd04 100644
--- a/src/Event/Value/Telemetry/HRTime.php
+++ b/src/Event/Value/Telemetry/HRTime.php
@@ -13,7 +13,7 @@
use PHPUnit\Event\InvalidArgumentException;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -56,9 +56,6 @@ public function nanoseconds(): int
return $this->nanoseconds;
}
- /**
- * @throws InvalidArgumentException
- */
public function duration(self $start): Duration
{
$seconds = $this->seconds - $start->seconds();
@@ -71,7 +68,7 @@ public function duration(self $start): Duration
}
if ($seconds < 0) {
- throw new InvalidArgumentException('Start needs to be smaller.');
+ return Duration::fromSecondsAndNanoseconds(0, 0);
}
return Duration::fromSecondsAndNanoseconds(
diff --git a/src/Event/Value/Telemetry/Info.php b/src/Event/Value/Telemetry/Info.php
index 94b2afea2e9..a0d0a99f169 100644
--- a/src/Event/Value/Telemetry/Info.php
+++ b/src/Event/Value/Telemetry/Info.php
@@ -12,7 +12,7 @@
use function sprintf;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
@@ -79,7 +79,7 @@ public function asString(): string
'[%s / %s] [%d bytes]',
$this->durationSinceStart()->asString(),
$this->durationSincePrevious()->asString(),
- $this->memoryUsage()->bytes(),
+ $this->peakMemoryUsage()->bytes(),
);
}
}
diff --git a/src/Event/Value/Telemetry/MemoryMeter.php b/src/Event/Value/Telemetry/MemoryMeter.php
index 4955397e5d8..4d116ff3ef3 100644
--- a/src/Event/Value/Telemetry/MemoryMeter.php
+++ b/src/Event/Value/Telemetry/MemoryMeter.php
@@ -10,6 +10,8 @@
namespace PHPUnit\Event\Telemetry;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This interface is not covered by the backward compatibility promise for PHPUnit
*/
interface MemoryMeter
diff --git a/src/Event/Value/Telemetry/MemoryUsage.php b/src/Event/Value/Telemetry/MemoryUsage.php
index 384fa7d0d82..8ace32ea0bf 100644
--- a/src/Event/Value/Telemetry/MemoryUsage.php
+++ b/src/Event/Value/Telemetry/MemoryUsage.php
@@ -10,7 +10,7 @@
namespace PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
diff --git a/src/Event/Value/Telemetry/Php81GarbageCollectorStatusProvider.php b/src/Event/Value/Telemetry/Php81GarbageCollectorStatusProvider.php
deleted file mode 100644
index 335a7e245ef..00000000000
--- a/src/Event/Value/Telemetry/Php81GarbageCollectorStatusProvider.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Telemetry;
-
-use function gc_status;
-
-/**
- * @internal This class is not covered by the backward compatibility promise for PHPUnit
- */
-final class Php81GarbageCollectorStatusProvider implements GarbageCollectorStatusProvider
-{
- public function status(): GarbageCollectorStatus
- {
- $status = gc_status();
-
- return new GarbageCollectorStatus(
- $status['runs'],
- $status['collected'],
- $status['threshold'],
- $status['roots'],
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- );
- }
-}
diff --git a/src/Event/Value/Telemetry/Php83GarbageCollectorStatusProvider.php b/src/Event/Value/Telemetry/Php83GarbageCollectorStatusProvider.php
deleted file mode 100644
index c3808b6b99d..00000000000
--- a/src/Event/Value/Telemetry/Php83GarbageCollectorStatusProvider.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-namespace PHPUnit\Event\Telemetry;
-
-use function gc_status;
-
-/**
- * @internal This class is not covered by the backward compatibility promise for PHPUnit
- */
-final class Php83GarbageCollectorStatusProvider implements GarbageCollectorStatusProvider
-{
- public function status(): GarbageCollectorStatus
- {
- $status = gc_status();
-
- return new GarbageCollectorStatus(
- $status['runs'],
- $status['collected'],
- $status['threshold'],
- $status['roots'],
- $status['application_time'],
- $status['collector_time'],
- $status['destructor_time'],
- $status['free_time'],
- $status['running'],
- $status['protected'],
- $status['full'],
- $status['buffer_size'],
- );
- }
-}
diff --git a/src/Event/Value/Telemetry/Snapshot.php b/src/Event/Value/Telemetry/Snapshot.php
index 29fc1407200..0f00f5d8054 100644
--- a/src/Event/Value/Telemetry/Snapshot.php
+++ b/src/Event/Value/Telemetry/Snapshot.php
@@ -10,7 +10,7 @@
namespace PHPUnit\Event\Telemetry;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
diff --git a/src/Event/Value/Telemetry/StopWatch.php b/src/Event/Value/Telemetry/StopWatch.php
index 8a1492571a4..07ce5227faa 100644
--- a/src/Event/Value/Telemetry/StopWatch.php
+++ b/src/Event/Value/Telemetry/StopWatch.php
@@ -10,6 +10,8 @@
namespace PHPUnit\Event\Telemetry;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This interface is not covered by the backward compatibility promise for PHPUnit
*/
interface StopWatch
diff --git a/src/Event/Value/Telemetry/System.php b/src/Event/Value/Telemetry/System.php
index e8bcab255e1..0a178363e55 100644
--- a/src/Event/Value/Telemetry/System.php
+++ b/src/Event/Value/Telemetry/System.php
@@ -10,6 +10,8 @@
namespace PHPUnit\Event\Telemetry;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class System
diff --git a/src/Event/Value/Telemetry/SystemGarbageCollectorStatusProvider.php b/src/Event/Value/Telemetry/SystemGarbageCollectorStatusProvider.php
new file mode 100644
index 00000000000..3f33d690d0e
--- /dev/null
+++ b/src/Event/Value/Telemetry/SystemGarbageCollectorStatusProvider.php
@@ -0,0 +1,40 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Telemetry;
+
+use function gc_status;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
+ * @internal This class is not covered by the backward compatibility promise for PHPUnit
+ */
+final readonly class SystemGarbageCollectorStatusProvider implements GarbageCollectorStatusProvider
+{
+ public function status(): GarbageCollectorStatus
+ {
+ $status = gc_status();
+
+ return new GarbageCollectorStatus(
+ $status['runs'],
+ $status['collected'],
+ $status['threshold'],
+ $status['roots'],
+ $status['application_time'],
+ $status['collector_time'],
+ $status['destructor_time'],
+ $status['free_time'],
+ $status['running'],
+ $status['protected'],
+ $status['full'],
+ $status['buffer_size'],
+ );
+ }
+}
diff --git a/src/Event/Value/Telemetry/SystemMemoryMeter.php b/src/Event/Value/Telemetry/SystemMemoryMeter.php
index f052f6f4498..16d895a949b 100644
--- a/src/Event/Value/Telemetry/SystemMemoryMeter.php
+++ b/src/Event/Value/Telemetry/SystemMemoryMeter.php
@@ -13,17 +13,19 @@
use function memory_get_usage;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
-final class SystemMemoryMeter implements MemoryMeter
+final readonly class SystemMemoryMeter implements MemoryMeter
{
public function memoryUsage(): MemoryUsage
{
- return MemoryUsage::fromBytes(memory_get_usage(true));
+ return MemoryUsage::fromBytes(memory_get_usage());
}
public function peakMemoryUsage(): MemoryUsage
{
- return MemoryUsage::fromBytes(memory_get_peak_usage(true));
+ return MemoryUsage::fromBytes(memory_get_peak_usage());
}
}
diff --git a/src/Event/Value/Telemetry/SystemStopWatch.php b/src/Event/Value/Telemetry/SystemStopWatch.php
index bf37fb4edd7..a57c1032407 100644
--- a/src/Event/Value/Telemetry/SystemStopWatch.php
+++ b/src/Event/Value/Telemetry/SystemStopWatch.php
@@ -13,9 +13,11 @@
use PHPUnit\Event\InvalidArgumentException;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
-final class SystemStopWatch implements StopWatch
+final readonly class SystemStopWatch implements StopWatch
{
/**
* @throws InvalidArgumentException
diff --git a/src/Event/Value/Telemetry/SystemStopWatchWithOffset.php b/src/Event/Value/Telemetry/SystemStopWatchWithOffset.php
index f4515787f36..d27fd98c14b 100644
--- a/src/Event/Value/Telemetry/SystemStopWatchWithOffset.php
+++ b/src/Event/Value/Telemetry/SystemStopWatchWithOffset.php
@@ -13,7 +13,11 @@
use PHPUnit\Event\InvalidArgumentException;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
+ *
+ * @codeCoverageIgnore
*/
final class SystemStopWatchWithOffset implements StopWatch
{
diff --git a/src/Event/Value/Test/Issue/DirectTrigger.php b/src/Event/Value/Test/Issue/DirectTrigger.php
new file mode 100644
index 00000000000..bbb3c66a890
--- /dev/null
+++ b/src/Event/Value/Test/Issue/DirectTrigger.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Code\IssueTrigger;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final class DirectTrigger extends IssueTrigger
+{
+ /**
+ * Your own code triggers an issue in third-party code.
+ */
+ public function isDirect(): true
+ {
+ return true;
+ }
+
+ public function asString(): string
+ {
+ return 'issue triggered by first-party code calling into third-party code';
+ }
+}
diff --git a/src/Event/Value/Test/Issue/IndirectTrigger.php b/src/Event/Value/Test/Issue/IndirectTrigger.php
new file mode 100644
index 00000000000..81f76b45e9a
--- /dev/null
+++ b/src/Event/Value/Test/Issue/IndirectTrigger.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Code\IssueTrigger;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final class IndirectTrigger extends IssueTrigger
+{
+ /**
+ * Third-party code triggers an issue either in your own code or in third-party code.
+ */
+ public function isIndirect(): true
+ {
+ return true;
+ }
+
+ public function asString(): string
+ {
+ return 'issue triggered by third-party code';
+ }
+}
diff --git a/src/Event/Value/Test/Issue/IssueTrigger.php b/src/Event/Value/Test/Issue/IssueTrigger.php
new file mode 100644
index 00000000000..93e42c72950
--- /dev/null
+++ b/src/Event/Value/Test/Issue/IssueTrigger.php
@@ -0,0 +1,97 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Code\IssueTrigger;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+abstract class IssueTrigger
+{
+ public static function test(): TestTrigger
+ {
+ return new TestTrigger;
+ }
+
+ public static function self(): SelfTrigger
+ {
+ return new SelfTrigger;
+ }
+
+ public static function direct(): DirectTrigger
+ {
+ return new DirectTrigger;
+ }
+
+ public static function indirect(): IndirectTrigger
+ {
+ return new IndirectTrigger;
+ }
+
+ public static function unknown(): UnknownTrigger
+ {
+ return new UnknownTrigger;
+ }
+
+ final private function __construct()
+ {
+ }
+
+ /**
+ * Your test code triggers an issue.
+ *
+ * @phpstan-assert-if-true TestTrigger $this
+ */
+ public function isTest(): bool
+ {
+ return false;
+ }
+
+ /**
+ * Your own code triggers an issue in your own code.
+ *
+ * @phpstan-assert-if-true SelfTrigger $this
+ */
+ public function isSelf(): bool
+ {
+ return false;
+ }
+
+ /**
+ * Your own code triggers an issue in third-party code.
+ *
+ * @phpstan-assert-if-true DirectTrigger $this
+ */
+ public function isDirect(): bool
+ {
+ return false;
+ }
+
+ /**
+ * Third-party code triggers an issue either in your own code or in third-party code.
+ *
+ * @phpstan-assert-if-true IndirectTrigger $this
+ */
+ public function isIndirect(): bool
+ {
+ return false;
+ }
+
+ /**
+ * @phpstan-assert-if-true UnknownTrigger $this
+ */
+ public function isUnknown(): bool
+ {
+ return false;
+ }
+
+ abstract public function asString(): string;
+}
diff --git a/src/Event/Value/Test/Issue/SelfTrigger.php b/src/Event/Value/Test/Issue/SelfTrigger.php
new file mode 100644
index 00000000000..e569e72f578
--- /dev/null
+++ b/src/Event/Value/Test/Issue/SelfTrigger.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Code\IssueTrigger;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final class SelfTrigger extends IssueTrigger
+{
+ /**
+ * Your own code triggers an issue in your own code.
+ */
+ public function isSelf(): true
+ {
+ return true;
+ }
+
+ public function asString(): string
+ {
+ return 'issue triggered by first-party code calling into first-party code';
+ }
+}
diff --git a/src/Event/Value/Test/Issue/TestTrigger.php b/src/Event/Value/Test/Issue/TestTrigger.php
new file mode 100644
index 00000000000..4768baca6bd
--- /dev/null
+++ b/src/Event/Value/Test/Issue/TestTrigger.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Code\IssueTrigger;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final class TestTrigger extends IssueTrigger
+{
+ /**
+ * Your test code triggers an issue.
+ */
+ public function isTest(): true
+ {
+ return true;
+ }
+
+ public function asString(): string
+ {
+ return 'issue triggered by test code';
+ }
+}
diff --git a/src/Event/Value/Test/Issue/UnknownTrigger.php b/src/Event/Value/Test/Issue/UnknownTrigger.php
new file mode 100644
index 00000000000..61f81148929
--- /dev/null
+++ b/src/Event/Value/Test/Issue/UnknownTrigger.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Event\Code\IssueTrigger;
+
+/**
+ * @immutable
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ */
+final class UnknownTrigger extends IssueTrigger
+{
+ public function isUnknown(): true
+ {
+ return true;
+ }
+
+ public function asString(): string
+ {
+ return 'unknown if issue was triggered in first-party code or third-party code';
+ }
+}
diff --git a/src/Event/Value/Test/Phpt.php b/src/Event/Value/Test/Phpt.php
index 1056787140d..65a3aec8268 100644
--- a/src/Event/Value/Test/Phpt.php
+++ b/src/Event/Value/Test/Phpt.php
@@ -10,22 +10,19 @@
namespace PHPUnit\Event\Code;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-final class Phpt extends Test
+final readonly class Phpt extends Test
{
- /**
- * @psalm-assert-if-true Phpt $this
- */
- public function isPhpt(): bool
+ public function isPhpt(): true
{
return true;
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function id(): string
{
@@ -33,7 +30,7 @@ public function id(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function name(): string
{
diff --git a/src/Event/Value/Test/Test.php b/src/Event/Value/Test/Test.php
index 6ec899c6053..43ed73eb7b6 100644
--- a/src/Event/Value/Test/Test.php
+++ b/src/Event/Value/Test/Test.php
@@ -10,19 +10,19 @@
namespace PHPUnit\Event\Code;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-abstract class Test
+abstract readonly class Test
{
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
- private readonly string $file;
+ private string $file;
/**
- * @psalm-param non-empty-string $file
+ * @param non-empty-string $file
*/
public function __construct(string $file)
{
@@ -30,7 +30,7 @@ public function __construct(string $file)
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function file(): string
{
@@ -38,7 +38,7 @@ public function file(): string
}
/**
- * @psalm-assert-if-true TestMethod $this
+ * @phpstan-assert-if-true TestMethod $this
*/
public function isTestMethod(): bool
{
@@ -46,7 +46,7 @@ public function isTestMethod(): bool
}
/**
- * @psalm-assert-if-true Phpt $this
+ * @phpstan-assert-if-true Phpt $this
*/
public function isPhpt(): bool
{
@@ -54,12 +54,12 @@ public function isPhpt(): bool
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
abstract public function id(): string;
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
abstract public function name(): string;
}
diff --git a/src/Event/Value/Test/TestCollection.php b/src/Event/Value/Test/TestCollection.php
index e5710468432..1924b64b614 100644
--- a/src/Event/Value/Test/TestCollection.php
+++ b/src/Event/Value/Test/TestCollection.php
@@ -16,19 +16,19 @@
/**
* @template-implements IteratorAggregate
*
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class TestCollection implements Countable, IteratorAggregate
{
/**
- * @psalm-var list
+ * @var list
*/
private array $tests;
/**
- * @psalm-param list $tests
+ * @param list $tests
*/
public static function fromArray(array $tests): self
{
@@ -41,7 +41,7 @@ private function __construct(Test ...$tests)
}
/**
- * @psalm-return list
+ * @return list
*/
public function asArray(): array
{
diff --git a/src/Event/Value/Test/TestCollectionIterator.php b/src/Event/Value/Test/TestCollectionIterator.php
index a392a60e7a3..7c96f3409e4 100644
--- a/src/Event/Value/Test/TestCollectionIterator.php
+++ b/src/Event/Value/Test/TestCollectionIterator.php
@@ -20,7 +20,7 @@
final class TestCollectionIterator implements Iterator
{
/**
- * @psalm-var list
+ * @var list
*/
private readonly array $tests;
private int $position = 0;
diff --git a/src/Event/Value/Test/TestData/DataFromDataProvider.php b/src/Event/Value/Test/TestData/DataFromDataProvider.php
index 7ca96dd0e0e..981fd9e4f65 100644
--- a/src/Event/Value/Test/TestData/DataFromDataProvider.php
+++ b/src/Event/Value/Test/TestData/DataFromDataProvider.php
@@ -10,22 +10,24 @@
namespace PHPUnit\Event\TestData;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-final class DataFromDataProvider extends TestData
+final readonly class DataFromDataProvider extends TestData
{
- private readonly int|string $dataSetName;
+ private int|string $dataSetName;
+ private string $dataAsStringForResultOutput;
- public static function from(int|string $dataSetName, string $data): self
+ public static function from(int|string $dataSetName, string $data, string $dataAsStringForResultOutput): self
{
- return new self($dataSetName, $data);
+ return new self($dataSetName, $data, $dataAsStringForResultOutput);
}
- protected function __construct(int|string $dataSetName, string $data)
+ protected function __construct(int|string $dataSetName, string $data, string $dataAsStringForResultOutput)
{
- $this->dataSetName = $dataSetName;
+ $this->dataSetName = $dataSetName;
+ $this->dataAsStringForResultOutput = $dataAsStringForResultOutput;
parent::__construct($data);
}
@@ -36,9 +38,14 @@ public function dataSetName(): int|string
}
/**
- * @psalm-assert-if-true DataFromDataProvider $this
+ * @internal This method is not covered by the backward compatibility promise for PHPUnit
*/
- public function isFromDataProvider(): bool
+ public function dataAsStringForResultOutput(): string
+ {
+ return $this->dataAsStringForResultOutput;
+ }
+
+ public function isFromDataProvider(): true
{
return true;
}
diff --git a/src/Event/Value/Test/TestData/DataFromTestDependency.php b/src/Event/Value/Test/TestData/DataFromTestDependency.php
index 48fa5cdcd16..9fbf17ebf43 100644
--- a/src/Event/Value/Test/TestData/DataFromTestDependency.php
+++ b/src/Event/Value/Test/TestData/DataFromTestDependency.php
@@ -10,21 +10,18 @@
namespace PHPUnit\Event\TestData;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-final class DataFromTestDependency extends TestData
+final readonly class DataFromTestDependency extends TestData
{
public static function from(string $data): self
{
return new self($data);
}
- /**
- * @psalm-assert-if-true DataFromTestDependency $this
- */
- public function isFromTestDependency(): bool
+ public function isFromTestDependency(): true
{
return true;
}
diff --git a/src/Event/Value/Test/TestData/TestData.php b/src/Event/Value/Test/TestData/TestData.php
index dd68d1f6f62..893444806c2 100644
--- a/src/Event/Value/Test/TestData/TestData.php
+++ b/src/Event/Value/Test/TestData/TestData.php
@@ -10,13 +10,13 @@
namespace PHPUnit\Event\TestData;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-abstract class TestData
+abstract readonly class TestData
{
- private readonly string $data;
+ private string $data;
protected function __construct(string $data)
{
@@ -29,7 +29,7 @@ public function data(): string
}
/**
- * @psalm-assert-if-true DataFromDataProvider $this
+ * @phpstan-assert-if-true DataFromDataProvider $this
*/
public function isFromDataProvider(): bool
{
@@ -37,7 +37,7 @@ public function isFromDataProvider(): bool
}
/**
- * @psalm-assert-if-true DataFromTestDependency $this
+ * @phpstan-assert-if-true DataFromTestDependency $this
*/
public function isFromTestDependency(): bool
{
diff --git a/src/Event/Value/Test/TestData/TestDataCollection.php b/src/Event/Value/Test/TestData/TestDataCollection.php
index 8f8047a5319..460f0c0c59b 100644
--- a/src/Event/Value/Test/TestData/TestDataCollection.php
+++ b/src/Event/Value/Test/TestData/TestDataCollection.php
@@ -18,16 +18,16 @@
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-final class TestDataCollection implements Countable, IteratorAggregate
+final readonly class TestDataCollection implements Countable, IteratorAggregate
{
/**
- * @psalm-var list
+ * @var list
*/
- private readonly array $data;
- private ?DataFromDataProvider $fromDataProvider = null;
+ private array $data;
+ private ?DataFromDataProvider $fromDataProvider;
/**
- * @psalm-param list $data
+ * @param list $data
*/
public static function fromArray(array $data): self
{
@@ -36,17 +36,20 @@ public static function fromArray(array $data): self
private function __construct(TestData ...$data)
{
+ $fromDataProvider = null;
+
foreach ($data as $_data) {
if ($_data->isFromDataProvider()) {
- $this->fromDataProvider = $_data;
+ $fromDataProvider = $_data;
}
}
- $this->data = $data;
+ $this->data = $data;
+ $this->fromDataProvider = $fromDataProvider;
}
/**
- * @psalm-return list
+ * @return list
*/
public function asArray(): array
{
@@ -59,7 +62,7 @@ public function count(): int
}
/**
- * @psalm-assert-if-true !null $this->fromDataProvider
+ * @phpstan-assert-if-true !null $this->fromDataProvider
*/
public function hasDataFromDataProvider(): bool
{
diff --git a/src/Event/Value/Test/TestData/TestDataCollectionIterator.php b/src/Event/Value/Test/TestData/TestDataCollectionIterator.php
index 93f02c490bb..aebed66ca17 100644
--- a/src/Event/Value/Test/TestData/TestDataCollectionIterator.php
+++ b/src/Event/Value/Test/TestData/TestDataCollectionIterator.php
@@ -20,7 +20,7 @@
final class TestDataCollectionIterator implements Iterator
{
/**
- * @psalm-var list
+ * @var list
*/
private readonly array $data;
private int $position = 0;
diff --git a/src/Event/Value/Test/TestDox.php b/src/Event/Value/Test/TestDox.php
index 2703a368500..53604dbfc65 100644
--- a/src/Event/Value/Test/TestDox.php
+++ b/src/Event/Value/Test/TestDox.php
@@ -10,7 +10,7 @@
namespace PHPUnit\Event\Code;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
diff --git a/src/Event/Value/Test/TestDoxBuilder.php b/src/Event/Value/Test/TestDoxBuilder.php
index edad458748c..af7e8b5ba86 100644
--- a/src/Event/Value/Test/TestDoxBuilder.php
+++ b/src/Event/Value/Test/TestDoxBuilder.php
@@ -13,9 +13,11 @@
use PHPUnit\Logging\TestDox\NamePrettifier;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
-final class TestDoxBuilder
+final readonly class TestDoxBuilder
{
public static function fromTestCase(TestCase $testCase): TestDox
{
@@ -29,17 +31,19 @@ public static function fromTestCase(TestCase $testCase): TestDox
}
/**
- * @psalm-param class-string $className
- * @psalm-param non-empty-string $methodName
+ * @param class-string $className
+ * @param non-empty-string $methodName
*/
public static function fromClassNameAndMethodName(string $className, string $methodName): TestDox
{
$prettifier = new NamePrettifier;
+ $prettifiedMethodName = $prettifier->prettifyTestMethodName($methodName);
+
return new TestDox(
$prettifier->prettifyTestClassName($className),
- $prettifier->prettifyTestMethodName($methodName),
- $prettifier->prettifyTestMethodName($methodName),
+ $prettifiedMethodName,
+ $prettifiedMethodName,
);
}
}
diff --git a/src/Event/Value/Test/TestMethod.php b/src/Event/Value/Test/TestMethod.php
index 58b2e015297..4c972645436 100644
--- a/src/Event/Value/Test/TestMethod.php
+++ b/src/Event/Value/Test/TestMethod.php
@@ -9,43 +9,41 @@
*/
namespace PHPUnit\Event\Code;
-use function assert;
use function is_int;
use function sprintf;
-use PHPUnit\Event\TestData\NoDataSetFromDataProviderException;
use PHPUnit\Event\TestData\TestDataCollection;
use PHPUnit\Metadata\MetadataCollection;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-final class TestMethod extends Test
+final readonly class TestMethod extends Test
{
/**
- * @psalm-var class-string
+ * @var class-string
*/
- private readonly string $className;
+ private string $className;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
- private readonly string $methodName;
+ private string $methodName;
/**
- * @psalm-var non-negative-int
+ * @var non-negative-int
*/
- private readonly int $line;
- private readonly TestDox $testDox;
- private readonly MetadataCollection $metadata;
- private readonly TestDataCollection $testData;
+ private int $line;
+ private TestDox $testDox;
+ private MetadataCollection $metadata;
+ private TestDataCollection $testData;
/**
- * @psalm-param class-string $className
- * @psalm-param non-empty-string $methodName
- * @psalm-param non-empty-string $file
- * @psalm-param non-negative-int $line
+ * @param class-string $className
+ * @param non-empty-string $methodName
+ * @param non-empty-string $file
+ * @param non-negative-int $line
*/
public function __construct(string $className, string $methodName, string $file, int $line, TestDox $testDox, MetadataCollection $metadata, TestDataCollection $testData)
{
@@ -60,7 +58,7 @@ public function __construct(string $className, string $methodName, string $file,
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function className(): string
{
@@ -68,7 +66,7 @@ public function className(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function methodName(): string
{
@@ -76,7 +74,7 @@ public function methodName(): string
}
/**
- * @psalm-return non-negative-int
+ * @return non-negative-int
*/
public function line(): int
{
@@ -98,18 +96,13 @@ public function testData(): TestDataCollection
return $this->testData;
}
- /**
- * @psalm-assert-if-true TestMethod $this
- */
- public function isTestMethod(): bool
+ public function isTestMethod(): true
{
return true;
}
/**
- * @psalm-return non-empty-string
- *
- * @throws NoDataSetFromDataProviderException
+ * @return non-empty-string
*/
public function id(): string
{
@@ -123,9 +116,7 @@ public function id(): string
}
/**
- * @psalm-return non-empty-string
- *
- * @throws NoDataSetFromDataProviderException
+ * @return non-empty-string
*/
public function nameWithClass(): string
{
@@ -133,9 +124,7 @@ public function nameWithClass(): string
}
/**
- * @psalm-return non-empty-string
- *
- * @throws NoDataSetFromDataProviderException
+ * @return non-empty-string
*/
public function name(): string
{
diff --git a/src/Event/Value/Test/TestMethodBuilder.php b/src/Event/Value/Test/TestMethodBuilder.php
index 8a276fec0bd..e88a5ae400b 100644
--- a/src/Event/Value/Test/TestMethodBuilder.php
+++ b/src/Event/Value/Test/TestMethodBuilder.php
@@ -9,10 +9,7 @@
*/
namespace PHPUnit\Event\Code;
-use function assert;
-use function debug_backtrace;
use function is_numeric;
-use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Event\TestData\DataFromDataProvider;
use PHPUnit\Event\TestData\DataFromTestDependency;
use PHPUnit\Event\TestData\TestDataCollection;
@@ -20,19 +17,19 @@
use PHPUnit\Metadata\Parser\Registry as MetadataRegistry;
use PHPUnit\Util\Exporter;
use PHPUnit\Util\Reflection;
+use PHPUnit\Util\Test as TestUtil;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
-final class TestMethodBuilder
+final readonly class TestMethodBuilder
{
public static function fromTestCase(TestCase $testCase): TestMethod
{
$methodName = $testCase->name();
-
- assert(!empty($methodName));
-
- $location = Reflection::sourceLocationFor($testCase::class, $methodName);
+ $location = Reflection::sourceLocationFor($testCase::class, $methodName);
return new TestMethod(
$testCase::class,
@@ -50,13 +47,7 @@ public static function fromTestCase(TestCase $testCase): TestMethod
*/
public static function fromCallStack(): TestMethod
{
- foreach (debug_backtrace() as $frame) {
- if (isset($frame['object']) && $frame['object'] instanceof TestCase) {
- return $frame['object']->valueObjectForEvents();
- }
- }
-
- throw new NoTestCaseObjectOnCallStackException;
+ return TestUtil::currentTestCase()->valueObjectForEvents();
}
private static function dataFor(TestCase $testCase): TestDataCollection
@@ -72,13 +63,14 @@ private static function dataFor(TestCase $testCase): TestDataCollection
$testData[] = DataFromDataProvider::from(
$dataSetName,
- Exporter::export($testCase->providedData(), EventFacade::emitter()->exportsObjects()),
+ Exporter::export($testCase->providedData()),
+ $testCase->dataSetAsStringWithData(),
);
}
if ($testCase->hasDependencyInput()) {
$testData[] = DataFromTestDependency::from(
- Exporter::export($testCase->dependencyInput(), EventFacade::emitter()->exportsObjects()),
+ Exporter::export($testCase->dependencyInput()),
);
}
diff --git a/src/Event/Value/TestSuite/TestSuite.php b/src/Event/Value/TestSuite/TestSuite.php
index 744f7095e0f..783de57bd24 100644
--- a/src/Event/Value/TestSuite/TestSuite.php
+++ b/src/Event/Value/TestSuite/TestSuite.php
@@ -12,21 +12,21 @@
use PHPUnit\Event\Code\TestCollection;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-abstract class TestSuite
+abstract readonly class TestSuite
{
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
- private readonly string $name;
- private readonly int $count;
- private readonly TestCollection $tests;
+ private string $name;
+ private int $count;
+ private TestCollection $tests;
/**
- * @psalm-param non-empty-string $name
+ * @param non-empty-string $name
*/
public function __construct(string $name, int $size, TestCollection $tests)
{
@@ -36,7 +36,7 @@ public function __construct(string $name, int $size, TestCollection $tests)
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function name(): string
{
@@ -54,7 +54,7 @@ public function tests(): TestCollection
}
/**
- * @psalm-assert-if-true TestSuiteWithName $this
+ * @phpstan-assert-if-true TestSuiteWithName $this
*/
public function isWithName(): bool
{
@@ -62,7 +62,7 @@ public function isWithName(): bool
}
/**
- * @psalm-assert-if-true TestSuiteForTestClass $this
+ * @phpstan-assert-if-true TestSuiteForTestClass $this
*/
public function isForTestClass(): bool
{
@@ -70,7 +70,7 @@ public function isForTestClass(): bool
}
/**
- * @psalm-assert-if-true TestSuiteForTestMethodWithDataProvider $this
+ * @phpstan-assert-if-true TestSuiteForTestMethodWithDataProvider $this
*/
public function isForTestMethodWithDataProvider(): bool
{
diff --git a/src/Event/Value/TestSuite/TestSuiteBuilder.php b/src/Event/Value/TestSuite/TestSuiteBuilder.php
index c8988693076..3192636baa9 100644
--- a/src/Event/Value/TestSuite/TestSuiteBuilder.php
+++ b/src/Event/Value/TestSuite/TestSuiteBuilder.php
@@ -9,90 +9,83 @@
*/
namespace PHPUnit\Event\TestSuite;
+use function assert;
+use function class_exists;
+use function count;
use function explode;
+use function method_exists;
use PHPUnit\Event\Code\Test;
use PHPUnit\Event\Code\TestCollection;
use PHPUnit\Event\RuntimeException;
use PHPUnit\Framework\DataProviderTestSuite;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\TestSuite as FrameworkTestSuite;
-use PHPUnit\Runner\PhptTestCase;
+use PHPUnit\Runner\Phpt\TestCase as PhptTestCase;
use ReflectionClass;
-use ReflectionException;
use ReflectionMethod;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
-final class TestSuiteBuilder
+final readonly class TestSuiteBuilder
{
/**
* @throws RuntimeException
*/
public static function from(FrameworkTestSuite $testSuite): TestSuite
{
- $groups = [];
-
- foreach ($testSuite->groupDetails() as $groupName => $tests) {
- if (!isset($groups[$groupName])) {
- $groups[$groupName] = [];
- }
-
- foreach ($tests as $test) {
- $groups[$groupName][] = $test::class;
- }
- }
-
$tests = [];
self::process($testSuite, $tests);
if ($testSuite instanceof DataProviderTestSuite) {
+ assert(count(explode('::', $testSuite->name())) === 2);
[$className, $methodName] = explode('::', $testSuite->name());
- try {
- $reflector = new ReflectionMethod($className, $methodName);
-
- return new TestSuiteForTestMethodWithDataProvider(
- $testSuite->name(),
- $testSuite->count(),
- TestCollection::fromArray($tests),
- $className,
- $methodName,
- $reflector->getFileName(),
- $reflector->getStartLine(),
- );
- // @codeCoverageIgnoreStart
- } catch (ReflectionException $e) {
- throw new RuntimeException(
- $e->getMessage(),
- $e->getCode(),
- $e,
- );
- }
- // @codeCoverageIgnoreEnd
+ assert(class_exists($className));
+ assert($methodName !== '' && method_exists($className, $methodName));
+
+ $reflector = new ReflectionMethod($className, $methodName);
+
+ $file = $reflector->getFileName();
+ $line = $reflector->getStartLine();
+
+ assert($file !== false);
+ assert($line !== false);
+
+ return new TestSuiteForTestMethodWithDataProvider(
+ $testSuite->name(),
+ $testSuite->count(),
+ TestCollection::fromArray($tests),
+ $className,
+ $methodName,
+ $file,
+ $line,
+ );
}
if ($testSuite->isForTestClass()) {
- try {
- $reflector = new ReflectionClass($testSuite->name());
-
- return new TestSuiteForTestClass(
- $testSuite->name(),
- $testSuite->count(),
- TestCollection::fromArray($tests),
- $reflector->getFileName(),
- $reflector->getStartLine(),
- );
- // @codeCoverageIgnoreStart
- } catch (ReflectionException $e) {
- throw new RuntimeException(
- $e->getMessage(),
- $e->getCode(),
- $e,
- );
- }
- // @codeCoverageIgnoreEnd
+ $testClassName = $testSuite->name();
+
+ assert(class_exists($testClassName));
+
+ $reflector = new ReflectionClass($testClassName);
+
+ $file = $reflector->getFileName();
+ $line = $reflector->getStartLine();
+
+ assert($file !== false);
+ assert($line !== false);
+
+ return new TestSuiteForTestClass(
+ $testClassName,
+ $testSuite->count(),
+ TestCollection::fromArray($tests),
+ $file,
+ $line,
+ );
}
return new TestSuiteWithName(
@@ -103,11 +96,11 @@ public static function from(FrameworkTestSuite $testSuite): TestSuite
}
/**
- * @psalm-param list $tests
+ * @param list $tests
*/
- private static function process(FrameworkTestSuite $testSuite, &$tests): void
+ private static function process(FrameworkTestSuite $testSuite, array &$tests): void
{
- foreach ($testSuite->tests() as $test) {
+ foreach ($testSuite->getIterator() as $test) {
if ($test instanceof FrameworkTestSuite) {
self::process($test, $tests);
diff --git a/src/Event/Value/TestSuite/TestSuiteForTestClass.php b/src/Event/Value/TestSuite/TestSuiteForTestClass.php
index fcfc9d0a296..34ad9d5eac3 100644
--- a/src/Event/Value/TestSuite/TestSuiteForTestClass.php
+++ b/src/Event/Value/TestSuite/TestSuiteForTestClass.php
@@ -12,21 +12,21 @@
use PHPUnit\Event\Code\TestCollection;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-final class TestSuiteForTestClass extends TestSuite
+final readonly class TestSuiteForTestClass extends TestSuite
{
/**
- * @psalm-var class-string
+ * @var class-string
*/
- private readonly string $className;
- private readonly string $file;
- private readonly int $line;
+ private string $className;
+ private string $file;
+ private int $line;
/**
- * @psalm-param class-string $name
+ * @param class-string $name
*/
public function __construct(string $name, int $size, TestCollection $tests, string $file, int $line)
{
@@ -38,7 +38,7 @@ public function __construct(string $name, int $size, TestCollection $tests, stri
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function className(): string
{
@@ -55,10 +55,7 @@ public function line(): int
return $this->line;
}
- /**
- * @psalm-assert-if-true TestSuiteForTestClass $this
- */
- public function isForTestClass(): bool
+ public function isForTestClass(): true
{
return true;
}
diff --git a/src/Event/Value/TestSuite/TestSuiteForTestMethodWithDataProvider.php b/src/Event/Value/TestSuite/TestSuiteForTestMethodWithDataProvider.php
index 29bebc6f42d..67a94391dd5 100644
--- a/src/Event/Value/TestSuite/TestSuiteForTestMethodWithDataProvider.php
+++ b/src/Event/Value/TestSuite/TestSuiteForTestMethodWithDataProvider.php
@@ -12,28 +12,28 @@
use PHPUnit\Event\Code\TestCollection;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-final class TestSuiteForTestMethodWithDataProvider extends TestSuite
+final readonly class TestSuiteForTestMethodWithDataProvider extends TestSuite
{
/**
- * @psalm-var class-string
+ * @var class-string
*/
- private readonly string $className;
+ private string $className;
/**
- * @psalm-var non-empty-string
+ * @var non-empty-string
*/
- private readonly string $methodName;
- private readonly string $file;
- private readonly int $line;
+ private string $methodName;
+ private string $file;
+ private int $line;
/**
- * @psalm-param non-empty-string $name
- * @psalm-param class-string $className
- * @psalm-param non-empty-string $methodName
+ * @param non-empty-string $name
+ * @param class-string $className
+ * @param non-empty-string $methodName
*/
public function __construct(string $name, int $size, TestCollection $tests, string $className, string $methodName, string $file, int $line)
{
@@ -46,7 +46,7 @@ public function __construct(string $name, int $size, TestCollection $tests, stri
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function className(): string
{
@@ -54,7 +54,7 @@ public function className(): string
}
/**
- * @psalm-return non-empty-string
+ * @return non-empty-string
*/
public function methodName(): string
{
@@ -71,10 +71,7 @@ public function line(): int
return $this->line;
}
- /**
- * @psalm-assert-if-true TestSuiteForTestMethodWithDataProvider $this
- */
- public function isForTestMethodWithDataProvider(): bool
+ public function isForTestMethodWithDataProvider(): true
{
return true;
}
diff --git a/src/Event/Value/TestSuite/TestSuiteWithName.php b/src/Event/Value/TestSuite/TestSuiteWithName.php
index 68c2f706c49..4823fb26333 100644
--- a/src/Event/Value/TestSuite/TestSuiteWithName.php
+++ b/src/Event/Value/TestSuite/TestSuiteWithName.php
@@ -10,16 +10,13 @@
namespace PHPUnit\Event\TestSuite;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
-final class TestSuiteWithName extends TestSuite
+final readonly class TestSuiteWithName extends TestSuite
{
- /**
- * @psalm-assert-if-true TestSuiteWithName $this
- */
- public function isWithName(): bool
+ public function isWithName(): true
{
return true;
}
diff --git a/src/Event/Value/Throwable.php b/src/Event/Value/Throwable.php
index c294de51e44..e48cf1a3ac6 100644
--- a/src/Event/Value/Throwable.php
+++ b/src/Event/Value/Throwable.php
@@ -13,14 +13,14 @@
use PHPUnit\Event\NoPreviousThrowableException;
/**
- * @psalm-immutable
+ * @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class Throwable
{
/**
- * @psalm-var class-string
+ * @var class-string
*/
private string $className;
private string $message;
@@ -29,7 +29,7 @@
private ?Throwable $previous;
/**
- * @psalm-param class-string $className
+ * @param class-string $className
*/
public function __construct(string $className, string $message, string $description, string $stackTrace, ?self $previous)
{
@@ -47,7 +47,7 @@ public function asString(): string
{
$buffer = $this->description();
- if (!empty($this->stackTrace())) {
+ if ($this->stackTrace() !== '') {
$buffer .= PHP_EOL . $this->stackTrace();
}
@@ -59,7 +59,7 @@ public function asString(): string
}
/**
- * @psalm-return class-string
+ * @return class-string
*/
public function className(): string
{
@@ -82,7 +82,7 @@ public function stackTrace(): string
}
/**
- * @psalm-assert-if-true !null $this->previous
+ * @phpstan-assert-if-true !null $this->previous
*/
public function hasPrevious(): bool
{
diff --git a/src/Event/Value/ThrowableBuilder.php b/src/Event/Value/ThrowableBuilder.php
index aed9144fb88..7db4beea721 100644
--- a/src/Event/Value/ThrowableBuilder.php
+++ b/src/Event/Value/ThrowableBuilder.php
@@ -15,9 +15,11 @@
use PHPUnit\Util\ThrowableToStringMapper;
/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
+ *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
-final class ThrowableBuilder
+final readonly class ThrowableBuilder
{
/**
* @throws Exception
@@ -35,7 +37,7 @@ public static function from(\Throwable $t): Throwable
$t::class,
$t->getMessage(),
ThrowableToStringMapper::map($t),
- Filter::getFilteredStacktrace($t),
+ Filter::stackTraceFromThrowableAsString($t, false),
$previous,
);
}
diff --git a/src/Framework/Assert.php b/src/Framework/Assert.php
index 83684b04d25..91f940af36b 100644
--- a/src/Framework/Assert.php
+++ b/src/Framework/Assert.php
@@ -9,15 +9,18 @@
*/
namespace PHPUnit\Framework;
+use function array_combine;
+use function array_intersect_key;
use function class_exists;
use function count;
use function file_get_contents;
use function interface_exists;
use function is_bool;
+use function sprintf;
use ArrayAccess;
use Countable;
use Generator;
-use PHPUnit\Event;
+use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Framework\Constraint\ArrayHasKey;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\Constraint\Constraint;
@@ -72,153 +75,891 @@ abstract class Assert
{
private static int $count = 0;
+ /**
+ * Asserts that two arrays are equal while only considering a list of keys.
+ *
+ * @param array $expected
+ * @param array $actual
+ * @param non-empty-list $keysToBeConsidered
+ *
+ * @throws Exception
+ * @throws ExpectationFailedException
+ */
+ final public static function assertArrayIsEqualToArrayOnlyConsideringListOfKeys(array $expected, array $actual, array $keysToBeConsidered, string $message = ''): void
+ {
+ $filteredExpected = [];
+
+ foreach ($keysToBeConsidered as $key) {
+ if (isset($expected[$key])) {
+ $filteredExpected[$key] = $expected[$key];
+ }
+ }
+
+ $filteredActual = [];
+
+ foreach ($keysToBeConsidered as $key) {
+ if (isset($actual[$key])) {
+ $filteredActual[$key] = $actual[$key];
+ }
+ }
+
+ self::assertEquals($filteredExpected, $filteredActual, $message);
+ }
+
+ /**
+ * Asserts that two arrays are equal while ignoring a list of keys.
+ *
+ * @param array $expected
+ * @param array $actual
+ * @param non-empty-list $keysToBeIgnored
+ *
+ * @throws Exception
+ * @throws ExpectationFailedException
+ */
+ final public static function assertArrayIsEqualToArrayIgnoringListOfKeys(array $expected, array $actual, array $keysToBeIgnored, string $message = ''): void
+ {
+ foreach ($keysToBeIgnored as $key) {
+ unset($expected[$key], $actual[$key]);
+ }
+
+ self::assertEquals($expected, $actual, $message);
+ }
+
+ /**
+ * Asserts that two arrays are identical while only considering a list of keys.
+ *
+ * @param array $expected
+ * @param array $actual
+ * @param non-empty-list $keysToBeConsidered
+ *
+ * @throws Exception
+ * @throws ExpectationFailedException
+ */
+ final public static function assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys(array $expected, array $actual, array $keysToBeConsidered, string $message = ''): void
+ {
+ $keysToBeConsidered = array_combine($keysToBeConsidered, $keysToBeConsidered);
+ $expected = array_intersect_key($expected, $keysToBeConsidered);
+ $actual = array_intersect_key($actual, $keysToBeConsidered);
+
+ self::assertSame($expected, $actual, $message);
+ }
+
+ /**
+ * Asserts that two arrays are equal while ignoring a list of keys.
+ *
+ * @param array $expected
+ * @param array $actual
+ * @param non-empty-list $keysToBeIgnored
+ *
+ * @throws Exception
+ * @throws ExpectationFailedException
+ */
+ final public static function assertArrayIsIdenticalToArrayIgnoringListOfKeys(array $expected, array $actual, array $keysToBeIgnored, string $message = ''): void
+ {
+ foreach ($keysToBeIgnored as $key) {
+ unset($expected[$key], $actual[$key]);
+ }
+
+ self::assertSame($expected, $actual, $message);
+ }
+
/**
* Asserts that an array has a specified key.
*
+ * @param array|ArrayAccess $array
+ *
* @throws Exception
* @throws ExpectationFailedException
*/
- final public static function assertArrayHasKey(int|string $key, array|ArrayAccess $array, string $message = ''): void
+ final public static function assertArrayHasKey(mixed $key, array|ArrayAccess $array, string $message = ''): void
{
$constraint = new ArrayHasKey($key);
- static::assertThat($array, $constraint, $message);
+ self::assertThat($array, $constraint, $message);
+ }
+
+ /**
+ * Asserts that an array does not have a specified key.
+ *
+ * @param array|ArrayAccess $array
+ *
+ * @throws Exception
+ * @throws ExpectationFailedException
+ */
+ final public static function assertArrayNotHasKey(mixed $key, array|ArrayAccess $array, string $message = ''): void
+ {
+ $constraint = new LogicalNot(
+ new ArrayHasKey($key),
+ );
+
+ self::assertThat($array, $constraint, $message);
+ }
+
+ /**
+ * @phpstan-assert list $array
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertIsList(mixed $array, string $message = ''): void
+ {
+ self::assertThat(
+ $array,
+ new IsList,
+ $message,
+ );
+ }
+
+ /**
+ * Asserts that a haystack contains a needle.
+ *
+ * @param iterable $haystack
+ *
+ * @throws Exception
+ * @throws ExpectationFailedException
+ */
+ final public static function assertContains(mixed $needle, iterable $haystack, string $message = ''): void
+ {
+ $constraint = new TraversableContainsIdentical($needle);
+
+ self::assertThat($haystack, $constraint, $message);
+ }
+
+ /**
+ * @param iterable $haystack
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertContainsEquals(mixed $needle, iterable $haystack, string $message = ''): void
+ {
+ $constraint = new TraversableContainsEqual($needle);
+
+ self::assertThat($haystack, $constraint, $message);
+ }
+
+ /**
+ * Asserts that a haystack does not contain a needle.
+ *
+ * @param iterable $haystack
+ *
+ * @throws Exception
+ * @throws ExpectationFailedException
+ */
+ final public static function assertNotContains(mixed $needle, iterable $haystack, string $message = ''): void
+ {
+ $constraint = new LogicalNot(
+ new TraversableContainsIdentical($needle),
+ );
+
+ self::assertThat($haystack, $constraint, $message);
+ }
+
+ /**
+ * @param iterable $haystack
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertNotContainsEquals(mixed $needle, iterable $haystack, string $message = ''): void
+ {
+ $constraint = new LogicalNot(new TraversableContainsEqual($needle));
+
+ self::assertThat($haystack, $constraint, $message);
+ }
+
+ /**
+ * Asserts that a haystack contains only values of a given type.
+ *
+ * @param 'array'|'bool'|'boolean'|'callable'|'double'|'float'|'int'|'integer'|'iterable'|'null'|'numeric'|'object'|'real'|'resource (closed)'|'resource'|'scalar'|'string' $type
+ * @param iterable $haystack
+ *
+ * @throws Exception
+ * @throws ExpectationFailedException
+ *
+ * @deprecated https://github.com/sebastianbergmann/phpunit/issues/6056
+ */
+ final public static function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void
+ {
+ if ($isNativeType === null) {
+ $isNativeType = self::isNativeType($type);
+ }
+
+ if ($isNativeType) {
+ $replacement = match ($type) {
+ 'array' => 'assertContainsOnlyArray',
+ 'bool' => 'assertContainsOnlyBool',
+ 'boolean' => 'assertContainsOnlyBool',
+ 'callable' => 'assertContainsOnlyCallable',
+ 'double' => 'assertContainsOnlyFloat',
+ 'float' => 'assertContainsOnlyFloat',
+ 'int' => 'assertContainsOnlyInt',
+ 'integer' => 'assertContainsOnlyInt',
+ 'iterable' => 'assertContainsOnlyIterable',
+ 'null' => 'assertContainsOnlyNull',
+ 'numeric' => 'assertContainsOnlyNumeric',
+ 'object' => 'assertContainsOnlyObject',
+ 'real' => 'assertContainsOnlyFloat',
+ 'resource' => 'assertContainsOnlyResource',
+ 'resource (closed)' => 'assertContainsOnlyClosedResource',
+ 'scalar' => 'assertContainsOnlyScalar',
+ 'string' => 'assertContainsOnlyString',
+ };
+
+ EventFacade::emitter()->testTriggeredPhpunitDeprecation(
+ null,
+ sprintf(
+ 'assertContainsOnly() is deprecated and will be removed in PHPUnit 13. ' .
+ 'Please use %s($haystack) instead of assertContainsOnly(\'%s\', $haystack).',
+ $replacement,
+ $type,
+ ),
+ );
+
+ $constraint = TraversableContainsOnly::forNativeType(self::mapNativeType($type));
+ } else {
+ EventFacade::emitter()->testTriggeredPhpunitDeprecation(
+ null,
+ sprintf(
+ 'assertContainsOnly() is deprecated and will be removed in PHPUnit 13. ' .
+ 'Please use assertContainsOnlyInstancesOf(\'%s\', $haystack) instead of assertContainsOnly(\'%s\', $haystack).',
+ $type,
+ $type,
+ ),
+ );
+
+ /** @phpstan-ignore argument.type */
+ $constraint = TraversableContainsOnly::forClassOrInterface($type);
+ }
+
+ self::assertThat($haystack, $constraint, $message);
+ }
+
+ /**
+ * Asserts that a haystack contains only values of type array.
+ *
+ * @phpstan-assert iterable> $haystack
+ *
+ * @param iterable $haystack
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertContainsOnlyArray(iterable $haystack, string $message = ''): void
+ {
+ self::assertThat(
+ $haystack,
+ TraversableContainsOnly::forNativeType(
+ NativeType::Array,
+ ),
+ $message,
+ );
+ }
+
+ /**
+ * Asserts that a haystack contains only values of type bool.
+ *
+ * @phpstan-assert iterable $haystack
+ *
+ * @param iterable $haystack
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertContainsOnlyBool(iterable $haystack, string $message = ''): void
+ {
+ self::assertThat(
+ $haystack,
+ TraversableContainsOnly::forNativeType(
+ NativeType::Bool,
+ ),
+ $message,
+ );
+ }
+
+ /**
+ * Asserts that a haystack contains only values of type callable.
+ *
+ * @phpstan-assert iterable $haystack
+ *
+ * @param iterable $haystack
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertContainsOnlyCallable(iterable $haystack, string $message = ''): void
+ {
+ self::assertThat(
+ $haystack,
+ TraversableContainsOnly::forNativeType(
+ NativeType::Callable,
+ ),
+ $message,
+ );
+ }
+
+ /**
+ * Asserts that a haystack contains only values of type float.
+ *
+ * @phpstan-assert iterable $haystack
+ *
+ * @param iterable $haystack
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertContainsOnlyFloat(iterable $haystack, string $message = ''): void
+ {
+ self::assertThat(
+ $haystack,
+ TraversableContainsOnly::forNativeType(
+ NativeType::Float,
+ ),
+ $message,
+ );
+ }
+
+ /**
+ * Asserts that a haystack contains only values of type int.
+ *
+ * @phpstan-assert iterable $haystack
+ *
+ * @param iterable $haystack
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertContainsOnlyInt(iterable $haystack, string $message = ''): void
+ {
+ self::assertThat(
+ $haystack,
+ TraversableContainsOnly::forNativeType(
+ NativeType::Int,
+ ),
+ $message,
+ );
+ }
+
+ /**
+ * Asserts that a haystack contains only values of type iterable.
+ *
+ * @phpstan-assert iterable> $haystack
+ *
+ * @param iterable $haystack
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertContainsOnlyIterable(iterable $haystack, string $message = ''): void
+ {
+ self::assertThat(
+ $haystack,
+ TraversableContainsOnly::forNativeType(
+ NativeType::Iterable,
+ ),
+ $message,
+ );
+ }
+
+ /**
+ * Asserts that a haystack contains only values of type null.
+ *
+ * @phpstan-assert iterable $haystack
+ *
+ * @param iterable $haystack
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertContainsOnlyNull(iterable $haystack, string $message = ''): void
+ {
+ self::assertThat(
+ $haystack,
+ TraversableContainsOnly::forNativeType(
+ NativeType::Null,
+ ),
+ $message,
+ );
+ }
+
+ /**
+ * Asserts that a haystack contains only values of type numeric.
+ *
+ * @phpstan-assert iterable $haystack
+ *
+ * @param iterable $haystack
+ *
+ * @throws ExpectationFailedException
+ */
+ final public static function assertContainsOnlyNumeric(iterable $haystack, string $message = ''): void
+ {
+ self::assertThat(
+ $haystack,
+ TraversableContainsOnly::forNativeType(
+ NativeType::Numeric,
+ ),
+ $message,
+ );
+ }
+
+ /**
+ * Asserts that a haystack contains only values of type object.
+ *
+ * @phpstan-assert iterable