wip: booking process
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\BusProNet\Model;
|
||||
|
||||
/**
|
||||
* Represents a notification with code and message information.
|
||||
*
|
||||
* This class handles notification data including error codes and messages
|
||||
* for API response handling. It provides methods to determine if the
|
||||
* notification represents an error condition.
|
||||
*/
|
||||
class Notification
|
||||
{
|
||||
public function __construct(int $code, string $message)
|
||||
@@ -13,6 +22,14 @@ class Notification
|
||||
public ?int $code;
|
||||
public ?string $message;
|
||||
|
||||
/**
|
||||
* Determines if the notification represents an error.
|
||||
*
|
||||
* Returns true if the notification code is not 650 (success code).
|
||||
* Code 650 is used for successful operations in the BusProNet API.
|
||||
*
|
||||
* @return bool True if the notification is an error, false otherwise
|
||||
*/
|
||||
public function isError(): bool
|
||||
{
|
||||
return 650 !== $this->code;
|
||||
|
||||
Reference in New Issue
Block a user