Skip to content

Commit 80b7522

Browse files
authored
Merge pull request #261 from raicabogdan/5.9.x
Update filter api documentation
2 parents 916d2eb + a3e1ead commit 80b7522

File tree

2 files changed

+51
-24
lines changed

2 files changed

+51
-24
lines changed

docs/api/phalcon_filter.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,32 @@ Exceptions thrown in Phalcon\Filter will use this class
5555

5656
Lazy loads, stores and exposes sanitizer objects
5757

58+
@method int absint(mixed $input)
59+
@method string alnum(mixed $input)
60+
@method string alpha(mixed $input)
61+
@method bool bool(mixed $input)
62+
@method string email(string $input)
63+
@method float float(mixed $input)
64+
@method int int(string $input)
65+
@method string|false ip(string $input, int $filter = FILTER_FLAG_NONE)
66+
@method string lower(string $input)
67+
@method string lowerfirst(string $input)
68+
@method mixed regex(mixed $input, mixed $pattern, mixed $replace)
69+
@method mixed remove(mixed $input, mixed $replace)
70+
@method mixed replace(mixed $input, mixed $source, mixed $target)
71+
@method string special(string $input)
72+
@method string specialfull(string $input)
73+
@method string string(string $input)
74+
@method string stringlegacy(mixed $input)
75+
@method string striptags(string $input)
76+
@method string trim(string $input)
77+
@method string upper(string $input)
78+
@method string upperFirst(string $input)
79+
@method null upperWords(string $input): strin
80+
@method null url(string $input): strin
81+
82+
@property array $mapper
83+
@property array $services
5884

5985

6086
### Constants
@@ -66,7 +92,7 @@ const FILTER_BOOL = bool;
6692
const FILTER_EMAIL = email;
6793
const FILTER_FLOAT = float;
6894
const FILTER_INT = int;
69-
const FILTER_IP = 'ip';
95+
const FILTER_IP = ip;
7096
const FILTER_LOWER = lower;
7197
const FILTER_LOWERFIRST = lowerfirst;
7298
const FILTER_REGEX = regex;
@@ -448,7 +474,7 @@ public function __invoke( mixed $input );
448474

449475

450476

451-
## Filter\Sanitize\Ip
477+
## Filter\Sanitize\Ip
452478

453479
[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Ip.zep)
454480

@@ -458,28 +484,29 @@ public function __invoke( mixed $input );
458484
- `Phalcon\Filter\Sanitize`
459485

460486
- __Uses__
461-
487+
462488

463489
- __Extends__
464-
490+
465491

466492
- __Implements__
493+
467494

495+
Phalcon\Filter\Sanitize\IP
468496

469-
Phalcon\Filter\Sanitize\Ip
470-
471-
Sanitizes a value to an IP address or CIDR IP range
497+
Sanitizes a value to an ip address or CIDR range
472498

473499

474500
### Methods
475501

476502
```php
477-
public function __invoke(string input, int filter = 0);
503+
public function __invoke( string $input, int $filter = int ): string | false;
478504
```
479505

480506

481507

482508

509+
483510
## Filter\Sanitize\Lower
484511

485512
[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Filter/Sanitize/Lower.zep)

docs/api/phalcon_http.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ private $strictHostCheck = false;
720720
/**
721721
* @var array
722722
*/
723-
private $trustedProxies = [];
723+
private $trustedProxies;
724724

725725
```
726726

@@ -777,11 +777,11 @@ _SERVER["HTTP_ACCEPT_LANGUAGE"]
777777

778778

779779
```php
780-
public function getClientAddress( bool $trustForwardedHeader = bool ): string | bool;
780+
public function getClientAddress( bool $trustForwardedHeader = bool ): string | false;
781781
```
782-
Gets most possible client IPv4 Address. This method searches in
782+
Gets most possible client IP Address. This method searches in
783783
`$_SERVER["REMOTE_ADDR"]` and optionally in
784-
`$_SERVER["HTTP_X_FORWARDED_FOR"]`
784+
`$_SERVER["HTTP_X_FORWARDED_FOR"]` and returns the first non-private or non-reserved IP address
785785

786786

787787
```php
@@ -837,7 +837,7 @@ Retrieves a query/get value always sanitized with the preset filters
837837
```php
838838
public function getHTTPReferer(): string;
839839
```
840-
Gets web page that refers active request. ie: https://www.google.com
840+
Gets web page that refers active request. ie: http://www.google.com
841841

842842

843843
```php
@@ -1253,21 +1253,15 @@ of host name or not
12531253

12541254

12551255
```php
1256-
final protected function getBestQuality( array $qualityParts, string $name ): string;
1257-
```
1258-
Process a request header and return the one with best quality
1259-
1260-
1261-
```php
1262-
protected function setTrustedProxies(array $trustedProxies): RequestInterface;
1256+
public function setTrustedProxies( array $trustedProxies ): RequestInterface;
12631257
```
1264-
Set trusted proxy list.
1258+
Set trusted proxy
12651259

12661260

12671261
```php
1268-
protected function isIpAddressInCIDR(string $ip, string $cidr): bool;
1262+
final protected function getBestQuality( array $qualityParts, string $name ): string;
12691263
```
1270-
Check if an IP address exists in CIDR range.
1264+
Process a request header and return the one with best quality
12711265

12721266

12731267
```php
@@ -1289,6 +1283,12 @@ final protected function hasFileHelper( mixed $data, bool $onlySuccessful ): lon
12891283
Recursively counts file in an array of files
12901284

12911285

1286+
```php
1287+
protected function isIpAddressInCIDR( string $ip, string $cidr ): bool;
1288+
```
1289+
Check if an IP address exists in CIDR range
1290+
1291+
12921292
```php
12931293
protected function resolveAuthorizationHeaders(): array;
12941294
```
@@ -1659,7 +1659,7 @@ $_SERVER["PHP_AUTH_DIGEST"]
16591659
```php
16601660
public function getHTTPReferer(): string;
16611661
```
1662-
Gets web page that refers active request. ie: https://www.google.com
1662+
Gets web page that refers active request. ie: http://www.google.com
16631663

16641664

16651665
```php

0 commit comments

Comments
 (0)