Download the PHP package ajthinking/anything without Composer
On this page you can find all versions of the php package ajthinking/anything. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ajthinking/anything
More information about ajthinking/anything
Files in ajthinking/anything
Package anything
Short Description Create code by imagining public apis
License MIT
Homepage https://github.com/ajthinking/anything
Informations about the package anything
Anything! 💫
Imagine public API:s and make it so - a TDD and sketch toy for Laravel projects :star_struck:
Getting started
Install and enable like so:
Then, flesh out your idea and execute it in a console context. Lets say we want to build a git client:
The last method call ->build()
will create this class for you along with all the method stubs:
When referenced statically like above the first call will typically spawn a static method. However, if the class name contains Facades\
lets say App\Facades\Zonda
we will instead make it an instance method and create a facade next to it:
Finally, make sure to clean up by discarding the change in bootstrap/app.php
with git, or by running
php artisan anything:off
Gotchas
This experiment comes with some limitations.
anything:on/off
commands it makes a little intrusion in yourbootstrap/app.php
to temporary swap out the console kernel. It assumes you have not made any major modifications to this file.- it will only work for classes in the
App
namespace - method arguments are currently ignored
- assumes everything returns
$this
- when using in tests, make sure your test case uses
CreatesApplication
. This might not always be the case for unit test setups
License
The MIT License (MIT). Please see License File for more information.