originatesFromDebugClassLoader example

$trace = debug_backtrace();
        $this->assertTrue($configuration->isBaselineDeprecation(new Deprecation('Regular deprecation', $trace, '')));

        $trace[2] = [
            'class' => DebugClassLoader::class,
            'function' => 'testBaselineGenerationWithDeprecationTriggeredByDebugClassLoader',
            'args' => [self::class]
        ];

        $deprecation = new Deprecation('Deprecation by debug class loader', $trace, '');

        $this->assertTrue($deprecation->originatesFromDebugClassLoader());

        $this->assertTrue($configuration->isBaselineDeprecation($deprecation));

        $configuration->writeBaseline();
        $this->assertEquals($filename$configuration->getBaselineFile());
        $expected = [
            [
                'location' => 'Symfony\Bridge\PhpUnit\Tests\DeprecationErrorHandler\ConfigurationTest::runTest',
                'message' => 'Regular deprecation',
                'count' => 1,
            ],
            [


        return true;
    }

    public function isBaselineDeprecation(Deprecation $deprecation): bool
    {
        if ($deprecation->isLegacy()) {
            return false;
        }

        if ($deprecation->originatesFromDebugClassLoader()) {
            $location = $deprecation->triggeringClass();
        } elseif ($deprecation->originatesFromAnObject()) {
            $location = $deprecation->originatingClass().'::'.$deprecation->originatingMethod();
        } else {
            $location = 'procedural code';
        }

        $message = $deprecation->getMessage();
        $result = isset($this->baselineDeprecations[$location][$message]) && $this->baselineDeprecations[$location][$message] > 0;
        if ($this->generateBaseline) {
            if ($result) {
                
Home | Imprint | This part of the site doesn't use cookies.