mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 03:29:20 +03:00
29 lines
582 B
PHP
29 lines
582 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of MailSo.
|
|
*
|
|
* (c) 2014 Usenko Timur
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace MailSo\Base;
|
|
|
|
/**
|
|
* @category MailSo
|
|
* @package Base
|
|
*/
|
|
class Validator
|
|
{
|
|
public static function RangeInt(int $iNumber, int $iMin = null, int $iMax = null) : bool
|
|
{
|
|
return (null === $iMin || $iNumber >= $iMin) && (null === $iMax || $iNumber <= $iMax);
|
|
}
|
|
|
|
public static function PortInt(int $iPort) : bool
|
|
{
|
|
return static::RangeInt($iPort, 0, 65535);
|
|
}
|
|
}
|