8000 Disable PHP Attribute mutations globally via config. · Issue #1894 · infection/infection · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Disable PHP Attribute mutations globally via config. #1894
Closed
@nuryagdym

Description

@nuryagdym

Hi,

I am working with Doctrine Entities and Mongo DB documents.

Doctrine allows us to configure ORM mapping with PHP attributes.
Example:

class UserDevice
{
    public function __construct(
        #[MongoDB\Id]
        private ?string $id,

        #[MongoDB\Field(type: Types::DATE_MUTABLE, nullable: true)]
        private ?UTCDateTime $updatedAt = null,
    ) {
    }

In this case infection test is changing nullable: true to nullable: false.

There is no direct way of handling this mutant, especially with unit tests.

Can we add a config, using which we can disable mutation of PHP attributes at all?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0