Skip to content

docs: add @immutable to Config classes that do not extend BaseConfig#7869

Merged
kenjis merged 1 commit intocodeigniter4:developfrom
kenjis:add-immutable-to-config
Aug 29, 2023
Merged

docs: add @immutable to Config classes that do not extend BaseConfig#7869
kenjis merged 1 commit intocodeigniter4:developfrom
kenjis:add-immutable-to-config

Conversation

@kenjis
Copy link
Copy Markdown
Member

@kenjis kenjis commented Aug 27, 2023

Description
There is no reason to change the values after the instantiation.

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

There is no reason to change the values after the instantiation.
@kenjis kenjis merged commit d043f4a into codeigniter4:develop Aug 29, 2023
@kenjis kenjis deleted the add-immutable-to-config branch August 29, 2023 23:55
@neznaika0
Copy link
Copy Markdown
Contributor

https://phpstan.org/r/d471fb72-a06c-4798-9d19-9e34901b7458
Readonly properties are allowed in the parent constructor.
phpstan shows errors as:

 ------ ------------------------------------------------- 
  Line   Config/Autoload.php                              
 ------ ------------------------------------------------- 
  :42    @readonly property cannot have a default value.  
         🪪  property.readOnlyByPhpDocDefaultValue  

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.

3 participants