composer update

This commit is contained in:
2026-07-29 16:32:25 +02:00
parent 1ede9cc3af
commit 8ad8d279e6
1156 changed files with 22791 additions and 22591 deletions
+15 -65
View File
@@ -2,88 +2,38 @@
All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [5.0.0] - 2023-02-03
## [5.1.4] - 2025-09-24
### Changed
* [#42](https://github.com/sebastianbergmann/exporter/pull/42): Improve export of enumerations
* Suppress `unexpected NAN value was coerced to string` warning triggered on PHP 8.5
### Removed
* This component is no longer supported on PHP 7.3, PHP 7.4 and PHP 8.0
## [4.0.5] - 2022-09-14
### Fixed
* [#47](https://github.com/sebastianbergmann/exporter/pull/47): Fix `float` export precision
## [4.0.4] - 2021-11-11
## [5.1.3] - 2025-09-22
### Changed
* [#37](https://github.com/sebastianbergmann/exporter/pull/37): Improve export of closed resources
* Suppress `not representable as an int, cast occurred` warning triggered on PHP 8.5
## [4.0.3] - 2020-09-28
## [5.1.2] - 2024-03-02
### Changed
* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3`
* Do not use implicitly nullable parameters
## [4.0.2] - 2020-06-26
### Added
* This component is now supported on PHP 8
## [4.0.1] - 2020-06-15
## [5.1.1] - 2023-09-24
### Changed
* Tests etc. are now ignored for archive exports
* [#52](https://github.com/sebastianbergmann/exporter/pull/52): Optimize export of large arrays and object graphs
## [4.0.0] - 2020-02-07
### Removed
* This component is no longer supported on PHP 7.0, PHP 7.1, and PHP 7.2
## [3.1.5] - 2022-09-14
### Fixed
* [#47](https://github.com/sebastianbergmann/exporter/pull/47): Fix `float` export precision
## [3.1.4] - 2021-11-11
## [5.1.0] - 2023-09-18
### Changed
* [#38](https://github.com/sebastianbergmann/exporter/pull/38): Improve export of closed resources
* [#51](https://github.com/sebastianbergmann/exporter/pull/51): Export arrays using short array syntax
## [3.1.3] - 2020-11-30
### Changed
* Changed PHP version constraint in `composer.json` from `^7.0` to `>=7.0`
## [3.1.2] - 2019-09-14
### Fixed
* [#29](https://github.com/sebastianbergmann/exporter/pull/29): Second parameter for `str_repeat()` must be an integer
### Removed
* Remove HHVM-specific code that is no longer needed
[5.0.0]: https://github.com/sebastianbergmann/exporter/compare/4.0.5...5.0.0
[4.0.5]: https://github.com/sebastianbergmann/exporter/compare/4.0.4...4.0.5
[4.0.4]: https://github.com/sebastianbergmann/exporter/compare/4.0.3...4.0.4
[4.0.3]: https://github.com/sebastianbergmann/exporter/compare/4.0.2...4.0.3
[4.0.2]: https://github.com/sebastianbergmann/exporter/compare/4.0.1...4.0.2
[4.0.1]: https://github.com/sebastianbergmann/exporter/compare/4.0.0...4.0.1
[4.0.0]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...4.0.0
[3.1.5]: https://github.com/sebastianbergmann/exporter/compare/3.1.4...3.1.5
[3.1.4]: https://github.com/sebastianbergmann/exporter/compare/3.1.3...3.1.4
[3.1.3]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...3.1.3
[3.1.2]: https://github.com/sebastianbergmann/exporter/compare/3.1.1...3.1.2
[5.1.4]: https://github.com/sebastianbergmann/exporter/compare/5.1.3...5.1.4
[5.1.3]: https://github.com/sebastianbergmann/exporter/compare/5.1.2...5.1.3
[5.1.2]: https://github.com/sebastianbergmann/exporter/compare/5.1.1...5.1.2
[5.1.1]: https://github.com/sebastianbergmann/exporter/compare/5.1.0...5.1.1
[5.1.0]: https://github.com/sebastianbergmann/exporter/compare/5.0.1...5.1.0
+1 -1
View File
@@ -1,6 +1,6 @@
BSD 3-Clause License
Copyright (c) 2002-2023, Sebastian Bergmann
Copyright (c) 2002-2025, Sebastian Bergmann
All rights reserved.
Redistribution and use in source and binary forms, with or without
+25 -4
View File
@@ -1,9 +1,30 @@
# Security Policy
This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver.
If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure.
**If you upload this library 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 do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.**
## Security Contact Information
Instead, please email `sebastian@phpunit.de`.
Please include as much of the information listed below as you can to help us better understand and resolve the issue:
* The type of issue
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.
## Web Context
The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit.
The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes.
If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context.
Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes.
After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`.
+6 -2
View File
@@ -26,6 +26,10 @@
"email": "bschussek@gmail.com"
}
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"security": "https://github.com/sebastianbergmann/exporter/security/policy"
},
"config": {
"platform": {
"php": "8.1.0"
@@ -40,7 +44,7 @@
"sebastian/recursion-context": "^5.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0"
"phpunit/phpunit": "^10.5"
},
"autoload": {
"classmap": [
@@ -54,7 +58,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "5.0-dev"
"dev-main": "5.1-dev"
}
}
}
+46 -64
View File
@@ -17,6 +17,7 @@ use function implode;
use function ini_get;
use function ini_set;
use function is_array;
use function is_bool;
use function is_float;
use function is_object;
use function is_resource;
@@ -34,17 +35,6 @@ use SebastianBergmann\RecursionContext\Context;
use SplObjectStorage;
use UnitEnum;
/**
* A nifty utility for visualizing PHP variables.
*
* <code>
* <?php
* use SebastianBergmann\Exporter\Exporter;
*
* $exporter = new Exporter;
* print $exporter->export(new Exception);
* </code>
*/
final class Exporter
{
/**
@@ -65,7 +55,7 @@ final class Exporter
return $this->recursiveExport($value, $indentation);
}
public function shortenedRecursiveExport(array &$data, Context $context = null): string
public function shortenedRecursiveExport(array &$data, ?Context $context = null): string
{
$result = [];
$exporter = new self;
@@ -84,10 +74,7 @@ final class Exporter
if ($context->contains($data[$key]) !== false) {
$result[] = '*RECURSION*';
} else {
$result[] = sprintf(
'array(%s)',
$this->shortenedRecursiveExport($data[$key], $context)
);
$result[] = sprintf('[%s]', $this->shortenedRecursiveExport($data[$key], $context));
}
} else {
$result[] = $exporter->shortenedExport($value);
@@ -123,7 +110,7 @@ final class Exporter
'%s Enum (%s, %s)',
$value::class,
$value->name,
$this->export($value->value)
$this->export($value->value),
);
}
@@ -131,7 +118,7 @@ final class Exporter
return sprintf(
'%s Enum (%s)',
$value::class,
$value->name
$value->name,
);
}
@@ -139,14 +126,14 @@ final class Exporter
return sprintf(
'%s Object (%s)',
$value::class,
count($this->toArray($value)) > 0 ? '...' : ''
count($this->toArray($value)) > 0 ? '...' : '',
);
}
if (is_array($value)) {
return sprintf(
'Array (%s)',
count($value) > 0 ? '...' : ''
'[%s]',
count($value) > 0 ? '...' : '',
);
}
@@ -174,10 +161,10 @@ final class Exporter
}
// properties are transformed to keys in the following way:
// private $property => "\0Classname\0property"
// protected $property => "\0*\0property"
// public $property => "property"
if (preg_match('/^\0.+\0(.+)$/', (string) $key, $matches)) {
// private $propertyName => "\0ClassName\0propertyName"
// protected $propertyName => "\0*\0propertyName"
// public $propertyName => "propertyName"
if (preg_match('/\0.+\0(.+)/', (string) $key, $matches)) {
$key = $matches[1];
}
@@ -189,7 +176,7 @@ final class Exporter
$array[$key] = $val;
}
// Some internal classes like SplObjectStorage don't work with the
// Some internal classes like SplObjectStorage do not work with the
// above (fast) mechanism nor with reflection in Zend.
// Format the output similarly to print_r() in this case
if ($value instanceof SplObjectStorage) {
@@ -199,26 +186,21 @@ final class Exporter
'inf' => $value->getInfo(),
];
}
$value->rewind();
}
return $array;
}
/**
* Recursive implementation of export.
*/
private function recursiveExport(mixed &$value, int $indentation, ?Context $processed = null): string
{
if ($value === null) {
return 'null';
}
if ($value === true) {
return 'true';
}
if ($value === false) {
return 'false';
if (is_bool($value)) {
return $value ? 'true' : 'false';
}
if (is_float($value)) {
@@ -226,17 +208,15 @@ final class Exporter
ini_set('precision', '-1');
try {
$valueStr = (string) $value;
$valueAsString = @(string) $value;
if ((string) (int) $value === $valueStr) {
return $valueStr . '.0';
}
ini_set('precision', $precisionBackup);
return $valueStr;
} finally {
ini_set('precision', $precisionBackup);
if ((string) @(int) $value === $valueAsString) {
return $valueAsString . '.0';
}
return $valueAsString;
}
if (gettype($value) === 'resource (closed)') {
@@ -246,8 +226,8 @@ final class Exporter
if (is_resource($value)) {
return sprintf(
'resource(%d) of type (%s)',
$value,
get_resource_type($value)
(int) $value,
get_resource_type($value),
);
}
@@ -257,7 +237,7 @@ final class Exporter
$value::class,
spl_object_id($value),
$value->name,
$this->export($value->value, $indentation)
$this->export($value->value, $indentation),
);
}
@@ -266,12 +246,12 @@ final class Exporter
'%s Enum #%d (%s)',
$value::class,
spl_object_id($value),
$value->name
$value->name,
);
}
if (is_string($value)) {
// Match for most non printable chars somewhat taking multibyte chars into account
// Match for most non-printable chars somewhat taking multibyte chars into account
if (preg_match('/[^\x09-\x0d\x1b\x20-\xff]/', $value)) {
return 'Binary String: 0x' . bin2hex($value);
}
@@ -283,8 +263,8 @@ final class Exporter
str_replace(
["\r\n", "\n\r", "\r", "\n"],
['\r\n<lf>', '\n\r<lf>', '\r<lf>', '\n<lf>'],
$value
)
$value,
),
) .
"'";
}
@@ -306,25 +286,26 @@ final class Exporter
if (count($array) > 0) {
foreach ($array as $k => $v) {
$values .= sprintf(
'%s %s => %s' . "\n",
$whitespace,
$this->recursiveExport($k, $indentation),
$values .=
$whitespace
. ' ' .
$this->recursiveExport($k, $indentation)
. ' => ' .
$this->recursiveExport($value[$k], $indentation + 1, $processed)
);
. ",\n";
}
$values = "\n" . $values . $whitespace;
}
return sprintf('Array &%s (%s)', $key, $values);
return 'Array &' . (string) $key . ' [' . $values . ']';
}
if (is_object($value)) {
$class = $value::class;
if ($processed->contains($value)) {
return sprintf('%s Object #%d', $class, spl_object_id($value));
if ($processed->contains($value) !== false) {
return $class . ' Object #' . spl_object_id($value);
}
$processed->add($value);
@@ -333,18 +314,19 @@ final class Exporter
if (count($array) > 0) {
foreach ($array as $k => $v) {
$values .= sprintf(
'%s %s => %s' . "\n",
$whitespace,
$this->recursiveExport($k, $indentation),
$values .=
$whitespace
. ' ' .
$this->recursiveExport($k, $indentation)
. ' => ' .
$this->recursiveExport($v, $indentation + 1, $processed)
);
. ",\n";
}
$values = "\n" . $values . $whitespace;
}
return sprintf('%s Object #%d (%s)', $class, spl_object_id($value), $values);
return $class . ' Object #' . spl_object_id($value) . ' (' . $values . ')';
}
return var_export($value, true);