-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add ResolverInterface::isStored #3
add ResolverInterface::isStored #3
Conversation
*/ | ||
public function isStored($path, $filter) | ||
{ | ||
return $this->getResolver($filter)->isStored($path, $filter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@havvg do we really need such methods in the manager?
<?php
$cacheManager->getResolver($filter)->isStored($path, $filter);
Maybe something like this would be better. I am just wonder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added this method because the other forwards are also present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can back to this later. good for now.
I think we should throw an exception when |
What do you mean by "when |
let's assume one tries to execute next code <?php
$cacheManager->isStored($path, $filter);
//false
//and now I am trying to call resolve
$cacheManager->resolve($path, $filter);
//what should it return? I propse to throw exception in this case |
The However by design there is no need for this. I'm fine with adding an exception class to be thrown, so one exists within the namespace and we can handle those. The bundled resolver are fine as they are. They are capable of resolving to the target url, even if there actually might be no image available. |
yeah the bundle itself would never throw this exception. Because we use the logic in the right order isStored if not store and then resolve. But let's assume one implement its own logic and somehow called resole before actually storing something to cache. The exception is needed I think |
The exception itself is fine and should be provided by the bundle. But no resolver of this bundle is throwing it. You don't know what the user wants to accomplish when he calls The resolver of this bundle are just fine. They work by interface and contract. If one implements its own logic non-contractual, it's the business of the user to handle unwanted side-effects with the components in use. |
thanks for the good explanation. Now I now more about possible use cases of the bundle |
add ResolverInterface::isStored
see liip#284