sofascore / purgatory-bundle

Invalidate caches and achieve high hitrate with readable and maintainable annotations
MIT License
45 stars 0 forks source link

Debug command doesn't work well with arrays #45

Closed lskupnjak closed 1 year ago

lskupnjak commented 2 years ago

Describe the bug

     * @Rest\Get("/{id}/{type}")
     * @PurgeOn(Entity::class,
     *     properties={"prop1", "prop2"},
     *     parameters={"id": "id", "type": {"@value1","@value2"}}
     * )

Then run bin/console purgatory:debug Entity::prop1.

Expected: Two urls get dumped:

        route_name
                path: {id}/{type}
                parameters: 
                        id: id
                        type: @value1

        route_name
                path: {id}/{type}
                parameters: 
                        id: id
                        type: @value2

What happens: One url get dumped:

        route_name
                path: {id}/{type}
                parameters: 
                        id: id
                        type: @value1

Additional context Looks like \SofaScore\Purgatory\Command\DebugCommand::dumpMappingValueArrayElement has a bug where only value[0] is dumped, and not all values inside of that array.

zlatkoverk commented 1 year ago

Thank you for this report @lskupnjak, the fix will come in next release