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.
Installs: 217
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:helper
Requires
- php: >=7.0.0
- league/climate: ^3.2
Requires (Dev)
- phpstan/phpstan: ^0.9.2
- phpunit/phpunit: ^7
- squizlabs/php_codesniffer: *
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 |