Type 'static' not interpreted as expected
public $oldcopy is declared of static time in the base class. Yet this results in the following notification:
PhanTypeMismatchProperty Assigning (clone($object)) of type \User to property but \User->oldcopy is static
Test case:
class User {
/**
* @var static Global User
*/
public $userlink;
}
class Users {
/**
* @var User
*/
public $local_user;
public function testfunc() {
$u = new User();
$this->local_user->userlink = clone $this->local_user;
print "Class of clone is ".get_class($this->local_user->userlink).PHP_EOL;
}
}
$users = new Users();
$users->local_user = new User();
$users->testfunc();
Phan 5.4.5 php-ast version 1.0.16 PHP version used to run Phan: 8.1.13
I think I have a fix for this: https://github.com/reviewdog/reviewdog/pull/1975
IIRC, even if reviewdog support it, GitHub code suggestion doesn't support inserting EOF with the error message same as you posted in the top of this issue.
```suggestion
end of file
```
reviewdog will generate the above suggestion regardless of the existence of EOF newline and GitHub says it's invalid because there are no changes.
```suggestion
end of file
```
We could think of inserting new blank line at the end alternatively like the above, but it's obviously different suggestion and unintended behabior.
I think this issue is resolved.
I confirm reviewdog makes EOF new line code suggestion.
https://github.com/mongolyy/reviewdog-action-biome/pull/69#discussion_r2348623163
Thank you!!