php - Is it a good practice to use an "untouchable"? It cant be instanized, nor inherited -
php - Is it a good practice to use an "untouchable"? It cant be instanized, nor inherited -
lets imagine class, checking values:
final class validator { private function __construct() { } private function __clone() { } public static final function checkvalue ($a) { ... } public static final function checkvalueindb ($a) { ... } } its useless instantize it, or inherit - no need mock, or utilize dependency injections. however, right cant test __constructor , __clone because private, , code coverage says not 100%
you utilize abstract class static methods instead of construction private methods.
php
Comments
Post a Comment