decorator

Python style decorator for PHP

MIT License

Downloads
57
Stars
11
Committers
3

Bot releases are hidden (Show)

decorator - v3.0.0

Published by sagittaracc over 1 year ago

  • Изменил логику применения декораторов класса (по аналогии с Python)
decorator - v2.0.1

Published by sagittaracc over 1 year ago

  • Выпилил костыль ClassWrapper для property. Теперь все декораторы PythonDecorator можно применять и к методами класса и к его свойствам
decorator - v2.0.0

Published by sagittaracc over 1 year ago

  • Переработка враппера декоратора. Расширение декоратора на свойства класса. Обобщение декоратора на метод
decorator - v1.14.1

Published by sagittaracc over 1 year ago

PythonDecorator:

  • getMethod() -> getPropertyOrMethod()
decorator - v1.13.1

Published by sagittaracc over 1 year ago

ClassWrapperInterface -> ClassWrapper

decorator - v1.12.5

Published by sagittaracc over 1 year ago

  • Закончил реализацию DI контейнера здесь
decorator - v1.12.4

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();
    }
}
decorator - v1.12.3

Published by sagittaracc over 1 year ago

  • Add fast ORM implementation by using decorators only. See here
decorator - v1.12.2

Published by sagittaracc over 1 year ago

  • Применение только декораторов класса
decorator - v1.12.1

Published by sagittaracc over 1 year ago

  • Only public methods can be decorated
decorator - v1.12.0

Published by sagittaracc over 1 year ago

  • Порядок применения декораторов как в питоне
decorator - v1.11.1

Published by sagittaracc over 1 year ago

  • Переименовал основную функцию декоратора main -> wrapper
decorator - v1.10.1

Published by sagittaracc over 1 year ago

  • Refactor
decorator - v1.10.0

Published by sagittaracc over 1 year ago

  • Рефакторинг
  • Добавил Rpc реализацию
decorator - v1.9.0

Published by sagittaracc over 1 year ago

  • Рефакторинг
  • Обработка middleware в конструкторе
decorator - v1.8.1

Published by sagittaracc over 1 year ago

  • Реализовал Middleware
decorator - v1.8.0

Published by sagittaracc over 1 year ago

  • Доработал route для применения с ним appliable декораторов
decorator - v1.7.0

Published by sagittaracc over 1 year ago

  • Доработал роуты с параметрами
decorator - v1.6.0

Published by sagittaracc over 1 year ago

  • Сделал вызов методов класса по имени декоратора привязанному к этому методу
decorator - v1.5.0

Published by sagittaracc over 1 year ago

Добавил флаг appliable для декоратора (подготовка к реализации декоратора Router)
appliable = true - Тогда декоратор применяется к вызываемому методу
appliable = false - Тогда по данному декоратору будет вызван метод

Package Rankings
Top 22.71% on Packagist.org