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

Breadcrumb

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

function Silencer::call

Calls a specified function while silencing warnings and below.

Parameters

callable $callable Function to execute.:

mixed $parameters Function to execute.:

Return value

mixed Return value of the callback.

Throws

\Exception Any exceptions from the callback are rethrown.

24 calls to Silencer::call()
Application::doRun in vendor/composer/composer/src/Composer/Console/Application.php
Runs the current application.
Application::__construct in vendor/composer/composer/src/Composer/Console/Application.php
BaseIO::log in vendor/composer/composer/src/Composer/IO/BaseIO.php
BinaryInstaller::installBinaries in vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php
BinaryInstaller::installFullBinaries in vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php

... See full list

File

vendor/composer/composer/src/Composer/Util/Silencer.php, line 63

Class

Silencer
Temporarily suppress PHP error reporting, usually warnings and below.

Namespace

Composer\Util

Code

public static function call(callable $callable, ...$parameters) {
    try {
        self::suppress();
        $result = $callable(...$parameters);
        self::restore();
        return $result;
    } catch (\Exception $e) {
        // Use a finally block for this when requirements are raised to PHP 5.5
        self::restore();
        throw $e;
    }
}

API Navigation

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