This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Debug
Fabien Potencier 67083b6f93 feature #28879 [Debug] Mimic __toString php behavior in FlattenException (Deltachaos)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Debug] Mimic __toString php behavior in FlattenException

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | symfony/symfony-docs#

The `Symfony\Component\Debug\Exception\FlattenException` object is returned by `Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector::getException` method, but the docblock of this method indicates that it should return `\Exception` object.

As the `FlattenException` class should behave as much as possible like a php `\Exception` object, it should implement the same methods as `\Exception`.

This PR is adding `__toString` and `getTraceAsString` methods. Those methods are (in my opinion) the most useful methods of a `\Exception` object. A potential use case (where i am stumbled across this inconsistency) is to get the last exception of a request in a `WebTestCase` using the profiler and printing the trace.

Commits
-------

514a1b506c [Debug] Mimic __toString php behavior in FlattenException
2019-03-31 11:12:58 +02:00
..
Exception [Debug] Mimic __toString php behavior in FlattenException 2019-02-21 14:05:12 +01:00
FatalErrorHandler Merge branch '3.4' into 4.1 2019-01-16 19:21:11 +01:00
Tests feature #28879 [Debug] Mimic __toString php behavior in FlattenException (Deltachaos) 2019-03-31 11:12:58 +02:00
.gitignore [Debug] fixed minor bugs 2013-04-07 18:19:06 +02:00
BufferingLogger.php switched array() to [] 2019-01-16 10:39:14 +01:00
CHANGELOG.md [Debug] Mimic __toString php behavior in FlattenException 2019-02-21 14:05:12 +01:00
composer.json updated version to 4.3 2018-11-26 17:19:01 +01:00
Debug.php Merge branch '3.4' into 4.1 2019-01-16 19:21:11 +01:00
DebugClassLoader.php Merge branch '4.2' 2019-03-10 18:10:06 +01:00
ErrorHandler.php Merge branch '4.2' 2019-02-23 16:22:31 +01:00
ExceptionHandler.php Additional addons for the ghost 2019-02-21 00:39:50 +01:00
LICENSE update year in license files 2019-01-01 14:45:19 +01:00
phpunit.xml.dist Bump phpunit XSD version to 5.2 2018-11-11 12:18:13 +01:00
README.md Updated all the README files 2016-03-04 08:12:06 +01:00

Debug Component

The Debug component provides tools to ease debugging PHP code.

Resources