tobento / app-skeleton
PHP application skeleton.
Requires
- php: >=8.0
- tobento/app: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- tobento/app-testing: ^1.0
- vimeo/psalm: ^4.0
README
Use this app skeleton to quickly setup and start working on a new App project.
Table of Contents
Getting Started
Add the latest version of the app skeleton running this command.
composer create-project tobento/app-skeleton [my-app-name]
Requirements
- PHP 8.0 or greater
Documentation
App
Check out the App to learn more about the app in general.
Directory Structure
The directories are set on the app.php file. You can freely change them as you prefer.
app/app.php
Check out the App Directories to learn more about directories in general.
Config
Some App Bundles have config files, which will be located as default at:
app/config/
Src
The app/src/
directory is the place to put your classes which is namespaced under App
.
Register Boots
You may register boots on two places.
On the app.php config file
app/config/app.php
return [ /* |-------------------------------------------------------------------------- | Application Boots |-------------------------------------------------------------------------- | | The application boots. | */ 'boots' => [ \Tobento\App\Boot\ErrorHandling::class, // add more boots. AnyBoot::class, ], ];
On the app.php file
app/app.php
// Boot the app ----------------------------------------------------------- $app->boot(\Tobento\App\Boot\App::class); // Add more boots here $app->boot(AnyBoot::class);
App Testing
Unit Tests
Unit tests are designed to test small, isolated portions of code, often focusing on a single method.
See demo test file: tests/Unit/DemoTest.php
Feature Tests
Feature tests test the behavior of a complete application. They may make HTTP requests and test that the response is as expected.
See demo test file: tests/Feature/DemoTest.php
Furthermore, check out the App Testing bundle for more information.