Skip to content

Commit 2ae5659

Browse files
committed
deprecated setName() & from() trigger warnings (BC break)
1 parent 392139b commit 2ae5659

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/PhpGenerator/Parameter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Parameter
4040
*/
4141
public static function from(\ReflectionParameter $from)
4242
{
43+
trigger_error(__METHOD__ . '() is deprecated, use Nette\PhpGenerator\Factory.', E_USER_DEPRECATED);
4344
return (new Factory)->fromParameterReflection($from);
4445
}
4546

src/PhpGenerator/Property.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Property
3333
*/
3434
public static function from(\ReflectionProperty $from)
3535
{
36+
trigger_error(__METHOD__ . '() is deprecated, use Nette\PhpGenerator\Factory.', E_USER_DEPRECATED);
3637
return (new Factory)->fromPropertyReflection($from);
3738
}
3839

src/PhpGenerator/Traits/NameAware.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function __construct($name)
2929
/** @deprecated */
3030
public function setName($name)
3131
{
32+
trigger_error(__METHOD__ . '() is deprecated, use constructor.', E_USER_DEPRECATED);
3233
$this->__construct($name);
3334
return $this;
3435
}

0 commit comments

Comments
 (0)