Will it be possible to automatically add property typehints if constructor has assignment, but property itself doesn't have @var annotation?
Example:
class Product
{
private $category;
public function __construct(Category $category)
{
$this->category = $category;
}
}
The reason is that I never put @var annotations, PHPStorm is smart enough to figure the type from constructor and give me autocomplete.
can be problematic in cases like
private $foo;
public function __construct(Category $category)
{
$this->foo = validateCategory($category) ? $category : createDummyCategory();
}
i know, stupid code, but possible.
PHP CS Fixer is not going that deep into looking on code execution
I removed _Deprecate left-associative ternary operator_ item as I don't think we have anything to do for it (it does not introduce any syntax change).
I checked every item of the list: all seem ok to me or have a corresponding PR to improve support. Please review :)
Note that merging those PRs should allow us to claim support for PHP 7.4 on branch 2.15 only. We still need to do the same checks on master for new fixers that have been added.
can you take a look at higher branches, @julienfalque , please ?
It took us quite a while, but i'm supper happy we have it now, just before 7.4 official release at 28th of Nov
Is there any documentation available on how to use these new PHP 7.4 features?
i am also interested, how to use new features?
This issue was not about implementation of new features for PHP 7.4 but to make sure that existing features were compatible with new PHP 7.4 syntax changes.
see also https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/4834 for the introduction of the PHP7.4 rule sets to easy migration
Most helpful comment
It took us quite a while, but i'm supper happy we have it now, just before 7.4 official release at 28th of Nov