DDC-3190: [GH-1071] Setup::createConfiguration breaks Cache interface contract #3953

Closed
opened 2026-01-22 14:32:16 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 25, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of VasekPurchart:

Url: https://github.com/doctrine/doctrine2/pull/1071

Message:

Method setNamespace is called in Setup::createConfiguration, but at the moment there can be an instance of Doctrine\Common\Cache\Cache (when given in the 3rd parameter), which does not define this method. This method is defined in Doctrine\Common\Cache\CacheProvider from which are the defaults being instantiated in this method extended.

So there should be an condition or the 3rd parameter should declare a dependency on CacheProvider rather than just Cache interface. Or maybe the namespace should be set only if the Cache instance is not given by the 3rd parameter (as proposed in this PR now), assuming that when someone is giving a ready instance of Cache, it is configured properly.

If you want to take another approach, I can change this PR.

Originally created by @doctrinebot on GitHub (Jun 25, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of VasekPurchart: Url: https://github.com/doctrine/doctrine2/pull/1071 Message: Method `setNamespace` is called in `Setup::createConfiguration`, but at the moment there can be an instance of `Doctrine\Common\Cache\Cache` (when given in the 3rd parameter), which does not define this method. This method is defined in `Doctrine\Common\Cache\CacheProvider` from which are the defaults being instantiated in this method extended. So there should be an condition or the 3rd parameter should declare a dependency on `CacheProvider` rather than just `Cache` interface. Or maybe the namespace should be set only if the Cache instance is not given by the 3rd parameter (as proposed in this PR now), assuming that when someone is giving a ready instance of Cache, it is configured properly. If you want to take another approach, I can change this PR.
admin added the Bug label 2026-01-22 14:32:16 +01:00
admin closed this issue 2026-01-22 14:32:17 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 26, 2014):

Comment created by @ocramius:

Merged: 22d71de2c3

@doctrinebot commented on GitHub (Jun 26, 2014): Comment created by @ocramius: Merged: https://github.com/doctrine/doctrine2/commit/22d71de2c3f9632deb63a77646b11e21d9105cbd
Author
Owner

@doctrinebot commented on GitHub (Jun 26, 2014):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jun 26, 2014): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3953