Abdeslam-Gacemi/EventManager

View on GitHub
src/CatchableListenerTrait.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

/**
 * @author Abdeslam Gacemi <abdobling@gmail.com>
 */

namespace Abdeslam\EventManager;

use Closure;

trait CatchableListenerTrait
{
    /**
     * 
     *
     * @var Closure 
     */
    protected $catcher;

    public function catch(Closure $catcher): void
    {
        $this->catcher = $catcher;
    }

    public function getCatcher(): ?Closure
    {
        return $this->catcher;
    }
}