shipmonk-rnd / composer-dependency-analyser

🚀 Fast detection of composer dependency issues (unused dependencies, shadow dependencies, misplaced dependencies)
MIT License
435 stars 10 forks source link

[1.8] Unknown class `locale` #197

Closed ruudk closed 2 hours ago

ruudk commented 2 hours ago

Found 1 unknown class! (unable to autoload those, so we cannot check them)

• locale

use App\Shared\Internationalization\Locale\Locale;

class A 
{
    public function translate(Translatable | TranslationKey $translatable, ?Locale $locale = null) : string
    {
        if ($translatable instanceof TranslationKey) {
            return $this->trans($translatable->getId(), domain: $translatable->getDomain(), locale: $locale?->toString()); // error produced here
        }

        return $translatable->trans($this, $locale);
    }
}

// ..clip...

            return (new IdentityTranslator())->trans(
                $this->id,
                $parameters,
                locale: (string) $locale,  // error produced here
            );
janedbal commented 2 hours ago

Same issue as #194

janedbal commented 2 hours ago

dev-master should work, I'll check few more related cases and release it