Skip to content

Commit 2d626b1

Browse files
author
Greg Bowler
authored
Http exception visibility (#37)
* Build up request URI in parts for greater compatibility * Change visibility to public for all getStatusCode functions
1 parent 064b495 commit 2d626b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+48
-48
lines changed

src/ResponseStatusException/AbstractResponseStatusException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ public function __construct(string $message = "") {
1212
);
1313
}
1414

15-
abstract protected function getHttpCode():int;
15+
abstract public function getHttpCode():int;
1616
}

src/ResponseStatusException/HttpBadGateway.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @link https://httpstatuses.com/502
1010
*/
1111
class HttpBadGateway extends AbstractResponseStatusException {
12-
protected function getHttpCode():int {
12+
public function getHttpCode():int {
1313
return StatusCode::BAD_GATEWAY;
1414
}
1515
}

src/ResponseStatusException/HttpBadRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @link https://httpstatuses.com/400
1111
*/
1212
class HttpBadRequest extends AbstractResponseStatusException {
13-
protected function getHttpCode():int {
13+
public function getHttpCode():int {
1414
return StatusCode::BAD_REQUEST;
1515
}
1616
}

src/ResponseStatusException/HttpConflict.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Gt\Http\StatusCode;
55

66
class HttpConflict extends AbstractResponseStatusException {
7-
protected function getHttpCode():int {
7+
public function getHttpCode():int {
88
return StatusCode::CONFLICT;
99
}
1010
}

src/ResponseStatusException/HttpExpectationFailed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Gt\Http\StatusCode;
55

66
class HttpExpectationFailed extends AbstractResponseStatusException {
7-
protected function getHttpCode():int {
7+
public function getHttpCode():int {
88
return StatusCode::EXPECTATION_FAILED;
99
}
1010
}

src/ResponseStatusException/HttpFailedDependency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Gt\Http\StatusCode;
55

66
class HttpFailedDependency extends AbstractResponseStatusException {
7-
protected function getHttpCode():int {
7+
public function getHttpCode():int {
88
return StatusCode::FAILED_DEPENDENCY;
99
}
1010
}

src/ResponseStatusException/HttpForbidden.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @link https://httpstatuses.com/403
1515
*/
1616
class HttpForbidden extends AbstractResponseStatusException {
17-
protected function getHttpCode():int {
17+
public function getHttpCode():int {
1818
return StatusCode::FORBIDDEN;
1919
}
2020
}

src/ResponseStatusException/HttpFound.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @link https://httpstatuses.com/302
1616
*/
1717
class HttpFound extends AbstractResponseStatusException {
18-
protected function getHttpCode():int {
18+
public function getHttpCode():int {
1919
return StatusCode::FOUND;
2020
}
2121
}

src/ResponseStatusException/HttpGatewayTimeout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @link https://httpstatuses.com/504
1010
*/
1111
class HttpGatewayTimeout extends AbstractResponseStatusException {
12-
protected function getHttpCode():int {
12+
public function getHttpCode():int {
1313
return StatusCode::GATEWAY_TIMEOUT;
1414
}
1515
}

src/ResponseStatusException/HttpGone.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Gt\Http\StatusCode;
55

66
class HttpGone extends AbstractResponseStatusException {
7-
protected function getHttpCode():int {
7+
public function getHttpCode():int {
88
return StatusCode::GONE;
99
}
1010
}

0 commit comments

Comments
 (0)