<?php

namespace Sargilla\Flatlab4\Console\Routes;

use Sargilla\Filesystem\Compiler\StubFileCompiler;
use Sargilla\Filesystem\Filesystem;

/**
 * Class ControllerResourceRoute.
 *
 * @package Sargilla\Flatlab4\Console\Routes
 */
class ControllerResourceRoute extends Route
{
    use Controller;

    /**
     * ControllerResourceRoute constructor.
     *
     * @param StubFileCompiler $compiler
     * @param Filesystem $filesystem
     */
    public function __construct(StubFileCompiler $compiler, Filesystem $filesystem)
    {
        parent::__construct($compiler, $filesystem);
    }

    /**
     * Get stub path.
     *
     * @return mixed
     */
    protected function getStubPath()
    {
        return __DIR__ . '/../stubs/route_with_resource_controller.stub';
    }

    /**
     * Obtain replacements for stub.
     *
     * @return mixed
     */
    protected function obtainReplacements()
    {
        return [
            'ROUTE_LINK' => $this->getReplacements()[0],
            'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]),
        ];
    }
}
