1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
<?php
namespace test;
/**
*
* @ invalid annotion syntax
*/
class FooException extends \Exception {}
interface someInterface {
/**
* @param int $a
* @param int $b
*
* @return mixed
*/
public function someInterfaceMethod($a, $b);
}
class base {
public function baseMethod() {
// some inline comment - syntax 1
echo "123";
/* comment - syntax 2
multine comment
for the win ;)
*/
$x = 1 + 2;
// @TODO: fix me as well
$y = '12345';
# comment syntax 4
# multi line
# in a different
# way
for($a=0; $a<100; $a++) {
// comment within foreach
$y++;
}
/**
* @todo fix me!
* with a second line
*/
$z = $x * $y;
echo $z;
/** docblock style comment - syntax 3 */
$this->someMethod();
}
}
/**
* Halli hallo hallöle :) Hier steht Text mit Sönderzeichän.
*
* @author Reiner Zufall
* @copyright 1234 by Reiner Zufall Productions
* @link http://remote.tld/page
* @license BSD
*/
class foo extends base implements someInterface{
/** some description */
const foo = 123;
const baz = 'abc';
/** @var string for you */
protected $bar = 'SomeDefaultValue';
private $pr = NULL;
public $pub = FALSE;
/**
* First line descr.
* More text here with inline {@link My\Beautiful\Class} - addtionally
* some {@link My\Beautiful\Class::getId} and of course with
* even anther {@link http://http://www.php.net/manual/en/language.oop5.php Classes and Objects} to render
*/
public function blupp(SomeClass $o, $x = 'hello', $y = 1, $z = 0.5,
$c = self::foo, $c2 = \test\foo::foo, $c3 = \Exception::some,
$a = array(), $a2 = array(1,2,3, 'four', 'five')
) {
}
/**
* @inheritdoc
*
* @param string $c
*/
public function someInterfaceMethod($a, $b, $c = null) {
// ...
}
/**
* This is the 2nd method of this class
*
* We can have a funny description text here, going over multiple lines if need be. So we just add
* more text so it get's longer and longer and longer.. This is for testing only, so the text
* does not even have to make sense.
*
* @param SomeClass $o First Parameter description
* @param string $x Second parameter is a string with text
* @param int $y We also pass in an integer
* @param float $z This variable is a float, with a default
* @param int $c An Integer with a given default value by self reference
* @param int $c2 Also floats can have a predefined value
* @param string $c3 Reference to some constant in a different class
* @param array $a Array parameter
* @param array $a2 And an array with default entries
*/
public function someLongerMethodNameWithSomeReallyLongName(SomeClass $o, $x = 'hello', $y = 1, $z = 0.5, $c = self::foo,
$c2 = \test\foo::foo, $c3 = \Exception::some,
$a = array(), $a2 = array(1,2,3, 'four', 'five')
) {
}
/**
* @param Base $para Only Parameter
*/
public function docblockClassParamSpec($para) {}
}
class baz extends foo {
protected function bazMethod() {}
}
class last extends baz {
/** @var baz[] */
private $arrayOfBaz;
public function blupp(SomeClass $o, $x = 'hello', $y = 1, $z = 0.5, $last = true) {}
}
|