Update PHPdoc & allow immutable
annotation via Attributes on Eloquent Model
#836
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When overloading some classes I need to suppress psalm errors for invalid return types, when they are actually correct:
Changes
GeneratedProperty::invoke
does expect aPrimitive
(but it is able to convert scalar types itself)EloquentEntitySet::read
should correctly implement and comply with theReadInterface
it implementsimmutable
eg:
#[LodataString(name: 'Type', source: 'type', immutable: true)]
Comments
I'm still looking into the immutable aspect of the library because I feel
Immutable
,Computed
andComputedDefaultValue
are implemented too loosely (vocabulary here):I've defined a property as computed and the OpenAPI specification looks good, the property is not defined for Create- or Update operations. But it is accepted and passed on as in the arguments nonetheless - so in my case the user is able to manipulate computed attributes like the
updated
date, by just providing a value in their PATCH request 🤔