mirror of
https://github.com/Karaka-Management/Developer-Guide.git
synced 2026-01-11 12:28:41 +00:00
Improve documentation
This commit is contained in:
parent
77e9b955e1
commit
4270c5b0f6
|
|
@ -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">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
In the following only the WebApplication and Application are mentioned as the other components are explained in detail in their respective documentation.
|
||||
|
||||
|
|
|
|||
|
|
@ -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}' => [
|
||||
[
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -26,3 +26,9 @@ header ('Content-type: image/png');
|
|||
imagepng($c128b);
|
||||
imagedestroy($c128b);
|
||||
```
|
||||
|
||||
<div align="center">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
BIN
services/codes1.png
Normal file
BIN
services/codes1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 136 B |
Loading…
Reference in New Issue
Block a user