juliocapuano/simple-anti-spam

1.0.0 2021-02-03 19:56 UTC

This package is auto-updated.

Last update: 2024-04-29 04:40:38 UTC


README

Latest Version on Packagist Total Downloads Software License

this Package is focused in a simple field validation

Actually using the open api from stopforumspam.com

Structure

If any of the following are applicable to your project, then the directory structure should follow industry best practices by being named the following.

bin/        
config/
src/
tests/
vendor/

Install

Via Composer

$ composer require juliocapuano/simple-antispam

Usage

use juliocapuano\SimpleAntiSpam;

try{

    if(SimpleAntiSpam::isSpamEmail($email))
        throw new \Exception('email is invalid or in black list')

    if(SimpleAntiSpam::isSpamIp([$ip]))
        throw new \Exception('ip is invalid or in black list')
    
    if(SimpleAntiSpam::isUrlInText($content))
        throw new \Exception('is span text')

    // sendEmailOrSomeElse();

} catch (Exception $e){

    // manageError($e)

}
    

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email juliocapuano@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.