PSR1 recommends that each class should be in its own file to aid autoloaders.
Having each class in a dedicated file usually plays nice with PSR autoloaders
and is therefore a well established practice. If you use other autoloaders, you
might not want to follow this rule.
Loading history...
25
/** @var string */
26
protected $argument;
27
28
8
public function __construct(string $argument) {
29
8
$this->argument = $argument;
30
31
8
parent::__construct(sprintf('Argument "%s" can\'t be empty!', $argument));
PSR1 recommends that each class should be in its own file to aid autoloaders.
Having each class in a dedicated file usually plays nice with PSR autoloaders
and is therefore a well established practice. If you use other autoloaders, you
might not want to follow this rule.
Loading history...
49
/** @var string */
50
protected $argument;
51
52
2
public function __construct(string $argument, string $expected) {
53
2
$this->argument = $argument;
54
55
2
parent::__construct(sprintf('Argument "%s" has wrong value! %s', $argument, $expected));
Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.