Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types to object properties that lack them where possible #435

Open
muglug opened this issue Jan 9, 2018 · 3 comments

Comments

@muglug
Copy link
Member

commented Jan 9, 2018

Using Psalter this shouldn't be too difficult

class A {
  public $foo;

  public function __construct(string $foo) {
    $this->foo = $foo;
  }
}

to

class A {
  /** @var string */
  public $foo;

  public function __construct(string $foo) {
    $this->foo = $foo;
  }
}
@iluuu1994

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

With typed properties coming in PHP 7.4 this seems unnecessary.

@muglug

This comment has been minimized.

Copy link
Member Author

commented May 7, 2019

Why?

@iluuu1994

This comment has been minimized.

Copy link
Contributor

commented Jun 2, 2019

Sorry, I misunderstood the issue. I thought it was about inferring the property type. This seems like a good idea, for PHP 7.4 you could even add the native property type if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.