Skip to content

Commit 74e4e7a

Browse files
committed
Updated to 1.1.2 version
1 parent bb390b3 commit 74e4e7a

7 files changed

+42
-68
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/tests export-ignore
2-
/src/Exception export-ignore
32
.gitattributes export-ignore
43
.gitignore export-ignore
54
CHANGELOG.md export-ignore

CHANGELOG.md

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

3+
## 1.1.2 - 2017-07-16
4+
* Deleted `Josantonius\HTTPStatusCode\Exception\HTTPStatusCodeException` class.
5+
* Deleted `Josantonius\HTTPStatusCode\Exception\Exceptions` abstract class.
6+
* Deleted `Josantonius\HTTPStatusCode\Exception\HTTPStatusCodeException->__construct()` method.
7+
38
## 1.1.1 - 2017-03-18
49
* Some files were excluded from download and comments and readme files were updated.
510

README-ES.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,23 @@ Librería PHP para obtener significado de códigos de estado de respuesta HTTP.
1414
- [Métodos disponibles](#métodos-disponibles)
1515
- [Uso](#uso)
1616
- [Tests](#tests)
17-
- [Manejador de excepciones](#manejador-de-excepciones)
1817
- [Contribuir](#contribuir)
1918
- [Repositorio](#repositorio)
2019
- [Licencia](#licencia)
2120
- [Copyright](#copyright)
2221

2322
---
2423

24+
<p align="center"><strong>Echa un vistazo al código</strong></p>
25+
26+
<p align="center">
27+
<a href="" title="Echa un vistazo al código">
28+
<img src="https://raw.githubusercontent.com/Josantonius/PHP-Algorithm/master/resources/youtube-thumbnail.jpg">
29+
</a>
30+
</p>
31+
32+
---
33+
2534
### Instalación
2635

2736
La mejor forma de instalar esta extensión es a través de [composer](http://getcomposer.org/download/).
@@ -40,7 +49,7 @@ También puedes clonar el repositorio completo con Git:
4049

4150
### Requisitos
4251

43-
Esta ĺibrería es soportada por versiones de PHP 5.6 o superiores y es compatible con versiones de HHVM 3.0 o superiores.
52+
Esta biblioteca es soportada por versiones de PHP 5.6 o superiores y es compatible con versiones de HHVM 3.0 o superiores.
4453

4554
### Cómo empezar y ejemplos
4655

@@ -156,9 +165,6 @@ HTTPStatusCodeTest::testGetAllEN();
156165
HTTPStatusCodeTest::testGetAllES();
157166
```
158167

159-
### Manejador de excepciones
160-
161-
Esta librería utiliza [control de excepciones](src/Exception) que puedes personalizar a tu gusto.
162168
### Contribuir
163169
1. Comprobar si hay incidencias abiertas o abrir una nueva para iniciar una discusión en torno a un fallo o función.
164170
1. Bifurca la rama del repositorio en GitHub para iniciar la operación de ajuste.

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,23 @@ PHP library to get the meaning from HTTP response status codes.
1414
- [Available Methods](#available-methods)
1515
- [Usage](#usage)
1616
- [Tests](#tests)
17-
- [Exception Handler](#exception-handler)
1817
- [Contribute](#contribute)
1918
- [Repository](#repository)
20-
- [Licensing](#licensing)
19+
- [License](#license)
2120
- [Copyright](#copyright)
2221

2322
---
2423

24+
<p align="center"><strong>Take a look at the code</strong></p>
25+
26+
<p align="center">
27+
<a href="" title="Take a look at the code">
28+
<img src="https://raw.githubusercontent.com/Josantonius/PHP-Algorithm/master/resources/youtube-thumbnail.jpg">
29+
</a>
30+
</p>
31+
32+
---
33+
2534
### Installation
2635

2736
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
@@ -156,9 +165,6 @@ HTTPStatusCodeTest::testGetAllEN();
156165
HTTPStatusCodeTest::testGetAllES();
157166
```
158167

159-
### Exception Handler
160-
161-
This library uses [exception handler](src/Exception) that you can customize.
162168
### Contribute
163169
1. Check for open issues or open a new issue to start a discussion around a bug or feature.
164170
1. Fork the repository on GitHub to start making your changes.
@@ -172,7 +178,7 @@ This is intended for large and long-lived objects.
172178

173179
All files in this repository were created and uploaded automatically with [Reposgit Creator](https://github.com/Josantonius/BASH-Reposgit).
174180

175-
### Licensing
181+
### License
176182

177183
This project is licensed under **MIT license**. See the [LICENSE](LICENSE) file for more info.
178184

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "josantonius/httpstatuscode",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"type": "library",
55
"description": "PHP library to get the meaning from HTTP response status codes.",
66
"keywords": [

src/Exception/HTTPStatusCodeException.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/HTTPStatusCode.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Josantonius\HTTPStatusCode;
1313

14-
# use Josantonius\HTTPStatusCode\Exception\HTTPStatusCodeException;
15-
1614
/**
1715
* HTTP response status codes handler.
1816
*
@@ -49,27 +47,27 @@ class HTTPStatusCode {
4947
*/
5048
protected static function load($lang = 'en') {
5149

52-
if ($lang != static::$lang) {
50+
if ($lang != self::$lang) {
5351

54-
static::$status = null;
52+
self::$status = null;
5553

56-
static::$lang = $lang;
54+
self::$lang = $lang;
5755
}
5856

59-
if (is_null(static::$status)) {
57+
if (is_null(self::$status)) {
6058

61-
$filepath = __DIR__ . "/resources/http-status-code.jsond";
59+
$filepath = __DIR__ . '/resources/http-status-code.jsond';
6260

6361
$jsonFile = file_get_contents($filepath);
6462

6563
$status = json_decode($jsonFile, true);
6664

67-
static::$status = $status['data'][$lang];
65+
self::$status = $status['data'][$lang];
6866

6967
unset($status);
7068
}
7169

72-
return static::$status;
70+
return self::$status;
7371
}
7472

7573
/**
@@ -78,18 +76,18 @@ protected static function load($lang = 'en') {
7876
* @since 1.0.0
7977
*
8078
* @param int $code → 100 - 511 → HTTP status code definition
81-
* @param string $code → "1xx" - "5xx" → HTTP status code general type definition
79+
* @param string $code → '1xx' - '5xx' → HTTP status code general type definition
8280
* @param string $lang → language for definition
83-
* @param string $size → "short" → short definition
84-
* "large" → large definition
81+
* @param string $size → 'short' → short definition
82+
* 'large' → large definition
8583
*
8684
* @return string → HTTP status code definition
8785
*/
8886
public static function get($code, $lang = 'en', $size = 'short') {
8987

90-
static::load($lang);
88+
self::load($lang);
9189

92-
$result = (isset(static::$status[$code][$size])) ? static::$status[$code][$size] : "Undefined";
90+
$result = (isset(self::$status[$code][$size])) ? self::$status[$code][$size] : 'Undefined';
9391

9492
return $result;
9593
}
@@ -105,6 +103,6 @@ public static function get($code, $lang = 'en', $size = 'short') {
105103
*/
106104
public static function getAll($lang = 'en') {
107105

108-
return static::load($lang);
106+
return self::load($lang);
109107
}
110108
}

0 commit comments

Comments
 (0)