X

Create New Item

File Folder

X

Search Results

File "SupportsStartWithEndWith.php"

Full path: /home/orbitecv/orbite-school.orbit.et/vendor/spatie/laravel-package-tools/src/Commands/Concerns/SupportsStartWithEndWith.php
File size: 769 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Edit   Back

<?php

namespace Spatie\LaravelPackageTools\Commands\Concerns;

use Closure;

trait SupportsStartWithEndWith
{
    public ?Closure $startWith = null;
    public ?Closure $endWith = null;

    public function startWith(callable $callable): self
    {
        $this->startWith = $callable;

        return $this;
    }

    public function endWith(callable $callable): self
    {
        $this->endWith = $callable;

        return $this;
    }

    protected function processStartWith(): self
    {
        if ($this->startWith) {
            ($this->startWith)($this);
        }

        return $this;
    }

    protected function processEndWith(): self
    {
        if ($this->endWith) {
            ($this->endWith)($this);
        }

        return $this;
    }
}