Skip to content

Commit 153c5c7

Browse files
author
Fredrick Peter
committed
package name change
1 parent 87ea5ee commit 153c5c7

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# PHP Form Validator - PFV
22

3-
[![Total Downloads](https://poser.pugx.org/peterson/php-form-validator/downloads)](https://packagist.org/packages/peterson/php-form-validator)
4-
[![Latest Stable Version](https://poser.pugx.org/peterson/php-form-validator/version.png)](https://packagist.org/packages/peterson/php-form-validator)
5-
[![License](https://poser.pugx.org/peterson/php-form-validator/license)](https://packagist.org/packages/peterson/php-form-validator)
3+
[![Total Downloads](https://poser.pugx.org/peterson/validator/downloads)](https://packagist.org/packages/peterson/validator)
4+
[![Latest Stable Version](https://poser.pugx.org/peterson/validator/version.png)](https://packagist.org/packages/peterson/validator)
5+
[![License](https://poser.pugx.org/peterson/validator/license)](https://packagist.org/packages/peterson/validator)
66
[![Build Status](https://github.com/tamedevelopers/phpFormValidator/actions/workflows/php.yml/badge.svg)](https://github.com/tamedevelopers/phpFormValidator/actions)
7-
[![Code Coverage](https://codecov.io/gh/peterson/php-form-validator/branch/2.2.x/graph/badge.svg)](https://codecov.io/gh/peterson/php-form-validator/branch/3.2.2.x)
7+
[![Code Coverage](https://codecov.io/gh/peterson/validator/branch/2.2.x/graph/badge.svg)](https://codecov.io/gh/peterson/validator/branch/3.2.2.x)
88

99
## Documentation
1010

@@ -60,7 +60,7 @@ Prior to installing `ultimate-uploader` get the [Composer](https://getcomposer.o
6060
**Step 1** — update your `composer.json`:
6161
```composer.json
6262
"require": {
63-
"peterson/php-form-validator": "^3.3.4"
63+
"peterson/validator": "^3.3.5"
6464
}
6565
```
6666

@@ -71,7 +71,7 @@ composer update
7171

7272
**Or composer require**:
7373
```
74-
composer require peterson/php-form-validator
74+
composer require peterson/validator
7575
```
7676

7777
## Instantiate
@@ -100,7 +100,7 @@ $form = new UltimateValidator\UltimateValidator($data);
100100

101101
- **Example 3** `Helpers Function`
102102
```
103-
$form = opForm();
103+
$form = form();
104104
```
105105

106106
## Laravel Support
@@ -112,7 +112,7 @@ public function save(Request $request){
112112
113113
$form = new UltimateValidator();
114114
or
115-
$form = opForm();
115+
$form = form();
116116
}
117117
```
118118

@@ -136,7 +136,7 @@ $form->post()->submit([
136136

137137
## Global Configuration
138138
- Helpers available to assist on easy configuration
139-
- `Config_opForm()`
139+
- `config_form()`
140140

141141
| Array Keys | Description |
142142
|-------------|-----------------------------------------|
@@ -145,7 +145,7 @@ $form->post()->submit([
145145
| csrf_token | Boolean `true\|false` Default `true` |
146146

147147
```
148-
Config_opForm([
148+
config_form([
149149
'request' => 'POST',
150150
'error_type' => true,
151151
'csrf_token' => true,
@@ -155,7 +155,7 @@ Config_opForm([
155155
## Csrf
156156
- Implementing `Csrf` (Cross-Site Request Forgery)
157157
- By default the form requires all request to have a token attached.
158-
- You can disable the usage with the `Config_opForm()` Helper
158+
- You can disable the usage with the `config_form()` Helper
159159

160160

161161
### Csrf Form Input
@@ -226,7 +226,7 @@ $form->token(true)->submit([
226226
### POST
227227
- You can call separately or Call Before any other method, if intend to use.
228228
- This will set the Form Request to `POST`
229-
- This will always override the `Config_opForm()` settings
229+
- This will always override the `config_form()` settings
230230

231231
```
232232
$form->post()->submit([
@@ -626,7 +626,7 @@ $form->toJson([
626626

627627
| function | Description |
628628
|---------------|-----------------------------------|
629-
| opForm() | Return instance of `(new UltimateValidator)` class |
629+
| form() | Return instance of `(new UltimateValidator)` class |
630630
| request() | Return instance of `(new RequestMethod)` class |
631631

632632

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "peterson/php-form-validator",
2+
"name": "peterson/validator",
33
"type": "library",
44
"description": "PHP Form Validator is a small no-depencies library for PHP codes.",
55
"keywords": ["php form validator", "form validator", "form", "php forms", "php", "forms", "easy validation"],
6-
"homepage": "https://github.com/tamedevelopers/phpFormValidator",
6+
"homepage": "https://github.com/tamedevelopers/validator",
77
"license": "MIT",
88
"authors": [
99
{
@@ -39,7 +39,7 @@
3939
},
4040
"extra": {
4141
"branch-alias": {
42-
"dev-main": "3.3.4-dev"
42+
"dev-main": "3.3.5-dev"
4343
}
4444
},
4545
"minimum-stability": "stable",

src/Methods/GetRequestType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static function request(?string $type = null)
1717
// set default value for request type to POST
1818
$requestType = INPUT_POST;
1919

20-
// always empty|null except `Config_opForm` has been used
20+
// always empty|null except `config_form` has been used
2121
if(!empty($type)){
2222
$type = strtoupper(trim($type));
2323
if($type == 'ALL'){

src/helpers.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use UltimateValidator\UltimateValidator;
66

77

8-
if (! function_exists('opForm')) {
8+
if (! function_exists('form')) {
99

1010
/**
1111
* Get Form Instance \ PHP Form Validator
@@ -14,7 +14,7 @@
1414
*
1515
* @return object\data\UltimateValidator
1616
*/
17-
function opForm(mixed $attribute = null)
17+
function form(mixed $attribute = null)
1818
{
1919
return new UltimateValidator($attribute);
2020
}
@@ -37,7 +37,7 @@ function request(?string $key = null)
3737
}
3838

3939

40-
if (! function_exists('Config_opForm')) {
40+
if (! function_exists('config_form')) {
4141

4242
/**
4343
* Set Global Configuration of FORM Setting
@@ -47,7 +47,7 @@ function request(?string $key = null)
4747
*
4848
* @return void
4949
*/
50-
function Config_opForm(?array $option = [])
50+
function config_form(?array $option = [])
5151
{
5252
$default = [
5353
'error_type' => $option['error_type'] ?? false,

tests/index_get.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'occupation' => 'Web Artisans'
99
];
1010

11-
$form = opForm($data);
11+
$form = form($data);
1212
$form->get()->submit([
1313
"string:name" => 'Please enter a name',
1414
"str_len:name:<:5" => 'Name should be more than five(5) characters',

tests/index_text3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
];
1212

1313
// This can be on just one file accesible to all forms request
14-
Config_opForm([
14+
config_form([
1515
'request' => 'POST',
1616
'error_type' => true,
1717
'csrf_token' => true,

0 commit comments

Comments
 (0)