Skip to content

Commit c98a435

Browse files
committed
lets not confuse ourselves
1 parent 4aefb63 commit c98a435

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Maker/AbstractMaker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ protected function addDependencies(array $dependencies, string $message = null):
4949
);
5050
}
5151

52-
protected function useAnnotations(): bool
52+
protected function useAttributes(): bool
5353
{
54-
return version_compare(PHP_VERSION, '8') >= 0;
54+
return \PHP_VERSION_ID >= 80000;
5555
}
5656
}

src/Maker/MakeController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
5858
$controllerClassNameDetails->getFullName(),
5959
'controller/Controller.tpl.php',
6060
[
61-
'use_annotations' => $this->useAnnotations(),
61+
'use_attributes' => $this->useAttributes(),
6262
'route_path' => Str::asRoutePath($controllerClassNameDetails->getRelativeNameWithoutSuffix()),
6363
'route_name' => Str::asRouteName($controllerClassNameDetails->getRelativeNameWithoutSuffix()),
6464
'with_template' => $this->isTwigInstalled() && !$noTemplate,

src/Resources/skeleton/controller/Controller.tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class <?= $class_name; ?> extends <?= $parent_class_name; ?><?= "\n" ?>
1010
{
11-
<?php if ($use_annotations) { ?>
11+
<?php if ($use_attributes) { ?>
1212
#[Route('<?= $route_path ?>', name: '<?= $route_name ?>')]
1313
<?php } else { ?>
1414
/**

0 commit comments

Comments
 (0)