Skip to content

docs: add @property to Time#8337

Merged
kenjis merged 2 commits intocodeigniter4:developfrom
kenjis:docs-Time-properties
Dec 19, 2023
Merged

docs: add @property to Time#8337
kenjis merged 2 commits intocodeigniter4:developfrom
kenjis:docs-Time-properties

Conversation

@kenjis
Copy link
Copy Markdown
Member

@kenjis kenjis commented Dec 16, 2023

Description

  • add @property

See https://codeigniter4.github.io/CodeIgniter4/libraries/time.html#getters
Related #8338

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

Comment thread system/I18n/Time.php
*
* Requires the intl PHP extension.
*
* @property string $date
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed $date because it cannot be read.

        $time = Time::now();
        dd($time->date); // null

@kenjis
Copy link
Copy Markdown
Member Author

kenjis commented Dec 16, 2023

@paulbalandan Why cannot we use @property-read?

The phpdoc_no_alias_tag rule replaces it.
https://cs.symfony.com/doc/rules/phpdoc/phpdoc_no_alias_tag.html

@kenjis kenjis merged commit f69a39b into codeigniter4:develop Dec 19, 2023
@kenjis kenjis deleted the docs-Time-properties branch December 19, 2023 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants