predefinedStatusService = $predefinedStatusService; } /** * Get all predefined messages * * @NoAdminRequired * * @return DataResponse * * 200: Predefined statuses returned */ #[ApiRoute(verb: 'GET', url: '/api/v1/predefined_statuses/')] public function findAll():DataResponse { // Filtering out the invisible one, that should only be set by API return new DataResponse(array_filter($this->predefinedStatusService->getDefaultStatuses(), function (array $status) { return !array_key_exists('visible', $status) || $status['visible'] === true; })); } }