millancore / lake
Command line utility for agile project creation
Requires
- php: >=7.1
- laminas/laminas-code: ^3.4
- symfony/console: ^4.4
- symfony/filesystem: ^4.4
- symfony/options-resolver: ^4.4
- symfony/process: ^4.4
- symfony/yaml: ^4.4
Requires (Dev)
- phpstan/phpstan: ^0.12.14
- phpunit/phpunit: ^7.5
This package is auto-updated.
Last update: 2024-11-17 08:28:10 UTC
README
Lake is a command line utility that allows you to dynamically create classes and methods and create your reflexes for testing, also Lake can add methods to existing classes.
One of the most powerful features of Lake is that it automatically adds "USE" statements, Lake can recognize internal PHP classes, project classes and those that are present as Composer dependencies.
Install
PHP 7.1 or newer
composer require --dev millancore/lake
Configure
Lake takes to Composer the configuration of your project, he expects that the folder tests
to store the reflections of test.
But not all projects have the same structure, if that's the case you can use the configuration file lake.yml
and Config options.
Usage
In order for Lake to automatically add the USE
statements from Composer's dependencies, you must run lake dump
. If in the process of creation there is ambiguity in the name of the class or interface Lake will give you a choice from those available.
Only run once after installing some dependencies with Composer.
vendor/bin/lake dump
Create a class + method
vendor/bin/lake make src/DirName/ClassName MethodName
If the name of the method is not defined, the defined arguments will be those of the constructor.
Options
Examples
vendor/bin/lake make src/App/Command/CommandLake -e Command configure -a array:params
classFile: src/App/Command/CommandLake.php
<?php namespace Lake\App\Command; use Symfony\Component\Console\Command\Command; class CommandLake extends Command { /** * Undocumented function * * @param array $params * @return void */ public function configure(array $params) : void { } }
testFile: test/App/Command/CommandLakeTest.php
<?php use PHPUnit\Framework\TestCase; use Lake\App\Command\CommandLake; class CommandLakeTest extends TestCase { public function testDummyConfigureMethod() { } }