| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 12 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function __construct( $entity_class, $message = '', $code = 0, \Exception $previous = null ) { |
||
| 31 | if ( empty( $message ) ) { |
||
| 32 | $message = sprintf( |
||
| 33 | __( |
||
| 34 | 'The "%1$s" entity could not be instantiated for an unknown reason', |
||
| 35 | 'event_espresso' |
||
| 36 | ), |
||
| 37 | $entity_class |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | parent::__construct( $message, $code, $previous ); |
||
| 41 | } |
||
| 42 | |||
| 45 | // Location: /EntityConstructionException.php |
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.