Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"symfony/yaml": "^5.4 || ^6.4 || ^7.0 || ^8.0",
"symfony/filesystem": "^5.4 || ^6.4 || ^7.0 || ^8.0",
"twig/twig": "^3.0",
"nette/php-generator": "^3.6 || ^4.0",
"nette/php-generator": "^4.1.7",
"nikic/php-parser": "^4.13 || ^5.0",
"devizzent/cebe-php-openapi": "^1.0.3",
"symfony/string": "^5.4 || ^6.4 || ^7.0 || ^8.0",
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Constant.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace ApiPlatform\SchemaGenerator\Model;

use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\Constant as NetteConstant;
use Nette\PhpGenerator\Visibility;

abstract class Constant
{
Expand Down Expand Up @@ -49,7 +49,7 @@ public function toNetteConstant(): NetteConstant
{
$constant = (new NetteConstant($this->name))
->setValue($this->value())
->setVisibility(ClassType::VISIBILITY_PUBLIC);
->setVisibility(Visibility::Public);

foreach ($this->annotations as $annotation) {
$constant->addComment($annotation);
Expand Down
9 changes: 4 additions & 5 deletions src/Model/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use ApiPlatform\SchemaGenerator\Model\Type\ArrayType;
use ApiPlatform\SchemaGenerator\Model\Type\Type;
use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\Method;
use Nette\PhpGenerator\PhpNamespace;
use Nette\PhpGenerator\Property as NetteProperty;
Expand Down Expand Up @@ -214,7 +213,7 @@ private function generateGetter(PhpNamespace $namespace): Method
throw new \LogicException(\sprintf("Property '%s' is not readable.", $this->name));
}

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

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

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

$mutators[] = $remover;
} else {
$setter = (new Method('set'.ucfirst($this->name())))->setVisibility(ClassType::VISIBILITY_PUBLIC);
$setter = (new Method('set'.ucfirst($this->name())))->setVisibility(Visibility::Public);
$setter->setReturnType($useFluentMutators ? 'self' : 'void');
foreach ($this->setterAnnotations as $annotation) {
$setter->addComment($annotation);
Expand Down