Skip to content

Commit

Permalink
Rename repo to Helga.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Robert committed Jan 1, 2022
1 parent a762925 commit ed31cdc
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chase\Validator;
namespace Chase\Helga;

/**
* Holds the value following a rule evaluation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chase\Validator;
namespace Chase\Helga;

use finfo;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chase\Validator;
namespace Chase\Helga;

use finfo;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Chase\Validator;
namespace Chase\Helga;

/**
* A function that wraps instantiation of Chase\Validator\Validator Objects
* A function that wraps instantiation of Chase\Helga\Validator Objects
*
* @param mixed $subject The item to be validated
* @param string $key The key, when being used for multiple values.
*
* @return Chase\Validator\Validator Returns An Instance of Chase\Validator\Validator
* @return Chase\Helga\Validator Returns An Instance of Chase\Helga\Validator
*/
function validate($subject, $key = null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chase\Validator;
namespace Chase\Helga;

class RuleParser
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chase\Validator;
namespace Chase\Helga;

class ValidationState
{
Expand Down
12 changes: 6 additions & 6 deletions Chase/Validator/Validator.php → Chase/Helga/Validator.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chase\Validator;
namespace Chase\Helga;

class Validator
{
Expand Down Expand Up @@ -125,7 +125,7 @@ public function flatErrors(bool $firstOnly = true)
/**
* Adds a rule to check if a value is unique
*
* @return Chase\Validator\Validator
* @return Chase\Helga\Validator
*/
public function unique(...$args)
{
Expand Down Expand Up @@ -160,7 +160,7 @@ public function unique(...$args)
/**
* Adds a rule to check if a value exists
*
* @return Chase\Validator\Validator
* @return Chase\Helga\Validator
*/
public function exists(...$args)
{
Expand Down Expand Up @@ -197,7 +197,7 @@ public function exists(...$args)
* Adds a rule for custom validation
*
* @param callable $checker A function that performs the custom validation.
* @return Chase\Validator\Validator
* @return Chase\Helga\Validator
*/
public function check(callable $checker)
{
Expand All @@ -210,10 +210,10 @@ public function check(callable $checker)
}

/**
* Pass an associative array of rules to an instance of Chase\Validator\Validator.
* Pass an associative array of rules to an instance of Chase\Helga\Validator.
*
* @param array $rules
* @return Chase\Validator\Validator Returns the validator it was called on
* @return Chase\Helga\Validator Returns the validator it was called on
*/
public function withRules(array $rules)
{
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Chase Validator
![github stars](https://img.shields.io/github/stars/phrenotype/validator?style=social)
![packagist stars](https://img.shields.io/packagist/stars/chase/validator)
![license](https://img.shields.io/github/license/phrenotype/validator)
![contributors](https://img.shields.io/github/contributors/phrenotype/validator)
![contributors](https://img.shields.io/github/languages/code-size/phrenotype/validator)
![downloads](https://img.shields.io/packagist/dm/chase/validator)
![github stars](https://img.shields.io/github/stars/phrenotype/helga?style=social)
![packagist stars](https://img.shields.io/packagist/stars/chase/helga)
![license](https://img.shields.io/github/license/phrenotype/helga)
![contributors](https://img.shields.io/github/contributors/phrenotype/helga)
![contributors](https://img.shields.io/github/languages/code-size/phrenotype/helga)
![downloads](https://img.shields.io/packagist/dm/chase/helga)

This is a library for validation with easy customization of error messages. It validates everything from variables to files. It is not limited to form validation.

It has a clean and easy syntax with no clutters. Additionally, there are no external dependencies, apart from php, of course :).

## INSTALL
`composer require chase/validator`
`composer require chase/helga`

## USAGE

Expand All @@ -20,7 +20,7 @@ The most basic use is to validate single values.
```php
<?php

use Chase\Validator\validate;
use Chase\Helga\validate;

$v = validate("chase")->withRules(['required', 'minLen:5', 'maxLen:10']);

Expand All @@ -35,7 +35,7 @@ if($v->passes()){
```php
<?php

use Chase\Validator\validate;
use Chase\Helga\validate;

$v = validate("[email protected]")->withRules(['email']);

Expand All @@ -50,7 +50,7 @@ For multiple values, pass an associative array like so :
```php
<?php

use Chase\Validator\validate;
use Chase\Helga\validate;

$values = [
'name' => '',
Expand Down Expand Up @@ -92,7 +92,7 @@ By default, it only flattens and returns the first error for each field. Passing
```php
<?php

use Chase\Validator\validate;
use Chase\Helga\validate;

$values = [
'name' => 'ab1',
Expand Down Expand Up @@ -133,7 +133,7 @@ For directives without arguments i.e single directives
```php
<?php

use Chase\Validator\validate;
use Chase\Helga\validate;

$v = validate("c")->withRules([
'integer::It must be a number',
Expand All @@ -148,7 +148,7 @@ For directives with arguments
```php
<?php

use Chase\Validator\validate;
use Chase\Helga\validate;

$v = validate("c")->withRules([
'minLen:4:Cannot be less than four',
Expand Down
2 changes: 1 addition & 1 deletion Tests/ComparisonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use PHPUnit\Framework\TestCase;

use function Chase\Validator\validate;
use function Chase\Helga\validate;

class ComparisonTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/CustomMessagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use PHPUnit\Framework\TestCase;

use function Chase\Validator\validate;
use function Chase\Helga\validate;

class CustomMessagesTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/FilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use PHPUnit\Framework\TestCase;

use function Chase\Validator\validate;
use function Chase\Helga\validate;

class FilesTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/ValuesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use PHPUnit\Framework\TestCase;

use function Chase\Validator\validate;
use function Chase\Helga\validate;

class ValuesTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "chase/validator",
"name": "chase/helga",
"description": "Validation at it's best - variables, forms and files",
"type": "library",
"keywords": [
Expand All @@ -22,7 +22,7 @@
"Chase\\" : "Chase/",
"Tests\\" : "Tests/"
},
"files" : ["Chase/Validator/Functions/include.php"]
"files" : ["Chase/Helga/Functions/include.php"]
},
"require" : {
"php" : ">=7.0.0"
Expand Down

0 comments on commit ed31cdc

Please sign in to comment.