Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Update EasyLogFormatter.php #14

Merged
merged 1 commit into from
Jul 27, 2018
Merged

Conversation

szepczynski
Copy link
Contributor

Added root namespace for \Throwable. Without that i got:

PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to EasyCorp\EasyLog\EasyLogFormatter::formatThrowable() must be an instance of EasyCorp\EasyLog\Throwable, instance of Symfony\Component\Security\Core\Exception\AccessDeniedException given

Added root namespace for \Throwable. Without that i got:

PHP message: PHP Fatal error:  Uncaught TypeError: Argument 1 passed to EasyCorp\EasyLog\EasyLogFormatter::formatThrowable() must be an instance of EasyCorp\EasyLog\Throwable, instance of Symfony\Component\Security\Core\Exception\AccessDeniedException given
@theofidry
Copy link
Contributor

I would prefer to see a use Throwable statement instead but that's tastes and colors I guess.

That said I think this would lead to an error in <7.0 so I would require symfony/polyfill-php70 as well

@theofidry theofidry mentioned this pull request Jun 21, 2018
@tarlepp
Copy link

tarlepp commented Jun 22, 2018

Hmm I'm having this same with

php --version
PHP 7.2.5-0ubuntu0.18.04.1 (cli) (built: May  9 2018 17:21:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.5-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
    with blackfire v1.20.0~linux-x64-non_zts72, https://blackfire.io, by Blackfire

@tarlepp
Copy link

tarlepp commented Jun 22, 2018

And now looked that change - makes sense :D

@fnash fnash mentioned this pull request Jul 4, 2018
@vudaltsov
Copy link

@javiereguiluz , looking forward to this being merged!

Copy link

@chalasr chalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm facing this bug as well.

@chalasr
Copy link

chalasr commented Jul 18, 2018

Note that a very minimal test suite could prevent such issues.

@javiereguiluz
Copy link
Contributor

Thanks for this and sorry for having taken so long to merge it.

@javiereguiluz javiereguiluz merged commit 41b6783 into EasyCorp:master Jul 27, 2018
javiereguiluz added a commit that referenced this pull request Jul 27, 2018
This PR was merged into the master branch.

Discussion
----------

Update EasyLogFormatter.php

Added root namespace for \Throwable. Without that i got:

PHP message: PHP Fatal error:  Uncaught TypeError: Argument 1 passed to EasyCorp\EasyLog\EasyLogFormatter::formatThrowable() must be an instance of EasyCorp\EasyLog\Throwable, instance of Symfony\Component\Security\Core\Exception\AccessDeniedException given

Commits
-------

41b6783 Update EasyLogFormatter.php
@javiereguiluz
Copy link
Contributor

This fix was included in the just released 1.0.6 version (https://github.com/EasyCorp/easy-log-handler/releases/tag/v1.0.6)

@fabschurt
Copy link

Thanks a lot @javiereguiluz !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants