1. Go to this page and download the library: Download crustum/structarmed-cakephp library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// structarmed.php
use Boundwize\StructArmed\Architecture;
use Crustum\StructArmed\Cake\CakeAppPreset;
return Architecture::define()
->layer('Source', []) // PSR-4 scan paths (needed for the PHPUnit extension)
->withPreset(new CakeAppPreset())
->ruleset([ // your own domain layers, if any
// ...
]);
new CakeAppPreset(
namespace: 'App', // root namespace (no trailing backslash)
controllerMaxComplexity: 3, // default: 5
controllerMaxMethodLength: 15, // default: 20
controllerMaxDependencies: 4, // default: 5
viewMaxComplexity: 2, // default: 3 — View classes should just load helpers
)