phpstan complains: PropertyPath (from symfony) does not specify iterable type

Error shown when using the PropertyPath instead of the Interface

When you are using phpstan and the Symfony Component Property Access and you would get this error:

Method YAY\Sync\Subject::initPath() has parameter $path with no value type specified in iterable type Symfony\Component\PropertyAccess\PropertyPath

Make sure that you

a) have the phpstan symfony extension installed

b) you are using the interface:

private function initPath(PropertyPathInterface $path): void

instead of

private function initPath(PropertyPath $path): void

Just the plain path. The reason is, that in the phpstan symfony extension the interface is stubbed and has the iterable type applied.

--

--

--

Senior Web Developer — Entrepreneur — yaymemories.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Cycan Bi-Weekly Report | Development Progress of Cycan Ecological Project 2022/01/08

Chinese Postman in Python

Algorithm with Code — Backtracking

How to Get Email Alerts for Unhandled PHP Exceptions

My journey to master AWS CDK

Thoughts on an Async Game Engine Architecture

How to root Alcatel One Touch m Pop 5020x

ScreenShot_20160422225054

Let’s learn about kafka

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Philipp Scheit

Philipp Scheit

Senior Web Developer — Entrepreneur — yaymemories.com

More from Medium

Testing Twig Extensions The Right Way

A handsome, young Afro-American  man pointing on his temple thinking: “no tests? More time for coding”

Php 8.1 New Features — Readonly Properties

Today I Learnt — Twig and Services

PHP Examples of Polymorphism