D
D
dmitriy2015-02-11 16:25:46
PHP
dmitriy, 2015-02-11 16:25:46

Why is a class with this method not stable?

public function addPatient(IBearing $patient){
    $this->patient = $patient;
  }

when parsing a class, the metrics mark it as unstable Instability = 1 , due to the fact that the class depends on other classes, by checking the interface.
Is it right to remove the check, or is it just to score on the metric?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2015-02-11
@OnYourLips

Removing type checking would be wrong.

A
Arman, 2015-02-11
@Arik

Rather, it is just a warning that the current class has dependencies, which is quite normal.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question