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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -