/*
* This file is part of Psy Shell.
*
- * (c) 2012-2017 Justin Hileman
+ * (c) 2012-2018 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class LegacyEmptyPass extends CodeCleanerPass
{
+ private $atLeastPhp55;
+
+ public function __construct()
+ {
+ $this->atLeastPhp55 = version_compare(PHP_VERSION, '5.5', '>=');
+ }
+
/**
* Validate use of empty in PHP < 5.5.
*
*/
public function enterNode(Node $node)
{
- if (version_compare(PHP_VERSION, '5.5', '>=')) {
+ if ($this->atLeastPhp55) {
return;
}