1
0
cms11/app/Services/BundleCreator/Contracts/CreatesBundle.php

37 lines
968 B
PHP
Raw Normal View History

2024-04-17 11:41:10 +02:00
<?php
namespace App\Services\BundleCreator\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;
}