function registerException(string $class, callable $exporter, callable $importer) {
        if(!\class_exists($class, true)) {
            throw new \InvalidArgumentException('Given class does not exist');
        } elseif(!\in_array(\Throwable::class, \class_implements($class))) {
            throw new \InvalidArgumentException('Given class is not a Throwable');
        } elseif($exporter instanceof \Closure || $importer instanceof \Closure) {
            throw new \LogicException('Closures are not supported');
        }
        
        $this->exceptions[$class] = array(
            'export' => $exporter,
            'import' => $importer
        );
        
        return $this;
    }
function registerException(string $class, callable $exporter, callable $importer) {
        if(!\class_exists($class, true)) {
            throw new \InvalidArgumentException('Given class does not exist');
        } elseif(!\in_array(\Throwable::class, \class_implements($class))) {
            throw new \InvalidArgumentException('Given class is not a Throwable');
        } elseif($exporter instanceof \Closure || $importer instanceof \Closure) {
            throw new \LogicException('Closures are not supported');
        }
        
        $this->exceptions[$class] = array(
            'export' => $exporter,
            'import' => $importer
        );
        
        return $this;
    }
function registerException ( string $ class , callable $ exporter , callable $ importer ) { if ( ! \ class_exists ( $ class , true ) ) { throw new \ InvalidArgumentException ( 'Given class does not exist' ) ; } elseif ( ! \ in_array ( \ Throwable :: class , \ class_implements ( $ class ) ) ) { throw new \ InvalidArgumentException ( 'Given class is not a Throwable' ) ; } elseif ( $ exporter instanceof \ Closure || $ importer instanceof \ Closure ) { throw new \ LogicException ( 'Closures are not supported' ) ; } $ this -> exceptions [ $ class ] = array ( 'export' => $ exporter , 'import' => $ importer ) ; return $ this ; }
Registers an exception.
@param string    $class
@param callable  $exporter  MUST NOT be a closure.
@param callable  $importer  MUST NOT be a closure.
@return $this
@throws \InvalidArgumentException
@throws \LogicException
Registers an exception .