Menu

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)

     
  • Anonymous

    Anonymous - 2015-02-20

    Work 4 me. Thanks!

     

    Last edit: Ariel Ale 2015-02-20
  • Anonymous

    Anonymous - 2015-05-02

    Work 4 me too.

     
  • Anonymous

    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
Anonymous

Add attachments
Cancel





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.