Introduced a new class ServiceResultSuccess to distinctively handle successful service responses. Changes were made in AuthService and Service base class to replace ServiceResultArray with ServiceResultSuccess for successful operations. This provides a more accurate response type and improves code readability.

This commit is contained in:
2023-07-06 21:54:10 +06:00
parent c18e7e54b7
commit 91810190b7
3 changed files with 20 additions and 4 deletions

View File

@@ -0,0 +1,15 @@
<?php declare(strict_types=1);
namespace App\ServiceResults;
final class ServiceResultSuccess extends ServiceResult
{
public function __construct(
private readonly string $message
) { }
public function getMessage(): string
{
return $this->message;
}
}