Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Workflow] Added generic template in Event and his inheritors #44702

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

Closed
wants to merge 1 commit into from
Closed

[Workflow] Added generic template in Event and his inheritors #44702

wants to merge 1 commit into from

Conversation

fractalzombie
Copy link
Contributor

Added generic template for Event in Workflow Component

Q A
Branch? 6.1
Bug fix? no
New feature? no
Deprecations? no
License MIT

Added generic template for Event, Event::$subject and Event::getSubject() for PHPStorm support.

@fractalzombie
Copy link
Contributor Author

It's already reviewed, something strange was broken my fork. #44622

@derrabus
Copy link
Member

To get rid of the error on the GuardEvent, you need to add the @param annotation to its constructor.

        /**
         * {@inheritdoc}
         *
         * @param TSubject $subject
         */
        public function __construct(object $subject, Marking $marking, Transition $transition = null, WorkflowInterface $workflow = null, array $context = [])

…ent::$subject`, `Event::getSubject()` and `Event::__constructor`
@fractalzombie
Copy link
Contributor Author

fractalzombie commented Dec 18, 2021

To get rid of the error on the GuardEvent, you need to add the @param annotation to its constructor.

        /**
         * {@inheritdoc}
         *
         * @param TSubject $subject
         */
        public function __construct(object $subject, Marking $marking, Transition $transition = null, WorkflowInterface $workflow = null, array $context = [])

Thanks, resolved!

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failure is legit.
Please don't forget to patch the .github/expected-missing-return-types.diff file as done eg in #44695 (see the file for how)
Note that since DebugClassLoader is not able to understand the @template annotations (yet), I added a hack in 1dad23b
We're going to need something similar here (or to patch DebugClassLoader before merging.)

@fractalzombie
Copy link
Contributor Author

The failure is legit.
Please don't forget to patch the .github/expected-missing-return-types.diff file as done eg in #44695 (see the file for how)
Note that since DebugClassLoader is not able to understand the @template annotations (yet), I added a hack in 1dad23b
We're going to need something similar here (or to patch DebugClassLoader before merging.)

Good idea, i will check how i can do it in this case.

@fractalzombie
Copy link
Contributor Author

The failure is legit.

Please don't forget to patch the .github/expected-missing-return-types.diff file as done eg in #44695 (see the file for how)

Note that since DebugClassLoader is not able to understand the @template annotations (yet), I added a hack in 1dad23b

We're going to need something similar here (or to patch DebugClassLoader before merging.)

Can't find solution for your suggestion. I close PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants