mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #1071] [MERGED] Setup::createConfiguration breaks Cache interface contract #9118
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/1071
Author: @VasekPurchart
Created: 6/25/2014
Status: ✅ Merged
Merged: 6/26/2014
Merged by: @Ocramius
Base:
master← Head:fix-setup-cache📝 Commits (1)
ee5f465set namespace in setup only on CacheProvider instances📊 Changes
2 files changed (+19 additions, -1 deletions)
View changed files
📝
lib/Doctrine/ORM/Tools/Setup.php(+4 -1)📝
tests/Doctrine/Tests/ORM/Tools/SetupTest.php(+15 -0)📄 Description
Method
setNamespaceis called inSetup::createConfiguration, but at the moment there can be an instance ofDoctrine\Common\Cache\Cache(when given in the 3rd parameter), which does not define this method. This method is defined inDoctrine\Common\Cache\CacheProviderfrom which are the defaults being instantiated in this method extended.So there should be an condition (as proposed in this PR now) or the 3rd parameter should declare a dependency on
CacheProviderrather than justCacheinterface. Or maybe the namespace should be set only if the Cache instance is not given by the 3rd parameter, 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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.