Skip to content

Commit 398aa32

Browse files
committed
docs: add functions to document methods
Functions were added to document the methods and avoid confusion. Closes #5
1 parent 215fd6d commit 398aa32

File tree

2 files changed

+37
-62
lines changed

2 files changed

+37
-62
lines changed

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

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ Para manejar excepciones puedes utilizar la biblioteca
1818

1919
---
2020

21-
- [Instalación](#instalación)
2221
- [Requisitos](#requisitos)
23-
- [Cómo empezar](#cómo-empezar)
22+
- [Instalación](#instalación)
2423
- [Clases disponibles](#clases-disponibles)
2524
- [Clase ErrorHandler](#clase-errorhandler)
2625
- [Clase ErrorHandled](#clase-errorhandled)
@@ -67,79 +66,71 @@ git clone https://github.com/josantonius/php-error-handler.git
6766

6867
### Clase ErrorException
6968

70-
```php
71-
/**
72-
* Esta clase es una extensión de ErrorException.
73-
*
74-
* @see https://www.php.net/manual/en/class.errorexception.php
75-
*/
76-
use Josantonius\ErrorHandler\ErrorException;
77-
```
69+
`Josantonius\ErrorHandler\ErrorException` Extends
70+
[ErrorException](https://www.php.net/manual/en/class.errorexception.php)
7871

7972
Obtener el archivo donde se produjo el error:
8073

8174
```php
82-
$errorHandled->getFile(): string
75+
public function getFile(): string;
8376
```
8477

8578
Obtener el nivel del error:
8679

8780
```php
88-
$errorHandled->getLevel(): int
81+
public function getLevel(): int;
8982
```
9083

9184
Obtener el la línea donde se produjo el error:
9285

9386
```php
94-
$errorHandled->getLine(): int
87+
public function getLine(): int;
9588
```
9689

9790
Obtener el mensaje del error:
9891

9992
```php
100-
$errorHandled->getMessage(): string
93+
public function getMessage(): string;
10194
```
10295

10396
Obtener el nombre del error:
10497

10598
```php
106-
$errorHandled->getName(): string
99+
public function getName(): string;
107100
```
108101

109102
### Clase ErrorHandled
110103

111-
```php
112-
use Josantonius\ErrorHandler\ErrorHandled;
113-
```
104+
`Josantonius\ErrorHandler\ErrorHandled`
114105

115106
Obtener el archivo donde se produjo el error:
116107

117108
```php
118-
$errorHandled->getFile(): string
109+
public function getFile(): string;
119110
```
120111

121112
Obtener el nivel del error:
122113

123114
```php
124-
$errorHandled->getLevel(): int
115+
public function getLevel(): int;
125116
```
126117

127118
Obtener el la línea donde se produjo el error:
128119

129120
```php
130-
$errorHandled->getLine(): int
121+
public function getLine(): int;
131122
```
132123

133124
Obtener el mensaje del error:
134125

135126
```php
136-
$errorHandled->getMessage(): string
127+
public function getMessage(): string;
137128
```
138129

139130
Obtener el nombre del error:
140131

141132
```php
142-
$errorHandled->getName(): string
133+
public function getName(): string;
143134
```
144135

145136
### Clase ErrorHandler
@@ -156,7 +147,7 @@ Convertir errores en excepciones:
156147
*
157148
* @see https://www.php.net/manual/en/errorfunc.constants.php para ver los niveles disponibles.
158149
*/
159-
$errorHandler->convertToExceptions(int ...$errorLevel): ErrorHandler
150+
public function convertToExceptions(int ...$errorLevel): ErrorHandler;
160151
```
161152

162153
Convertir errores en excepciones excepto algunos:
@@ -171,7 +162,7 @@ Convertir errores en excepciones excepto algunos:
171162
*
172163
* @see https://www.php.net/manual/en/errorfunc.constants.php para ver los niveles disponibles.
173164
*/
174-
$errorHandler->convertToExceptionsExcept(int ...$errorLevel): ErrorHandler
165+
public function convertToExceptionsExcept(int ...$errorLevel): ErrorHandler;
175166
```
176167

177168
Registrar función para manejar errores:
@@ -182,7 +173,7 @@ Registrar función para manejar errores:
182173
*
183174
* @see https://www.php.net/manual/en/functions.first_class_callable_syntax.php
184175
*/
185-
$errorHandler->register(callable $callback): ErrorHandler
176+
public function register(callable $callback): ErrorHandler;
186177
```
187178

188179
Utilizar los informes de errores para determinar qué errores se gestionan:
@@ -195,7 +186,7 @@ Utilizar los informes de errores para determinar qué errores se gestionan:
195186
*
196187
* @see https://www.php.net/manual/en/function.error-reporting.php
197188
*/
198-
$errorHandler->useErrorReportingLevel(): ErrorHandler
189+
public function useErrorReportingLevel(): ErrorHandler;
199190
```
200191

201192
## Excepciones utilizadas

README.md

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To handle exceptions you can use the
3030
- [TODO](#todo)
3131
- [Changelog](#changelog)
3232
- [Contribution](#contribution)
33-
- [Sponsor](#Sponsor)
33+
- [Sponsor](#sponsor)
3434
- [License](#license)
3535

3636
---
@@ -66,92 +66,76 @@ git clone https://github.com/josantonius/php-error-handler.git
6666

6767
### ErrorException Class
6868

69-
```php
70-
/**
71-
* This class extends from ErrorException.
72-
*
73-
* @see https://www.php.net/manual/en/class.errorexception.php
74-
*/
75-
use Josantonius\ErrorHandler\ErrorException;
76-
```
69+
`Josantonius\ErrorHandler\ErrorException` Extends
70+
[ErrorException](https://www.php.net/manual/en/class.errorexception.php)
7771

7872
Gets error file:
7973

8074
```php
81-
$errorHandler->getFile(): string
75+
public function getFile(): string;
8276
```
8377

8478
Gets error level:
8579

8680
```php
87-
$errorHandler->getLevel(): int
81+
public function getLevel(): int;
8882
```
8983

9084
Gets error file line:
9185

9286
```php
93-
$errorHandler->getLine(): int
87+
public function getLine(): int;
9488
```
9589

9690
Gets error message:
9791

9892
```php
99-
$errorHandler->getMessage(): string
93+
public function getMessage(): string;
10094
```
10195

10296
Gets error name:
10397

10498
```php
105-
$errorHandler->getName(): string
99+
public function getName(): string;
106100
```
107101

108102
### ErrorHandled Class
109103

110-
```php
111-
use Josantonius\ErrorHandler\ErrorHandled;
112-
```
104+
`Josantonius\ErrorHandler\ErrorHandled`
113105

114106
Gets error file:
115107

116108
```php
117-
$errorHandled->getFile(): string
109+
public function getFile(): string;
118110
```
119111

120112
Gets error level:
121113

122114
```php
123-
$errorHandled->getLevel(): int
115+
public function getLevel(): int;
124116
```
125117

126118
Gets error file line:
127119

128120
```php
129-
$errorHandled->getLine(): int
121+
public function getLine(): int;
130122
```
131123

132124
Gets error message:
133125

134126
```php
135-
$errorHandled->getMessage(): string
127+
public function getMessage(): string;
136128
```
137129

138130
Gets error name:
139131

140132
```php
141-
$errorHandled->getName(): string
133+
public function getName(): string;
142134
```
143135

144136
### ErrorHandler Class
145137

146-
```php
147-
use Josantonius\ErrorHandler\ErrorHandler;
148-
```
149-
150-
Create object:
151-
152-
```php
153-
$errorHandler = new ErrorHandler();
154-
```
138+
`Josantonius\ErrorHandler\ErrorHandler`
155139

156140
Convert errors to exceptions:
157141

@@ -165,7 +149,7 @@ Convert errors to exceptions:
165149
*
166150
* @see https://www.php.net/manual/en/errorfunc.constants.php to view available error levels.
167151
*/
168-
$errorHandler->convertToExceptions(int ...$errorLevel): ErrorHandler
152+
public function convertToExceptions(int ...$errorLevel): ErrorHandler;
169153
```
170154

171155
Convert errors to exceptions except for some of them:
@@ -180,7 +164,7 @@ Convert errors to exceptions except for some of them:
180164
*
181165
* @see https://www.php.net/manual/en/errorfunc.constants.php to view available error levels.
182166
*/
183-
$errorHandler->convertToExceptionsExcept(int ...$errorLevel): ErrorHandler
167+
public function convertToExceptionsExcept(int ...$errorLevel): ErrorHandler;
184168
```
185169

186170
Register error handler function:
@@ -191,7 +175,7 @@ Register error handler function:
191175
*
192176
* @see https://www.php.net/manual/en/functions.first_class_callable_syntax.php
193177
*/
194-
$errorHandler->register(callable $callback): ErrorHandler
178+
public function register(callable $callback): ErrorHandler;
195179
```
196180

197181
Use error reporting to determine which errors are handled:
@@ -204,7 +188,7 @@ Use error reporting to determine which errors are handled:
204188
*
205189
* @see https://www.php.net/manual/en/function.error-reporting.php
206190
*/
207-
$errorHandler->useErrorReportingLevel(): ErrorHandler
191+
public function useErrorReportingLevel(): ErrorHandler;
208192
```
209193

210194
## Exceptions Used

0 commit comments

Comments
 (0)