jeyroik/extas-repositories-get

View on GitHub
src/components/THasMagicClass.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
namespace extas\components;

/**
 * Trait THasMagicClass
 *
 * @package extas\components
 * @author jeyroik <jeyroik@gmail.com>
 */
trait THasMagicClass
{
    /**
     * @param string $name
     * @return mixed
     */
    protected function getMagicClass(string $name)
    {
        $item = new class() extends Item{
            protected function getSubjectForExtension(): string
            {
                return 'extas.tmp';
            }
        };

        return $item->$name();
    }
}