Strict Standards

Help
2012-05-23
2015-05-02
  • Nobody/Anonymous

    I get following error:
    Strict Standards: Declaration of MyCrawler::handleDocumentInfo() should be compatible with that of PHPCrawler::handleDocumentInfo() in C:\xampp\htdocs\PHPCrawl_080\example.php on line 11

    Why's that?

     
  • Nobody/Anonymous

    Hi,

    the phpcrawler-class internally uses type-hinting for the handleDocumentInfo()-method (for documentation rerasons).
    So if you want to get rid of the error, just use type-hinting in your extended crawler-class as well:

    class MyCrawler extends PHPCrawler 
    { 
      function handleDocumentInfo([b]PHPCrawlerDocumentInfo[/b] $DocInfo) 
      {
        // ...
      }
    }
    

    The example-scripts coming with phpcrawl don't use it like that, i will change that in the next release.

    Best regards!

     
  • Nobody/Anonymous

    .. just to mention: This is just a formal thing and doesn't affect functionallity or something.

     
  • Nobody/Anonymous

    you need specify the object  like this
    function handleDocumentInfo(PHPCrawlerDocumentInfo $DocInfo)

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2015-02-20

    Work 4 me. Thanks!

     
    Last edit: Ariel Ale 2015-02-20
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2015-05-02

    Work 4 me too.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2015-11-03

    Thank you all very much...this discussion helped me even after 3 years. Hope it will also help others in the future.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks