Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How replace ExceptionCaster::filterTrace to ExceptionCaster::castTraceStub? #22583

Closed
@Aliance

Description

@Aliance
Q A
Bug report?
Feature request?
BC Break report?
RFC?
Symfony version 2.8

The filterTrace method is deprecated since version 2.8 and will be removed in 3.0. Use the castTraceStub method instead.

Can not understand how should I change them. I have this code:

$trace = $exception->getTrace();
ExceptionCaster::filterTrace($trace, false);

This code transforms $trace variable from

[
    [
        'function' => '%methodName%',
        'class' => '%FQCN%',
        'type' => '->',
        'args' => [/* ... */],
    ],
    // ...
]

to this format:

[
    [
        'call' => '%FQCN%->%methodName%',
        'file' => '',
    ],
    // ...
]

How can I do the same by using ExceptionCaster::castTraceStub? I'm tried to use It like this:

        $trace = $exception->getTrace();
        $trace = ExceptionCaster::castTraceStub(
            new TraceStub($trace),
            $trace,
            new Stub(),
            true
        );

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions