Skip to content

Commit 39f70c7

Browse files
authored
Merge pull request #41 from SMillerDev/http/statuscodes
Http/statuscodes
2 parents f759492 + fd650ea commit 39f70c7

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ language: php
22
php:
33
- '5.6'
44
- '7.0'
5+
- '7.1'
6+
- '7.2'
7+
- nightly
58
before_script:
69
- composer -n install
7-
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then pecl install runkit; fi
10+
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then pecl install runkit; else pecl install uopz; fi
811
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then echo "runkit.internal_override=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
9-
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then pecl install uopz; fi
1012
- export PATH=$PATH:$PWD
1113
script: vendor/bin/phpunit --configuration tests/phpunit.xml
1214
before_deploy:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": "5.6.* || 7.*",
2020
"ql/uri-template": "1.*",
2121
"michelf/php-markdown": "1.*",
22-
"enjoy/http-status-code": "master-dev"
22+
"lukasoppermann/http-status": "^1.0@dev"
2323
},
2424
"require-dev": {
2525
"phpunit/phpunit": "5.7.*",

src/PHPDraft/Out/HTML/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ use Enjoy\HttpStatusCode\Statuscodes;
231231
data-toggle="collapse"
232232
data-target="#request-coll--<?= $transition->get_href() . '-' . $response->statuscode; ?>">
233233
Response <var
234-
class="<?= $this->get_response_status($response->statuscode) ?>"><?= StatusCodes::getMessageForCode($response->statuscode)?></var>
234+
class="<?= $this->get_response_status($response->statuscode) ?>"><?= $response->statuscode." ".$this->http_status->getReasonPhrase($response->statuscode)?></var>
235235
<span
236236
class="glyphicon
237237
indicator

src/PHPDraft/Out/HTML/material.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ use Enjoy\HttpStatusCode\Statuscodes;
9898
<?php foreach ($transition->responses as $key => $response): ?>
9999
<a href="#<?= $transition->get_href() . '-' . $response->statuscode; ?>-panel"
100100
class="mdl-tabs__tab <?= $this->get_response_status($response->statuscode) ?>"
101-
title="<?= StatusCodes::getMessageForCode($response->statuscode)?>"><?= $response->statuscode; ?></a>
101+
title="<?= $response->statuscode." ".$this->http_status->getReasonPhrase($response->statuscode)?>"><?= $response->statuscode; ?></a>
102102
<?php endforeach;?>
103103
<?php endif;?>
104104
</div>

src/PHPDraft/Out/TemplateGenerator.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace PHPDraft\Out;
1010

11+
use Lukasoppermann\Httpstatus\Httpstatus;
1112
use Michelf\MarkdownExtra;
1213
use PHPDraft\Model\Category;
1314
use PHPDraft\Model\Elements\ObjectStructureElement;
@@ -56,6 +57,12 @@ class TemplateGenerator
5657
* @var
5758
*/
5859
protected $base_data;
60+
/**
61+
* The Http Status resolver
62+
*
63+
* @var Httpstatus
64+
*/
65+
protected $http_status;
5966
/**
6067
* Structures used in all data
6168
*
@@ -73,6 +80,7 @@ public function __construct($template, $image)
7380
{
7481
$this->template = $template;
7582
$this->image = $image;
83+
$this->http_status = new Httpstatus();
7684
}
7785

7886
/**

0 commit comments

Comments
 (0)