src/Helpers/GenericValidator.php
public static function argsValidation($cacheDir, $cacheTTL, $caching,
                                          $cacheForever, $charset)
    {
        if (!self::validateDirName($cacheDir))
            throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $cacheDir: please supply a valid non-empty string.');

        if (!self::validateExpirationTime($cacheTTL))
            throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $cacheTTL: please supply a positive integer.');

        if (!self::validateCacheOpt($caching))
            throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $caching: please supply a boolean value.');

        if (!self::validateCacheOpt($cacheForever))
            throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $cacheForever: please supply a boolean value.');

        if (!self::validateCharset($charset))
            throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $charset: please supply a valid non-empty string.');
    }
public static function argsValidation($cacheDir, $cacheTTL, $caching,
                                          $cacheForever, $charset)
    {
        if (!self::validateDirName($cacheDir))
            throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $cacheDir: please supply a valid non-empty string.');

        if (!self::validateExpirationTime($cacheTTL))
            throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $cacheTTL: please supply a positive integer.');

        if (!self::validateCacheOpt($caching))
            throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $caching: please supply a boolean value.');

        if (!self::validateCacheOpt($cacheForever))
            throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $cacheForever: please supply a boolean value.');

        if (!self::validateCharset($charset))
            throw new \Franzip\SerpFetcher\Exceptions\InvalidArgumentException('Invalid SerpFetcher $charset: please supply a valid non-empty string.');
    }
public static function argsValidation ( $ cacheDir , $ cacheTTL , $ caching , $ cacheForever , $ charset ) { if ( ! self :: validateDirName ( $ cacheDir ) ) throw new \ Franzip \ SerpFetcher \ Exceptions \ InvalidArgumentException ( 'Invalid SerpFetcher $cacheDir: please supply a valid non-empty string.' ) ; if ( ! self :: validateExpirationTime ( $ cacheTTL ) ) throw new \ Franzip \ SerpFetcher \ Exceptions \ InvalidArgumentException ( 'Invalid SerpFetcher $cacheTTL: please supply a positive integer.' ) ; if ( ! self :: validateCacheOpt ( $ caching ) ) throw new \ Franzip \ SerpFetcher \ Exceptions \ InvalidArgumentException ( 'Invalid SerpFetcher $caching: please supply a boolean value.' ) ; if ( ! self :: validateCacheOpt ( $ cacheForever ) ) throw new \ Franzip \ SerpFetcher \ Exceptions \ InvalidArgumentException ( 'Invalid SerpFetcher $cacheForever: please supply a boolean value.' ) ; if ( ! self :: validateCharset ( $ charset ) ) throw new \ Franzip \ SerpFetcher \ Exceptions \ InvalidArgumentException ( 'Invalid SerpFetcher $charset: please supply a valid non-empty string.' ) ; }
Perform validation on SerpFetcher constructor arguments.
@param  string $cacheDir
@param  int    $cacheTTL
@param  bool   $caching
@param  bool   $cacheForever
@param  string $charset
Perform validation on SerpFetcher constructor arguments .