Skip to content

Commit 05c8cf2

Browse files
committed
docs: add functions to document methods
Functions were added to document the methods and avoid confusion. Closes #20
1 parent 58e84b5 commit 05c8cf2

File tree

2 files changed

+72
-92
lines changed

2 files changed

+72
-92
lines changed

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

Lines changed: 37 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,11 @@ También puedes **clonar el repositorio** completo con Git:
5858
git clone https://github.com/josantonius/php-session.git
5959
```
6060

61-
## Métodos disponibles
61+
## Clases disponibles
6262

63-
### Session Class
63+
### Clase Session
6464

65-
```php
66-
use Josantonius\Session\Session;
67-
```
68-
69-
Create object:
70-
71-
```php
72-
$session = new Session();
73-
```
65+
`Josantonius\Session\Session`
7466

7567
Iniciar la sesión:
7668

@@ -82,13 +74,13 @@ Iniciar la sesión:
8274
*
8375
* @see https://php.net/session.configuration para ver la lista de opciones disponibles.
8476
*/
85-
$session->start(array $options = []): bool
77+
public function start(array $options = []): bool;
8678
```
8779

8880
Comprobar si la sesión fue iniciada:
8981

9082
```php
91-
$session->isStarted(): bool
83+
public function isStarted(): bool;
9284
```
9385

9486
Establecer un atributo por su nombre:
@@ -97,7 +89,7 @@ Establecer un atributo por su nombre:
9789
/**
9890
* @throws SessionNotStartedException si la sesión no está iniciada.
9991
*/
100-
$session->set(string $name, mixed $value): void
92+
public function set(string $name, mixed $value): void;
10193
```
10294

10395
Obtener un atributo por su nombre:
@@ -106,19 +98,19 @@ Obtener un atributo por su nombre:
10698
/**
10799
* Opcionalmente define un valor por defecto cuando el atributo no existe.
108100
*/
109-
$session->get(string $name, mixed $default = null): mixed
101+
public function get(string $name, mixed $default = null): mixed;
110102
```
111103

112104
Obtener todos los atributos:
113105

114106
```php
115-
$session->all(): array
107+
public function all(): array;
116108
```
117109

118110
Comprobar si un atributo existe en la sesión:
119111

120112
```php
121-
$session->has(string $name): bool
113+
public function has(string $name): bool;
122114
```
123115

124116
Establecer múltiples atributos de una vez:
@@ -129,7 +121,7 @@ Establecer múltiples atributos de una vez:
129121
*
130122
* @throws SessionNotStartedException si la sesión no está iniciada.
131123
*/
132-
$session->replace(array $data): void
124+
public function replace(array $data): void;
133125
```
134126

135127
Eliminar un atributo por su nombre y devolver su valor:
@@ -140,7 +132,7 @@ Eliminar un atributo por su nombre y devolver su valor:
140132
*
141133
* @throws SessionNotStartedException si la sesión no está iniciada.
142134
*/
143-
$session->pull(string $name, mixed $default = null): mixed
135+
public function pull(string $name, mixed $default = null): mixed;
144136
```
145137

146138
Eliminar un atributo por su nombre:
@@ -149,7 +141,7 @@ Eliminar un atributo por su nombre:
149141
/**
150142
* @throws SessionNotStartedException si la sesión no está iniciada.
151143
*/
152-
$session->remove(string $name): void
144+
public function remove(string $name): void;
153145
```
154146

155147
Liberar todas las variables de la sesión:
@@ -158,13 +150,13 @@ Liberar todas las variables de la sesión:
158150
/**
159151
* @throws SessionNotStartedException si la sesión no está iniciada.
160152
*/
161-
$session->clear(): void
153+
public function clear(): void;
162154
```
163155

164156
Obtiene el ID de la sesión:
165157

166158
```php
167-
$session->getId(): string
159+
public function getId(): string;
168160
```
169161

170162
Establecer el ID de la sesión:
@@ -173,7 +165,7 @@ Establecer el ID de la sesión:
173165
/**
174166
* @throws SessionStartedException si la sesión ya está iniciada.
175167
*/
176-
$session->setId(string $sessionId): void
168+
public function setId(string $sessionId): void;
177169
```
178170

179171
Actualizar el ID de la sesión actual con uno recién generado:
@@ -182,13 +174,13 @@ Actualizar el ID de la sesión actual con uno recién generado:
182174
/**
183175
* @throws SessionNotStartedException si la sesión no está iniciada.
184176
*/
185-
$session->regenerateId(bool $deleteOldSession = false): bool
177+
public function regenerateId(bool $deleteOldSession = false): bool;
186178
```
187179

188180
Obtener el nombre de la sesión:
189181

190182
```php
191-
$session->getName(): string
183+
public function getName(): string;
192184
```
193185

194186
Establecer el nombre de la sesión:
@@ -197,7 +189,7 @@ Establecer el nombre de la sesión:
197189
/**
198190
* @throws SessionStartedException si la sesión ya está iniciada.
199191
*/
200-
$session->setName(string $name): void
192+
public function setName(string $name): void;
201193
```
202194

203195
Eliminar la sesión:
@@ -206,14 +198,12 @@ Eliminar la sesión:
206198
/**
207199
* @throws SessionNotStartedException si la sesión no está iniciada.
208200
*/
209-
$session->destroy(): bool
201+
public function destroy(): bool;
210202
```
211203

