Skip to content

Commit 1ea7ddf

Browse files
committed
Updated to 1.1.6 version
1 parent c29b314 commit 1ea7ddf

File tree

8 files changed

+61
-67
lines changed

8 files changed

+61
-67
lines changed

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ phpmd.xml export-ignore
88
.travis.yml export-ignore
99
.editorconfig export-ignore
1010
.gitattributes export-ignore
11-
.gitignore export-ignore
11+
.gitignore export-ignore
12+
.php_cs.dist export-ignore
13+
CONDUCT.md export-ignore

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## 1.1.6 - 2018-01-06
4+
5+
* The tests were fixed.
6+
7+
* Changes in documentation.
8+
39
## 1.1.5 - 2017-11-08
410

511
* Implemented `PHP Mess Detector` to detect inconsistencies in code styles.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22
=====================
33

4-
Copyright (c) `2016 - 2017` `Josantonius, https://josantonius.com <hello@josantonius.com>`
4+
Copyright (c) `2016 - 2018` `Josantonius, https://josantonius.com <hello@josantonius.com>`
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy of
77
this software and associated documentation files (the "Software"), to deal in

README-ES.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ Ejecutar todas las pruebas anteriores:
186186

187187
## ☑ Tareas pendientes
188188

189-
- [ ] Añadir nueva funcionalidad
190-
- [ ] Mejorar pruebas
191-
- [ ] Mejorar documentación
192-
- [ ] Refactorizar código
189+
- [ ] Añadir nueva funcionalidad.
190+
- [ ] Mejorar pruebas.
191+
- [ ] Mejorar documentación.
192+
- [ ] Refactorizar código para las reglas de estilo de código deshabilitadas. Ver [phpmd.xml](phpmd.xml) y [.php_cs.dist](.php_cs.dist).
193193

194194
## Contribuir
195195

@@ -216,7 +216,7 @@ Este proyecto está licenciado bajo **licencia MIT**. Consulta el archivo [LICEN
216216

217217
## Copyright
218218

219-
2017 Josantonius, [josantonius.com](https://josantonius.com/)
219+
2016 - 2018 Josantonius, [josantonius.com](https://josantonius.com/)
220220

221221
Si te ha resultado útil, házmelo saber :wink:
222222

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ Run all previous tests:
185185

186186
## ☑ TODO
187187

188-
- [ ] Add new feature
189-
- [ ] Improve tests
190-
- [ ] Improve documentation
191-
- [ ] Refactor code
188+
- [ ] Add new feature.
189+
- [ ] Improve tests.
190+
- [ ] Improve documentation.
191+
- [ ] Refactor code for disabled code style rules. See [phpmd.xml](phpmd.xml) and [.php_cs.dist](.php_cs.dist).
192192

193193
## Contribute
194194

@@ -215,7 +215,7 @@ This project is licensed under **MIT license**. See the [LICENSE](LICENSE) file
215215

216216
## Copyright
217217

218-
2017 Josantonius, [josantonius.com](https://josantonius.com/)
218+
2016 - 2018 Josantonius, [josantonius.com](https://josantonius.com/)
219219

220220
If you find it useful, let me know :wink:
221221

src/HTTPStatusCode.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* PHP library to get the meaning from HTTP response status codes.
44
*
55
* @author Josantonius <hello@josantonius.com>
6-
* @copyright 2016 - 2017 (c) Josantonius - PHP-HTTPStatusCode
6+
* @copyright 2016 - 2018 (c) Josantonius - PHP-HTTPStatusCode
77
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
88
* @link https://github.com/Josantonius/PHP-HTTPStatusCode
99
* @since 1.0.0
@@ -12,30 +12,24 @@
1212

1313
/**
1414
* HTTP response status codes handler.
15-
*
16-
* @since 1.0.0
1715
*/
1816
class HTTPStatusCode
1917
{
2018
/**
2119
* Default language to display notices.
2220
*
23-
* @since 1.0.0
24-
*
2521
* @var string
2622
*/
2723
public static $lang;
2824

2925
/**
3026
* Get meaning from an HTTP response code.
3127
*
32-
* @since 1.0.0
33-
*
3428
* @param int $code → 100 - 511 → HTTP response code
3529
* @param string $code → '1xx' - '5xx' → code general type definition
3630
* @param string $lang → language for definition
37-
* @param string $size → 'short' → short definition
38-
* 'large' → large definition
31+
* @param string $size → 'short' → short definition
32+
* 'large' → large definition
3933
*
4034
* @return string|false → HTTP status code definition
4135
*/
@@ -47,8 +41,6 @@ public static function get($code, $lang = 'en', $size = 'short')
4741
/**
4842
* Get all meanings in a array.
4943
*
50-
* @since 1.0.0
51-
*
5244
* @param string $lang → language
5345
*
5446
* @return array|false → all definitions of HTTP response codes

src/HTTPStatusCodeCollection.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* PHP library to get the meaning from HTTP response status codes.
44
*
55
* @author Josantonius <hello@josantonius.com>
6-
* @copyright 2016 - 2017 (c) Josantonius - PHP-HTTPStatusCode
6+
* @copyright 2016 - 2018 (c) Josantonius - PHP-HTTPStatusCode
77
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
88
* @link https://github.com/Josantonius/PHP-HTTPStatusCode
99
* @since 1.1.4
@@ -14,16 +14,12 @@
1414
* HTTP status code handler.
1515
*
1616
* Compiled from http://wikipedia.org/wiki/List_of_HTTP_status_codes
17-
*
18-
* @since 1.1.4
1917
*/
2018
class HTTPStatusCodeCollection
2119
{
2220
/**
2321
* HTTP status code list.
2422
*
25-
* @since 1.1.4
26-
*
2723
* @var array
2824
*/
2925
protected static $data = [
@@ -573,8 +569,6 @@ class HTTPStatusCodeCollection
573569
/**
574570
* Returns all HTTP status codes.
575571
*
576-
* @since 1.1.4
577-
*
578572
* @param string $lang → language for definitions
579573
*
580574
* @return array|null
@@ -587,8 +581,6 @@ public static function all($lang)
587581
/**
588582
* Returns HTTP status definition by code.
589583
*
590-
* @since 1.1.4
591-
*
592584
* @param int $code → 100 - 511 → code definition
593585
* @param string $code → '1xx' - '5xx' → code general type definition
594586
* @param string $lang → language for definition

tests/HTTPStatusCodeTest.php

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* PHP library to get the meaning from HTTP response status codes.
44
*
55
* @author Josantonius <hello@josantonius.com>
6-
* @copyright 2016 - 2017 (c) Josantonius - PHP-HTTPStatusCode
6+
* @copyright 2016 - 2018 (c) Josantonius - PHP-HTTPStatusCode
77
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
88
* @link https://github.com/Josantonius/PHP-HTTPStatusCode
99
* @since 1.1.3
@@ -14,8 +14,6 @@
1414

1515
/**
1616
* Tests class for HTTPStatusCode library.
17-
*
18-
* @since 1.1.3
1917
*/
2018
class HTTPStatusCodeTest extends TestCase
2119
{
@@ -47,135 +45,139 @@ public function setUp()
4745
*/
4846
public function testIsInstanceOfHTTPStatusCode()
4947
{
50-
$actual = $this->HTTPStatusCode;
51-
$this->assertInstanceOf('Josantonius\HTTPStatusCode\HTTPStatusCode', $actual);
48+
$httpStatusCode = $this->HTTPStatusCode;
49+
50+
$this->assertInstanceOf(
51+
'Josantonius\HTTPStatusCode\HTTPStatusCode',
52+
$this->HTTPStatusCode
53+
);
5254
}
5355

5456
/**
5557
* Get the short english meaning of an HTTP response code.
56-
*
57-
* @since 1.1.3
5858
*/
5959
public function testGetEN()
6060
{
61+
$httpStatusCode = $this->HTTPStatusCode;
62+
6163
$this->assertContains(
6264
'OK',
63-
$this->HTTPStatusCode->get(200)
65+
$httpStatusCode::get(200)
6466
);
6567
}
6668

6769
/**
6870
* Get the short spanish meaning of an HTTP response code.
69-
*
70-
* @since 1.1.3
7171
*/
7272
public function testGetES()
7373
{
74+
$httpStatusCode = $this->HTTPStatusCode;
75+
7476
$this->assertContains(
7577
'OK',
76-
$this->HTTPStatusCode->get(200, 'es')
78+
$httpStatusCode::get(200, 'es')
7779
);
7880
}
7981

8082
/**
8183
* Get the detailed english meaning of an HTTP response code.
82-
*
83-
* @since 1.1.3
8484
*/
8585
public function testGetLargeEN()
8686
{
87+
$httpStatusCode = $this->HTTPStatusCode;
88+
8789
$this->assertContains(
8890
'Standard response for successful HTTP requests',
89-
$this->HTTPStatusCode->get(200, 'en', 'large')
91+
$httpStatusCode::get(200, 'en', 'large')
9092
);
9193
}
9294

9395
/**
9496
* Get the detailed spanish meaning of an HTTP response code.
95-
*
96-
* @since 1.1.3
9797
*/
9898
public function testGetLargeES()
9999
{
100+
$httpStatusCode = $this->HTTPStatusCode;
101+
100102
$this->assertContains(
101103
'Respuesta estándar para peticiones correctas',
102-
$this->HTTPStatusCode->get(200, 'es', 'large')
104+
$httpStatusCode::get(200, 'es', 'large')
103105
);
104106
}
105107

106108
/**
107109
* Get the detailed english meaning of an HTTP response code.
108-
*
109-
* @since 1.1.3
110110
*/
111111
public function testGetShortEN()
112112
{
113+
$httpStatusCode = $this->HTTPStatusCode;
114+
113115
$this->assertContains(
114116
'OK',
115-
$this->HTTPStatusCode->get(200, 'en', 'short')
117+
$httpStatusCode::get(200, 'en', 'short')
116118
);
117119
}
118120

119121
/**
120122
* Get the short spanish meaning of an HTTP response code.
121-
*
122-
* @since 1.1.3
123123
*/
124124
public function testGetShortES()
125125
{
126+
$httpStatusCode = $this->HTTPStatusCode;
127+
126128
$this->assertContains(
127129
'OK',
128-
$this->HTTPStatusCode->get(200, 'es', 'short')
130+
$httpStatusCode::get(200, 'es', 'short')
129131
);
130132
}
131133

132134
/**
133135
* Get english meaning from an undefined HTTP response code.
134-
*
135-
* @since 1.1.3
136136
*/
137137
public function testGetUndefinedEN()
138138
{
139+
$httpStatusCode = $this->HTTPStatusCode;
140+
139141
$this->assertFalse(
140-
$this->HTTPStatusCode->get(800)
142+
$httpStatusCode::get(800)
141143
);
142144
}
143145

144146
/**
145147
* Get spanish meaning from an undefined HTTP response code.
146-
*
147-
* @since 1.1.3
148148
*/
149149
public function testGetUndefinedES()
150150
{
151+
$httpStatusCode = $this->HTTPStatusCode;
152+
151153
$this->assertFalse(
152-
$this->HTTPStatusCode->get(800, 'es')
154+
$httpStatusCode::get(800, 'es')
153155
);
154156
}
155157

156158
/**
157159
* Get a english HTTP response code array.
158-
*
159-
* @since 1.1.3
160160
*/
161161
public function testGetAllEN()
162162
{
163+
$httpStatusCode = $this->HTTPStatusCode;
164+
163165
$this->assertInternalType(
164166
'array',
165-
$this->HTTPStatusCode->getAll()
167+
$httpStatusCode::getAll()
166168
);
167169
}
168170

169171
/**
170172
* Get a spanish HTTP response code array.
171-
*
172-
* @since 1.1.3
173173
*/
174174
public function testGetAllES()
175175
{
176+
$httpStatusCode = $this->HTTPStatusCode;
177+
176178
$this->assertInternalType(
177179
'array',
178-
$this->HTTPStatusCode->getAll('es')
180+
$httpStatusCode::getAll('es')
179181
);
180182
}
181183
}

0 commit comments

Comments
 (0)