transaction = $transaction; } public function getTransaction() : CraftingTransaction{ return $this->transaction; } /** * @return Recipe */ public function getRecipe() : Recipe{ $recipe = $this->transaction->getRecipe(); if($recipe === null){ throw new \RuntimeException("This shouldn't be called if the transaction can't be executed"); } return $recipe; } /** * @return Player */ public function getPlayer() : Player{ return $this->transaction->getSource(); } }