luyadev/luya-module-admin

View on GitHub
src/openapi/specs/ControllerSpecs.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace luya\admin\openapi\specs;

use ReflectionClass;
use yii\base\Controller;

/**
 * Specs of a Controller.
 *
 * @author Basil Suter <git@nadar.io>
 * @since 3.2.0
 */
class ControllerSpecs extends BaseSpecs
{
    protected $reflection;

    public function __construct(public Controller $controller)
    {
        $this->reflection = new ReflectionClass($controller::class);
    }

    /**
     * {@inheritDoc}
     */
    public function getVerbName()
    {
        return 'get';
    }

    /**
     * {@inheritDoc}
     */
    public function getControllerObject()
    {
        return $this->controller;
    }

    /**
     * {@inheritDoc}
     */
    public function getActionObject()
    {
        return $this->controller;
    }

    /**
     * {@inheritDoc}
     */
    public function getReflection()
    {
        return $this->reflection;
    }
}