Skip to content

Commit ae5b872

Browse files
committed
Fix inconsistent naming
1 parent ec275fe commit ae5b872

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

bin/annotate

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ require_once __DIR__ . '/../vendor/autoload.php';
3131
->addOption('outputDir', 'o', InputOption::VALUE_REQUIRED, 'Output directory', './.annotated')
3232
->addOption('inputDir', 'i', InputOption::VALUE_REQUIRED, 'Directory containing the files to annotate', '.')
3333
->addOption('linkPrefix', 'l', InputOption::VALUE_REQUIRED, 'Prefix for links in the output')
34-
->addOption('mixAnnotationIntoSource', 'm', InputOption::VALUE_NONE, 'Include all lua source files, and add class annotations to the source files')
34+
->addOption('mixAnnotationsIntoSource', 'm', InputOption::VALUE_NONE, 'Include all lua source files, and add class annotations to the source files')
3535
->setCode(function (InputInterface $input, ConsoleOutput $output) {
3636
$io = new SymfonyStyle($input, $output);
3737

3838
$outputDir = $input->getOption('outputDir');
3939
$inputDir = $input->getOption('inputDir');
4040
$linkPrefix = $input->getOption('linkPrefix');
41-
$mixAnnotationIntoSource = $input->getOption('mixAnnotationIntoSource');
41+
$mixAnnotationsIntoSource = $input->getOption('mixAnnotationsIntoSource');
4242
try {
4343
$flavor = FlavorEnum::from($input->getArgument('flavor'));
4444
} catch (Throwable) {
@@ -86,7 +86,7 @@ require_once __DIR__ . '/../vendor/autoload.php';
8686
$templateRegistry = new Registry();
8787
$frameRegistry = new Registry();
8888
$xmlFileParser = new XmlFileParser($intrinsicRegistry, $templateRegistry, $frameRegistry);
89-
$luaFileParser = new LuaFileParser($mixAnnotationIntoSource);
89+
$luaFileParser = new LuaFileParser($mixAnnotationsIntoSource);
9090

9191
$io->writeln('Parsing files...');
9292
$progressBar = $io->createProgressBar(count($fileList));

src/LuaFileParser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class LuaFileParser
1212
private array $functions = [];
1313

1414
public function __construct(
15-
private readonly bool $mixAnnotationIntoSource,
15+
private readonly bool $mixAnnotationsIntoSource,
1616
) {
1717
}
1818

@@ -27,15 +27,15 @@ public function parse(string $filename, string $prefixToStrip, ?string $linkPref
2727
$mixins = $this->extractMixins($fileContents, $linkPrefix);
2828
$this->mixins[$filename] = $mixins;
2929

30-
if (!$this->mixAnnotationIntoSource) {
30+
if (!$this->mixAnnotationsIntoSource) {
3131
$functions = $this->extractFunctions($fileContents, $mixins, $linkPrefix);
3232
$this->functions[$filename] = $functions;
3333
}
3434
}
3535

3636
public function writeAnnotationsToFile(string $filename, string $outDir, string $prefixToStrip): void
3737
{
38-
if ($this->mixAnnotationIntoSource) {
38+
if ($this->mixAnnotationsIntoSource) {
3939
$data = file_get_contents($filename);
4040
$byLine = explode("\n", $data);
4141
foreach ($this->mixins[$filename] ?? [] as $funcInfo) {
@@ -114,7 +114,7 @@ private function parseMixinRegex(
114114
$funcInfo['classAnnotation'] .= ' : ' . $match['extends'][0];
115115
}
116116
$funcInfo['annotated'] = $funcInfo['classAnnotation'];
117-
if (!$this->mixAnnotationIntoSource) {
117+
if (!$this->mixAnnotationsIntoSource) {
118118
$funcInfo['annotated'] .= "\n" . $match['match'][0];
119119
if ($linkPrefix) {
120120
$funcInfo['annotated'] = sprintf(

0 commit comments

Comments
 (0)