PHP code example of kodzila / architecture-validator
1. Go to this page and download the library: Download kodzila/architecture-validator 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/ */
kodzila / architecture-validator example snippets
use Kodzila\ArchValidator\Architecture;
use Kodzila\ArchValidator\Rule\CoreModuleRule;
use PHPUnit\Framework\TestCase;
final class ArchitectureTest extends TestCase
{
public function test(): void
{
$architecture = Architecture::build()
->defineModule(
'Core',
'Isav\\Core\\',
'src/Core'
)
->defineModule(
'Armap',
'Isav\\Armap\\',
'src/Armap'
)
->defineModule(
'Import',
'Isav\\Import\\',
'src/Import'
)
;
$architecture->checkRule(new CoreModuleRule('Core'));
$this->assertTrue(true);
}
}