ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
example_raw.php
Go to the documentation of this file.
1 <?php
2 // PSR-2
3 namespace Vendor\Package;
4 
5 use ZPackage;
6 use FooInterface;
7 use BarClass as Bar;
9 
10 class Foo extends Bar implements FooInterface
11 {
12  public function sampleMethod($a, $b = null)
13  {
14  if ($a === $b)
15  {
16  bar();
17  }
18  elseif ($a > $b)
19  {
20  $foo->bar($arg1);
21  }
22  else
23  {
24  BazClass::bar($arg2, $arg3);
25  }
26  }
27 
28  final public static function bar()
29  {
30  // method body
31  }
32 }
33 
35 // cast_spaces
36 $a = 0; $b = 0; $c = 0; $d=0; $e= 0 ; $f =0;
37 $bar = ( string ) $a;
38 $foo = (int)$b;
39 // concat_space
40 $foo = 'bar' . 3 . 'baz'.'qux';
41 // binary_operator_spaces
42 $a= 1 + $b^ $d !== $e or $f;
43 // unary_operator_spaces
44 $sample = 0;
45 $sample ++;
46 //Unused blank lines: begin
47 
48 
49 
50 //Unused blank lines: end
51 -- $sample;
52 $sample = ! ! $a;
53 $sample = ~ $c;
54 function & foo(){}
55 // function_typehint_space
56 function sample(array$a)
57 {}
58 // return_type_declaration
59 function bar(int $a):string {};
60 // whitespace_after_comma_in_array
61 $sample = array(1,'a',$b,);
sampleMethod($a, $b=null)
Definition: example_raw.php:12
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples