CodeIgniter4: Bug: classes overwrites parameter defaults, phpDoc's defined in interfaces

Please fix difference(phpDoc, parameter defaults) between classes and their interfaces.

For example: in system/View/RendererInterface.php $saveData = false:

interface RendererInterface {
public function render(string $view, array $options = null, bool $saveData = false): string;
public function renderString(string $view, array $options = null, bool $saveData = false): string;
}

in system/View/View.php $saveData = null:

class View implements RendererInterface {
public function render(string $view, array $options = null, bool $saveData = null): string
public function renderString(string $view, array $options = null, bool $saveData = null): string
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 26 (26 by maintainers)

Most upvoted comments

changing interface default value parameter will break its implementation, ref https://3v4l.org/KuM1M

@MGatner but “if not specified, use the config setting.” is mistake