ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
example_raw.php
Go to the documentation of this file.
1<?php
2
19// PSR-12
20namespace Vendor\Package;
21
22use ZPackage;
23use FooInterface;
24use BarClass as Bar;
25use OtherVendor\OtherPackage\BazClass;
26
27class Foo extends Bar implements FooInterface
28{
29 public function sampleMethod($a, $b = null)
30 {
31 if ($a === $b)
32 {
33 bar();
34 }
35 elseif ($a > $b)
36 {
37 $foo->bar($arg1);
38 }
39 else
40 {
41 BazClass::bar($arg2, $arg3);
42 }
43 }
44
45 final public static function bar()
46 {
47 // method body
48 }
49}
50
52// cast_spaces
53$a = 0; $b = 0; $c = 0; $d=0; $e= 0 ; $f =0;
54$bar = ( string ) $a;
55$foo = (int)$b;
56// concat_space
57$foo = 'bar' . 3 . 'baz'.'qux';
58// binary_operator_spaces
59$a= 1 + $b^ $d !== $e or $f;
60// unary_operator_spaces
61$sample = 0;
62$sample ++;
63//Unused blank lines: begin
64
65
66
67//Unused blank lines: end
68-- $sample;
69$sample = ! ! $a;
70$sample = ~ $c;
71function & foo(){}
72// function_typehint_space
73function sample(array$a)
74{}
75// return_type_declaration
76function bar(int $a):string {};
77// whitespace_after_comma_in_array
78$sample = array(1,'a',$b,);
sampleMethod($a, $b=null)
Definition: example_raw.php:29
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples