Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 1.14 KB

UPGRADE.md

File metadata and controls

34 lines (27 loc) · 1.14 KB

New v1.0 version package

Major changes:

  • Minimum php version raised to 8.1
  • Removed support for symfony < 5
  • Now you must always pass an array in a property `columns` (previously it was possible to pass a string/array)
  • Replaced the use of annotations with attributes

Automatic transition with Rector

You may use rector to automatically convert your code to the new version.

<?php

use Intaro\CustomIndexBundle\Annotations\CustomIndexes;
use Intaro\CustomIndexBundle\Metadata\Attribute\CustomIndex;
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Property\NestedAnnotationToAttributeRector;
use Rector\Php80\ValueObject\AnnotationPropertyToAttributeClass;
use Rector\Php80\ValueObject\NestedAnnotationToAttribute;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->paths(['src']);

    $rectorConfig->ruleWithConfiguration(NestedAnnotationToAttributeRector::class, [
        new NestedAnnotationToAttribute(CustomIndexes::class, [
            new AnnotationPropertyToAttributeClass(CustomIndex::class, 'indexes'),
        ], true),
    ]);
};