Menu

#25 Error: Notice: Trying to get property of non-object in /home/Martin/phpcheckstyle/PhpCheckstyle/src/PHPCheckstyle.php on line 1891

Fixed
nobody
None
Medium
Defect
2012-02-10
2012-02-08
Anonymous
No

Originally created by: martin@arp242.net

I get the following error when trying to check my code (I'm using the default rules):

{{{
Notice: Trying to get property of non-object in /home/martin/phpcheckstyle/PhpCheckstyle/src/PHPCheckstyle.php on line 1891
}}}

It would seem that `$this->_getCurrentStackItem()` returns `False`. I didn't investigate beyond this ...

This simple file triggers it:
{{{
<?php

$translator = new Zend_Translate('csv', "languages/$lang.csv");
}}}

Complete output:

{{{
[~/phpcheckstyle/PhpCheckstyle]% php run.php --src test.php --format console

Notice: Trying to get property of non-object in /home/Martin/phpcheckstyle/PhpCheckstyle/src/PHPCheckstyle.php on line 1891
test.php WARNING Line:3 - encapsed variables must not be used inside a string

Notice: Trying to get property of non-object in /home/Martin/phpcheckstyle/PhpCheckstyle/src/PHPCheckstyle.php on line 1891
test.php WARNING Line:3 - encapsed variables must not be used inside a string
test.php WARNING Line:3 - Undeclared or unused variable : '$translator'.
test.php WARNING Line:3 - Undeclared or unused variable : '$lang'.

Reporting Completed.
}}}

Related

Wiki: History

Discussion

  • Anonymous

    Anonymous - 2012-02-08

    Originally posted by: martin@arp242.net

    Sorry, I forgot to mention, but I'm using this version:

    [~/phpcheckstyle/PhpCheckstyle]% svn info
    Path: .
    Working Copy Root Path: /home/martin/phpcheckstyle
    URL: http://phpcheckstyle.googlecode.com/svn/trunk/PhpCheckstyle
    Repository Root: http://phpcheckstyle.googlecode.com/svn
    Repository UUID: 9aec88b1-1b24-c516-cc61-d7528b567548
    Revision: 96
    Node Kind: directory
    Schedule: normal
    Last Changed Author: knohax@gmail.com
    Last Changed Rev: 96
    Last Changed Date: 2012-01-31 14:05:04 +0100 (Tue, 31 Jan 2012)

     
  • Anonymous

    Anonymous - 2012-02-08

    Originally posted by: tch...@hotmail.com

    Hello,

    Thanks a lot for the report, I wiil look into it as soon as possible.

    Tchule

    Status: Accepted

     
  • Anonymous

    Anonymous - 2012-02-09

    Originally posted by: tch...@hotmail.com

    I have commited something, the problem was very general. It's about all the checks done a the root of a PHP file, the stackItem was empty.

    Can you check if the lastest version from trunk is OK for you ?

    Thanks a lot.

    Status: Fixed

     
  • Anonymous

    Anonymous - 2012-02-10

    Originally posted by: martin@arp242.net

    > Can you check if the lastest version from trunk is OK for you ?

    Yep, fixed it!

    Thanks for the quick reply!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.