| @@ -5,15 +5,12 @@ | ||
| 5 | 5 | class Error_Builder { |
| 6 | 6 | private string $message; |
| 7 | 7 | private int $status; |
| 8 | 8 | private string $code; |
| 9 | - private array $meta; | |
| 10 | 9 | |
| 11 | 10 | private function __construct( $code, $status = 500 ) { |
| 12 | 11 | $this->code = $code; |
| 13 | 12 | $this->status = $status; |
| 14 | - $this->message = ''; | |
| 15 | - $this->meta = []; | |
| 16 | 13 | } |
| 17 | 14 | |
| 18 | 15 | public static function make( $code, $status = 500 ) { |
| 19 | 16 | return new self( $code, $status ); |
| @@ -30,17 +27,8 @@ | ||
| 30 | 27 | |
| 31 | 28 | return $this; |
| 32 | 29 | } |
| 33 | 30 | |
| 34 | - public function set_meta( array $meta ) { | |
| 35 | - $this->meta = $meta; | |
| 36 | - | |
| 37 | - return $this; | |
| 38 | - } | |
| 39 | - | |
| 40 | 31 | public function build() { |
| 41 | - return new \WP_Error( $this->code, $this->message, [ | |
| 42 | - 'status' => $this->status, | |
| 43 | - 'meta' => $this->meta, | |
| 44 | - ], ); | |
| 32 | + return new \WP_Error( $this->code, $this->message, [ 'status' => $this->status ] ); | |
| 45 | 33 | } |
| 46 | 34 | } |