Update DepthOfInheritance.php

Using the right condition and naming of property