PrestaShop / PrestaShop/docs

Explain how multiple modules can decorate same Symfony service

Open
#512 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Scala
Stars
136
Forks
555
Avg merge
4d 14h
Merged PRs (30d)
4

Description

    foo:
        class: App\Foo
        arguments: ['@router']
        public: true

    foo_decorated1:
        class: App\DecorFooOne
        decorates: foo
        arguments: ['@foo_decorated1.inner']
        public: true

    foo_decorated2:
        class: App\DecorFooTwo
        decorates: foo
        arguments: ['@foo_decorated2.inner']
        public: true

Constructor of DecorFooTwo will receive an instance of DecorFooOne, not Foo. Symfony is able to chain decoration links.

This means that if multiple modules decorate the same Core service, all the behaviors will be kept (instead of one module overriding others behaviors).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No documentation file or entry point is named. Add an explanation of how multiple modules can decorate the same Symfony service, using the foo, foo_decorated1, and foo_decorated2 example; done when the documentation clearly explains that decorators are chained and behaviors are preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
symfony
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.