Skip to content

Add template types to Result #6749

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

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

paulbalandan
Copy link
Member

Description
Make ResultInterface a generic type.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added refactor Pull requests that refactor code 4.3 labels Oct 24, 2022
@kenjis
Copy link
Member

kenjis commented Oct 24, 2022

I think if the code is return $this;, the phpdoc should be @return $this.

$this: the element to which this type applies is the same exact instance as the current class in the given context. As such, this type is a stricter version of static, because the returned instance must not only be of the same class but also the same instance.
https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md

But if we can set return type, it should be static (or self).

@paulbalandan paulbalandan marked this pull request as draft October 25, 2022 12:43
@MGatner
Copy link
Member

MGatner commented Oct 30, 2022

This one can be added at any point as a bugfix/tech-debt change so no need to rush it for 4.3.

@paulbalandan paulbalandan force-pushed the result-template-types branch from 2c1d5bb to 9bdce75 Compare November 1, 2022 09:14
@paulbalandan paulbalandan marked this pull request as ready for review November 1, 2022 09:22
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

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

Looks good! Lots more baseline cleanup, makes me happy 🤗

@paulbalandan paulbalandan merged commit 24d4944 into codeigniter4:4.3 Nov 1, 2022
@paulbalandan paulbalandan deleted the result-template-types branch November 1, 2022 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants