Skip to content

Commit 1f13fc0

Browse files
authored
Merge pull request #41 from kettasoft/chore/docs-typos
Fix spelling errors in documentation and test descriptions
2 parents 081ccd3 + 456eb77 commit 1f13fc0

5 files changed

Lines changed: 29 additions & 29 deletions

File tree

config/filterable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
| Invokable Filter Engine
213213
|--------------------------------------------------------------------------
214214
|
215-
| The Invokable Engine provides a powerful way to dynamically map incomming reuqest parameters to corresponding methods in a filter class.
215+
| The Invokable Engine provides a powerful way to dynamically map incomming request parameters to corresponding methods in a filter class.
216216
|
217217
*/
218218
'invokable' => [

docs/engines/invokable.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ sidebarDepth: 2
44

55
# Invokable Engine
66

7-
The **Invokable Engine** provides a powerful way to dynamically map incomming reuqest parameters to corresponding methods in a filter class. This mechanism enables clean, scalable filtering logic and behavior injection without requiring large **switch** or **if-else** blocks.
7+
The **Invokable Engine** provides a powerful way to dynamically map incomming request parameters to corresponding methods in a filter class. This mechanism enables clean, scalable filtering logic and behavior injection without requiring large **switch** or **if-else** blocks.
88

99
---
1010

1111
## Purpose
1212

13-
To automatically execute soecific methods in a filter class based on the incomming request keys, Each key in the request is matched with a method of the same name in the filter class and registered in **`$filters`** property, and the method is executed with the provided value.
13+
To automatically execute specific methods in a filter class based on the incomming request keys, Each key in the request is matched with a method of the same name in the filter class and registered in **`$filters`** property, and the method is executed with the provided value.
1414

1515
---
1616

@@ -96,7 +96,7 @@ You can access not only the raw value but also the parsed operator (e.g. =, like
9696

9797
## Mapping Request Keys
9898

99-
By default, the engine attempts to match the reuqest keys directly to metch names in the filter class. However, for mode flexibility and clarity, you can define a custom map that links request keys to specific method names.
99+
By default, the engine attempts to match the request keys directly to match names in the filter class. However, for mode flexibility and clarity, you can define a custom map that links request keys to specific method names.
100100

101101
This allows you to:
102102

@@ -182,15 +182,15 @@ This ensures that the filter system remains dynamic and flexible whether or not
182182

183183
- **Convention over configuration:** Method names match request keys.
184184
- **Safe execution:** Only existing methods and registered filter keys in **`$filters`** are called.
185-
- **Flexable extension:** Add or override logic in the filter class easily.
185+
- **Flexible extension:** Add or override logic in the filter class easily.
186186
- **Clean query builder:** Keeps container logic slim and readable.
187187

188188
---
189189

190190
### Lifecycle
191191

192-
1. Controller recevies request.
193-
2. $request->only([...]) extracts relevent filters.
192+
1. Controller receives request.
193+
2. $request->only([...]) extracts relevant filters.
194194
3. Filter class loops over keys.
195195
4. For each key:
196196
- if a method named **`$key`** exists and registered in **`$filters`** property, is is executed with the value.

docs/engines/invokable/index.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ $posts = Post::filter(PostFilter::class)->paginate();
9494

9595
Every filter method receives a `Payload` instance, giving you full access to the parsed request data:
9696

97-
| Property | Type | Description |
98-
| ----------- | -------- | ---------------------------------------------- |
99-
| `field` | `string` | The column/filter name |
100-
| `operator` | `string` | The parsed operator (e.g., `eq`, `like`, `gt`) |
101-
| `value` | `mixed` | The sanitized filter value |
102-
| `rawValue` | `mixed` | The original raw input before sanitization |
97+
| Property | Type | Description |
98+
| ---------- | -------- | ---------------------------------------------- |
99+
| `field` | `string` | The column/filter name |
100+
| `operator` | `string` | The parsed operator (e.g., `eq`, `like`, `gt`) |
101+
| `value` | `mixed` | The sanitized filter value |
102+
| `rawValue` | `mixed` | The original raw input before sanitization |
103103

104104
```php
105105
protected function price(Payload $payload)
@@ -155,12 +155,12 @@ The Invokable Engine supports **PHP 8 Attributes** (annotations) on filter metho
155155

156156
Attributes are sorted and executed by **stage**:
157157

158-
| Order | Stage | Purpose | Example Attributes |
159-
| ----- | ------------- | ---------------------------------- | ----------------------------------- |
160-
| 1 | **CONTROL** | Decide whether to run the filter | `#[Authorize]`, `#[SkipIf]` |
161-
| 2 | **TRANSFORM** | Modify the payload value | `#[Trim]`, `#[Sanitize]`, `#[Cast]`, `#[MapValue]`, `#[DefaultValue]`, `#[Explode]` |
162-
| 3 | **VALIDATE** | Assert correctness of the value | `#[Required]`, `#[In]`, `#[Between]`, `#[Regex]` |
163-
| 4 | **BEHAVIOR** | Affect query behavior | `#[Scope]` |
158+
| Order | Stage | Purpose | Example Attributes |
159+
| ----- | ------------- | -------------------------------- | ----------------------------------------------------------------------------------- |
160+
| 1 | **CONTROL** | Decide whether to run the filter | `#[Authorize]`, `#[SkipIf]` |
161+
| 2 | **TRANSFORM** | Modify the payload value | `#[Trim]`, `#[Sanitize]`, `#[Cast]`, `#[MapValue]`, `#[DefaultValue]`, `#[Explode]` |
162+
| 3 | **VALIDATE** | Assert correctness of the value | `#[Required]`, `#[In]`, `#[Between]`, `#[Regex]` |
163+
| 4 | **BEHAVIOR** | Affect query behavior | `#[Scope]` |
164164

165165
### Example with Attributes
166166

@@ -221,14 +221,14 @@ The default operator can be configured per engine:
221221

222222
## Key Features
223223

224-
| Feature | Description |
225-
| ------------------------------ | -------------------------------------------------------------- |
226-
| **Convention over Configuration** | Method names match request keys automatically |
227-
| **Safe Execution** | Only registered filter keys in `$filters` are processed |
228-
| **Attribute Pipeline** | PHP 8 attributes for validation, transformation, and control |
229-
| **Custom Method Mapping** | `$mentors` property for flexible key-to-method mapping |
230-
| **Rich Payload Object** | Full access to field, operator, value, and raw value |
231-
| **Extensible** | Add or override filter methods easily |
224+
| Feature | Description |
225+
| --------------------------------- | ------------------------------------------------------------ |
226+
| **Convention over Configuration** | Method names match request keys automatically |
227+
| **Safe Execution** | Only registered filter keys in `$filters` are processed |
228+
| **Attribute Pipeline** | PHP 8 attributes for validation, transformation, and control |
229+
| **Custom Method Mapping** | `$mentors` property for Flexible key-to-method mapping |
230+
| **Rich Payload Object** | Full access to field, operator, value, and raw value |
231+
| **Extensible** | Add or override filter methods easily |
232232

233233
---
234234

docs/sanitization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Request Sanitization
22

3-
Sanitization allows you to clean or transform incomming reuqest data **before** validation or filtering is applied.
3+
Sanitization allows you to clean or transform incomming request data **before** validation or filtering is applied.
44
This feature ensures your filters always work with clean and normalized data.
55

66
## Overview

tests/Unit/Filterable/FilterRulesValidationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class FilterRulesValidationTest extends TestCase
1111
{
1212
/**
13-
* It validate incomming reuqest before filtering.
13+
* It validate incomming request before filtering.
1414
* @test
1515
*/
1616
public function it_validate_incomming_reuqest_before_filtering()

0 commit comments

Comments
 (0)