You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several of our in-house modules are no-longer backwards compatible with PHP 5.x. A lot of our modules have been upgraded to take advantage of certain changes and features introduced in PHP 7.x. Currently, we try to be compliant up to PHP 7.4.x which introduced typed properties. We have discovered that Coder Upgrade w/ Grammar Parser 1.x does not support typed properties and the conversion result ends up being syntactically incorrect.
Original Code Example:
class MyInteger {
public int $my_integer;
protected ?bool $plus_one = FALSE;
public function __construct($my_integer, $plus_one) {
$this->my_integer = $my_integer;
$this->plus_one = $plus_one;
}
public function get_my_integer() {
$my_integer = $this->my_integer;
if ($this->plus_one) {
$my_integer += 1;
}
return $my_integer;
}
}
Converted Code:
class MyInteger {
public int $my_integer;
public protected bool $plus_one = FALSE;
public protected public function __construct($my_integer, $plus_one) {
$this->my_integer = $my_integer;
$this->plus_one = $plus_one;
}
public function get_my_integer() {
$my_integer = $this->my_integer;
if ($this->plus_one) {
$my_integer += 1;
}
return $my_integer;
}
}
We have a fork in progress that addresses this issue and we will be submitting a PR for this issue soon.
The text was updated successfully, but these errors were encountered:
smaiorana
added a commit
to smaiorana/coder_upgrade
that referenced
this issue
Jan 24, 2022
Hello,
Several of our in-house modules are no-longer backwards compatible with PHP 5.x. A lot of our modules have been upgraded to take advantage of certain changes and features introduced in PHP 7.x. Currently, we try to be compliant up to PHP 7.4.x which introduced typed properties. We have discovered that Coder Upgrade w/ Grammar Parser 1.x does not support typed properties and the conversion result ends up being syntactically incorrect.
Original Code Example:
Converted Code:
We have a fork in progress that addresses this issue and we will be submitting a PR for this issue soon.
The text was updated successfully, but these errors were encountered: