Answer the question
In order to leave comments, you need to log in
How to make the dependency more abstract?
There is such a dependence (in a simplified form):
// Класс ошибок
class Err {
// Запись сообщения
public function remember($mess) {
...
}
}
// Класс файлов
class File {
// Вывести ошибку
protected function setError(string $error) {
$this->ok = false;
(new Err)->remember('Ошибка в папке '.$this->cut('').':<br>'.$error);
}
}
Answer the question
In order to leave comments, you need to log in
Try using interfaces. But from project to project. you can’t guess with methods, so from project to project you will have to use the adapter + interface pattern. adapter to guess with method name, in new project. but it's all rubbish. but i answered your question
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question