title: Checking "PropertyNotSetInConstructor" on a custom function with Psalm
body: <p>Is there a way I could tell <a href="https://psalm.dev/" rel="nofollow noreferrer">Psalm</a> to check other functions than <code>__construct()</code> methods for ensuring all properties are set when a class is instantiated ?</p>
  <p>In some PHP library, Psalm complains about <code>PropertyNotSetInConstructor</code> because it is not able to infer the whole work that is done in each constructor. The constructors all rely on calling dynamically the right function using <code>call_user_func_array()</code>. I am not suprised Psalm cannot see that but I need a workaround to show it the right function to analyze as a constructor.</p>
  <p>The underlying reason is that we mimic constructors with different number of arguments so we can write both <code>$x = new X()</code> and <code>$x = new X($a, $b)</code>.</p>