-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Assume you have the following:
<?php
class User
{
private ?string $name;
private int $age;
private bool $isDeveloper;
}The quick fix will generate the following:
<?php
class User
{
private ?string $name;
private int $age;
private bool $isDeveloper;
/**
* @param $name ?string
* @param $age int
* @param $isDeveloper bool
*/
function __construct(?string $name, int $age, bool $isDeveloper) {
$this->name = $name;
$this->age = $age;
$this->isDeveloper = $isDeveloper;
}
}Suggestions:
- insert a new line before
- docblocks: swap param name and data type:
@param $age int->@param int $age - docblocks:
nullis not?:@param $name ?string->@param null|string $name - Add visibility (
publicby default) - apply configured code formatting (in my case PSR12) -> have to click ctrl + s and then it gets formatted for PSR12
The expected output would be:
<?php
class User
{
private ?string $name;
private int $age;
private bool $isDeveloper;
/**
* @param null|string $name
* @param int $age
* @param bool $isDeveloper
*/
public function __construct(?string $name, int $age, bool $isDeveloper)
{
$this->name = $name;
$this->age = $age;
$this->isDeveloper = $isDeveloper;
}
}jakubmisek
Metadata
Metadata
Assignees
Labels
No labels