tom-millard/php-class-gen

Generate php classes

This package's canonical repository appears to be gone and the package has been frozen as a result.

v1.1.0 2018-03-02 20:14 UTC

This package is not auto-updated.

Last update: 2019-11-04 19:28:42 UTC


README

Helper repo for creating php classes, with factory and unit test files.

Example:

php ./bin/classgen \\Namespace\\Class ./src --test=./tests

This will create the following:

  • Class.php in the src directory
  • ClassFactory.php in the src directory
  • ClassTest.php in the test directory

Creating the following structure:

  • src
    • Class.php
    • ClassFactory.php
  • tests
    • ClassTest.php

File structures are not taken from namespaces and nothing is assumed about the layout of the project.

Note: if no test dir is given no test will be created

Additional arguments

The following arguments can be passed in at the end of the required values.

argument description example
--extends=[string] extend the class --extends=\namespace\class
--no-factory Do not create a factory n/a