Commit Graph

81 Commits

Author SHA1 Message Date
Sebastian Bergmann 4f62befcd6
Eliminate superfluous exception handling 2024-04-04 08:02:12 +02:00
Sebastian Bergmann 84efbdb28c
Refactor 2024-04-04 08:01:34 +02:00
Sebastian Bergmann 16cb1f8ca0
Use strict comparison 2024-03-29 08:01:49 +01:00
Sebastian Bergmann 955288482d
Do not use implicitly nullable parameters and prepare release 2024-03-02 08:17:12 +01:00
Markus Staab b4655d4c0d
Optimize exporting big object graphs 2023-09-24 15:04:27 +02:00
Sebastian Bergmann 085185a2e3
Tweak comments 2023-09-24 14:12:57 +02:00
Gabriel Ostrolucký caa31540c3 Modernize array syntax 2023-09-18 08:39:36 +02:00
Sebastian Bergmann 32ff03d078
Closes #49 2023-09-08 06:46:58 +02:00
Sebastian Bergmann 66aee9ca60
Fix 2023-09-08 06:38:00 +02:00
Sebastian Bergmann 29d9871476
Remove superfluous comments 2023-09-08 06:37:51 +02:00
Sebastian Bergmann ffa288398e
Fix CS/WS issues 2023-09-08 06:35:09 +02:00
Sebastian Bergmann e80b8a0c16
Fix CS/WS issues 2023-01-15 14:07:48 +01:00
Sebastian Bergmann 4c656d3311
Remove code that is not needed 2022-09-14 08:13:06 +02:00
Sebastian Bergmann 4930e1e48a
Merge branch '4.0' 2022-09-14 08:07:23 +02:00
Sebastian Bergmann 8097ec96c0
Merge branch '3.1' into 4.0 2022-09-14 08:02:51 +02:00
Sebastian Bergmann ee1ea57106
Do not use ternary operator 2022-09-14 07:50:25 +02:00
Sebastian Bergmann 5ebb947622
Fix CS/WS issues 2022-09-14 07:49:23 +02:00
Michael Voříšek a9f4590ffb Fix float export precision 2022-09-14 07:34:49 +02:00
Sebastian Bergmann 492bc70b5a
Refactor 2022-01-22 07:38:58 +01:00
Marijn van Wezel ba5c2c83da Improve export of enums
This commit improves the export of enumerations (see https://wiki.php.net/rfc/enumerations). This change is backwards-compatible with PHP 8.0. Previously, enums would be exported as objects (which they are internally), for instance:

```
SebastianBergmann\Exporter\ExampleEnum Object #%d (
    'name' => 'Value'
)"
```

This commit changes that behaviour and improves the export for both backed and non-backed enums:

Unit enum:
 SebastianBergmann\Exporter\ExampleEnum Enum #%d (Value)

Backed enum:
 SebastianBergmann\Exporter\ExampleBackedEnum Enum #%d (Value, 'value')
2022-01-22 07:30:17 +01:00
Sebastian Bergmann 9e1c14f828
Require mbstring extension 2021-12-13 15:46:40 +01:00
Tyson Andre 8742034e90 Change `Object &hash` to `Object #id` in variable representation
This proposes using `#` instead of `&` to

1. Avoid overlapping with the hash numbers for `Array &%d ()`
2. Be similar to var_dump.

This proposes a `Object #` prefix for SplObjectStorage object id keys
to make **accidental** ambiguity with dynamic properties less likely.

Closes #39
2021-12-13 15:43:42 +01:00
Sebastian Bergmann dd7b15e57f
Revert "Fix CS/WS issues"
This reverts commit 55a5916c01.
2021-11-11 14:46:33 +01:00
Sebastian Bergmann b2b605d2c8
Merge branch '4.0' 2021-11-11 14:17:11 +01:00
jrfnl 967ffc8eae Improve export of closed resources
Fixes 36
2021-11-11 14:13:43 +01:00
Sebastian Bergmann 55a5916c01
Fix CS/WS issues 2021-11-11 14:08:23 +01:00
jrfnl 8535229308 Improve export of closed resources (for 3.x)
As the 3.x branch has a minimum PHP version of PHP 7.0 and the `resource (closed)` return value for `gettype()` was only introduced in PHP 7.2, a slightly more involved solution for the same is needed for the 3.x branch.

The methods I'm adding are based on code I've used to polyfill the `assertClosedResource()` assertion in the PHPUnit Polyfills and has been (and still is) extensively tested there.

Fixes 36
2021-11-11 13:33:13 +01:00
Sebastian Bergmann 74a548f2c2
Cleanup 2021-05-27 07:49:52 +02:00
Sebastian Bergmann e76377d976
Fix CS/WS issues 2021-05-04 17:48:27 +02:00
Sebastian Bergmann 428b8e89e2
Fix issue identified by Psalm 2020-12-05 07:55:56 +01:00
Sebastian Bergmann 9372d519fe Fix CS/WS issues 2020-06-22 16:36:01 +02:00
Andreas Möller 7b5ae5488b Fix: Run friendsofphp/php-cs-fixer 2020-02-09 07:39:11 +01:00
Ciaran McNulty 05e2a220e5 Make str_repeat call stricter
This was causing an issue with PhpSpec
2019-09-10 17:13:45 +02:00
Claudio Zizza 5aff3e282c Adapt type of data argument in docblock 2019-09-08 14:59:02 +02:00
Claudio Zizza aa936a3d22 Remove unsupported HHVM code 2019-09-07 11:15:01 +02:00
Sebastian Bergmann 636773fb0b Revert "Cleanup"
This reverts commit ff5bade60c.
2019-08-14 17:08:01 +02:00
Sebastian Bergmann ff5bade60c Cleanup 2019-08-14 16:54:55 +02:00
Bernhard Schussek 71e429fb3a Exclude trace from exceptions/errors for performance reasons (#24) 2019-08-11 14:37:44 +02:00
Sebastian Bergmann 00930b5231 Fix CS/WS issues 2018-06-28 10:18:04 -04:00
Sebastian Bergmann 6506a83c47 Fix CS/WS issues 2017-04-03 15:17:37 +02:00
Mariano Custiel 4722899d45 Added visible representation of line endings for diffs (#19)
* Added visible representation of line endings for diffs

* Added fix to avoid the Replacement order gotcha from str_replace

* cs-fixer

* Fixed expectation of shortened string

* I misunderstood the problem, the length of the string now is longer because we are showing \n and \r characters
2017-04-03 15:13:50 +02:00
Sebastian Bergmann d3975cb8a3 Fix CS/WS issues 2017-04-01 14:43:33 +02:00
Bob Weinand cd63c71ded Also fix shortenedRecursiveExport for recursion-context changes 2016-11-18 12:14:04 +01:00
Bob Weinand ecbefe18c8 Work on a copy as recursion-context changes the arrays 2016-11-18 11:33:43 +01:00
Nicolas Grekas 42c4c2eec4 Tweak binary string regexp and allow \e (#15) 2016-06-17 11:04:28 +02:00
Nicolas Grekas 6e6a2a0b9a Tweak binary string regexp and allow \e (#14) 2016-06-17 10:12:15 +02:00
Sebastian Bergmann f88f893651 Improve docblock 2015-08-09 06:23:41 +02:00
KUBO Atsuhiro 2348488730 Add multibyte character support for Exporter::shortenedExport() 2015-07-30 11:57:30 +02:00
Sebastian Bergmann 7ae5513327 Fix CS/WS issues 2015-06-21 09:55:53 +02:00
Sebastian Bergmann 0e03278b2f Move PHPUnit_Framework_TestCase::dataToString() to Exporter::shortenedRecursiveExport() 2015-01-27 08:22:40 +01:00