This repository has been archived by the owner on Feb 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Symfony2Extension doesn't like namespaces containing Spec #5
Comments
@brunoroux good catch. There's probably a aproblem with one of the regexps. |
I think I found it : in Locator/PSR0Locator.php : /**
* @param string $classname
*
* @return PSR0Resource|null
*/
public function createResource($classname)
{
$classname = str_replace('/', '\\', $classname);
$classname = str_replace(array($this->specSubNamespace, 'Spec'), '', $classname);
$classname = str_replace('\\\\', '\\', $classname);
if ('' === $this->srcNamespace || 0 === strpos($classname, $this->srcNamespace)) {
return $this->resourceFactory->create(explode('\\', $classname), $this->specSubNamespace, $this->srcPath);
}
return null;
} It seems the $classname = str_replace(array($this->specSubNamespace, 'Spec'), '', $classname); is the one messing the namespace |
@brunoroux : are you gonna submit this as a PR? |
@brunoroux : sorry about that. i didn't see a reference to #6 in this, so i didn't think there was one. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I tried using the specification pattern on some doctrine repository.
I ended up doing something like this :
which gave me :
Seems like Spec acts like a reserved keyword and strips itself from any namespace.
The text was updated successfully, but these errors were encountered: