demos-europe / edt

Enables your PHP application to expose its entities as REST resources using the feature rich JSON:API specification as API. How and to whom your entities are exposed is highly customizable while minimizing boilerplate code.
MIT License
2 stars 1 forks source link

Do not accept empty condition list if unnecessary #162

Open joorei opened 2 months ago

joorei commented 2 months ago

RepositoryInterface::assertMatchingEntity accepts an empty list of conditions, which implies the method could perform any logic on such input. But it will in fact always simply return without an exception.

This distinction is important to set its purpose apart from FilterableTypeInterface::assertMatchingEntity, which correctly accepts an empty list of conditions, as those are optional and the method may additionally apply internal conditions defined by the implementation (e.g. such inheriting from AbstractResourceType).