src/Hook/Restriction.php
/**
     * Add an allowed hook to the restriction
     *
     * If the Restrictions is already applicable it returns itself
     * if not the current instance get cloned and the new hook is
     * added to the applicable hook list.
     *
     * @param  string $hook
     * @return \CaptainHook\App\Hook\Restriction
     */
Add an allowed hook to the restriction
If the Restrictions is already applicable it returns itself
if not the current instance get cloned and the new hook is
added to the applicable hook list.

@param  string $hook
@return \CaptainHook\App\Hook\Restriction
Add an allowed hook to the restriction If the Restrictions is already applicable it returns itself if not the current instance get cloned and the new hook is added to the applicable hook list . @param string $hook @return \ CaptainHook \ App \ Hook \ Restriction
public function with(string $hook): self
    {
        if ($this->isApplicableFor($hook)) {
            return $this;
        }
        $restriction = clone ($this);
        $restriction->allowHook($hook);
        return $restriction;
    }
public function with ( string $ hook ) : self { if ( $ this -> isApplicableFor ( $ hook ) ) { return $ this ; } $ restriction = clone ( $ this ) ; $ restriction -> allowHook ( $ hook ) ; return $ restriction ; }
Add an allowed hook to the restriction
 If the Restrictions is already applicable it returns itself
 if not the current instance get cloned and the new hook is
 added to the applicable hook list.
Add an allowed hook to the restriction If the Restrictions is already applicable it returns itself if not the current instance get cloned and the new hook is added to the applicable hook list .