TrimStrings
class TrimStrings extends TransformsRequest
Constants
| protected KEY_BYTES_CONTEXT_KEY |
|
Properties
| protected int | $maxKeyBytes | The maximum cumulative size of the keys processed per request, in bytes. |
from TransformsRequest |
| protected int | $keyBytes | The cumulative size of the keys processed for the current request. |
from TransformsRequest |
| protected array<int, string> | $except | The attributes that should not be trimmed. |
|
| static protected array<int, string> | $neverTrim | The globally ignored attributes that should not be trimmed. |
|
| static protected array<int, callable> | $skipCallbacks | All of the registered skip callbacks. |
Methods
Clean the data in the parameter bag.
Clean the data in the given array.
Transform the given value.
Determine if the given key should be skipped.
Indicate that the given attributes should never be trimmed.
Flush all static state.
Details
in
TransformsRequest at line 48
protected void
clean(Request $request)
Clean the request's data.
in
TransformsRequest at line 62
protected void
cleanParameterBag(ParameterBag $bag)
Clean the data in the parameter bag.
in
TransformsRequest at line 74
protected array
cleanArray(array $data, string $keyPrefix = '')
Clean the data in the given array.
in
TransformsRequest at line 107
protected mixed
cleanValue(string $key, mixed $value)
Clean the given value.
at line 57
protected mixed
transform(string $key, mixed $value)
Transform the given value.
at line 75
protected bool
shouldSkip(string $key, array $except)
Determine if the given key should be skipped.
at line 86
static void
except(array|string $attributes)
Indicate that the given attributes should never be trimmed.
The list persists in a static property for the worker lifetime and applies to every subsequent request.
at line 100
static void
skipWhen(Closure $callback)
Register a callback that instructs the middleware to be skipped.
Skip callbacks persist in a static property for the worker lifetime and run on every subsequent request.
at line 109
static void
flushState()
Flush all static state.