2017-02-10 21:27:12 -05:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Tests;
|
|
|
|
|
|
|
|
use Psalm\Checker\FileChecker;
|
|
|
|
|
2017-04-24 23:45:02 -04:00
|
|
|
class BadFormatTest extends TestCase
|
2017-02-10 21:27:12 -05:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testMissingSemicolon()
|
|
|
|
{
|
2017-07-25 16:11:02 -04:00
|
|
|
$this->addFile(
|
2017-04-24 23:45:02 -04:00
|
|
|
'somefile.php',
|
2017-02-10 21:27:12 -05:00
|
|
|
'<?php
|
2017-07-25 16:11:02 -04:00
|
|
|
class A {
|
|
|
|
/** @var int|null */
|
|
|
|
protected $hello;
|
2017-02-10 21:27:12 -05:00
|
|
|
|
2017-07-25 16:11:02 -04:00
|
|
|
/** @return void */
|
|
|
|
function foo() {
|
|
|
|
$this->hello = 5
|
|
|
|
}
|
|
|
|
}'
|
2017-02-10 21:27:12 -05:00
|
|
|
);
|
|
|
|
|
2017-04-24 23:45:02 -04:00
|
|
|
$file_checker = new FileChecker('somefile.php', $this->project_checker);
|
2017-02-10 21:27:12 -05:00
|
|
|
$file_checker->visitAndAnalyzeMethods();
|
|
|
|
}
|
|
|
|
}
|