Skip to content

Commit

Permalink
docs: add variable in available methods
Browse files Browse the repository at this point in the history
  • Loading branch information
josantonius committed Jun 27, 2022
1 parent e9547d9 commit 17eae44
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 42 deletions.
41 changes: 20 additions & 21 deletions .github/lang/es-ES/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,30 @@ Métodos disponibles en esta biblioteca:
### Iniciar la sesión

```php
start(array $options = []);
$session->start(array $options = []);
```

**@see** <https://php.net/session.configuration>
para ver la lista de las `$opciones` disponibles y sus valores por defecto.
para ver la lista de las `$opciones` disponibles y sus valores por defecto

**@throws** `SessionException`
Si las cabeceras ya se enviaron |
Si la sesión ya está iniciada |
Si hay algún fallo con las opciones
**@throws** `SessionException` Si los _headers_ ya se enviaron
**@throws** `SessionException` Si la sesión ya está iniciada
**@throws** `SessionException` Si hay algún fallo con las opciones

**@Return** `bool`

### Comprobar si la sesión está iniciada

```php
isStarted();
$session->isStarted();
```

**@Return** `bool`

### Establecer un atributo por su nombre

```php
set(string $name, mixed $value = null);
$session->set(string $name, mixed $value = null);
```

**@throws** `SessionException` Si la sesión no está iniciada
Expand All @@ -104,23 +103,23 @@ set(string $name, mixed $value = null);
Opcionalmente define un valor por defecto cuando el atributo no existe.

```php
get(string $name, mixed $default = null);
$session->get(string $name, mixed $default = null);
```

**@Return** `mixed` Valor

### Obtener todos los atributos

```php
all();
$session->all();
```

**@Return** `array` Contenido de la $_SESSION

### Comprobar si un atributo existe en la sesión

```php
has(string $name);
$session->has(string $name);
```

**@Return** `bool`
Expand All @@ -130,7 +129,7 @@ has(string $name);
Si los atributos existen se sustituyen, si no existen se crean.

```php
replace(array $data);
$session->replace(array $data);
```

**@throws** `SessionException` Si la sesión no está iniciada
Expand All @@ -142,7 +141,7 @@ replace(array $data);
Opcionalmente define un valor por defecto cuando el atributo no existe.

```php
pull(string $name, mixed $default = null);
$session->pull(string $name, mixed $default = null);
```

**@throws** `SessionException` Si la sesión no está iniciada
Expand All @@ -152,7 +151,7 @@ pull(string $name, mixed $default = null);
### Eliminar un atributo por su nombre

```php
remove(string $name);
$session->remove(string $name);
```

**@throws** `SessionException` Si la sesión no está iniciada
Expand All @@ -162,7 +161,7 @@ remove(string $name);
### Liberar todas las variables de la sesión

```php
clear();
$session->clear();
```

**@throws** `SessionException` Si la sesión no está iniciada
Expand All @@ -172,15 +171,15 @@ clear();
### Obtiene el ID de la sesión

```php
getId();
$session->getId();
```

**@Return** `string` ID de la sesión

### Establecer el ID de la sesión

```php
setId(string $sessionId);
$session->setId(string $sessionId);
```

**@throws** `SessionException` Si la sesión ya está iniciada
Expand All @@ -190,7 +189,7 @@ setId(string $sessionId);
### Actualizar el ID de la sesión actual con uno recién generado

```php
regenerateId(bool $deleteOldSession = false);
$session->regenerateId(bool $deleteOldSession = false);
```

**@throws** `SessionException` Si la sesión no está iniciada
Expand All @@ -200,15 +199,15 @@ regenerateId(bool $deleteOldSession = false);
### Obtener el nombre de la sesión

```php
getName();
$session->getName();
```

**@Return** `string` Nombre de la sesión

### Establecer el nombre de la sesión

```php
setName(string $name);
$session->setName(string $name);
```

**@throws** `SessionException` Si la sesión ya está iniciada
Expand All @@ -218,7 +217,7 @@ setName(string $name);
### Eliminar la sesión

```php
destroy();
$session->destroy();
```

**@throws** `SessionException` Si la sesión no está iniciada
Expand Down
41 changes: 20 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,30 @@ Available methods in this library:
### Starts the session

```php
start(array $options = []);
$session->start(array $options = []);
```

**@see** <https://php.net/session.configuration>
for List of available `$options` and their default values.
for List of available `$options` and their default values

**@throws** `SessionException`
If headers already sent |
If session already started |
If setting options failed
**@throws** `SessionException` If headers already sent
**@throws** `SessionException` If session already started
**@throws** `SessionException` If setting options failed

**@Return** `bool`

### Check if the session is started

```php
isStarted();
$session->isStarted();
```

**@Return** `bool`

### Sets an attribute by name

```php
set(string $name, mixed $value = null);
$session->set(string $name, mixed $value = null);
```

**@throws** `SessionException` If session is unstarted
Expand All @@ -104,23 +103,23 @@ set(string $name, mixed $value = null);
Optionally defines a default value when the attribute does not exist.

```php
get(string $name, mixed $default = null);
$session->get(string $name, mixed $default = null);
```

**@Return** `mixed` Value

### Gets all attributes

```php
all();
$session->all();
```

**@Return** `array` $_SESSION content

### Check if an attribute exists in the session

```php
has(string $name);
$session->has(string $name);
```

**@Return** `bool`
Expand All @@ -130,7 +129,7 @@ has(string $name);
If attributes exist they are replaced, if they do not exist they are created.

```php
replace(array $data);
$session->replace(array $data);
```

**@throws** `SessionException` If session is unstarted
Expand All @@ -142,7 +141,7 @@ replace(array $data);
Optionally defines a default value when the attribute does not exist.

```php
pull(string $name, mixed $default = null);
$session->pull(string $name, mixed $default = null);
```

**@throws** `SessionException` If session is unstarted
Expand All @@ -152,7 +151,7 @@ pull(string $name, mixed $default = null);
### Deletes an attribute by name

```php
remove(string $name);
$session->remove(string $name);
```

**@throws** `SessionException` If session is unstarted
Expand All @@ -162,7 +161,7 @@ remove(string $name);
### Free all session variables

```php
clear();
$session->clear();
```

**@throws** `SessionException` If session is unstarted
Expand All @@ -172,15 +171,15 @@ clear();
### Gets the session ID

```php
getId();
$session->getId();
```

**@Return** `string` Session ID

### Sets the session ID

```php
setId(string $sessionId);
$session->setId(string $sessionId);
```

**@throws** `SessionException` If session already started
Expand All @@ -190,7 +189,7 @@ setId(string $sessionId);
### Update the current session id with a newly generated one

```php
regenerateId(bool $deleteOldSession = false);
$session->regenerateId(bool $deleteOldSession = false);
```

**@throws** `SessionException` If session is unstarted
Expand All @@ -200,15 +199,15 @@ regenerateId(bool $deleteOldSession = false);
### Gets the session name

```php
getName();
$session->getName();
```

**@Return** `string` Session name

### Sets the session name

```php
setName(string $name);
$session->setName(string $name);
```

**@throws** `SessionException` If session already started
Expand All @@ -218,7 +217,7 @@ setName(string $name);
### Destroys the session

```php
destroy();
$session->destroy();
```

**@throws** `SessionException` If session is unstarted
Expand Down

0 comments on commit 17eae44

Please sign in to comment.