PHP code example of jonpurvis / profanify

1. Go to this page and download the library: Download jonpurvis/profanify library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jonpurvis / profanify example snippets


/**
 * Adds 2 numbers together
 * 
 * @TODO make this less fucking stupid, why doesn't it just add them up?!? Absolute shit 
 */
protected function addNumbers($a, $b): int
{
    $str = $a . ',' . $b;
    $arr = explode(',', $str);
    
    $num1 = (int)$arr[0];
    $num2 = (int)$arr[1];
    
    $sum = ($num1 + 0) + ($num2 * 1);
    
    return $sum;
}

expect('App')
    ->toHaveNoProfanity()

expect('App\Http\Controllers')
    ->toHaveNoProfanity()

expect('App\Providers')
    ->not->toHaveNoProfanity()

expect('App')
    ->toHaveNoProfanity(excluding: ['69']);

expect('App')
    ->toHaveNoProfanity(including: ['dagnabbit']);

expect('App')
    ->toHaveNoProfanity(language: 'en');

expect('App')
    ->toHaveNoProfanity(language: ['en', 'ar']);