Improve documentation

This commit is contained in:
Dennis Eichhorn 2017-12-02 19:42:16 +01:00
parent 77e9b955e1
commit 4270c5b0f6
8 changed files with 34 additions and 12 deletions

View File

@ -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.
<p align="center"><img alt="Application Flow" src="app_flow.svg"></p>
<div align="center">
![Application Flow](app_flow.svg)
</div>
In the following only the WebApplication and Application are mentioned as the other components are explained in detail in their respective documentation.

View File

@ -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
<?php return [
'{ROUTE_STRING}' => [
[

View File

@ -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

View File

@ -16,7 +16,7 @@ Flexboxes are preferred for all content containers.
</div>
```
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

View File

@ -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();

View File

@ -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.

View File

@ -26,3 +26,9 @@ header ('Content-type: image/png');
imagepng($c128b);
imagedestroy($c128b);
```
<div align="center">
![C128b Code](codes1.png)
</div>

BIN
services/codes1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B