Skip to content

Commit 5eb9490

Browse files
committed
added support for static calls #9
1 parent 346b3f0 commit 5eb9490

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [1.2.1] - 2020-05-28
9+
### Added
10+
- Support for static calls [#9]
11+
812
## [1.2.0] - 2020-05-23
913
### Added
1014
- Function scanner extracts not only functions calls but also class methods calls.
@@ -33,7 +37,9 @@ First version
3337
[#5]: https://github.com/php-gettext/PHP-Scanner/issues/5
3438
[#6]: https://github.com/php-gettext/PHP-Scanner/issues/6
3539
[#8]: https://github.com/php-gettext/PHP-Scanner/issues/8
40+
[#9]: https://github.com/php-gettext/PHP-Scanner/issues/9
3641

42+
[1.2.1]: https://github.com/php-gettext/PHP-Scanner/compare/v1.2.0...v1.2.1
3743
[1.2.0]: https://github.com/php-gettext/PHP-Scanner/compare/v1.1.1...v1.2.0
3844
[1.1.1]: https://github.com/php-gettext/PHP-Scanner/compare/v1.1.0...v1.1.1
3945
[1.1.0]: https://github.com/php-gettext/PHP-Scanner/compare/v1.0.1...v1.1.0

src/PhpNodeVisitor.php

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function enterNode(Node $node)
3434
switch ($node->getType()) {
3535
case 'Expr_MethodCall':
3636
case 'Expr_FuncCall':
37+
case 'Expr_StaticCall':
3738
$name = static::getName($node);
3839

3940
if ($name && ($this->validFunctions === null || in_array($name, $this->validFunctions))) {

tests/assets/functions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
fn2($var);
66
fn3(fn4('arg4'), 'arg5', fn5(6, 7.5));
77
fn6(['arr']);
8-
fn7(CONSTANT_1);
8+
Translator::fn7(CONSTANT_1);
99
// fn_8();
1010
/* ALLOW: This is a comment to fn9 */
1111
return fn9(ARG_8);

0 commit comments

Comments
 (0)