212204
### Fachada Session
213205

214-
```php
215-
use Josantonius\Session\Facades\Session;
216-
```
206+
`Josantonius\Session\Facades\Session`
217207

218208
Iniciar la sesión:
219209

@@ -225,13 +215,13 @@ Iniciar la sesión:
225215
*
226216
* @see https://php.net/session.configuration para ver la lista de opciones disponibles.
227217
*/
228-
Session::start(array $options = []): bool
218+
public static function start(array $options = []): bool;
229219
```
230220

231221
Comprobar si la sesión fue iniciada:
232222

233223
```php
234-
Session::isStarted(): bool
224+
public static function isStarted(): bool;
235225
```
236226

237227
Establecer un atributo por su nombre:
@@ -240,7 +230,7 @@ Establecer un atributo por su nombre:
240230
/**
241231
* @throws SessionNotStartedException si la sesión no está iniciada.
242232
*/
243-
Session::set(string $name, mixed $value): void
233+
public static function set(string $name, mixed $value): void;
244234
```
245235

246236
Obtener un atributo por su nombre:
@@ -249,19 +239,19 @@ Obtener un atributo por su nombre:
249239
/**
250240
* Opcionalmente define un valor por defecto cuando el atributo no existe.
251241
*/
252-
Session::get(string $name, mixed $default = null): mixed
242+
public static function get(string $name, mixed $default = null): mixed;
253243
```
254244

255245
Obtener todos los atributos:
256246

257247
```php
258-
Session::all(): array
248+
public static function all(): array;
259249
```
260250

261251
Comprobar si un atributo existe en la sesión:
262252

263253
```php
264-
Session::has(string $name): bool
254+
public static function has(string $name): bool;
265255
```
266256

267257
Establecer múltiples atributos de una vez:
@@ -272,7 +262,7 @@ Establecer múltiples atributos de una vez:
272262
*
273263
* @throws SessionNotStartedException si la sesión no está iniciada.
274264
*/
275-
Session::replace(array $data): void
265+
public static function replace(array $data): void;
276266
```
277267

278268
Eliminar un atributo por su nombre y devolver su valor:
@@ -283,7 +273,7 @@ Eliminar un atributo por su nombre y devolver su valor:
283273
*
284274
* @throws SessionNotStartedException si la sesión no está iniciada.
285275
*/
286-
Session::pull(string $name, mixed $default = null): mixed
276+
public static function pull(string $name, mixed $default = null): mixed;
287277
```
288278

289279
Eliminar un atributo por su nombre:
@@ -292,7 +282,7 @@ Eliminar un atributo por su nombre:
292282
/**
293283
* @throws SessionNotStartedException si la sesión no está iniciada.
294284
*/
295-
Session::remove(string $name): void
285+
public static function remove(string $name): void;
296286
```
297287

298288
Liberar todas las variables de la sesión:
@@ -301,13 +291,13 @@ Liberar todas las variables de la sesión:
301291
/**
302292
* @throws SessionNotStartedException si la sesión no está iniciada.
303293
*/
304-
Session::clear(): void
294+
public static function clear(): void;
305295
```
306296

307297
Obtiene el ID de la sesión:
308298

309299
```php
310-
Session::getId(): string
300+
public static function getId(): string;
311301
```
312302

313303
Establecer el ID de la sesión:
@@ -316,7 +306,7 @@ Establecer el ID de la sesión:
316306
/**
317307
* @throws SessionStartedException si la sesión ya está iniciada.
318308
*/
319-
Session::setId(string $sessionId): void
309+
public static function setId(string $sessionId): void;
320310
```
321311

322312
Actualizar el ID de la sesión actual con uno recién generado:
@@ -325,13 +315,13 @@ Actualizar el ID de la sesión actual con uno recién generado:
325315
/**
326316
* @throws SessionNotStartedException si la sesión no está iniciada.
327317
*/
328-
Session::regenerateId(bool $deleteOldSession = false): bool
318+
public static function regenerateId(bool $deleteOldSession = false): bool;
329319
```
330320

331321
Obtener el nombre de la sesión:
332322

333323
```php
334-
Session::getName(): string
324+
public static function getName(): string;
335325
```
336326

337327
Establecer el nombre de la sesión:
@@ -340,7 +330,7 @@ Establecer el nombre de la sesión:
340330
/**
341331
* @throws SessionStartedException si la sesión ya está iniciada.
342332
*/
343-
Session::setName(string $name): void
333+
public static function setName(string $name): void;
344334
```
345335

346336
Eliminar la sesión:
@@ -349,7 +339,7 @@ Eliminar la sesión:
349339
/**
350340
* @throws SessionNotStartedException si la sesión no está iniciada.
351341
*/
352-
Session::destroy(): bool
342+
public static function destroy(): bool;
353343
```
354344

355345
## Excepciones utilizadas
@@ -362,7 +352,7 @@ use Josantonius\Session\Exceptions\SessionStartedException;
362352
use Josantonius\Session\Exceptions\WrongSessionOptionException;
363353
```
364354

365-
## Usage
355+
## Uso
366356

367357
Ejemplos de uso para esta biblioteca:
368358

0 commit comments

Comments
 (0)