Skip to content

Commit e1b4bc7

Browse files
authored
Merge pull request #4 from josantonius/release/v2.0.4
Release/v2.0.4
2 parents 6b46ec3 + e73e8b0 commit e1b4bc7

File tree

9 files changed

+90
-67
lines changed

9 files changed

+90
-67
lines changed

.github/lang/es-ES/README.md

+18-14
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Biblioteca de PHP para obtener mensajes y definiciones de códigos de estado HTT
1717

1818
- [Requisitos](#requisitos)
1919
- [Instalación](#instalación)
20-
- [Available Classes](#available-classes)
20+
- [Clases disponibles](#clases-disponibles)
2121
- [Clase HttpStatusCode](#clase-httpstatuscode)
2222
- [Excepciones utilizadas](#excepciones-utilizadas)
2323
- [Uso](#uso)
2424
- [Listado en formato JSON](#listado-en-formato-json)
2525
- [Tests](#tests)
26-
- [Tareas pendientes](#-tareas-pendientes)
26+
- [Tareas pendientes](#tareas-pendientes)
2727
- [Registro de Cambios](#registro-de-cambios)
2828
- [Contribuir](#contribuir)
2929
- [Patrocinar](#patrocinar)
@@ -33,7 +33,9 @@ Biblioteca de PHP para obtener mensajes y definiciones de códigos de estado HTT
3333

3434
## Requisitos
3535

36-
Esta biblioteca es compatible con las versiones de PHP: 8.0 | 8.1.
36+
- Sistema operativo: Linux | Windows.
37+
38+
- Versiones de PHP: 8.0 | 8.1 | 8.2.
3739

3840
## Instalación
3941

@@ -62,9 +64,7 @@ git clone https://github.com/josantonius/http-status-code.git
6264

6365
### Clase HttpStatusCode
6466

65-
```php
66-
use Josantonius\HttpStatusCode\HttpStatusCode;
67-
```
67+
`Josantonius\HttpStatusCode\HttpStatusCode`
6868

6969
Crear una nueva instancia que defina el idioma:
7070

@@ -77,37 +77,37 @@ Crear una nueva instancia que defina el idioma:
7777
*
7878
* @throws UnsupportedLanguageException if language is not supported.
7979
*/
80-
$httpStatusCode = new HttpStatusCode(string $language = 'en');
80+
public function __construct(string $language = 'en');
8181
```
8282

8383
Obtiene el mensaje de un código de estado HTTP:
8484

8585
```php
86-
$httpStatusCode->getMessage(int $code): string|null
86+
public function getMessage(int $code): string|null;
8787
```
8888

8989
Obtiene los mensajes de todos los códigos de estado HTTP:
9090

9191
```php
92-
$httpStatusCode->getMessages(): array
92+
public function getMessages(): array;
9393
```
9494

9595
Obtiene la definición de un código de estado HTTP:
9696

9797
```php
98-
$httpStatusCode->getDefinition(int $code): string|null
98+
public function getDefinition(int $code): string|null;
9999
```
100100

101101
Obtiene las definiciones de todos los códigos de estado HTTP:
102102

103103
```php
104-
$httpStatusCode->getDefinitions(): array
104+
public function getDefinitions(): array;
105105
```
106106

107107
Obtiene mensajes y definiciones de todos los códigos de estado HTTP:
108108

109109
```php
110-
$httpStatusCode->getAll(): array
110+
public function getAll(): array;
111111
```
112112

113113
## Excepciones utilizadas
@@ -123,10 +123,14 @@ Ejemplo de uso para esta biblioteca:
123123
### Crear una nueva instancia que defina el idioma
124124

125125
```php
126+
use Josantonius\HttpStatusCode\HttpStatusCode;
127+
126128
$httpStatusCode = new HttpStatusCode(); // Obtiene los mensajes en inglés.
127129
```
128130

129131
```php
132+
use Josantonius\HttpStatusCode\HttpStatusCode;
133+
130134
$httpStatusCode = new HttpStatusCode('es'); // Obtiene los mensajes en español.
131135
```
132136

@@ -235,9 +239,9 @@ $httpStatusCode->getAll();
235239
]
236240
```
237241

238-
## List in Json format
242+
## Listado en formato JSON
239243

240-
[Go to the resource](https://gist.github.com/Josantonius/b455e315bc7f790d14b136d61d9ae469).
244+
[Ir al recurso](https://gist.github.com/Josantonius/b455e315bc7f790d14b136d61d9ae469).
241245

242246
## Tests
243247

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ jobs:
4343
name: 'PHPUnit (PHP ${{ matrix.php }} - ${{ matrix.system }})'
4444
strategy:
4545
matrix:
46-
system: ['ubuntu-latest']
46+
system: ['ubuntu-latest', 'windows-latest']
4747
php:
4848
- '8.0'
4949
- '8.1'
50+
- '8.2'
5051
steps:
5152
- name: Checkout Code
5253
uses: actions/checkout@v3

CHANGELOG.md

+26-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
# CHANGELOG
22

3-
## [v2.0.3](https://github.com/josantonius/php-json/releases/tag/v2.0.3) (2022-08-11)
3+
## [v2.0.4](https://github.com/josantonius/php-http-status-code/releases/tag/v2.0.4) (2022-09-29)
4+
5+
* The notation type in the test function names has been changed from camel to snake case for readability.
6+
7+
* Functions were added to document the methods and avoid confusion.
8+
9+
* Disabled the ´CamelCaseMethodName´ rule in ´phpmd.xml´ to avoid warnings about function names in tests.
10+
11+
* The alignment of the asterisks in the comments has been fixed.
12+
13+
* Tests for Windows have been added.
14+
15+
* Tests for PHP 8.2 have been added.
16+
17+
## [v2.0.3](https://github.com/josantonius/php-http-status-code/releases/tag/v2.0.3) (2022-08-11)
418

519
* Improved documentation.
620

7-
## [v2.0.2](https://github.com/josantonius/php-json/releases/tag/v2.0.2) (2022-08-04)
21+
## [v2.0.2](https://github.com/josantonius/php-http-status-code/releases/tag/v2.0.2) (2022-08-04)
822

923
* Fix Packagist URL in `README.md` files
1024

11-
## [v2.0.1](https://github.com/josantonius/php-json/releases/tag/v2.0.1) (2022-07-31)
25+
## [v2.0.1](https://github.com/josantonius/php-http-status-code/releases/tag/v2.0.1) (2022-07-31)
1226

1327
* The links in the `CHANGELOG.md` file have been fixed.
1428

@@ -20,7 +34,7 @@
2034

2135
**Full Changelog**: <https://github.com/josantonius/php-http-status-code/compare/v2.0.0...v2.0.1>
2236

23-
## [v2.0.0](https://github.com/josantonius/php-json/releases/tag/v2.0.0) (2022-07-31)
37+
## [v2.0.0](https://github.com/josantonius/php-http-status-code/releases/tag/v2.0.0) (2022-07-31)
2438

2539
> Version 1.x is considered as deprecated and unsupported.
2640
> In this version (2.x) the library was completely restructured.
@@ -64,21 +78,21 @@
6478
* Deleted `README-ES.MD` file.
6579
* Deleted `.php_cs.dist` file.
6680

67-
## [1.1.6](https://github.com/josantonius/php-json/releases/tag/1.1.6) (2018-01-06)
81+
## [1.1.6](https://github.com/josantonius/php-http-status-code/releases/tag/1.1.6) (2018-01-06)
6882

6983
* The tests were fixed.
7084

7185
* Changes in documentation.
7286

73-
## [1.1.5](https://github.com/josantonius/php-json/releases/tag/1.1.5) (2017-11-08)
87+
## [1.1.5](https://github.com/josantonius/php-http-status-code/releases/tag/1.1.5) (2017-11-08)
7488

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

7791
* Implemented `PHP Code Beautifier and Fixer` to fixing errors automatically.
7892

7993
* Implemented `PHP Coding Standards Fixer` to organize PHP code automatically according to PSR standards.
8094

81-
## [1.1.4](https://github.com/josantonius/php-json/releases/tag/1.1.4) (2017-10-30)
95+
## [1.1.4](https://github.com/josantonius/php-http-status-code/releases/tag/1.1.4) (2017-10-30)
8296

8397
* Implemented `PSR-4 autoloader standard` from all library files.
8498

@@ -108,7 +122,7 @@
108122

109123
* Deleted `Josantonius\HTTPStatusCode\HTTPStatusCode::load()` method.
110124

111-
## [1.1.3](https://github.com/josantonius/php-json/releases/tag/1.1.3) (2017-09-13)
125+
## [1.1.3](https://github.com/josantonius/php-http-status-code/releases/tag/1.1.3) (2017-09-13)
112126

113127
* Unit tests supported by `PHPUnit` were added.
114128

@@ -138,21 +152,21 @@
138152

139153
* Added `Josantonius\HTTPStatusCode\Test\HTTPStatusCodeTest::test()` method.
140154

141-
## [1.1.2](https://github.com/josantonius/php-json/releases/tag/1.1.2) (2017-07-16)
155+
## [1.1.2](https://github.com/josantonius/php-http-status-code/releases/tag/1.1.2) (2017-07-16)
142156

143157
* Deleted `Josantonius\HTTPStatusCode\Exception\HTTPStatusCodeException` class.
144158
* Deleted `Josantonius\HTTPStatusCode\Exception\Exceptions` abstract class.
145159
* Deleted `Josantonius\HTTPStatusCode\Exception\HTTPStatusCodeException->__construct()` method.
146160

147-
## [1.1.1](https://github.com/josantonius/php-json/releases/tag/1.1.1) (2017-03-18)
161+
## [1.1.1](https://github.com/josantonius/php-http-status-code/releases/tag/1.1.1) (2017-03-18)
148162

149163
* Some files were excluded from download and comments and readme files were updated.
150164

151-
## [1.1.0](https://github.com/josantonius/php-json/releases/tag/1.1.0) (2017-01-30)
165+
## [1.1.0](https://github.com/josantonius/php-http-status-code/releases/tag/1.1.0) (2017-01-30)
152166

153167
* Compatible with PHP 5.6 or higher.
154168

155-
## [1.0.0](https://github.com/josantonius/php-json/releases/tag/1.0.0) (2016-12-19)
169+
## [1.0.0](https://github.com/josantonius/php-http-status-code/releases/tag/1.0.0) (2016-12-19)
156170

157171
* Compatible only with PHP 7.0 or higher. In the next versions, the library will be modified to make it compatible with PHP 5.6 or higher.
158172

README.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@ PHP library to get HTTP status code messages and definitions.
2626
- [TODO](#todo)
2727
- [Changelog](#changelog)
2828
- [Contribution](#contribution)
29-
- [Sponsor](#Sponsor)
29+
- [Sponsor](#sponsor)
3030
- [License](#license)
3131

3232
---
3333

3434
## Requirements
3535

36-
Esta biblioteca es compatible con las versiones de PHP: 8.0 | 8.1.
36+
- Operating System: Linux | Windows.
37+
38+
- PHP versions: 8.0 | 8.1 | 8.2.
3739

3840
## Installation
3941

@@ -62,9 +64,7 @@ git clone https://github.com/josantonius/http-status-code.git
6264

6365
### HttpStatusCode Class
6466

65-
```php
66-
use Josantonius\HttpStatusCode\HttpStatusCode;
67-
```
67+
`Josantonius\HttpStatusCode\HttpStatusCode`
6868

6969
Create a new instance defining the language:
7070

@@ -77,37 +77,37 @@ Create a new instance defining the language:
7777
*
7878
* @throws UnsupportedLanguageException if language is not supported.
7979
*/
80-
$httpStatusCode = new HttpStatusCode(string $language = 'en');
80+
public function __construct(string $language = 'en');
8181
```
8282

8383
Gets message of an HTTP status code:
8484

8585
```php
86-
$httpStatusCode->getMessage(int $code): string|null
86+
public function getMessage(int $code): string|null;
8787
```
8888

8989
Gets the messages of all HTTP status codes:
9090

9191
```php
92-
$httpStatusCode->getMessages(): array
92+
public function getMessages(): array;
9393
```
9494

9595
Gets definition of an HTTP status code:
9696

9797
```php
98-
$httpStatusCode->getDefinition(int $code): string|null
98+
public function getDefinition(int $code): string|null;
9999
```
100100

101101
Gets the definitions of all HTTP status codes:
102102

103103
```php
104-
$httpStatusCode->getDefinitions(): array
104+
public function getDefinitions(): array;
105105
```
106106

107107
Gets messages and definitions of all HTTP status codes:
108108

109109
```php
110-
$httpStatusCode->getAll(): array
110+
public function getAll(): array;
111111
```
112112

113113
## Exceptions Used
@@ -129,6 +129,8 @@ $httpStatusCode = new HttpStatusCode(); // Gets the messages in English.
129129
```
130130

131131
```php
132+
use Josantonius\HttpStatusCode\HttpStatusCode;
133+
132134
$httpStatusCode = new HttpStatusCode('es'); // Gets the messages in Spanish.
133135
```
134136

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"htmlCoverage": "vendor/bin/phpunit --coverage-html coverage",
5757
"phpcs": "vendor/bin/phpcs --standard=phpcs.xml $(find . -name '*.php');",
5858
"phpmd": "vendor/bin/phpmd src,tests text ./phpmd.xml",
59-
"phpunit": "vendor/bin/phpunit --colors=always;",
59+
"phpunit": "vendor/bin/phpunit",
6060
"tests": [
6161
"clear",
6262
"@phpmd",

phpmd.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<rule ref="rulesets/controversial.xml/Superglobals"/>
3535
<rule ref="rulesets/controversial.xml/CamelCaseClassName"/>
3636
<rule ref="rulesets/controversial.xml/CamelCasePropertyName"/>
37-
<rule ref="rulesets/controversial.xml/CamelCaseMethodName"/>
37+
<!--<rule ref="rulesets/controversial.xml/CamelCaseMethodName"/>-->
3838
<rule ref="rulesets/controversial.xml/CamelCaseParameterName"/>
3939
<rule ref="rulesets/controversial.xml/CamelCaseVariableName"/>
4040

src/Exceptions/UnsupportedLanguageException.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

33
/*
4-
* This file is part of https://github.com/josantonius/php-http-status-code repository.
5-
*
6-
* (c) Josantonius <[email protected]>
7-
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10-
*/
4+
* This file is part of https://github.com/josantonius/php-http-status-code repository.
5+
*
6+
* (c) Josantonius <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
1111

1212
namespace Josantonius\HttpStatusCode\Exceptions;
1313

src/HttpStatusCode.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
declare(strict_types=1);
44

55
/*
6-
* This file is part of https://github.com/josantonius/php-http-status-code repository.
7-
*
8-
* (c) Josantonius <[email protected]>
9-
*
10-
* For the full copyright and license information, please view the LICENSE
11-
* file that was distributed with this source code.
12-
*/
6+
* This file is part of https://github.com/josantonius/php-http-status-code repository.
7+
*
8+
* (c) Josantonius <[email protected]>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
1313

1414
namespace Josantonius\HttpStatusCode;
1515

0 commit comments

Comments
 (0)