vikkio88/slime-framework

View on GitHub
src/Lib/Slime/Console/Commands/CreateModelCommand.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php


namespace App\Lib\Slime\Console\Commands;


use App\Lib\Helpers\TextFormatter;
use App\Lib\Slime\Console\NamespacedGeneratorHelperCommand;

class CreateModelCommand extends NamespacedGeneratorHelperCommand
{
    protected function getHead()
    {
        $fileHead = parent::getHead();
        $fileHead .= PHP_EOL
            . 'namespace App\Models'
            . $this->getNamespaceString()
            . ';' . PHP_EOL
            . 'use App\Lib\Slime\Models\SlimeModel;'
            . PHP_EOL;
        return $fileHead;
    }

    protected function getFilePath()
    {
        return 'Models/';
    }

    protected function getStub()
    {
        return PHP_EOL . 'class ' .
            TextFormatter::snakeToCamelCase($this->filenameRoot) .
            ' extends SlimeModel {' . PHP_EOL . '}';
    }
}