Skip to content

Commit 04896f4

Browse files
committed
Remove deprecations
1 parent 69b28ea commit 04896f4

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"symfony/yaml": "^5.4 || ^6.4 || ^7.0 || ^8.0",
4545
"symfony/filesystem": "^5.4 || ^6.4 || ^7.0 || ^8.0",
4646
"twig/twig": "^3.0",
47-
"nette/php-generator": "^3.6 || ^4.0",
47+
"nette/php-generator": "^4.1.7",
4848
"nikic/php-parser": "^4.13 || ^5.0",
4949
"devizzent/cebe-php-openapi": "^1.0.3",
5050
"symfony/string": "^5.4 || ^6.4 || ^7.0 || ^8.0",

src/Model/Constant.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
namespace ApiPlatform\SchemaGenerator\Model;
1515

16-
use Nette\PhpGenerator\ClassType;
1716
use Nette\PhpGenerator\Constant as NetteConstant;
17+
use Nette\PhpGenerator\Visibility;
1818

1919
abstract class Constant
2020
{
@@ -49,7 +49,7 @@ public function toNetteConstant(): NetteConstant
4949
{
5050
$constant = (new NetteConstant($this->name))
5151
->setValue($this->value())
52-
->setVisibility(ClassType::VISIBILITY_PUBLIC);
52+
->setVisibility(Visibility::Public);
5353

5454
foreach ($this->annotations as $annotation) {
5555
$constant->addComment($annotation);

src/Model/Property.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use ApiPlatform\SchemaGenerator\Model\Type\ArrayType;
1717
use ApiPlatform\SchemaGenerator\Model\Type\Type;
18-
use Nette\PhpGenerator\ClassType;
1918
use Nette\PhpGenerator\Method;
2019
use Nette\PhpGenerator\PhpNamespace;
2120
use Nette\PhpGenerator\Property as NetteProperty;
@@ -214,7 +213,7 @@ private function generateGetter(PhpNamespace $namespace): Method
214213
throw new \LogicException(\sprintf("Property '%s' is not readable.", $this->name));
215214
}
216215

217-
$getter = (new Method('get'.ucfirst($this->name)))->setVisibility(ClassType::VISIBILITY_PUBLIC);
216+
$getter = (new Method('get'.ucfirst($this->name)))->setVisibility(Visibility::Public);
218217
foreach ($this->getterAnnotations as $annotation) {
219218
$getter->addComment($annotation);
220219
}
@@ -247,7 +246,7 @@ private function generateMutators(
247246
if ($this->isArray() && (!$this->isSimpleArray() || !$useSimpleArraySetter)) {
248247
$singularProperty = $singularize($this->name());
249248

250-
$adder = (new Method('add'.ucfirst($singularProperty)))->setVisibility(ClassType::VISIBILITY_PUBLIC);
249+
$adder = (new Method('add'.ucfirst($singularProperty)))->setVisibility(Visibility::Public);
251250
$adder->setReturnType($useFluentMutators ? 'self' : 'void');
252251
foreach ($this->adderAnnotations() as $annotation) {
253252
$adder->addComment($annotation);
@@ -265,7 +264,7 @@ private function generateMutators(
265264
}
266265
$mutators[] = $adder;
267266

268-
$remover = (new Method('remove'.ucfirst($singularProperty)))->setVisibility(ClassType::VISIBILITY_PUBLIC);
267+
$remover = (new Method('remove'.ucfirst($singularProperty)))->setVisibility(Visibility::Public);
269268
$remover->setReturnType($useFluentMutators ? 'self' : 'void');
270269
foreach ($this->removerAnnotations as $annotation) {
271270
$adder->addComment($annotation);
@@ -297,7 +296,7 @@ private function generateMutators(
297296

298297
$mutators[] = $remover;
299298
} else {
300-
$setter = (new Method('set'.ucfirst($this->name())))->setVisibility(ClassType::VISIBILITY_PUBLIC);
299+
$setter = (new Method('set'.ucfirst($this->name())))->setVisibility(Visibility::Public);
301300
$setter->setReturnType($useFluentMutators ? 'self' : 'void');
302301
foreach ($this->setterAnnotations as $annotation) {
303302
$setter->addComment($annotation);

0 commit comments

Comments
 (0)