Closed Arzaroth closed 4 years ago
Hi, thanks for your work with these issues!
I'd rather have these two issues in two different pull requests, because I have some doubts:
addReferences()
, to keep consistency with the $translations->getReferences()
function.$contents = file_get_contents($file);
$relativePath = get_the_relative_path($file);
$translations = $scanner->scanString($contents, $relativePath);
This function is already present in the interface (https://github.com/php-gettext/Gettext/blob/master/src/Scanner/ScannerInterface.php#L21) and this way is much more flexible, so I'd wouldn't add this feature (at least, for now).
Points taken.
I'll close this PR and submit two new ones.
Regarding relative paths, I didn't realize what you suggested was possible. It is indeed a nice workaround and I understand your argument on this matter.
This addresses both #208 and #143
I didn't provide tests for this PR since there is no concrete implementation of CodeScanner in this repository