mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
Refactored code to use PHP8 attributes instead of annotations
In this change, Doctrine and validation annotations have been replaced with PHP8 Attributes. The Rector tool has been configured with a list of annotations to convert to attributes. As a consequence, the PHPStan's rules have been updated to reflect these changes. The PHP8's nullable operator (?) has been added where required, and comments in field declaration have been replaced with #[Attribute] syntax.
This commit is contained in:
@@ -25,7 +25,6 @@ use Chill\MainBundle\Entity\HasScopesInterface;
|
||||
use Chill\MainBundle\Entity\Location;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
|
||||
use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
@@ -42,19 +41,12 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Class Activity.
|
||||
*
|
||||
* @ActivityValidator\ActivityValidity
|
||||
*
|
||||
* TODO see if necessary
|
||||
* UserCircleConsistency(
|
||||
* "CHILL_ACTIVITY_SEE_DETAILS",
|
||||
* getUserFunction="getUser",
|
||||
* path="scope")
|
||||
*/
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['activity' => Activity::class])]
|
||||
#[ORM\Entity(repositoryClass: \Chill\ActivityBundle\Repository\ActivityRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'activity')]
|
||||
#[ActivityValidator\ActivityValidity] // TODO see if necessary
|
||||
class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCentersInterface, HasScopesInterface, TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
|
Reference in New Issue
Block a user