Tech'n'Drinks Meetup (@myposterde)
Munich - 2018-02-28
Michael Haeuslmann (@michaelhaeu)
λ wget http://phar.dephpend.com/dephpend.phar -O ~/bin/dephpend
λ dephpend --help
_ _____ _ _ _____ _
| | | __ \| | | | __ \ | |
__| | ___| |__) | |__| | |__) |__ _ __ __| |
/ _` |/ _ \ ___/| __ | ___/ _ \ _ \ / _` |
| (_| | __/ | | | | | | | __/ | | | (_| |
\__,_|\___|_| |_| |_|_| \___|_| |_|\__,_| version 0.4
Usage: ...
λ dephpend text ~/workspace/dephpend/src
Mihaeu\PhpDependencies\Util\AbstractMap --> Mihaeu\PhpDependencies\Util\Collection
Mihaeu\PhpDependencies\Util\DI --> Mihaeu\PhpDependencies\Analyser\Analyser
...
<?php
$cmd = shell_exec('dephpend text src --no-classes');
$constraints = [
'Model.* --> .*View',
'View.* --> .*Model',
];
$regex = '/('.implode(')|(', $constraints).')/x';
if (preg_match($regex, $cmd)) {
echo 'Architecture violation'.PHP_EOL;
exit(1);
}
https://github.com/mihaeu/dephpend
Whatever you end up using:
Test your architecture!
https://phpmd.org/
https://github.com/kalessil/phpinspectionsea
Plaintext
vi /usr/share/dict/project-glossary-english
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8
# 4 space indentation
[*.py]
indent_style = space
indent_size = 4
Stock photos from pexels.com