Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AbstractDumper.php

function AbstractDumper::setOutput

Sets the output destination of the dumps.

Parameters

callable|resource|string|null $output A line dumper callable, an opened stream or an output path:

Return value

callable|resource|string|null The previous output destination

2 calls to AbstractDumper::setOutput()
AbstractDumper::dump in vendor/symfony/var-dumper/Dumper/AbstractDumper.php
Dumps a Data object.
AbstractDumper::__construct in vendor/symfony/var-dumper/Dumper/AbstractDumper.php

File

vendor/symfony/var-dumper/Dumper/AbstractDumper.php, line 66

Class

AbstractDumper
Abstract mechanism for dumping a Data object.

Namespace

Symfony\Component\VarDumper\Dumper

Code

public function setOutput($output) {
    $prev = $this->outputStream ?? $this->lineDumper;
    if (\is_callable($output)) {
        $this->outputStream = null;
        $this->lineDumper = $output;
    }
    else {
        if (\is_string($output)) {
            $output = fopen($output, 'w');
        }
        $this->outputStream = $output;
        $this->lineDumper = $this->echoLine(...);
    }
    return $prev;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal