Skip to content

Commit 5085467

Browse files
committed
Se agrega StatusInterface::getCode() y StatusInterface::getFlashType()
1 parent 851b8f3 commit 5085467

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

src/Contract/StatusInterface.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,25 @@
3636
*/
3737
interface StatusInterface
3838
{
39+
/**
40+
* Returns the status code (e.g. "success", "error", "pending").
41+
*/
42+
public function getCode(): string;
43+
3944
/**
4045
* Human-readable label for the status.
4146
*
4247
* @return string e.g. "Success", "Error", "Pending"
4348
*/
4449
public function getLabel(): string;
4550

51+
/**
52+
* Returns the flash type for the status.
53+
*
54+
* @return string e.g. "success", "error", "warning", "info"
55+
*/
56+
public function getFlashType(): string;
57+
4658
/**
4759
* Bootstrap 5.3 contextual color name.
4860
*

src/Status.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ enum Status: string implements StatusInterface
6565
*/
6666
case Dark = 'dark';
6767

68+
/**
69+
* {@inheritDoc}
70+
*/
71+
public function getCode(): string
72+
{
73+
return $this->value;
74+
}
75+
6876
/**
6977
* {@inheritDoc}
7078
*/
@@ -82,6 +90,14 @@ public function getLabel(): string
8290
};
8391
}
8492

93+
/**
94+
* {@inheritDoc}
95+
*/
96+
public function getFlashType(): string
97+
{
98+
return $this->value;
99+
}
100+
85101
/**
86102
* {@inheritDoc}
87103
*/

0 commit comments

Comments
 (0)