Skip to content

PHP 8 Support #8

@colinodell

Description

@colinodell

I was running into a weird issue on PHP 8 where code like this:

<?php

declare(strict_types=1);

namespace Foo\Bar;

$n = new \DateTime;

echo $n->format('c');

Was being improperly "fixed" into something like this:

<?php

declare(strict_types=1);

namespace Foo\Bar;

$n = new(()) \DateTime;

echo $n->format('c');

(may not be exact - recording this bug from memory)

I have a hunch it's related to the following two sniffs which both seem to try and make changes to the affected line:

  • PSR12.Classes.ClassInstantiation
  • SlevomatCodingStandard.ControlStructures.NewWithParentheses

Further debugging to confirm and fix is needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions