When the value object was originally developed as part of a value object, one of the tests on the class containing the value object, was for the case when the raw value passed was null. In order to get the correct type of exception (ValidationException), the constructor parameter was made optional.
At the moment, there is no test that explicitly tests what happens when passing null to the constructor. So that should be added as well.
At the moment, the constructor parameter is optional.
See https://github.com/spoorsny/php-south-african-id/blob/master/src/ValueObjects/SouthAfricanId.php#L51
When the value object was originally developed as part of a value object, one of the tests on the class containing the value object, was for the case when the raw value passed was null. In order to get the correct type of exception (ValidationException), the constructor parameter was made optional.
At the moment, there is no test that explicitly tests what happens when passing null to the constructor. So that should be added as well.