Skip to content

Commit 9dc4d48

Browse files
committed
removed old deprecated stuff
1 parent 9bba8a9 commit 9dc4d48

File tree

6 files changed

+3
-64
lines changed

6 files changed

+3
-64
lines changed

src/PhpGenerator/Method.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ class Method
4141
*/
4242
public static function from($method)
4343
{
44-
$method = $method instanceof \ReflectionFunctionAbstract ? $method : Nette\Utils\Callback::toReflection($method);
45-
if ($method instanceof \ReflectionFunction) {
46-
trigger_error('For global functions or closures use Nette\PhpGenerator\GlobalFunction or Nette\PhpGenerator\Closure.', E_USER_DEPRECATED);
47-
return (new Factory)->fromFunctionReflection($method);
48-
}
44+
$method = $method instanceof \ReflectionMethod ? $method : Nette\Utils\Callback::toReflection($method);
4945
return (new Factory)->fromMethodReflection($method);
5046
}
5147

@@ -55,9 +51,7 @@ public static function from($method)
5551
*/
5652
public function __construct($name)
5753
{
58-
if ($name === NULL) {
59-
throw new Nette\DeprecatedException('For closures use Nette\PhpGenerator\Closure instead of Nette\PhpGenerator\Method.');
60-
} elseif (!Helpers::isIdentifier($name)) {
54+
if (!Helpers::isIdentifier($name)) {
6155
throw new Nette\InvalidArgumentException("Value '$name' is not valid name.");
6256
}
6357
$this->name = $name;

src/PhpGenerator/Parameter.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ class Parameter
3636
public $defaultValue;
3737

3838

39-
/**
40-
* @deprecated
41-
* @return static
42-
*/
43-
public static function from(\ReflectionParameter $from)
44-
{
45-
trigger_error(__METHOD__ . '() is deprecated, use Nette\PhpGenerator\Factory.', E_USER_DEPRECATED);
46-
return (new Factory)->fromParameterReflection($from);
47-
}
48-
49-
5039
/**
5140
* @param bool
5241
* @return static

src/PhpGenerator/Property.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@ class Property
2929
private $static = FALSE;
3030

3131

32-
/**
33-
* @deprecated
34-
* @return static
35-
*/
36-
public static function from(\ReflectionProperty $from)
37-
{
38-
trigger_error(__METHOD__ . '() is deprecated, use Nette\PhpGenerator\Factory.', E_USER_DEPRECATED);
39-
return (new Factory)->fromPropertyReflection($from);
40-
}
41-
42-
4332
/**
4433
* @return static
4534
*/

src/PhpGenerator/Traits/CommentAware.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,4 @@ public function addComment($val)
4949
return $this;
5050
}
5151

52-
53-
/** @deprecated */
54-
public function setDocuments(array $s)
55-
{
56-
trigger_error(__METHOD__ . '() is deprecated, use similar setComment()', E_USER_DEPRECATED);
57-
return $this->setComment(implode("\n", $s));
58-
}
59-
60-
61-
/** @deprecated */
62-
public function getDocuments()
63-
{
64-
trigger_error(__METHOD__ . '() is deprecated, use similar getComment()', E_USER_DEPRECATED);
65-
return $this->comment ? [$this->comment] : [];
66-
}
67-
68-
69-
/** @deprecated */
70-
public function addDocument($s)
71-
{
72-
trigger_error(__METHOD__ . '() is deprecated, use addComment()', E_USER_DEPRECATED);
73-
return $this->addComment($s);
74-
}
75-
7652
}

src/PhpGenerator/Traits/NameAware.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ public function __construct($name)
3333
}
3434

3535

36-
/** @deprecated */
37-
public function setName($name)
38-
{
39-
trigger_error(__METHOD__ . '() is deprecated, use constructor.', E_USER_DEPRECATED);
40-
$this->__construct($name);
41-
return $this;
42-
}
43-
44-
4536
/**
4637
* @return string
4738
*/

tests/PhpGenerator/invalidNames.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Assert::exception(function () {
108108

109109
Assert::exception(function () {
110110
new Nette\PhpGenerator\Method(NULL);
111-
}, Nette\DeprecatedException::class);
111+
}, Nette\InvalidArgumentException::class);
112112

113113
Assert::exception(function () {
114114
new Nette\PhpGenerator\Method('*');

0 commit comments

Comments
 (0)