Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is
duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
32
throw new \InvalidArgumentException(sprintf(
33
'Argument "%s" is invalid. Allowed types for argument are "url path".',
It seems like $filteredValue defined by parse_url($value, PHP_URL_PATH) on line 30 can also be of type false; however, Cubiche\Domain\System\StringLiteral::__construct() does only seem to accept string, did you maybe forget to handle an error condition?
This check looks for type mismatches where the missing type is false. This
is usually indicative of an error condtion.
This function either returns a new DateTime object or false, if there was an error.
This is a typical pattern in PHP programming to show that an error has occurred without
raising an exception. The calling code should check for this returned false
before passing on the value to another function or method that may not
be able to handle a false.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.