src/PHPEncoder.php
private function encodeValue($value, $depth, array $options, callable $encode)
    {
        foreach ($this->encoders as $encoder) {
            if ($encoder->supports($value)) {
                return $encoder->encode($value, $depth, $options, $encode);
            }
        }

        throw new \InvalidArgumentException(sprintf("Unsupported value type '%s'", \gettype($value)));
    }
private function encodeValue($value, $depth, array $options, callable $encode)
    {
        foreach ($this->encoders as $encoder) {
            if ($encoder->supports($value)) {
                return $encoder->encode($value, $depth, $options, $encode);
            }
        }

        throw new \InvalidArgumentException(sprintf("Unsupported value type '%s'", \gettype($value)));
    }
private function encodeValue ( $ value , $ depth , array $ options , callable $ encode ) { foreach ( $ this -> encoders as $ encoder ) { if ( $ encoder -> supports ( $ value ) ) { return $ encoder -> encode ( $ value , $ depth , $ options , $ encode ) ; } } throw new \ InvalidArgumentException ( sprintf ( "Unsupported value type '%s'" , \ gettype ( $ value ) ) ) ; }
Encodes the value using one of the encoders that supports the value type.
@param mixed $value Value to encode
@param int $depth Current indentation depth of the output
@param array $options List of encoder options
@param callable $encode Callback used to encode values
@return string The PHP code that represents the given value
@throws \InvalidArgumentException If the provided value contains an unsupported value type
Encodes the value using one of the encoders that supports the value type .