title: phpdoc: PHP Warning: count(): Parameter must be an array or an object that implements Countable
body: <p>Install</p>
  
  <pre><code>$ wget http://www.phpdoc.org/phpDocumentor.phar
  $ chmod +x phpdocumentor.phar
  </code></pre>
  
  <p>Let's try a class</p>
  
  <pre><code>$ cat src/Classe.php
  &lt;?php
  
  /**
   * Classe.
   */
  class Classe {}
  
  $ ./phpdocumentor.phar -f src/Classe.php
  Collecting files .. OK
  Initializing parser .. OK
  Parsing files
  blablabla...
  </code></pre>
  
  <p>All right.
  But now let's try a function</p>
  
  <pre><code>$ cat src/fun.php
  &lt;?php
  /**
   * Summary fun.php
   */
  
  /**
   * Function.
   */
  function fun() {}
  
  $ ./phpdocumentor.phar -f src/fun.php
  Collecting files .. OK
  Initializing parser .. OK
  Parsing files
  blablabla...
  PHP Warning:  count(): Parameter must be an array or an object that implements Countable in phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293
  PHP Warning:  count(): Parameter must be an array or an object that implements Countable in phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293
    Execute transformation using writer "twig"
  PHP Warning:  count(): Parameter must be an array or an object that implements Countable in phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293
  PHP Warning:  count(): Parameter must be an array or an object that implements Countable in phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293
    Execute transformation using writer "twig"
    Execute transformation using writer "twig"
    Execute transformation using writer "twig"
    Execute transformation using writer "twig"
  PHP Warning:  count(): Parameter must be an array or an object that implements Countable in phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293
  PHP Warning:  count(): Parameter must be an array or an object that implements Countable in phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293
  blablabla...
  </code></pre>
  
  <p>Now there are errors (Warning).
  Why?</p>
  
  <p>I also tried installing phpdoc via composer</p>
  
  <pre><code>$ composer require --dev phpDocumentor/phpDocumentor
  blablabla...
  Package kherge/version is abandoned, you should avoid using it. No replacement was suggested.
  Package herrera-io/json is abandoned, you should avoid using it. Use kherge/json instead.
  Package herrera-io/phar-update is abandoned, you should avoid using it. No replacement was suggested.
  Writing lock file
  Generating autoload files
  </code></pre>
  
  <p>But the result is even worse</p>
  
  <pre><code>$ vendor/bin/phpdoc -f src/Classe.php 
  PHP Fatal error:  Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@JMS\Serializer\Annotation\Type" in property phpDocumentor\Configuration::$title does not exist, or could not be auto-loaded. in vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54
  Stack trace:
  #0 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(741): Doctrine\Common\Annotations\AnnotationException::semanticalError('The annotation ...')
  #1 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(663): Doctrine\Common\Annotations\DocParser-&gt;Annotation()
  #2 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(354): Doctrine\Common\Annotations\DocParser-&gt;Annotations()
  #3 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(254): Doctrine\Common\Annotations\Doc in vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php on line 54
  </code></pre>
  
  <p>At this point I would like to know, is this phpdoc a valid tool?
  Am I the one who can't use it?
  What's wrong?</p>