trait DumperTrait

Provides a trait for dumper service.

Hierarchy

1 file declares its use of DumperTrait
FileExampleSubmitHandlerHelper.php in modules/file_example/src/FileExampleSubmitHandlerHelper.php

File

modules/file_example/src/Traits/DumperTrait.php, line 8

Namespace

Drupal\file_example\Traits
View source
trait DumperTrait {
    
    /**
     * Gets the dumper service.
     *
     * @return \Drupal\devel\DevelDumperManagerInterface|bool
     *   The dumper service or FALSE if the service is not available.
     */
    protected function dumper() {
        if (\Drupal::hasService('devel.dumper')) {
            
            /** @var \Drupal\devel\DevelDumperManagerInterface $dumper */
            $dumper = \Drupal::service('devel.dumper');
            return $dumper;
        }
        return FALSE;
    }

}

Members

Title Sort descending Modifiers Object type Summary
DumperTrait::dumper protected function Gets the dumper service.