Skip to content

v1.3.0 #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
829 changes: 0 additions & 829 deletions Inp.php

This file was deleted.

317 changes: 248 additions & 69 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"autoload": {
"psr-4": {
"MaplePHP\\Validate\\": ""
"MaplePHP\\Validate\\": "src"
}
},
"minimum-stability": "dev"
Expand Down
15 changes: 15 additions & 0 deletions src/Inp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/**
* @Package: MaplePHP - Input shortcut to validation library
* @Author: Daniel Ronkainen
* @Licence: Apache-2.0 license, Copyright © Daniel Ronkainen
* Don't delete this comment, it's part of the license.
* @deprecated This class has been renamed to "Validator" and will be removed in future versions
*/

namespace MaplePHP\Validate;

class Inp extends Validator
{
}
File renamed without changes.
188 changes: 188 additions & 0 deletions src/Traits/InpAliases.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<?php

/**
* @Package: MaplePHP - Validate - Aliases
* @Author: Daniel Ronkainen
* @Licence: Apache-2.0 license, Copyright © Daniel Ronkainen
* Don't delete this comment, its part of the license.
*/

namespace MaplePHP\Validate\Traits;

trait InpAliases
{
public function isDns(): bool
{
return $this->isResolvableHost();
}

public function url(): bool
{
return $this->isUrl();
}

public function domain(bool $strict = true): bool
{
return $this->isDomain($strict);
}

public function age(int $checkAge): bool
{
return $this->isAge($checkAge);
}

public function time(): bool
{
return $this->isTime();
}

public function dateTime(): bool
{
return $this->dateTime();
}

public function date(string $format = "Y-m-d"): bool
{
return $this->isDate();
}

public function hex(): bool
{
return $this->isHexColor();
}

public function strictPassword(int $length = 1): bool
{
return $this->isStrictPassword($length);
}

public function lossyPassword(int $length = 1): bool
{
return $this->isLossyPassword($length);
}

public function validVersion(bool $strict = false): bool
{
return $this->isValidVersion();
}

public function moreThan(float|int $num): bool
{
return $this->isGreaterThan($num);
}

public function lessThan(float|int $num): bool
{
return $this->isLessThan($num);
}

public function notEqual(mixed $value): bool
{
return $this->isNotEqualTo($value);
}

public function equal(mixed $value): bool
{
return $this->isEqualTo($value);
}

public function equalLength(int $length): bool
{
return $this->isLengthEqualTo($length);
}

public function negative(): bool
{
return $this->isNegative();
}

public function positive(): bool
{
return $this->isPositive();
}

public function number(): bool
{
return $this->isNumber();
}

public function zip(int $minLength, ?int $maxLength = null): bool
{
return $this->isZip($minLength, $maxLength);
}

public function phone(): bool
{
return $this->isPhone();
}

public function email(): bool
{
return $this->isEmail();
}

public function vatNumber(): bool
{
return $this->isVatNumber();
}

public function creditCard(): bool
{
return $this->isCreditCard();
}

public function orgNumber(): bool
{
return $this->isOrgNumber();
}

public function socialNumber(): bool
{
return $this->isSocialNumber();
}

public function personalNumber(): bool
{
return $this->socialNumber();
}

public function required(): bool
{
return $this->isRequired();
}

public function isStr(): bool
{
return $this->isString();
}

public function minimum(float $int): bool
{
return $this->min($int);
}

public function maximum(float $int): bool
{
return $this->max($int);
}

public function pregMatch(string $match): bool
{
return $this->isMatchingPattern($match);
}

public function atoZ(): bool
{
return $this->isAlpha();
}

public function lowerAtoZ(): bool
{
return $this->isLowerAlpha();
}

public function upperAtoZ(): bool
{
return $this->isUpperAlpha();
}
}
Loading