Skip to content

Commit af7036a

Browse files
committed
docs: add functions to document methods
Functions were added to document the methods and avoid confusion. Closes #3
1 parent 01cfbb8 commit af7036a

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

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

Lines changed: 15 additions & 13 deletions
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)
@@ -62,9 +62,7 @@ git clone https://github.com/josantonius/http-status-code.git
6262

6363
### Clase HttpStatusCode
6464

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

6967
Crear una nueva instancia que defina el idioma:
7068

@@ -77,37 +75,37 @@ Crear una nueva instancia que defina el idioma:
7775
*
7876
* @throws UnsupportedLanguageException if language is not supported.
7977
*/
80-
$httpStatusCode = new HttpStatusCode(string $language = 'en');
78+
public function __construct(string $language = 'en');
8179
```
8280

8381
Obtiene el mensaje de un código de estado HTTP:
8482

8583
```php
86-
$httpStatusCode->getMessage(int $code): string|null
84+
public function getMessage(int $code): string|null;
8785
```
8886

8987
Obtiene los mensajes de todos los códigos de estado HTTP:
9088

9189
```php
92-
$httpStatusCode->getMessages(): array
90+
public function getMessages(): array;
9391
```
9492

9593
Obtiene la definición de un código de estado HTTP:
9694

9795
```php
98-
$httpStatusCode->getDefinition(int $code): string|null
96+
public function getDefinition(int $code): string|null;
9997
```
10098

10199
Obtiene las definiciones de todos los códigos de estado HTTP:
102100

103101
```php
104-
$httpStatusCode->getDefinitions(): array
102+
public function getDefinitions(): array;
105103
```
106104

107105
Obtiene mensajes y definiciones de todos los códigos de estado HTTP:
108106

109107
```php
110-
$httpStatusCode->getAll(): array
108+
public function getAll(): array;
111109
```
112110

113111
## Excepciones utilizadas
@@ -123,10 +121,14 @@ Ejemplo de uso para esta biblioteca:
123121
### Crear una nueva instancia que defina el idioma
124122

125123
```php
124+
use Josantonius\HttpStatusCode\HttpStatusCode;
125+
126126
$httpStatusCode = new HttpStatusCode(); // Obtiene los mensajes en inglés.
127127
```
128128

129129
```php
130+
use Josantonius\HttpStatusCode\HttpStatusCode;
131+
130132
$httpStatusCode = new HttpStatusCode('es'); // Obtiene los mensajes en español.
131133
```
132134

@@ -235,9 +237,9 @@ $httpStatusCode->getAll();
235237
]
236238
```
237239

238-
## List in Json format
240+
## Listado en formato JSON
239241

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

242244
## Tests
243245

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ 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
---
@@ -62,9 +62,7 @@ git clone https://github.com/josantonius/http-status-code.git
6262

6363
### HttpStatusCode Class
6464

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

6967
Create a new instance defining the language:
7068

@@ -77,37 +75,37 @@ Create a new instance defining the language:
7775
*
7876
* @throws UnsupportedLanguageException if language is not supported.
7977
*/
80-
$httpStatusCode = new HttpStatusCode(string $language = 'en');
78+
public function __construct(string $language = 'en');
8179
```
8280

8381
Gets message of an HTTP status code:
8482

8583
```php
86-
$httpStatusCode->getMessage(int $code): string|null
84+
public function getMessage(int $code): string|null;
8785
```
8886

8987
Gets the messages of all HTTP status codes:
9088

9189
```php
92-
$httpStatusCode->getMessages(): array
90+
public function getMessages(): array;
9391
```
9492

9593
Gets definition of an HTTP status code:
9694

9795
```php
98-
$httpStatusCode->getDefinition(int $code): string|null
96+
public function getDefinition(int $code): string|null;
9997
```
10098

10199
Gets the definitions of all HTTP status codes:
102100

103101
```php
104-
$httpStatusCode->getDefinitions(): array
102+
public function getDefinitions(): array;
105103
```
106104

107105
Gets messages and definitions of all HTTP status codes:
108106

109107
```php
110-
$httpStatusCode->getAll(): array
108+
public function getAll(): array;
111109
```
112110

113111
## Exceptions Used
@@ -129,6 +127,8 @@ $httpStatusCode = new HttpStatusCode(); // Gets the messages in English.
129127
```
130128

131129
```php
130+
use Josantonius\HttpStatusCode\HttpStatusCode;
131+
132132
$httpStatusCode = new HttpStatusCode('es'); // Gets the messages in Spanish.
133133
```
134134

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy