, " " " ", . "" .
In this case, it seems that you can start grouping things together, for example, you repeat the actions of number and size many times. Why not create a superclass inherited by other classes, for example:
class NameOfSuperClass {
public $type;
function __construct($type) {
$this->type = $type;
$this->getNumber();
$this->getSize();
}
public function getNumber() {
}
public function getSize() {
}
}
Class OfficeFiles extends NameOfSuperClass {
function __construct() {
$this->_super("office");
}
}
I'm not sure if this is correct in PHP, but you understand. Things will start to look a lot cleaner and better managed.
source
share