These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
0 ignored issues
–
show
|
|||
2 | |||
3 | if ( defined( 'Diff_VERSION' ) ) { |
||
4 | // Do not initialize more than once. |
||
5 | return 1; |
||
6 | } |
||
7 | |||
8 | define( 'Diff_VERSION', '2.0' ); |
||
9 | |||
10 | if ( defined( 'MEDIAWIKI' ) ) { |
||
11 | call_user_func( function() { |
||
12 | require_once __DIR__ . '/Diff.mw.php'; |
||
13 | } ); |
||
14 | } |
||
15 | |||
16 | // Aliasing of classes that got renamed. |
||
17 | // For more details, see Aliases.php. |
||
18 | |||
19 | // Aliases introduced in 1.0 |
||
20 | class_alias( 'Diff\Differ\CallbackListDiffer', 'Diff\CallbackListDiffer' ); |
||
21 | class_alias( 'Diff\Differ\Differ', 'Diff\Differ' ); |
||
22 | class_alias( 'Diff\Differ\ListDiffer', 'Diff\ListDiffer' ); |
||
23 | class_alias( 'Diff\Differ\MapDiffer', 'Diff\MapDiffer' ); |
||
24 | class_alias( 'Diff\Differ\OrderedListDiffer', 'Diff\OrderedListDiffer' ); |
||
25 | |||
26 | class_alias( 'Diff\Patcher\ListPatcher', 'Diff\ListPatcher' ); |
||
27 | class_alias( 'Diff\Patcher\MapPatcher', 'Diff\MapPatcher' ); |
||
28 | class_alias( 'Diff\Patcher\Patcher', 'Diff\Patcher' ); |
||
29 | class_alias( 'Diff\Patcher\PatcherException', 'Diff\PatcherException' ); |
||
30 | class_alias( 'Diff\Patcher\PreviewablePatcher', 'Diff\PreviewablePatcher' ); |
||
31 | class_alias( 'Diff\Patcher\ThrowingPatcher', 'Diff\ThrowingPatcher' ); |
||
32 | |||
33 | class_alias( 'Diff\DiffOp\Diff\Diff', 'Diff\Diff' ); |
||
34 | class_alias( 'Diff\DiffOp\Diff\ListDiff', 'Diff\ListDiff' ); |
||
35 | class_alias( 'Diff\DiffOp\Diff\MapDiff', 'Diff\MapDiff' ); |
||
36 | |||
37 | class_alias( 'Diff\DiffOp\AtomicDiffOp', 'Diff\AtomicDiffOp' ); |
||
38 | class_alias( 'Diff\DiffOp\DiffOp', 'Diff\DiffOp' ); |
||
39 | class_alias( 'Diff\DiffOp\DiffOpAdd', 'Diff\DiffOpAdd' ); |
||
40 | class_alias( 'Diff\DiffOp\DiffOpChange', 'Diff\DiffOpChange' ); |
||
41 | class_alias( 'Diff\DiffOp\DiffOpRemove', 'Diff\DiffOpRemove' ); |
||
42 |
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.