Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 307378

Introduce "deterministic" normalizers

$
0
0

Knowing which normalizer is going to be used without an instance of data in hand is essential to providing a reliable schema.

By adding the concept of a "deterministic" normalizer, we can start opting in normalizers that are capable of providing a reliable schema.

See #3022583: [META] Normalization System: clean up/speed up/provide schema for additional context.

Proposed Solution

Introduce a DeterministicNormalizerInterface with a getSupportedInterfaceOrClass() method.

If this interface is implemented, it signifies that the normalizer is valid for any instance of a particular interface or class and the given format. It should not be invalid for any particular value or $context.

Outcome

This will bring us a step closer to full schema support.
Additionally, we can avoid thousands of unnecessary calls to supportsNormalization in many instances.


Rough idea attached.


Viewing all articles
Browse latest Browse all 307378

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>