2017 © Pedro Peláez
 

library factory

Factory helps you create php classes, interfaces and more.

image

clarkeash/factory

Factory helps you create php classes, interfaces and more.

  • Monday, February 1, 2016
  • by clarkeash
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Factory

Factory helps you create php classes, interfaces and more, (*1)

Author Travis Scrutinizer Codecov Packagist Version License, (*2)

Installation

composer global require clarkeash/factory

Usage

This package requires that you have psr-4 autoloading enabled in your composer.json file, as this is how it calculates the namespace for the classes you create., (*3)

The factory command should be ran from the root directory, where the composer.json lives., (*4)

Class

Create a basic class, (*5)

factory make:class Application

Generates:, (*6)

<?php

namespace Acme;

class Application
{

}

Create an abstract class, (*7)

factory make:class Example --abstract

Generates:, (*8)

<?php

namespace Acme;

abstract class Example
{

}

Interface

Create an interface, (*9)

factory make:interface ExampleInterface

Generates:, (*10)

<?php

namespace Acme;

interface ExampleInterface
{

}

Trait

Create a trait, (*11)

factory make:trait ExampleTrait

Generates:, (*12)

<?php

namespace Acme;

trait ExampleTrait
{

}

Test

Create a test, (*13)

factory make:test Application

The above command will create a test class to test the Application class. And will generate the following:, (*14)

<?php

use Acme\Application;

class ApplicationTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var Application
     */
    protected $unit;

    public function setUp()
    {
        $this->unit = new Application();
    }

    /**
     * @test
     */
    public function it_works()
    {
        $this->assertTrue(true);
    }
}

Testing

bash ./vendor/bin/phpunit, (*15)

License

This package is released under the MIT license. Please see the License File for more information., (*16)

The Versions