2017-08-16 11:53:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Foo;
|
|
|
|
|
|
|
|
class Test
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Constructor comment goes here
|
|
|
|
*
|
|
|
|
* @param string $first First param
|
|
|
|
* @param int $second Second param
|
|
|
|
* @param Test $third Third param with a longer description
|
|
|
|
*/
|
|
|
|
public function __construct(string $first, int $second, Test $third)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function doc
|
|
|
|
*
|
|
|
|
* @param SomethingElse $a A param with a different doc type
|
|
|
|
* @param int|null $b Param with default value
|
|
|
|
*/
|
|
|
|
public function foo(\DateTime $a, int $b = null)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function bar($a)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Method with no params
|
|
|
|
*/
|
|
|
|
public function baz()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param int $i Global function param one
|
|
|
|
* @param bool $b Default false param
|
2017-12-08 22:43:15 +00:00
|
|
|
* @param Test|null ...$things Test things
|
2017-08-16 11:53:16 +00:00
|
|
|
*/
|
2017-12-08 22:43:15 +00:00
|
|
|
function foo(int $i, bool $b = false, Test ...$things = null)
|
2017-08-16 11:53:16 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
$t = new Test();
|
2017-12-10 02:33:32 +00:00
|
|
|
$t = new Test(1, );
|
2017-08-16 11:53:16 +00:00
|
|
|
$t->foo();
|
2017-08-17 04:19:47 +00:00
|
|
|
$t->foo(1,
|
|
|
|
$t->foo(1,);
|
2017-08-16 11:53:16 +00:00
|
|
|
$t->baz();
|
|
|
|
|
2017-12-08 22:43:15 +00:00
|
|
|
foo(
|
|
|
|
1,
|
|
|
|
foo(1, 2,
|
|
|
|
);
|
2017-08-16 11:53:16 +00:00
|
|
|
|
|
|
|
Test::bar();
|
2017-12-10 02:33:32 +00:00
|
|
|
|
|
|
|
new $foo();
|
|
|
|
new $foo(1, );
|
|
|
|
|
|
|
|
new NotExist();
|