public function handleEncode(EncodeValueEvent $event)
    {
        $definition = $event->getValue();
        if (!$definition instanceof Definition) {
            return;
        }

        $type   = $definition->getType();
        $method = 'encode' . $this->convertTypeToMethod($type);

        if (method_exists($this, $method)) {
            $buffer = $this->$method($definition, $event->getEncoder(), $event->getJsonFlags());

            if ($buffer) {
                $event->addLine($buffer);
                $this->handleMethodCalls($definition, $event->getEncoder(), $event);
            }

            $event->setSuccessful();
        }
    }
public function handleEncode(EncodeValueEvent $event)
    {
        $definition = $event->getValue();
        if (!$definition instanceof Definition) {
            return;
        }

        $type   = $definition->getType();
        $method = 'encode' . $this->convertTypeToMethod($type);

        if (method_exists($this, $method)) {
            $buffer = $this->$method($definition, $event->getEncoder(), $event->getJsonFlags());

            if ($buffer) {
                $event->addLine($buffer);
                $this->handleMethodCalls($definition, $event->getEncoder(), $event);
            }

            $event->setSuccessful();
        }
    }
public function handleEncode ( EncodeValueEvent $ event ) { $ definition = $ event -> getValue ( ) ; if ( ! $ definition instanceof Definition ) { return ; } $ type = $ definition -> getType ( ) ; $ method = 'encode' . $ this -> convertTypeToMethod ( $ type ) ; if ( method_exists ( $ this , $ method ) ) { $ buffer = $ this -> $ method ( $ definition , $ event -> getEncoder ( ) , $ event -> getJsonFlags ( ) ) ; if ( $ buffer ) { $ event -> addLine ( $ buffer ) ; $ this -> handleMethodCalls ( $ definition , $ event -> getEncoder ( ) , $ event ) ; } $ event -> setSuccessful ( ) ; } }
Handle compile event.

@param EncodeValueEvent $event The subscribed event.

@return void
Handle compile event .