public function processObject($path, $params) { $objectManager = new ObjectManager($path); $response = $objectManager->prepare()->process($params); if (!is_bool($response)) { throw new \Exception("Invalid {$path} response type: must be boolean"); } return $response; }