File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33All notable changes to this project will be documented in this file.
44
5- The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
5+ The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
66and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
77
88## [ 1.2.0] - Unreleased
99### Added
1010- Function scanner extracts not only functions calls but also class methods calls.
1111
12+ ### Fixed
13+ - Support for ` gettext/gettext v5.5.0 `
14+
1215## [ 1.1.1] - 2019-11-25
1316### Fixed
1417- Extract comments of functions prepended with echo, print or return [ #6 ]
Original file line number Diff line number Diff line change 2020 "require" : {
2121 "php" : " ^7.2" ,
2222 "nikic/php-parser" : " ^4.2" ,
23- "gettext/gettext" : " ^5.2.0 "
23+ "gettext/gettext" : " dev-feature/functions-handlers-trait "
2424 },
2525 "require-dev" : {
2626 "phpunit/phpunit" : " ^8.0" ,
Original file line number Diff line number Diff line change 1010 */
1111class PhpScanner extends CodeScanner
1212{
13+ use FunctionsHandlersTrait;
14+
15+ protected $ functions = [
16+ 'gettext ' => 'gettext ' ,
17+ '_ ' => 'gettext ' ,
18+ '__ ' => 'gettext ' ,
19+ 'ngettext ' => 'ngettext ' ,
20+ 'n__ ' => 'ngettext ' ,
21+ 'pgettext ' => 'pgettext ' ,
22+ 'p__ ' => 'pgettext ' ,
23+ 'dgettext ' => 'dgettext ' ,
24+ 'd__ ' => 'dgettext ' ,
25+ 'dngettext ' => 'dngettext ' ,
26+ 'dn__ ' => 'dngettext ' ,
27+ 'dpgettext ' => 'dpgettext ' ,
28+ 'dp__ ' => 'dpgettext ' ,
29+ 'npgettext ' => 'npgettext ' ,
30+ 'np__ ' => 'npgettext ' ,
31+ 'dnpgettext ' => 'dnpgettext ' ,
32+ 'dnp__ ' => 'dnpgettext ' ,
33+ 'noop ' => 'gettext ' ,
34+ 'noop__ ' => 'gettext ' ,
35+ ];
36+
1337 public function getFunctionsScanner (): FunctionsScannerInterface
1438 {
1539 return new PhpFunctionsScanner (array_keys ($ this ->functions ));
You can’t perform that action at this time.
0 commit comments