File tree Expand file tree Collapse file tree 6 files changed +3
-64
lines changed Expand file tree Collapse file tree 6 files changed +3
-64
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,7 @@ class Method
41
41
*/
42
42
public static function from ($ method )
43
43
{
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 );
49
45
return (new Factory )->fromMethodReflection ($ method );
50
46
}
51
47
@@ -55,9 +51,7 @@ public static function from($method)
55
51
*/
56
52
public function __construct ($ name )
57
53
{
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 )) {
61
55
throw new Nette \InvalidArgumentException ("Value ' $ name' is not valid name. " );
62
56
}
63
57
$ this ->name = $ name ;
Original file line number Diff line number Diff line change @@ -36,17 +36,6 @@ class Parameter
36
36
public $ defaultValue ;
37
37
38
38
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
-
50
39
/**
51
40
* @param bool
52
41
* @return static
Original file line number Diff line number Diff line change @@ -29,17 +29,6 @@ class Property
29
29
private $ static = FALSE ;
30
30
31
31
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
-
43
32
/**
44
33
* @return static
45
34
*/
Original file line number Diff line number Diff line change @@ -49,28 +49,4 @@ public function addComment($val)
49
49
return $ this ;
50
50
}
51
51
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
-
76
52
}
Original file line number Diff line number Diff line change @@ -33,15 +33,6 @@ public function __construct($name)
33
33
}
34
34
35
35
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
-
45
36
/**
46
37
* @return string
47
38
*/
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ Assert::exception(function () {
108
108
109
109
Assert::exception (function () {
110
110
new Nette \PhpGenerator \Method (NULL );
111
- }, Nette \DeprecatedException ::class);
111
+ }, Nette \InvalidArgumentException ::class);
112
112
113
113
Assert::exception (function () {
114
114
new Nette \PhpGenerator \Method ('* ' );
You can’t perform that action at this time.
0 commit comments