Code Duplication    Length = 10-13 lines in 5 locations

src/Comodojo/Dispatcher/Output/HttpStatus/Status202.php 1 location

@@ 27-38 (lines=12) @@
24
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25
 */
26
27
class Status202 extends AbstractHttpStatus {
28
29
    public function consolidate() {
30
31
        //PLEASE NOTE: according to HTTP/1.1, 202 header SHOULD HAVE status description in body... just in case
32
        header($_SERVER["SERVER_PROTOCOL"].' 202 Accepted');
33
        header('Status: 202 Accepted');
34
        header('Content-Length: '.$this->response()->content()->length());
35
36
    }
37
38
}
39

src/Comodojo/Dispatcher/Output/HttpStatus/Status204.php 1 location

@@ 27-39 (lines=13) @@
24
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25
 */
26
27
class Status204 extends AbstractHttpStatus {
28
29
    public function consolidate() {
30
31
        header($_SERVER["SERVER_PROTOCOL"].' 204 No Content');
32
        header('Status: 204 No Content');
33
        header('Content-Length: 0',true);
34
35
        $this->response()->content()->set(null);
36
37
    }
38
39
}
40

src/Comodojo/Dispatcher/Output/HttpStatus/Status400.php 1 location

@@ 27-36 (lines=10) @@
24
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25
 */
26
27
class Status400 extends AbstractHttpStatus {
28
29
    public function consolidate() {
30
31
        header($_SERVER["SERVER_PROTOCOL"].' 400 Bad Request', true, 400);
32
        header('Content-Length: '.$this->response()->content()->length());
33
34
    }
35
36
}
37

src/Comodojo/Dispatcher/Output/HttpStatus/Status404.php 1 location

@@ 27-37 (lines=11) @@
24
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25
 */
26
27
class Status404 extends AbstractHttpStatus {
28
29
    public function consolidate() {
30
31
        header($_SERVER["SERVER_PROTOCOL"].' 404 Not Found');
32
        header('Status: 404 Not Found');
33
        header('Content-Length: '.$this->response()->content()->length());
34
35
    }
36
37
}
38

src/Comodojo/Dispatcher/Output/HttpStatus/Status500.php 1 location

@@ 27-37 (lines=11) @@
24
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25
 */
26
27
class Status500 extends AbstractHttpStatus {
28
29
    public function consolidate() {
30
31
        header('500 Internal Server Error', true, 500);
32
        header('Content-Length: '.$this->response()->content()->length());
33
34
35
    }
36
37
}
38