Skip to content

Commit e6a7fde

Browse files
committed
Bye PHP 5.2!
Minimal required PHP version is 5.3.1
1 parent 78c4f0a commit e6a7fde

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ class ClassType extends Nette\Object
8888
public static function from($from)
8989
{
9090
$from = $from instanceof \ReflectionClass ? $from : new \ReflectionClass($from);
91-
$class = new static(/*5.2*PHP_VERSION_ID < 50300 ? $from->getName() : */$from->getShortName());
91+
$class = new static($from->getShortName());
9292
$class->type = $from->isInterface() ? 'interface' : (PHP_VERSION_ID >= 50400 && $from->isTrait() ? 'trait' : 'class');
9393
$class->final = $from->isFinal();
9494
$class->abstract = $from->isAbstract() && $class->type === 'class';
9595
$class->implements = $from->getInterfaceNames();
9696
$class->documents = preg_replace('#^\s*\* ?#m', '', trim($from->getDocComment(), "/* \r\n"));
97-
$namespace = /*5.2*PHP_VERSION_ID < 50300 ? NULL : */$from->getNamespaceName();
97+
$namespace = $from->getNamespaceName();
9898
if ($from->getParentClass()) {
9999
$class->extends = $from->getParentClass()->getName();
100100
if ($namespace) {

src/PhpGenerator/Parameter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static function from(\ReflectionParameter $from)
6767
$param->optional = PHP_VERSION_ID < 50407 ? $from->isOptional() || ($param->typeHint && $from->allowsNull()) : $from->isDefaultValueAvailable();
6868
$param->defaultValue = (PHP_VERSION_ID === 50316 ? $from->isOptional() : $from->isDefaultValueAvailable()) ? $from->getDefaultValue() : NULL;
6969

70-
$namespace = /*5.2*PHP_VERSION_ID < 50300 ? '' : */$from->getDeclaringClass()->getNamespaceName();
70+
$namespace = $from->getDeclaringClass()->getNamespaceName();
7171
$namespace = $namespace ? "\\$namespace\\" : "\\";
7272
if (Nette\Utils\Strings::startsWith($param->typeHint, $namespace)) {
7373
$param->typeHint = substr($param->typeHint, strlen($namespace));

tests/PhpGenerator/ClassType.from.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*
66
* @author David Grudl
77
* @package Nette\Utils
8-
* @phpversion 5.3
98
*/
109

1110
namespace Abc;

0 commit comments

Comments
 (0)