Skip to content

Commit

Permalink
Turn off location of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Arzaroth Lekva committed Apr 24, 2020
1 parent 737ff43 commit afaa9ba
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Scanner/CodeScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ abstract class CodeScanner extends Scanner
{
protected $ignoreInvalidFunctions = false;

protected $addReferences = true;

protected $commentsPrefixes = [];

protected $functions = [
Expand Down Expand Up @@ -63,6 +65,13 @@ public function ignoreInvalidFunctions($ignore = true): self
return $this;
}

public function addReferences($enabled = true): self
{
$this->addReferences = $enabled;

return $this;
}

public function extractCommentsStartingWith(string ...$prefixes): self
{
$this->commentsPrefixes = $prefixes;
Expand Down Expand Up @@ -93,7 +102,7 @@ protected function handleFunction(ParsedFunction $function)

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

if ($translation) {
if ($translation && $this->addReferences) {
$translation->getReferences()->add($function->getFilename(), $function->getLine());
}
}
Expand Down

0 comments on commit afaa9ba

Please sign in to comment.