protected function validateStateIsAvailable($state) { if (!in_array($state, $this->getAvailableStates())) { $message = "State: {$state} is an invalid state, and cannot be used."; throw new InvalidTransactionStateException($message); } return true; }