Bot releases are hidden (Show)
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
PythonDecorator:
Published by sagittaracc over 1 year ago
ClassWrapperInterface -> ClassWrapper
Published by sagittaracc over 1 year ago
Why would anyone need a DI container?
You can inject dependencies thru php attributes attached to class properties like this:
class StoreService
{
use Decorator;
#[GeolocationService]
private $geolocationService;
public function getStoreCoordinates() {
return $this->_geolocationService->getCoordinatesFromAddress();
}
}
instead of
class StoreService
{
private $geolocationService;
function __construct(GeolocationService $geolocationService)
{
$this->geolocationService = $geolocationService;
}
public function getStoreCoordinates() {
return $this->geolocationService->getCoordinatesFromAddress();
}
}
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Published by sagittaracc over 1 year ago
Добавил флаг appliable для декоратора (подготовка к реализации декоратора Router)
appliable = true
- Тогда декоратор применяется к вызываемому методу
appliable = false
- Тогда по данному декоратору будет вызван метод