You are here

public function FakeMetadataFactory::hasMetadataFor in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/Fixtures/FakeMetadataFactory.php \Symfony\Component\Validator\Tests\Fixtures\FakeMetadataFactory::hasMetadataFor()

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

Overrides MetadataFactoryInterface::hasMetadataFor

File

vendor/symfony/validator/Tests/Fixtures/FakeMetadataFactory.php, line 46

Class

FakeMetadataFactory

Namespace

Symfony\Component\Validator\Tests\Fixtures

Code

public function hasMetadataFor($class) {
  $hash = null;
  if (is_object($class)) {
    $hash = spl_object_hash($class);
    $class = get_class($class);
  }
  if (!is_string($class)) {
    return false;
  }
  return isset($this->metadatas[$class]) || isset($this->metadatas[$hash]);
}