-
-
Notifications
You must be signed in to change notification settings - Fork 83
Added support for readonly properties #112
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
Added support for readonly properties #112
Conversation
f1adafa
to
76ce08f
Compare
ef6d5af
to
e05f300
Compare
return $this->removeFlag(self::FLAG_READONLY); | ||
} | ||
|
||
public function isReadonly(): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably get rid of this public API - let's consider #generate()
our main API, while reading state is probably not relevant (and not the use-case for this class)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use it in tests, also this version provides such an interface for all other modifiers, imo we should keep it. Also keep in mind this is just a bool, so not much which can be misused?! But your decision!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember that any API we add is API we have to maintain long-term too.
No big issue here though, let's add it 👍
bd24fdb
to
9fd9b8b
Compare
Static analysis failing due to parsing: I think I need to set up dependabot here 🤔 |
I assume the problem here is that psalm runs on php80 and can not parse the test assets which contain php81 syntax? |
3f24eb4
to
264d745
Compare
The problem is indeed he PHP version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
HMM, static analysis still failed 🤔
|
Okay that's strange, will try to reproduce local. |
Signed-off-by: Michael Petri <mpetri@lyska.io>
264d745
to
e7730fe
Compare
Seems like i removed my own commit after the soft reset / rebase issues i faced the last time 🤷♂️ Anyway, removed class again, added eval to generate it while runtime. Unfortunately i was not able to solve this issue:
So i decided to add it to baseline, any ideas? I also realized that psalm is only running on PHP 8.0 in CI, should we extend matrix here as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
Thanks @michaelpetri!
Description
Requested with #101
Fixes #101