gacela-project / gacela

Build modular PHP applications.

Home Page:http://gacela-project.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove deprecated callable on gacela.php

Chemaclass opened this issue · comments

Current behaviour

On gacela.php you can return a callable. See: is_callable($setupGacelaFile)

final class GacelaConfigUsingGacelaPhpFileFactory 
{
    // ...

    public function createGacelaFileConfig(): GacelaConfigFileInterface
    {
        /** @var SetupGacelaInterface|callable $setupGacelaFile */
        $setupGacelaFile = $this->fileIo->include($this->gacelaPhpPath);
        if (is_callable($setupGacelaFile)) {
            trigger_deprecation('Gacela', '0.15', 'Return a SetupGacelaInterface instance directly. The callable option will be removed in the next version.');
        }

        /** @var object $setupGacela */
        $setupGacela = is_callable($setupGacelaFile) ? $setupGacelaFile() : $setupGacelaFile;

        // ...

Acceptance criteria

Remove that possibility of allowing a callable, because it's not useful at all.
Ensure the $this->fileIo->include($this->gacelaPhpPath); returns a SetupGacelaInterface or fail.

This new idea of simplifying the gacela.php content #146, makes this issue obsolete. I will close it now.