-
Notifications
You must be signed in to change notification settings - Fork 7
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
Cannot support different handling for the same named method in different classes #43
Comments
Can I have the js file? |
@pbyrne84 This happens also for masked methods: namespace Namespace1 {
class Controller {
public function model($name) {
$name = '\Namespace1\Model\\' . $name
return new $name;
}
}
}
namespace Namespace1\Model {
class Model1 {
public function insideModel1() {
}
}
}
namespace Namespace2 {
class Controller {
public function model($name) {
$name = '\Namespace2\Model\\' . $name;
return new $name;
}
}
}
namespace Namespace2\Model {
class Model1 {
public $model2;
public function insideModel2() {
}
}
}
namespace Namespace2 {
$controllerOne = new \Namespace1\Controller();
$controllerOne->model('Model1')->insideModel1();
$controllerTwo = new \Namespace2\Controller();
// this references the first model instead of the second:
$controllerTwo->model('Model1')->
} with config: {
"methodCalls" : [
{
"class" : "\\Namespace1\\Controller",
"method" : "model",
"position": 0,
"mask" : "\\Namespace1\\Model\\%s"
},
{
"class" : "\\Namespace2\\Controller",
"method" : "model",
"position": 0,
"mask" : "\\Namespace2\\Model\\%s"
},
],
"functionCalls": []
} |
Many thanks for the example. I have started looking into it. On 27 February 2016 at 22:43, David Meybohm notifications@github.com
|
In theory the deployable here https://github.com/pbyrne84/DynamicReturnTypePlugin/raw/master/deploy/DynamicReturnTypePlugin.zip fixes the problem locate your current DynamicReturnTypePlugin folder under plugins dir, delete and replace with the unzipped contents of this one and let me know if it works. |
It works. Thanks. |
Thanks for the confirmation |
Given the following:
Calls to both \ESP\Container::get and \ESP\Model\Factory::get are processed by the replaceModelFactory method. However, if I switch the order in which the two items appear, so that the one for \ESP\Container is first, then calls to both methods are processed by replaceContainerGet.
The text was updated successfully, but these errors were encountered: