Skip to content

Latest commit

 

History

History
134 lines (93 loc) · 2.66 KB

File metadata and controls

134 lines (93 loc) · 2.66 KB

Migrating GsId 1.x → 2.0

GsId 2.0.0 is a major release. It cleans up integration namespaces and removes historical compatibility classes.

1. Doctrine type moved

The following class was permanently removed:

GalacticShrine\GsId\GsIdDoctrineType

Use this class instead:

GalacticShrine\GsId\Bridge\Doctrine\Types\GsidType

Before

use GalacticShrine\GsId\GsIdDoctrineType;

#[ORM\Column(type: GsIdDoctrineType::Name)]
private ?GsId $id = null;

After

use GalacticShrine\GsId\Bridge\Doctrine\Types\GsidType;

#[ORM\Column(type: GsidType::Name)]
private ?GsId $id = null;

You can also use the type name directly:

#[ORM\Column(type: 'gsid')]
private ?GsId $id = null;

The Symfony bundle automatically registers the gsid DBAL type when DoctrineBundle is installed.

2. Symfony configurator moved

The following class was renamed and moved:

GalacticShrine\GsId\GsIdSymfonyOptionsConfigurator

New name:

GalacticShrine\GsId\Symfony\GsIdOptionsConfigurator

If you use the Symfony bundle, you normally do not need to change anything: the bundle registers this service automatically.

If you use the no-bundle mode, update config/services.gsid.yaml:

services:
  GalacticShrine\GsId\Symfony\GsIdOptionsConfigurator:
    arguments:
      $options:
        default_case: Lower
        default_text_format: N
        default_json_format: D
        default_database_format: N
        lock: true
    tags:
      - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 4096 }

3. Symfony bridge renamed

The following class was renamed and moved:

GalacticShrine\GsId\GsIdSymfonyUidBridge

New name:

GalacticShrine\GsId\Symfony\Bridge\GsIdToUid

Before

use GalacticShrine\GsId\GsIdSymfonyUidBridge;

After

use GalacticShrine\GsId\Symfony\Bridge\GsIdToUid;

The name GsIdToUid is intentional. GsIdToUuid was not used because GsId is a 256-bit identifier, while a standard UUID is a 128-bit identifier.

4. Recommended Symfony configuration

# config/packages/gsid.yaml
gsid:
    default_case: Lower
    default_text_format: N
    default_json_format: D
    default_database_format: N
    lock: true

5. Symfony Flex recipe

The 2.0 recipe is located in:

flex-recipes/galactic-shrine/gsid/2.0/

It is meant to be published in a public or private Symfony Flex recipe repository. Once published, it can enable the bundle and copy config/packages/gsid.yaml into the consumer Symfony project.

6. Verification commands

composer dump-autoload
composer lint
composer test