1 | <?php |
||
10 | class WordPress_GitHub_Sync_Response { |
||
11 | |||
12 | /** |
||
13 | * Application container. |
||
14 | * |
||
15 | * @var WordPress_GitHub_Sync |
||
16 | */ |
||
17 | protected $app; |
||
18 | |||
19 | /** |
||
20 | * WordPress_GitHub_Sync_Response constructor. |
||
21 | * |
||
22 | * @param WordPress_GitHub_Sync $app Application container. |
||
23 | */ |
||
24 | 2 | public function __construct( WordPress_GitHub_Sync $app ) { |
|
27 | |||
28 | /** |
||
29 | * Writes to the log and returns the error response. |
||
30 | * |
||
31 | * @param WP_Error $error Error to respond with. |
||
32 | * |
||
33 | * @return false |
||
34 | */ |
||
35 | 1 | public function error( WP_Error $error ) { |
|
63 | |||
64 | /** |
||
65 | * Writes to the log and returns the success response. |
||
66 | * |
||
67 | * @param string $success Success message to respond with. |
||
68 | * |
||
69 | * @return true |
||
70 | */ |
||
71 | 1 | public function success( $success ) { |
|
80 | |||
81 | /** |
||
82 | * Writes a log message. |
||
83 | * |
||
84 | * Can extract a message from WP_Error object. |
||
85 | * |
||
86 | * @param string|WP_Error $msg Message to log. |
||
87 | */ |
||
88 | 2 | protected function log( $msg ) { |
|
95 | } |
||
96 |