ApiPlatform\Core\Hal\Serializer\ItemNormalizer::supportsDenormalization PHP Method

supportsDenormalization() public method

public supportsDenormalization ( $data, $type, $format = null )
    public function supportsDenormalization($data, $type, $format = null)
    {
        return false;
    }

Usage Example

 /**
  * @expectedException \ApiPlatform\Core\Exception\RuntimeException
  */
 public function testDonTSupportDenormalization()
 {
     $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class);
     $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class);
     $iriConverterProphecy = $this->prophesize(IriConverterInterface::class);
     $resourceClassResolverProphecy = $this->prophesize(ResourceClassResolverInterface::class);
     $normalizer = new ItemNormalizer($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $iriConverterProphecy->reveal(), $resourceClassResolverProphecy->reveal());
     $this->assertFalse($normalizer->supportsDenormalization('foo', ItemNormalizer::FORMAT));
     $normalizer->denormalize(['foo'], 'Foo');
 }