public function __construct($value2, $value1) { $this->value1 = trim($value1); $this->value2 = trim($value2); if (strlen($value1) > 5) { $this->calculatedValue = 100; } else { $this->calculatedValue = 50; } }