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:
15
app/ServiceResults/ServiceResultSuccess.php
Normal file
15
app/ServiceResults/ServiceResultSuccess.php
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user