This commit is contained in:
Dennis Eichhorn 2018-08-11 18:04:59 +02:00
commit 8a660ff0f2
5 changed files with 35 additions and 8 deletions

View File

@ -16,7 +16,14 @@ With the rest implementation it's possible to make http requests and read the re
```php
$request = new Request(new Http('http://your_request.com/url?to=call'));
$result = Rest::request($request);
$result = Rest::request($request);
```
Alternatively it's also possible to make a rest request directly from the Http request object.
```php
$request = new Request(new Http('http://your_request.com/url?to=call'));
$result = $request->rest();
```
The result contains the raw response text. By defining the request method it's also possible to make other requests such as `PUT` requests.

View File

@ -9,13 +9,13 @@ This application uses PHPUnit as unit testing framework. The PHPUnit directory i
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
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
php phpunit.phar -c tests/PHPUnit/phpunit_default.xml
```
### Modules
@ -24,4 +24,4 @@ Every module needs to have a `Admin` directory containing a class called `AdminT
## Jasmine
The javascript testing is done with jasmine. The javascript testing directory is structured the same way as the `Framework`. Unit tests for specific classes need to be named in the same manner as the testing class.
The javascript testing is done with jasmine. The javascript testing directory is structured the same way as the `Framework`. Unit tests for specific classes need to be named in the same manner as the testing class.

View File

@ -58,4 +58,8 @@ $eventManager->trigger('eventId', 'conditionName'); // No output (if remove = fa
$eventManager->trigger('eventId', 'conditionName'); // No output (if remove = true)
```
The order in which these conditions are triggered doesn't mapper. A multi condition event SHOULD be atteched with the optional boolean parameter `true`. These events can only be executed once and will be removed afterwards. In case the optional boolean parameter was not set to `true` the event will remain in the event manager and will be triggered whenever `trigger('eventId')` is called.
The order in which these conditions are triggered doesn't mapper. A multi condition event SHOULD be atteched with the optional boolean parameter `true`. These events can only be executed once and will be removed afterwards. In case the optional boolean parameter was not set to `true` the event will remain in the event manager and will be triggered whenever `trigger('eventId')` is called.
## Frontend vs. Backend
The only key difference between the frontend and backend implementation is that the frontend prevents runnning the same event in quick succession (less than 500 ms) in order to prevent undesired effects which can happen due to quick UI interaction.

View File

@ -128,8 +128,8 @@ A function/method documentation MUST be implemented in the following form:
*
* Optional example or more detailed description.
*
* @param {variable_type} param1Name Parameter description
* @param {variable_type} [optionalPara] Parameter description
* @param {variable_type_1} param1Name Parameter description
* @param {variable_type} [optionalPara] Parameter description
*
* @return {return_type}
*
@ -137,4 +137,12 @@ A function/method documentation MUST be implemented in the following form:
*/
```
Please also note the correct alignment of `@param` type, name and description
### Variable
In some cases it may be required to type hint a variable in this case the following format MUST be used.
```php
/** @var variable_type varName {optional_description}
```

View File

@ -54,6 +54,14 @@ Use `elseif` where possible instead of `else if`.
Namespaces must be surrounded with new line elements.
## Class Constants
Class constants MUST have a access modifier
```php
public CONST_NAME = ...;
```
## Deprecated functions and variables
The following functions and (super-) global variables MUST NOT be used.
@ -155,4 +163,4 @@ The usage of the following functions SHOULD be avoided and inspected for any kin
* `rmdir()`
* `mkdir()`
* `touch()`
* `unlink()`
* `unlink()`