Skip to content

Add php8.1 enum support #70

@tdumalin

Description

@tdumalin

Hi there,

It would be nice if the bundle could be compatible with the new php enum:

https://www.php.net/manual/fr/language.enumerations.basics.php

Here's some sample with the current doc:

<?php

namespace App\Enum;

enum ArticleStates: string
{
      case NewArticle = 'new';
      case PendingReview = 'pending_review';
      //...
}
<?php

namespace App\Entity;

use  App\Enum\ArticleStates;

class Article
{
     /** @var ArticleStates */
     private $state;
     //...

   public function getState() : ArticleStates
   {
         return $this->state;
   }

  public function setState(ArticleStates $state) : self
  {
     $this->state = $state;
      return $this;
  } 
  //...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions