Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/config
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.4.0
Choose a base ref
...
head repository: symfony/config
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.4.1
Choose a head ref
  • 4 commits
  • 12 files changed
  • 4 contributors

Commits on Dec 1, 2025

  1. Import all node definition classes to DefinitionConfigurator

    Noticed problem on static analysis with `UnknownClass` due to not all`*NodeDefinition` being imported, see symfony/symfony@8099cda#commitcomment-171732637
    brzuchal authored Dec 1, 2025
    Configuration menu
    Copy the full SHA
    5ec5bd9 View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2025

  1. Configuration menu
    Copy the full SHA
    4c407fe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9b48b61 View commit details
    Browse the repository at this point in the history
  3. bug #62563 [Config] Fix array shape generation for backed enums (Oska…

    …rStark)
    
    This PR was squashed before being merged into the 7.4 branch.
    
    Discussion
    ----------
    
    [Config] Fix array shape generation for backed enums
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 7.4
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? | no
    | Issues        | --
    | License       | MIT
    
    Spotted in symfony/ai#1013 ➡️ https://github.com/symfony/ai/actions/runs/19780810683/job/56680686767?pr=1013
    
    It works for `redis`, but not for `postgres`, because `redis` is using `->values(Distance::cases())` and `postgres` is using `->enumFqcn(PostgresDistance::class)`:
    
    ### Redis
    
    #### Enum
    ```php
    enum Distance: string
    {
        use Comparable;
    
        case Cosine = 'COSINE';
        case L2 = 'L2';
        case Ip = 'IP';
    }
    ```
    #### Config
    ```php
    ->enumNode('distance')
        ->info('Distance metric to use for vector similarity search')
        ->values(Distance::cases())
        ->defaultValue(Distance::Cosine)
    ->end()
    ```
    #### RESULT
    ```php
     *         redis?: array<string, array{ // Default: []
     *             connection_parameters?: mixed, // see https://github.com/phpredis/phpredis?tab=readme-ov-file#example-1
     *             client?: string, // a service id of a Redis client
     *             index_name: string,
     *             key_prefix?: string, // Default: "vector:"
     *             distance?: \Symfony\AI\Store\Bridge\Redis\Distance::Cosine|\Symfony\AI\Store\Bridge\Redis\Distance::L2|\Symfony\AI\Store\Bridge\Redis\Distance::Ip, // Distance metric to use for vector similarity search // Default: "COSINE"
     *         }>,
    ```
    
    ### Postgres
    
    #### Enum
    ```php
    enum Distance: string
    {
        use Comparable;
    
        case Cosine = 'cosine';
        case InnerProduct = 'inner_product';
        case L1 = 'l1';
        case L2 = 'l2';
    
        public function getComparisonSign(): string
        {
            return match ($this) {
                self::Cosine => '<=>',
                self::InnerProduct => '<#>',
                self::L1 => '<+>',
                self::L2 => '<->',
            };
        }
    }
    ```
    #### Config
    ```php
    ->enumNode('distance')
        ->info('Distance metric to use for vector similarity search')
        ->enumFqcn(PostgresDistance::class)
        ->defaultValue(PostgresDistance::L2)
    ->end()
    ```
    #### RESULT
    ```php
     *         postgres?: array<string, array{ // Default: []
     *             dsn?: string,
     *             username?: string,
     *             password?: string,
     *             table_name: string,
     *             vector_field?: string,
     *             distance?: cosine|inner_product|l1|l2, // Distance metric to use for vector similarity search // Default: "l2"
     *             dbal_connection?: string,
     *         }>,
    ```
    
    you can see, that the result is different:
    FQCN:
    `distance?: \Symfony\AI\Store\Bridge\Redis\Distance::Cosine|\Symfony\AI\Store\Bridge\Redis\Distance::L2|\Symfony\AI\Store\Bridge\Redis\Distance::Ip,`
    vs. strings:
    `distance?: cosine|inner_product|l1|l2,`
    
    Why?
    
    Commits
    -------
    
    62422c43483 [Config] Fix array shape generation for backed enums
    nicolas-grekas committed Dec 5, 2025
    Configuration menu
    Copy the full SHA
    2c32330 View commit details
    Browse the repository at this point in the history
Loading