Possibly a breaking change coming soon to ATK UI


#1

In short - ATK UI currently hides warnings like “Declaration of V2API::add($user = Array) should be compatible with App::add(array $user = Array)”. This was done because PHP 7.0 and PHP 7.1 did not support parameter type widening.

This PR will keep the same behaviour on 7.0 and 7.1 but for 7.2 it will remove suppression and PHP will validate your method signatures correctly.

Example:

public function setModel($m) {
  // this generates no warnings in 7.2. Warning is suppressed in 7.1 and 7.0
}

Example:

public function setModel(Model\User $u) {
  // this is bad code as per SOLID. Rename method to setUser(Model\User $u);
  // https://en.wikipedia.org/wiki/SOLID
}

To test your existing code, in the composer.json:

  "atk4/ui": "dev-feature/be-more-strict-with-method-signatures as 1.6.0",

If this PR causes your application to explode with warnings, use this:

$app = new App(['fix_incompatible' = true]);

#2

these warnings cause psy/psysh to crash