From 4270c5b0f6d0832a742e5df6bf8287f91ddae6ad Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 2 Dec 2017 19:42:16 +0100 Subject: [PATCH] Improve documentation --- application/structure.md | 6 +++++- basics/routing.md | 10 +++++----- basics/views.md | 2 +- frontend/styles_and_layout.md | 2 +- math/matrix.md | 8 ++++---- quality/tests.md | 12 ++++++++++++ services/codes.md | 6 ++++++ services/codes1.png | Bin 0 -> 136 bytes 8 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 services/codes1.png diff --git a/application/structure.md b/application/structure.md index 74c906b..36777d3 100644 --- a/application/structure.md +++ b/application/structure.md @@ -4,7 +4,11 @@ The user request gets passed through the entire application to all modules. The The routes usually reference endpoints in the module `controllers` which collects the model data through the model `mapper` and creates a partial response `view` with an assigned `template` and the collected model data. -

Application Flow

+
+ +![Application Flow](app_flow.svg) + +
In the following only the WebApplication and Application are mentioned as the other components are explained in detail in their respective documentation. diff --git a/basics/routing.md b/basics/routing.md index 9501472..a9cbd99 100644 --- a/basics/routing.md +++ b/basics/routing.md @@ -33,7 +33,7 @@ $router->add('foo/bar', function() { Routes can have different verbs which are derived from the HTTP verbs. Routes that get assigned a verb will only be matched if the route and the routing verb match. -``` +```php $this->router->add('foo/bar', function() { return 'Hellow World'; }, RouteVerb::GET | RouteVerb::SET); @@ -47,13 +47,13 @@ $this->router->add('foo/bar', function() { Instead of defining closures it's possible to define a string representation of the destination that should be called. -``` +```php $this->router->add('foo/bar', '\foo\controller:barFunction'); ``` Static functions can be defined in the following fashion: -``` +```php $this->router->add('foo/bar', '\foo\controller::barFunction'); ``` @@ -61,13 +61,13 @@ $this->router->add('foo/bar', '\foo\controller::barFunction'); While routes can be added manually to the router it's also possible to import a list of routes through the file import function. -``` +```php $this->router->importFromFile($path); ``` The routing file must have the folloing structure: -``` +```php [ [ diff --git a/basics/views.md b/basics/views.md index d25be94..95f0621 100644 --- a/basics/views.md +++ b/basics/views.md @@ -1,6 +1,6 @@ # Views -Views contain the raw information of a result which then depending on the template will be rendered. While it is possible to use the generic `View` class which provides the `addData()` `setData()` and `getData()` methods it is recommended to generate more specialized views for better variable handling as well as providing view logic. The template itself should not contain view logic and only representation logic. In some cases however it is required to modify/transform data which should be handled in the view. +Views contain the raw information of a result which then depending on the template will be rendered. While it is possible to use the generic `View` class which provides the `addData()`, `setData()` and `getData()` methods it is recommended to generate more specialized views for better variable handling as well as providing view logic. The template itself should not contain view logic and only representation logic. In some cases however it is required to modify/transform data which should be handled in the view. ## Implementation diff --git a/frontend/styles_and_layout.md b/frontend/styles_and_layout.md index fe0f25c..fbd6ec3 100644 --- a/frontend/styles_and_layout.md +++ b/frontend/styles_and_layout.md @@ -16,7 +16,7 @@ Flexboxes are preferred for all content containers. ``` -Available sizes are `xs`, `sm`, `md`, `lg` with a grid ranging from `1-12`. +Available sizes are `xs-*`, `sm-*`, `md-*`, `lg-*` with a grid ranging from `1-12`. ## Sizes diff --git a/math/matrix.md b/math/matrix.md index 6eb53d7..b69e1cf 100644 --- a/math/matrix.md +++ b/math/matrix.md @@ -69,7 +69,7 @@ $matrix->mult($matrixB); ## Solve -In order to solve `A x = b` the matrix implements `solve` which automatically selects an appropriate algorithm (LU or QR decomposition) to solve the equation. +In order to solve `A x = b` the matrix implements `solve()` which automatically selects an appropriate algorithm (LU or QR decomposition) to solve the equation. ```php $matrix->solve($matrixB); @@ -93,7 +93,7 @@ $matrix->transpose(); ## Determinant -The determinant of a matrix is calculated via the `det` function. +The determinant of a matrix is calculated via the `det()` function. ```php $matrix->det(); @@ -111,7 +111,7 @@ $matrix->diagonalize(); ### Upper Triangular -The upper triangular of a matrix can be created via the `upperTriangular` function. +The upper triangular of a matrix can be created via the `upperTriangular()` function. ```php $matrix->upperTriangular(); @@ -119,7 +119,7 @@ $matrix->upperTriangular(); ### Lower Triangular -The lower triangular of a matrix can be created via the `lowerTriangular` function. +The lower triangular of a matrix can be created via the `lowerTriangular()` function. ```php $matrix->lowerTriangular(); diff --git a/quality/tests.md b/quality/tests.md index 7735849..3693880 100644 --- a/quality/tests.md +++ b/quality/tests.md @@ -6,6 +6,18 @@ The applications goal is to achive 90% code coverage, which applies for the core This application uses PHPUnit as unit testing framework. The PHPUnit directory is structured the same way as the `Framework`, `Modules`, `Install` and `Models` directories. Unit tests for specific classes need to be named in the same manner as the testing class. +In order to run all tests and also creating the dummy data for UI tests, execute the following command: + +```sh +php phpunit.phar -c Tests/PHPUnit/phpunit_no_coverage.xml +``` + +In order to also create a code coverage report run: + +```sh +php phpunit.phar -c Tests/PHPUnit/phpunit_default.xml +``` + ### Modules Every module needs to have a `Admin` directory containing a class called `AdminTest.php` which is used for testing the installation, activation, deactivation, uninstall and remove of the module. Tests that install, update, remove etc. a module need to have a group called `admin`. After running the `AdminTest.php` test the final state of the module should be installed and active, only this way it's possible to further test the controller and models. A code coverage of at least 80% is mandatory for every module for integration. diff --git a/services/codes.md b/services/codes.md index 620c1b9..978165e 100644 --- a/services/codes.md +++ b/services/codes.md @@ -26,3 +26,9 @@ header ('Content-type: image/png'); imagepng($c128b); imagedestroy($c128b); ``` + +
+ +![C128b Code](codes1.png) + +
\ No newline at end of file diff --git a/services/codes1.png b/services/codes1.png new file mode 100644 index 0000000000000000000000000000000000000000..51b36118309319dcf2dc041bd30fe3071a55804a GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^&w<#8kr_zNJsI~ONU;U@gt!9f|Ns9ly*d9bkY(%X z;uvDloBX4n{ZF#QRM&~Nv0wK*+53KW>ixAz`Ddn?#9aGaHhE*z#OIwE-A5O10zqay g>j2fm2~$`Z`p>I(9n1Fh0vg2N>FVdQ&MBb@07M-$3;+NC literal 0 HcmV?d00001