title: Class visibility (private) inside __construct parameters - is this a valid php code?
body: <p>I'm looking at some one else's code that I do not understand. This is example of class:</p>
  <pre><code>class ImageService
  {
     public function __construct(
         private ImageTransformer $imageTransformer,
         private PostService $postService
     ) {
  
     }
  
     // other methods here
  }
  </code></pre>
  <p>IDE is showing errors under _construct due to &quot;private&quot; inside params.
  I know that in PHP 8 there are union types, but I cannot find any info about using &quot;private&quot; or &quot;public&quot; not inside class but inside constructor, and what this supposed to do. I thought that this is typo, and it supposed to be inside class, but multiple classes are created like this. Is this a valid code or someone does not know what is he doing?</p>