vimeo / psalm

A static analysis tool for finding errors in PHP applications
https://psalm.dev
MIT License
5.55k stars 661 forks source link

Suggested but not installed dependency generates Fatal error on scan #2716

Closed Slamdunk closed 4 years ago

Slamdunk commented 4 years ago

Step to reproduce:

mkdir -p psalmbug/src && cd psalmbug
composer require vimeo/psalm laminas/laminas-validator laminas/laminas-form
./vendor/bin/psalm --init src 3
./vendor/bin/psalm

Output of last command:

Fatal error: Trait 'Laminas\Db\Adapter\AdapterAwareTrait' not found in ./psalmbug/vendor/laminas/laminas-validator/src/Db/AbstractDb.php on line 27

laminas-db package is only suggested by laminas-validator (https://github.com/laminas/laminas-validator/blob/master/composer.json#L55) and not installed, but I think this shouldn't stop the scan.

$ composer.phar show
amphp/amp                             v2.4.0  A non-blocking concurrency framework for PHP applications.
amphp/byte-stream                     v1.7.2  A stream abstraction to make working with non-blocking I/O simple.
composer/xdebug-handler               1.4.0   Restarts a process without Xdebug.
container-interop/container-interop   1.2.0   Promoting the interoperability of container objects (DIC, SL, etc.)
felixfbecker/advanced-json-rpc        v3.0.4  A more advanced JSONRPC implementation
felixfbecker/language-server-protocol v1.4.0  PHP classes for the Language Server Protocol
laminas/laminas-filter                2.9.3   Programmatically filter and normalize data and files
laminas/laminas-form                  2.14.3  Validate and display simple and complex forms, casting forms to business objects and vice versa
laminas/laminas-hydrator              3.0.2   Serialize objects to arrays, and vice versa
laminas/laminas-inputfilter           2.10.1  Normalize and validate input sets from the web, APIs, the CLI, and more, including files
laminas/laminas-servicemanager        3.4.0   Factory-Driven Dependency Injection Container
laminas/laminas-stdlib                3.2.1   SPL extensions, array utilities, error handlers, and more
laminas/laminas-validator             2.13.1  Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria
laminas/laminas-zendframework-bridge  1.0.1   Alias legacy ZF class names to Laminas Project equivalents.
netresearch/jsonmapper                v1.6.0  Map nested JSON structures onto PHP classes
nikic/php-parser                      v4.3.0  A PHP parser written in PHP
ocramius/package-versions             1.5.1   Composer plugin that provides efficient querying for installed package versions (no runtime IO)
openlss/lib-array2xml                 1.0.0   Array2XML conversion library credit to lalit.org
phpdocumentor/reflection-common       2.0.0   Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock     4.3.4   With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver           1.0.1   A PSR-5 based resolver of Class names, Types and Structural Element Names
psr/container                         1.0.0   Common Container Interface (PHP FIG PSR-11)
psr/log                               1.1.2   Common interface for logging libraries
sebastian/diff                        3.0.2   Diff implementation
symfony/console                       v5.0.3  Symfony Console Component
symfony/polyfill-ctype                v1.13.1 Symfony polyfill for ctype functions
symfony/polyfill-mbstring             v1.13.1 Symfony polyfill for the Mbstring extension
symfony/polyfill-php73                v1.13.1 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/service-contracts             v2.0.1  Generic abstractions related to writing services
vimeo/psalm                           3.8.3   A static analysis tool for finding errors in PHP applications
webmozart/assert                      1.6.0   Assertions to validate method input/output with nice error messages.
webmozart/glob                        4.1.0   A PHP implementation of Ant's glob.
webmozart/path-util                   2.3.0   A robust cross-platform utility for normalizing, comparing and modifying file paths.
muglug commented 4 years ago

I don't think that's Psalm – that's probably from reflection

muglug commented 4 years ago

what's Psalm's full output with --debug?

Slamdunk commented 4 years ago

If it can be of any help, Laminas is a replacement for Zend packages, and it is shipped with a custom autoloader to fulfill old packages that cannot be replaced yet: https://github.com/laminas/laminas-zendframework-bridge/blob/master/src/Autoloader.php#L35

This is the full output
    $ ./vendor/bin/psalm --debug
    Registering autoloaded files
    Deep scanning /mnt/data/repos/psalmbug/vendor/amphp/amp/lib/functions.php
    Using composer to locate file for Laminas\ZendFrameworkBridge\Autoloader
    Using composer to locate file for Symfony\Polyfill\Ctype\Ctype
    Using composer to locate file for Amp\Promise
    Using reflection to get metadata for Closure
    Using reflection to get metadata for Throwable
    Using composer to locate file for Amp\Failure
    Using reflection to get metadata for Generator
    Using composer to locate file for Amp\Coroutine
    Using reflection to locate file for React\Promise\PromiseInterface
    Using composer to locate file for Amp\Success
    Using composer to locate file for Amp\Delayed
    Using composer to locate file for Amp\Loop
    Using reflection to get metadata for Error
    Using composer to locate file for Amp\Deferred
    Using composer to locate file for Amp\TimeoutException
    Using reflection to get metadata for Countable
    Using reflection to get metadata for SimpleXMLElement
    Using reflection to get metadata for ResourceBundle
    Using composer to locate file for Amp\MultiReasonException
    Using reflection to get metadata for Traversable
    Using composer to locate file for Amp\Producer
    Using composer to locate file for Amp\Emitter
    Using composer to locate file for Amp\Iterator
    Using reflection to get metadata for TypeError
    Using composer to locate file for Symfony\Polyfill\Mbstring\Mbstring
    Using composer to locate file for Amp\ByteStream\InputStream
    Using composer to locate file for Amp\ByteStream\OutputStream
    Using composer to locate file for Amp\ByteStream\ResourceInputStream
    Using composer to locate file for Amp\ByteStream\ResourceOutputStream
    Using composer to locate file for Amp\ByteStream\LineReader
    Using composer to locate file for Amp\ByteStream\StreamException
    Using composer to locate file for Webmozart\PathUtil\Path
    Using reflection to get metadata for ReflectionFunction
    Using composer to locate file for Laminas\ServiceManager\ServiceManager
    Using composer to locate file for Laminas\Form\FormElementManager\FormElementManagerV3Polyfill
    Using composer to locate file for Laminas\Form\FormElementManager\FormElementManagerV2Polyfill
    Using reflection to locate file for Laminas\Form\FormElementManager
    Scanning /mnt/data/repos/psalmbug/vendor/amphp/amp/lib/Promise.php
    Scanning /mnt/data/repos/psalmbug/vendor/amphp/amp/lib/Producer.php
    Using reflection to get metadata for Exception
    Using reflection to get metadata for ReflectionClass
    Using reflection to get metadata for ReflectionExtension
    Using reflection to get metadata for ReflectionParameter
    Using reflection to get metadata for ReflectionType
    Using reflection to get metadata for RuntimeException
    Using reflection to locate file for Composer\Autoload\ClassLoader
    Using reflection to get metadata for ArrayObject
    Using composer to locate file for Amp\Internal\Placeholder
    Using composer to locate file for Amp\Loop\Driver
    Using composer to locate file for Amp\Loop\UnsupportedFeatureException
    Using composer to locate file for Amp\Loop\InvalidWatcherError
    Using composer to locate file for Amp\Loop\DriverFactory
    Using composer to locate file for Amp\CallableMaker
    Using composer to locate file for Amp\Internal\Producer
    Using composer to locate file for Amp\ByteStream\PendingReadError
    Using composer to locate file for Amp\ByteStream\ClosedException
    Using reflection to get metadata for SplQueue
    Using reflection to get metadata for InvalidArgumentException
    Using composer to locate file for Laminas\ServiceManager\ServiceLocatorInterface
    Using composer to locate file for Laminas\ServiceManager\Factory\AbstractFactoryInterface
    Using composer to locate file for Interop\Container\ContainerInterface
    Using composer to locate file for Laminas\ServiceManager\Factory\DelegatorFactoryInterface
    Using composer to locate file for Laminas\ServiceManager\Initializer\InitializerInterface
    Using composer to locate file for Laminas\ServiceManager\Proxy\LazyServiceFactory
    Using composer to locate file for Laminas\ServiceManager\Exception\ContainerModificationsNotAllowedException
    Using composer to locate file for Laminas\ServiceManager\Factory\FactoryInterface
    Using composer to locate file for Laminas\ServiceManager\Exception\ServiceNotFoundException
    Using composer to locate file for Laminas\ServiceManager\Exception\ServiceNotCreatedException
    Using composer to locate file for Interop\Container\Exception\ContainerException
    Using composer to locate file for Laminas\ServiceManager\AbstractPluginManager
    Using composer to locate file for Laminas\Form\FormElementManager\FormElementManagerTrait
    Using composer to locate file for Laminas\Form\Element\Button
    Using composer to locate file for Laminas\Form\Element\Captcha
    Using composer to locate file for Laminas\Form\Element\Checkbox
    Using composer to locate file for Laminas\Form\Element\Collection
    Using composer to locate file for Laminas\Form\Element\Color
    Using composer to locate file for Laminas\Form\Element\Csrf
    Using composer to locate file for Laminas\Form\Element\Date
    Using composer to locate file for Laminas\Form\Element\DateSelect
    Using composer to locate file for Laminas\Form\Element\DateTime
    Using composer to locate file for Laminas\Form\Element\DateTimeLocal
    Using composer to locate file for Laminas\Form\Element\DateTimeSelect
    Using composer to locate file for Laminas\Form\Element
    Using composer to locate file for Laminas\Form\Element\Email
    Using composer to locate file for Laminas\Form\Fieldset
    Using composer to locate file for Laminas\Form\Element\File
    Using composer to locate file for Laminas\Form\Form
    Using composer to locate file for Laminas\Form\Element\Hidden
    Using composer to locate file for Laminas\Form\Element\Image
    Using composer to locate file for Laminas\Form\Element\Month
    Using composer to locate file for Laminas\Form\Element\MonthSelect
    Using composer to locate file for Laminas\Form\Element\MultiCheckbox
    Using composer to locate file for Laminas\Form\Element\Number
    Using composer to locate file for Laminas\Form\Element\Password
    Using composer to locate file for Laminas\Form\Element\Radio
    Using composer to locate file for Laminas\Form\Element\Range
    Using composer to locate file for Laminas\Form\Element\Search
    Using composer to locate file for Laminas\Form\Element\Select
    Using composer to locate file for Laminas\Form\Element\Submit
    Using composer to locate file for Laminas\Form\Element\Tel
    Using composer to locate file for Laminas\Form\Element\Text
    Using composer to locate file for Laminas\Form\Element\Textarea
    Using composer to locate file for Laminas\Form\Element\Time
    Using composer to locate file for Laminas\Form\Element\Url
    Using composer to locate file for Laminas\Form\Element\Week
    Using reflection to locate file for Zend\Form\Element\Button
    Using reflection to locate file for Zend\Form\Element\Captcha
    Using reflection to locate file for Zend\Form\Element\Checkbox
    Using reflection to locate file for Zend\Form\Element\Collection
    Using reflection to locate file for Zend\Form\Element\Color
    Using reflection to locate file for Zend\Form\Element\Csrf
    Using reflection to locate file for Zend\Form\Element\Date
    Using reflection to locate file for Zend\Form\Element\DateSelect
    Using reflection to locate file for Zend\Form\Element\DateTime
    Using reflection to locate file for Zend\Form\Element\DateTimeLocal
    Using reflection to locate file for Zend\Form\Element\DateTimeSelect
    Using reflection to locate file for Zend\Form\Element
    Using reflection to locate file for Zend\Form\Element\Email
    Using reflection to locate file for Zend\Form\Fieldset
    Using reflection to locate file for Zend\Form\Element\File
    Using reflection to locate file for Zend\Form\Form
    Using reflection to locate file for Zend\Form\Element\Hidden
    Using reflection to locate file for Zend\Form\Element\Image
    Using reflection to locate file for Zend\Form\Element\Month
    Using reflection to locate file for Zend\Form\Element\MonthSelect
    Using reflection to locate file for Zend\Form\Element\MultiCheckbox
    Using reflection to locate file for Zend\Form\Element\Number
    Using reflection to locate file for Zend\Form\Element\Password
    Using reflection to locate file for Zend\Form\Element\Radio
    Using reflection to locate file for Zend\Form\Element\Range
    Using reflection to locate file for Zend\Form\Element\Search
    Using reflection to locate file for Zend\Form\Element\Select
    Using reflection to locate file for Zend\Form\Element\Submit
    Using reflection to locate file for Zend\Form\Element\Tel
    Using reflection to locate file for Zend\Form\Element\Text
    Using reflection to locate file for Zend\Form\Element\Textarea
    Using reflection to locate file for Zend\Form\Element\Time
    Using reflection to locate file for Zend\Form\Element\Url
    Using reflection to locate file for Zend\Form\Element\Week
    Using composer to locate file for Laminas\Form\ElementFactory
    Using composer to locate file for Laminas\Form\ElementInterface
    Using composer to locate file for Laminas\ServiceManager\Exception\InvalidServiceException
    Using composer to locate file for Laminas\Form\Exception\InvalidElementException
    Scanning /mnt/data/repos/psalmbug/vendor/amphp/amp/lib/Internal/Placeholder.php
    Scanning /mnt/data/repos/psalmbug/vendor/amphp/amp/lib/Loop/Driver.php
    Scanning /mnt/data/repos/psalmbug/vendor/amphp/amp/lib/CallableMaker.php
    Scanning /mnt/data/repos/psalmbug/vendor/amphp/amp/lib/Internal/Producer.php
    Scanning /mnt/data/repos/psalmbug/vendor/laminas/laminas-form/src/FormElementManager/FormElementManagerTrait.php
    Using reflection to get metadata for ReflectionMethod
    Using reflection to get metadata for ReflectionProperty
    Using reflection to get metadata for ReflectionClassConstant
    Using reflection to get metadata for ReflectionFunctionAbstract
    Using reflection to get metadata for ArrayIterator
    Using composer to locate file for Amp\Internal\ResolutionQueue
    Using composer to locate file for Amp\Loop\Watcher
    Using composer to locate file for Psr\Container\ContainerInterface
    Using composer to locate file for Psr\Container\ContainerExceptionInterface
    Using reflection to locate file for ProxyManager\Factory\LazyLoadingValueHolderFactory
    Using reflection to locate file for ProxyManager\Proxy\VirtualProxyInterface
    Using reflection to get metadata for DomainException
    Using composer to locate file for Laminas\ServiceManager\Exception\ExceptionInterface
    Using composer to locate file for Interop\Container\Exception\NotFoundException
    Using composer to locate file for Laminas\ServiceManager\PluginManagerInterface
    Using composer to locate file for Laminas\ServiceManager\ConfigInterface
    Using composer to locate file for Laminas\Form\Exception\DomainException
    Using composer to locate file for Laminas\InputFilter\InputProviderInterface
    Using reflection to locate file for Laminas\Captcha\AdapterInterface
    Using composer to locate file for Laminas\Form\Exception\InvalidArgumentException
    Using composer to locate file for Laminas\Validator\ValidatorInterface
    Using composer to locate file for Laminas\Form\FieldsetInterface
    Using composer to locate file for Laminas\Form\FormInterface
    Using composer to locate file for Laminas\Stdlib\Exception\InvalidArgumentException
    Using composer to locate file for Laminas\Form\ElementPrepareAwareInterface
    Using composer to locate file for Laminas\Validator\Csrf
    Using reflection to get metadata for ArrayAccess
    Using reflection to get metadata for DateTime
    Using composer to locate file for Laminas\Validator\Date
    Using composer to locate file for Laminas\Validator\DateStep
    Using composer to locate file for Laminas\Form\ElementAttributeRemovalInterface
    Using composer to locate file for Laminas\Stdlib\InitializableInterface
    Using composer to locate file for Laminas\Form\LabelAwareInterface
    Using composer to locate file for Laminas\Form\Factory
    Using composer to locate file for Laminas\Stdlib\PriorityList
    Using composer to locate file for Laminas\Hydrator\HydratorInterface
    Using composer to locate file for Laminas\InputFilter\InputFilterInterface
    Using composer to locate file for Laminas\InputFilter\CollectionInputFilter
    Using composer to locate file for Laminas\ServiceManager\FactoryInterface
    Using reflection to get metadata for DateTimeZone
    Using reflection to get metadata for DateTimeInterface
    Using reflection to get metadata for DateInterval
    Using reflection to get metadata for DateTimeImmutable
    Using composer to locate file for Amp\Struct
    Using composer to locate file for Psr\Container\NotFoundExceptionInterface
    Using composer to locate file for Laminas\Form\Exception\ExceptionInterface
    Using composer to locate file for Laminas\Validator\Exception\RuntimeException
    Using reflection to get metadata for IteratorAggregate
    Using composer to locate file for Laminas\Form\FormFactoryAwareInterface
    Using composer to locate file for Laminas\Stdlib\Exception\ExceptionInterface
    Using composer to locate file for Laminas\Validator\AbstractValidator
    Using reflection to locate file for Laminas\Session\Container
    Using composer to locate file for Laminas\Validator\Exception\InvalidArgumentException
    Using composer to locate file for Laminas\InputFilter\Factory
    Using reflection to locate file for Laminas\Form\FormElementManager
    Using reflection to get metadata for Iterator
    Using composer to locate file for Laminas\Hydrator\HydrationInterface
    Using composer to locate file for Laminas\Hydrator\ExtractionInterface
    Using composer to locate file for Laminas\InputFilter\Exception\InvalidArgumentException
    Using composer to locate file for Laminas\InputFilter\InputInterface
    Using composer to locate file for Laminas\InputFilter\InputFilter
    Using composer to locate file for Laminas\InputFilter\BaseInputFilter
    Using composer to locate file for Laminas\Validator\NotEmpty
    Using composer to locate file for Laminas\InputFilter\Exception\RuntimeException
    Scanning /mnt/data/repos/psalmbug/vendor/amphp/amp/lib/Struct.php
    Using composer to locate file for Laminas\Validator\Exception\ExceptionInterface
    Using composer to locate file for Laminas\Validator\Translator\TranslatorAwareInterface
    Using composer to locate file for Laminas\Validator\Translator\TranslatorInterface
    Using composer to locate file for Laminas\Filter\FilterChain
    Using composer to locate file for Laminas\Validator\ValidatorChain
    Using composer to locate file for Laminas\InputFilter\InputFilterPluginManager
    Using composer to locate file for Laminas\InputFilter\InputFilterProviderInterface
    Using composer to locate file for Laminas\InputFilter\Exception\ExceptionInterface
    Using composer to locate file for Laminas\InputFilter\UnknownInputsCapableInterface
    Using composer to locate file for Laminas\InputFilter\ReplaceableInputInterface
    Using composer to locate file for Laminas\InputFilter\UnfilteredDataInterface
    Using composer to locate file for Laminas\Filter\AbstractFilter
    Using composer to locate file for Laminas\Filter\FilterPluginManager
    Using composer to locate file for Laminas\Stdlib\PriorityQueue
    Using composer to locate file for Laminas\Filter\Exception\InvalidArgumentException
    Using composer to locate file for Laminas\Filter\FilterInterface
    Using composer to locate file for Laminas\Validator\ValidatorPluginManager
    Using composer to locate file for Laminas\InputFilter\OptionalInputFilter
    Using reflection to locate file for Zend\InputFilter\InputFilter
    Using reflection to locate file for Zend\InputFilter\CollectionInputFilter
    Using reflection to locate file for Zend\InputFilter\OptionalInputFilter
    Using composer to locate file for Laminas\ServiceManager\Factory\InvokableFactory
    Using composer to locate file for Laminas\Filter\Exception\ExceptionInterface
    Using composer to locate file for Laminas\Filter\ToInt
    Using composer to locate file for Laminas\Filter\ToNull
    Using reflection to locate file for Laminas\I18n\Filter\Alnum
    Using reflection to locate file for Laminas\I18n\Filter\Alpha
    Using reflection to locate file for Laminas\I18n\Filter\NumberFormat
    Using reflection to locate file for Laminas\I18n\Filter\NumberParse
    Using composer to locate file for Laminas\Filter\BaseName
    Using composer to locate file for Laminas\Filter\Blacklist
    Using composer to locate file for Laminas\Filter\Boolean
    Using composer to locate file for Laminas\Filter\Callback
    Using composer to locate file for Laminas\Filter\Compress
    Using composer to locate file for Laminas\Filter\DataUnitFormatter
    Using composer to locate file for Laminas\Filter\DateSelect
    Using composer to locate file for Laminas\Filter\DateTimeFormatter
    Using composer to locate file for Laminas\Filter\DateTimeSelect
    Using composer to locate file for Laminas\Filter\Decompress
    Using composer to locate file for Laminas\Filter\Decrypt
    Using composer to locate file for Laminas\Filter\Digits
    Using composer to locate file for Laminas\Filter\Dir
    Using composer to locate file for Laminas\Filter\Encrypt
    Using composer to locate file for Laminas\Filter\File\Decrypt
    Using composer to locate file for Laminas\Filter\File\Encrypt
    Using composer to locate file for Laminas\Filter\File\LowerCase
    Using composer to locate file for Laminas\Filter\File\Rename
    Using composer to locate file for Laminas\Filter\File\RenameUpload
    Using composer to locate file for Laminas\Filter\File\UpperCase
    Using composer to locate file for Laminas\Filter\HtmlEntities
    Using composer to locate file for Laminas\Filter\Inflector
    Using composer to locate file for Laminas\Filter\MonthSelect
    Using composer to locate file for Laminas\Filter\PregReplace
    Using composer to locate file for Laminas\Filter\RealPath
    Using composer to locate file for Laminas\Filter\StringPrefix
    Using composer to locate file for Laminas\Filter\StringSuffix
    Using composer to locate file for Laminas\Filter\StringToLower
    Using composer to locate file for Laminas\Filter\StringToUpper
    Using composer to locate file for Laminas\Filter\StringTrim
    Using composer to locate file for Laminas\Filter\StripNewlines
    Using composer to locate file for Laminas\Filter\StripTags
    Using composer to locate file for Laminas\Filter\ToFloat
    Using composer to locate file for Laminas\Filter\UpperCaseWords
    Using composer to locate file for Laminas\Filter\UriNormalize
    Using composer to locate file for Laminas\Filter\Whitelist
    Using composer to locate file for Laminas\Filter\Word\CamelCaseToDash
    Using composer to locate file for Laminas\Filter\Word\CamelCaseToSeparator
    Using composer to locate file for Laminas\Filter\Word\CamelCaseToUnderscore
    Using composer to locate file for Laminas\Filter\Word\DashToCamelCase
    Using composer to locate file for Laminas\Filter\Word\DashToSeparator
    Using composer to locate file for Laminas\Filter\Word\DashToUnderscore
    Using composer to locate file for Laminas\Filter\Word\SeparatorToCamelCase
    Using composer to locate file for Laminas\Filter\Word\SeparatorToDash
    Using composer to locate file for Laminas\Filter\Word\SeparatorToSeparator
    Using composer to locate file for Laminas\Filter\Word\UnderscoreToCamelCase
    Using composer to locate file for Laminas\Filter\Word\UnderscoreToStudlyCase
    Using composer to locate file for Laminas\Filter\Word\UnderscoreToDash
    Using composer to locate file for Laminas\Filter\Word\UnderscoreToSeparator
    Using reflection to locate file for Zend\I18n\Filter\Alnum
    Using reflection to locate file for Zend\I18n\Filter\Alpha
    Using reflection to locate file for Zend\I18n\Filter\NumberFormat
    Using reflection to locate file for Zend\I18n\Filter\NumberParse
    Using reflection to locate file for Zend\Filter\BaseName
    Using reflection to locate file for Zend\Filter\Blacklist
    Using reflection to locate file for Zend\Filter\Boolean
    Using reflection to locate file for Zend\Filter\Callback
    Using reflection to locate file for Zend\Filter\Compress
    Using reflection to locate file for Zend\Filter\DataUnitFormatter
    Using reflection to locate file for Zend\Filter\DateSelect
    Using reflection to locate file for Zend\Filter\DateTimeFormatter
    Using reflection to locate file for Zend\Filter\DateTimeSelect
    Using reflection to locate file for Zend\Filter\Decompress
    Using reflection to locate file for Zend\Filter\Decrypt
    Using reflection to locate file for Zend\Filter\Digits
    Using reflection to locate file for Zend\Filter\Dir
    Using reflection to locate file for Zend\Filter\Encrypt
    Using reflection to locate file for Zend\Filter\File\Decrypt
    Using reflection to locate file for Zend\Filter\File\Encrypt
    Using reflection to locate file for Zend\Filter\File\LowerCase
    Using reflection to locate file for Zend\Filter\File\Rename
    Using reflection to locate file for Zend\Filter\File\RenameUpload
    Using reflection to locate file for Zend\Filter\File\UpperCase
    Using reflection to locate file for Zend\Filter\HtmlEntities
    Using reflection to locate file for Zend\Filter\Inflector
    Using reflection to locate file for Zend\Filter\ToInt
    Using reflection to locate file for Zend\Filter\ToFloat
    Using reflection to locate file for Zend\Filter\MonthSelect
    Using reflection to locate file for Zend\Filter\ToNull
    Using reflection to locate file for Zend\Filter\UpperCaseWords
    Using reflection to locate file for Zend\Filter\PregReplace
    Using reflection to locate file for Zend\Filter\RealPath
    Using reflection to locate file for Zend\Filter\StringPrefix
    Using reflection to locate file for Zend\Filter\StringSuffix
    Using reflection to locate file for Zend\Filter\StringToLower
    Using reflection to locate file for Zend\Filter\StringToUpper
    Using reflection to locate file for Zend\Filter\StringTrim
    Using reflection to locate file for Zend\Filter\StripNewlines
    Using reflection to locate file for Zend\Filter\StripTags
    Using reflection to locate file for Zend\Filter\UriNormalize
    Using reflection to locate file for Zend\Filter\Whitelist
    Using reflection to locate file for Zend\Filter\Word\CamelCaseToDash
    Using reflection to locate file for Zend\Filter\Word\CamelCaseToSeparator
    Using reflection to locate file for Zend\Filter\Word\CamelCaseToUnderscore
    Using reflection to locate file for Zend\Filter\Word\DashToCamelCase
    Using reflection to locate file for Zend\Filter\Word\DashToSeparator
    Using reflection to locate file for Zend\Filter\Word\DashToUnderscore
    Using reflection to locate file for Zend\Filter\Word\SeparatorToCamelCase
    Using reflection to locate file for Zend\Filter\Word\SeparatorToDash
    Using reflection to locate file for Zend\Filter\Word\SeparatorToSeparator
    Using reflection to locate file for Zend\Filter\Word\UnderscoreToCamelCase
    Using reflection to locate file for Zend\Filter\Word\UnderscoreToStudlyCase
    Using reflection to locate file for Zend\Filter\Word\UnderscoreToDash
    Using reflection to locate file for Zend\Filter\Word\UnderscoreToSeparator
    Using composer to locate file for Laminas\Filter\Word\Service\SeparatorToSeparatorFactory
    Using composer to locate file for Laminas\Filter\Exception\RuntimeException
    Using reflection to get metadata for Serializable
    Using composer to locate file for Laminas\Stdlib\SplPriorityQueue
    Using composer to locate file for Laminas\Stdlib\Exception\DomainException
    Using reflection to locate file for Laminas\I18n\Validator\Alnum
    Using reflection to locate file for Laminas\I18n\Validator\Alpha
    Using composer to locate file for Laminas\Validator\Barcode
    Using composer to locate file for Laminas\Validator\Between
    Using composer to locate file for Laminas\Validator\Bitwise
    Using composer to locate file for Laminas\Validator\Callback
    Using composer to locate file for Laminas\Validator\CreditCard
    Using reflection to locate file for Laminas\I18n\Validator\DateTime
    Using composer to locate file for Laminas\Validator\Db\NoRecordExists
    Using composer to locate file for Laminas\Validator\Db\RecordExists
    Using composer to locate file for Laminas\Validator\Digits
    Using composer to locate file for Laminas\Validator\EmailAddress
    Using composer to locate file for Laminas\Validator\Explode
    Using composer to locate file for Laminas\Validator\File\Count
    Using composer to locate file for Laminas\Validator\File\Crc32
    Using composer to locate file for Laminas\Validator\File\ExcludeExtension
    Using composer to locate file for Laminas\Validator\File\ExcludeMimeType
    Using composer to locate file for Laminas\Validator\File\Exists
    Using composer to locate file for Laminas\Validator\File\Extension
    Using composer to locate file for Laminas\Validator\File\FilesSize
    Using composer to locate file for Laminas\Validator\File\Hash
    Using composer to locate file for Laminas\Validator\File\ImageSize
    Using composer to locate file for Laminas\Validator\File\IsCompressed
    Using composer to locate file for Laminas\Validator\File\IsImage
    Using composer to locate file for Laminas\Validator\File\Md5
    Using composer to locate file for Laminas\Validator\File\MimeType
    Using composer to locate file for Laminas\Validator\File\NotExists
    Using composer to locate file for Laminas\Validator\File\Sha1
    Using composer to locate file for Laminas\Validator\File\Size
    Using composer to locate file for Laminas\Validator\File\Upload
    Using composer to locate file for Laminas\Validator\File\UploadFile
    Using composer to locate file for Laminas\Validator\File\WordCount
    Using reflection to locate file for Laminas\I18n\Validator\IsFloat
    Using composer to locate file for Laminas\Validator\GpsPoint
    Using composer to locate file for Laminas\Validator\GreaterThan
    Using composer to locate file for Laminas\Validator\Hex
    Using composer to locate file for Laminas\Validator\Hostname
    Using composer to locate file for Laminas\Validator\Iban
    Using composer to locate file for Laminas\Validator\Identical
    Using composer to locate file for Laminas\Validator\InArray
    Using reflection to locate file for Laminas\I18n\Validator\IsInt
    Using composer to locate file for Laminas\Validator\Ip
    Using composer to locate file for Laminas\Validator\Isbn
    Using composer to locate file for Laminas\Validator\IsInstanceOf
    Using composer to locate file for Laminas\Validator\LessThan
    Using reflection to locate file for Laminas\I18n\Validator\PhoneNumber
    Using reflection to locate file for Laminas\I18n\Validator\PostCode
    Using composer to locate file for Laminas\Validator\Regex
    Using composer to locate file for Laminas\Validator\Sitemap\Changefreq
    Using composer to locate file for Laminas\Validator\Sitemap\Lastmod
    Using composer to locate file for Laminas\Validator\Sitemap\Loc
    Using composer to locate file for Laminas\Validator\Sitemap\Priority
    Using composer to locate file for Laminas\Validator\StringLength
    Using composer to locate file for Laminas\Validator\Step
    Using composer to locate file for Laminas\Validator\Timezone
    Using composer to locate file for Laminas\Validator\Uri
    Using composer to locate file for Laminas\Validator\Uuid
    Using reflection to locate file for Zend\I18n\Validator\Alnum
    Using reflection to locate file for Zend\I18n\Validator\Alpha
    Using reflection to locate file for Zend\Validator\Barcode
    Using reflection to locate file for Zend\Validator\Between
    Using reflection to locate file for Zend\Validator\Bitwise
    Using reflection to locate file for Zend\Validator\Callback
    Using reflection to locate file for Zend\Validator\CreditCard
    Using reflection to locate file for Zend\Validator\Csrf
    Using reflection to locate file for Zend\Validator\DateStep
    Using reflection to locate file for Zend\Validator\Date
    Using reflection to locate file for Zend\I18n\Validator\DateTime
    Using reflection to locate file for Zend\Validator\Db\NoRecordExists
    PHP Fatal error:  Trait 'Laminas\Db\Adapter\AdapterAwareTrait' not found in /mnt/data/repos/psalmbug/vendor/laminas/laminas-validator/src/Db/AbstractDb.php on line 27

    Fatal error: Trait 'Laminas\Db\Adapter\AdapterAwareTrait' not found in /mnt/data/repos/psalmbug/vendor/laminas/laminas-validator/src/Db/AbstractDb.php on line 27
    
muglug commented 4 years ago

I think that’s an issue with that package, not with Psalm. When Composer’s autoloader doesn’t have information about a given class, Psalm falls back to using regular PHP reflection (this is normally only necessary when using classes defined in extensions, but can occasionally occur in userland code with its own autoloaders).

Here reflection is failing, which indicates some underlying problem with the library itself — there’s nothing Psalm can really do about it, unfortunately.

nusphere commented 9 months ago

this issue is connected to https://github.com/laminas/laminas-validator/issues/220