The expression array_search($class, $th...contextServices, true); of type false|integer adds the type integer to the return on line 67 which is incompatible with the return type declared by the interface Behat\Behat\Context\Envi...onment::hasContextClass of type boolean.