Php 具有相同VO类型n构造函数的两个参数是否为干断开?

Php 具有相同VO类型n构造函数的两个参数是否为干断开?,php,dry,Php,Dry,嘿,我有一个简单的问题。但是我找不到答案 public function __construct( private GeographicCoordinates $coordinates, private GeographicCoordinates $target, ) { $this->calculate(); } 或者类似的事情 public function calculate(GeographicCoordinates $coordinates, Geogr

嘿,我有一个简单的问题。但是我找不到答案

public function __construct(
    private GeographicCoordinates $coordinates,
    private GeographicCoordinates $target,
)
{
    $this->calculate();
}
或者类似的事情

public function calculate(GeographicCoordinates $coordinates, GeographicCoordinates $targetCoordinates);

这是一条“打破僵局”的规则吗?

全班还有其他事情吗?您需要在实例中存储这两个对象是有原因的吗?或者您可以只使用静态计算方法吗?我使用地理坐标是因为tihs是我的VO,对数据有少量验证,不,使用计算方法的类不做任何其他事情。只是算计