tereta / development
Development tools for Tereta packages and applications.
Requires
- php: >=8.2
- composer-runtime-api: ^2.0
Requires (Dev)
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
- squizlabs/php_codesniffer: ^3.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-10-18 17:54:16 UTC
README
Development tools for Tereta packages and applications.
Installation
composer require --dev tereta/development
Usage
The package creates skeletons of classes and packages. The Create service runs the generators by command name.
Show the list of commands:
use Tereta\Development\Services\Create;
use Tereta\Development\Services\Package;
use Tereta\Development\Services\Signature;
use Tereta\Development\Services\Type;
$signature = new Signature();
$create = new Create(new Type($signature), new Package($signature));
echo $create->listing();
Create a class
The file is placed in the PSR-4 directory of the class namespace. The method returns the path of the new file.
$path = $create->create('class', ['Vendor\\Package\\Services\\Mailer']);
Create a package
Creates a new package skeleton in the packages directory of the current working directory.
$path = $create->create('package', ['vendor/package']);
Add your own generator
A generator is a class that implements the Generator interface. Register it in Create with a command name.
use Tereta\Development\Interfaces\Generator;
class Readme implements Generator
{
public function getArguments(): string
{
return '<path>';
}
public function getDescription(): string
{
return 'Create an empty README file';
}
public function create(array $arguments): string
{
$path = $arguments[0] . '/README.md';
file_put_contents($path, "# Readme\n");
return $path;
}
}
$create->register('readme', new Readme());
$create->create('readme', ['/path/to/project']);
In a Tereta application use the development:create console command from the tereta/application-development package.
License and author
Tereta Alexander tereta.alexander@gmail.com
Web: https://tereta.dev
Copyright ©2008-2026 Tereta Alexander
Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
www.████████╗███████╗██████╗ ███████╗████████╗ █████╗
╚══██╔══╝██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔══██╗
██║ █████╗ ██████╔╝█████╗ ██║ ███████║
██║ ██╔══╝ ██╔══██╗██╔══╝ ██║ ██╔══██║
██║ ███████╗██║ ██║███████╗ ██║ ██║ ██║
╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝
.dev