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

PHP 7 Types #3796

Merged
merged 2 commits into from
Oct 28, 2019
Merged

PHP 7 Types #3796

merged 2 commits into from
Oct 28, 2019

Conversation

ssigwart
Copy link
Contributor

  • PHP 7.0 return type declarations.
  • PHP 7.4 typed properties.

Example PHP Code

// PHP 7.0 return type declarations
function getLe(): LogicException
{}
function getLe2() : ?LogicException
{}
function getLe3() : \LogicException
{}
$le1 = getLe();
//$le1->
$le2 = getLe2();
//$le2->
$le3 = getLe3();
//$le3->

// PHP 7.4 typed properties
class PropTypeClass
{
	public LogicException $propLe1 = null;
	public ?LogicException $propLe2 = null;
	public ?\LogicException $propLe3 = null;
	public int $propInt = 0;
}
$ptc = new PropTypeClass();
//$ptc->propLe1->

This will likely have a merge conflict with #3770, but it should be an easy fix.

- PHP 7.0 return type declarations
- PHP 7.4 typed properties.
@@ -2567,6 +2569,39 @@ def _getArgumentsFromPos(self, styles, text, pos):
phpArgs.append(phpArg)
return phpArgs, p

def _getFuncTypeHintFromPos(self, styles, text, pos):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment isn't for you:
It's confusing that text here means a line of code and later it is an array of words. Best to do as you have done though and keep with the convention of the existing code.

@th3coop th3coop merged commit 89a0486 into Komodo:master Oct 28, 2019
@ssigwart ssigwart deleted the php7 branch October 29, 2019 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants