src/Dumper.php
public function dump($value, int $target = self::OUTPUT): ?string
    {
        $r = $this->getRenderer($target);
        $dump = $r->wrapContent($this->renderValue($r, $value));

        switch ($target) {
            case self::OUTPUT:
                echo $dump;
                break;

            case self::RETURN:
                return $dump;

            case self::LOGGER:
                if ($this->logger == null) {
                    throw new DumperException("Unable to dump value to log, no associated LoggerInterface");
                }
                $this->logger->debug($dump);
                break;

            case self::ERROR_LOG:
                error_log($dump, 0);
                break;
        }

        return null;
    }
public function dump($value, int $target = self::OUTPUT): ?string
    {
        $r = $this->getRenderer($target);
        $dump = $r->wrapContent($this->renderValue($r, $value));

        switch ($target) {
            case self::OUTPUT:
                echo $dump;
                break;

            case self::RETURN:
                return $dump;

            case self::LOGGER:
                if ($this->logger == null) {
                    throw new DumperException("Unable to dump value to log, no associated LoggerInterface");
                }
                $this->logger->debug($dump);
                break;

            case self::ERROR_LOG:
                error_log($dump, 0);
                break;
        }

        return null;
    }
public function dump ( $ value , int $ target = self :: OUTPUT ) : ? string { $ r = $ this -> getRenderer ( $ target ) ; $ dump = $ r -> wrapContent ( $ this -> renderValue ( $ r , $ value ) ) ; switch ( $ target ) { case self :: OUTPUT : echo $ dump ; break ; case self :: RETURN : return $ dump ; case self :: LOGGER : if ( $ this -> logger == null ) { throw new DumperException ( "Unable to dump value to log, no associated LoggerInterface" ) ; } $ this -> logger -> debug ( $ dump ) ; break ; case self :: ERROR_LOG : error_log ( $ dump , 0 ) ; break ; } return null ; }
Dump given value into target output.

@param mixed $value
@param int   $target Possible options: OUTPUT, RETURN, ERROR_LOG, LOGGER.
@return string
@throws DumperException
Dump given value into target output .