diff --git a/basics/requests.md b/basics/requests.md index 43c4d29..e925b34 100644 --- a/basics/requests.md +++ b/basics/requests.md @@ -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. diff --git a/quality/tests.md b/quality/tests.md index 57c37ef..c24e018 100644 --- a/quality/tests.md +++ b/quality/tests.md @@ -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. \ No newline at end of file +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. diff --git a/services/events.md b/services/events.md index e50ffbe..a03bc52 100644 --- a/services/events.md +++ b/services/events.md @@ -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. \ No newline at end of file +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. diff --git a/standards/documentation.md b/standards/documentation.md index ee5bbc0..f3753f2 100644 --- a/standards/documentation.md +++ b/standards/documentation.md @@ -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} +``` diff --git a/standards/php.md b/standards/php.md index a72d6df..e8a9602 100644 --- a/standards/php.md +++ b/standards/php.md @@ -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()` \ No newline at end of file +* `unlink()`