Skip to content

Commit afaa9ba

Browse files
author
Arzaroth Lekva
committed
Turn off location of strings
1 parent 737ff43 commit afaa9ba

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/Scanner/CodeScanner.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ abstract class CodeScanner extends Scanner
1414
{
1515
protected $ignoreInvalidFunctions = false;
1616

17+
protected $addReferences = true;
18+
1719
protected $commentsPrefixes = [];
1820

1921
protected $functions = [
@@ -63,6 +65,13 @@ public function ignoreInvalidFunctions($ignore = true): self
6365
return $this;
6466
}
6567

68+
public function addReferences($enabled = true): self
69+
{
70+
$this->addReferences = $enabled;
71+
72+
return $this;
73+
}
74+
6675
public function extractCommentsStartingWith(string ...$prefixes): self
6776
{
6877
$this->commentsPrefixes = $prefixes;
@@ -93,7 +102,7 @@ protected function handleFunction(ParsedFunction $function)
93102

94103
$translation = call_user_func([$this, $handler], $function);
95104

96-
if ($translation) {
105+
if ($translation && $this->addReferences) {
97106
$translation->getReferences()->add($function->getFilename(), $function->getLine());
98107
}
99108
}

0 commit comments

Comments
 (0)