scrutinizer-ci / scrutinizer

Legacy repository - archives past feature requests/bug reports
https://scrutinizer-ci.com/docs
140 stars 36 forks source link

Arrays type annotations #351

Open lvancrayelynghe opened 8 years ago

lvancrayelynghe commented 8 years ago

In https://scrutinizer-ci.com/docs/tools/php/php-analyzer/guides/annotating_code

array<T> or T[] should not assume keys are integers (lot of false positives in my case) or should allow typing like this T[string]

lvancrayelynghe commented 8 years ago

Exemple here

aik099 commented 8 years ago

I see this call: $constant->getName(). Maybe the getName method of ReflectionConstant class says that it returns integer value and that's why this error is reported.

lvancrayelynghe commented 8 years ago

I may be wrong but I don't think so, I've a string typing in Reflection\Reflection::getName() (ReflectionConstant extends Reflection) :

    /**
     * Gets the fully qualified entity name (with the namespace).
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }