BlackHoleMetadataFactory

BlackHoleMetadataFactory

class BlackHoleMetadataFactory implements MetadataFactoryInterface

Metadata factory that does not store metadata.

This implementation is useful if you want to validate values against constraints only and you don't need to add constraints to classes and properties.

Methods

MetadataInterface getMetadataFor(mixed $value)

Returns the metadata for the given value.

bool hasMetadataFor(mixed $value)

Returns whether the class is able to return metadata for the given value.

Details

MetadataInterface getMetadataFor(mixed $value)

Returns the metadata for the given value.

Parameters

mixed $value Some value

Return Value

MetadataInterface The metadata for the value

Exceptions

NoSuchMetadataException If no metadata exists for the given value

bool hasMetadataFor(mixed $value)

Returns whether the class is able to return metadata for the given value.

Parameters

mixed $value Some value

Return Value

bool Whether metadata can be returned for that value
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部