For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 18 and the first side effect is on line 3.
The PSR-1: Basic Coding Standard recommends that a file should either introduce
new symbols, that is classes, functions, constants or similar, or have side effects.
Side effects are anything that executes logic, like for example printing output,
changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state
of an application. It also promotes a cleaner style of programming and makes your code
less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the
PSR-1.
Loading history...
2
// Error Reporting Level
3
error_reporting(E_ALL | E_STRICT);
4
5
// add framework and tests to include path
6
$framework = realpath(__DIR__ . '/../framework');
7
$tests = realpath(__DIR__ . '/../tests');
8
9
$paths = [
10
$framework,
11
$tests,
12
get_include_path(), // attach original include paths
function _() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
The return type could not be reliably inferred; please add a @return annotation.
Our type inference engine in quite powerful, but sometimes the code does not
provide enough clues to go by. In these cases we request you to add a @return
annotation as described here.
This method's name is shorter than the configured minimum length of 3 characters.
Even though PHP does not care about the name of your methods, it is generally a
good practice to choose method names which can be easily understood by other human
readers.
Loading history...
19
{
20
return $msgid;
21
}
22
}
23
24
// Composer Autoloader
25
if (is_file(__DIR__ . '/../vendor/autoload.php')) {
26
include_once __DIR__ . '/../vendor/autoload.php';
27
} else {
28
echo '[Error] Koch Framework > Tests > Bootstrap: Could not find "vendor/autoload.php".' . PHP_EOL;
29
echo 'Did you forget to run "composer install --dev"?' . PHP_EOL;
30
exit(1);
31
}
32
33
// Koch Framework Autoloader
34
// Note: We are on top of the autoloader stack and not Composer's ClassLoader.
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.