-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from bim-g/dev
[ENH] Replace array message with a class module
- Loading branch information
Showing
8 changed files
with
255 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2023. Wepesi validation. | ||
* @author Boss Ibrahim Mussa | ||
*/ | ||
|
||
namespace Wepesi\App; | ||
|
||
/** | ||
* | ||
*/ | ||
final class MessageErrorBuilder | ||
{ | ||
|
||
/** | ||
* @var array | ||
*/ | ||
private array $items; | ||
|
||
/** | ||
* | ||
*/ | ||
public function __construct(){ | ||
$this->items = []; | ||
} | ||
|
||
/** | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function type(string $value): MessageErrorBuilder | ||
{ | ||
$this->items['type'] = $value; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function message(string $value): MessageErrorBuilder | ||
{ | ||
$this->items['message'] = $value; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function label(string $value): MessageErrorBuilder | ||
{ | ||
$this->items['label'] = $value; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function limit(string $value): MessageErrorBuilder | ||
{ | ||
$this->items['limit'] = $value; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function generate(){ | ||
return $this->items; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.