Skip to content

Commit

Permalink
Merge branch 'release/0.1.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthecow committed Jun 19, 2014
2 parents c290226 + 13754d2 commit 60bf0ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Psy/CodeCleaner/CalledClassPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public function enterNode(Node $node)
return;
}

// We'll ignore name expressions as well (things like `$foo()`)
if (!($node->name instanceof Name)) {
return;
}

$name = strtolower($node->name);
if (in_array($name, array('get_class', 'get_called_class'))) {
$msg = sprintf('%s() called without object from outside a class', $name);
Expand Down
2 changes: 1 addition & 1 deletion src/Psy/Shell.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
class Shell extends Application
{
const VERSION = 'v0.1.9';
const VERSION = 'v0.1.10';

const PROMPT = '>>> ';
const BUFF_PROMPT = '... ';
Expand Down
1 change: 1 addition & 0 deletions test/Psy/Test/CodeCleaner/CalledClassPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function validStatements()
array('class Foo { function bar() { return get_class(null); } }'),
array('class Foo { function bar() { return get_called_class(); } }'),
array('class Foo { function bar() { return get_called_class(null); } }'),
array('$foo = function(){}; $foo()'),
);
}

Expand Down

0 comments on commit 60bf0ad

Please sign in to comment.