Commit Graph

11 Commits

Author SHA1 Message Date
Márk Magyar 27be0e7157 code refactor (#364)
* use spread syntax instead of array_merge()

* use type cast instead of function cast

* removed redundant returns

* removed redundant phpdoc - type is already inferred

* removed invalid phpdoc - type is already inferred

The PHPDoc return type hint was incomplete, it should have been `InvalidEmail|null`, however, it can be removed altogether as the return type is already inferred from the code.

* changed warnEscaping()'s return value from bool to void

This is not a breaking change as the method is private,  and it's only used at one place, where the return value was not used anyway.

* made private class property local

`private $parser` was used in only one place, hence it can be local, there is no reason to put it into the class' scope.

* removed unnecessary type casting

Concatenation already casts `static::CODE` from `int` to `string`, no reason to do it explicitly.

* removed redundant initializers - constructor overwrites them immediately

* removed redundant else block

* simplified if-else statement

* wrapped if body in brackets to comply with PSR12

* fixed README formatting

- fixed numbering at the `Available validations` section
- fixed overall formatting

* Revert "removed redundant phpdoc - type is already inferred"

This reverts commit 68a9ae20bd.

* don't wrap long lines

* make properties typed

Also using constructor property promotion, see more info about it [here](https://php.watch/versions/8.0/constructor-property-promotion).
2023-06-07 16:47:52 +02:00
Bastien Wermeille 4665415250 Fix psalm type issues info 2022-12-18 23:33:57 +01:00
Bastien Wermeille 3d25492123 Fix Tests + Psalm issues 2022-12-15 00:04:10 +01:00
Mathias Reker ⚡️ 18b9e5b572 Visibility required (#329)
Visibility MUST be declared on all properties and methods; abstract and final MUST be declared before the visibility; static MUST be declared after the visibility.
2022-07-13 16:52:42 +02:00
Robert Fridzema 9aab2ceed6 Typos (#311) 2022-02-04 21:30:40 +01:00
Eduardo Gulias Davis 790881fe75 improving types 2020-12-05 23:16:56 +01:00
Eduardo Gulias Davis 729ecb2a35 Psalm fixes 2020-11-08 16:19:44 +01:00
Eduardo Gulias Davis 98ebd59e53 Psalm erros fixed 2020-09-19 16:33:03 +02:00
Eduardo Gulias Davis 044b1d55d9 Return type in signature 2020-09-12 16:41:06 +02:00
Eduardo Gulias Davis e2e234c4d8 merging from master, folder structure change 2020-08-30 15:59:42 +02:00
Simon Schaufelberger cfa3d44471 Move files in typical src and tests folder (#242)
* Move files in typical src and tests folder

* Fix psalm error
2020-06-16 22:11:17 +02:00