37 lines
969 B
PHP
37 lines
969 B
PHP
<?php
|
|
|
|
namespace App\Services\BundleCreators\Contracts;
|
|
|
|
use Illuminate\Filesystem\FilesystemAdapter;
|
|
|
|
interface CreatesBundle
|
|
{
|
|
/**
|
|
* Return a boolean value indicating if the creator can actually make the
|
|
* bundle using known data.
|
|
*/
|
|
public function canCreateBundle(): bool;
|
|
|
|
/**
|
|
* Return an array describing what kind of data the creator needs in
|
|
* addition to the one it already has
|
|
*/
|
|
public function formSpecs(): ?array;
|
|
|
|
/**
|
|
* Create a bundle and return its path
|
|
*/
|
|
public function createBundle(): string;
|
|
|
|
/**
|
|
* Return a boolean value indicating if this creator in particular can
|
|
* create bundles for specified section
|
|
*/
|
|
public static function handles(string $section, ?array $data = []): bool;
|
|
|
|
/**
|
|
* Return an instance of the creator, using specified data as input
|
|
*/
|
|
public static function make(?array $data, FilesystemAdapter $disk): CreatesBundle;
|
|
}
|