You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So Di has these three methods (Zephir translated to PHP):
getRaw(string $name) : mixed which returns service definition, i.e. return $service->getDefinition()
setRaw(string $name, ServiceInterface $service) which sets a service, i.e. $this->services[$name] = $service
getService(string $name) : ServiceInterface which returns a service, i.e. return $this->services[$name]
Obviously, getRaw() and setRaw() do not match. By looking at the names, one would assume that ifgetRaw() returns just the definition, then setRaw() must set the definition of the service with the name provided as the first parameter, which is not the case. Instead, setRaw() actually sets the service, therefore it would make more sense to rename setRaw() to setService().
Furthermore, I think that name argument in setRaw() is redundant, given that it could be obtained from the service which is the second argument.
So
Di
has these three methods (Zephir translated to PHP):getRaw(string $name) : mixed
which returns service definition, i.e.return $service->getDefinition()
setRaw(string $name, ServiceInterface $service)
which sets a service, i.e.$this->services[$name] = $service
getService(string $name) : ServiceInterface
which returns a service, i.e.return $this->services[$name]
Obviously,
getRaw()
andsetRaw()
do not match. By looking at the names, one would assume that ifgetRaw()
returns just the definition, thensetRaw()
must set the definition of the service with the name provided as the first parameter, which is not the case. Instead,setRaw()
actually sets the service, therefore it would make more sense to renamesetRaw()
tosetService()
.Furthermore, I think that name argument in
setRaw()
is redundant, given that it could be obtained from the service which is the second argument.Should be
It doesn't need to break BC:
cc @niden @sergeyklay @Jurigag
The text was updated successfully, but these errors were encountered: