Skip to content

Commit

Permalink
Merge pull request #1 from veeqtoh/main
Browse files Browse the repository at this point in the history
Initial Release
  • Loading branch information
veeqtoh authored Jun 15, 2024
2 parents c587cfe + c03a8b0 commit c5b2052
Show file tree
Hide file tree
Showing 23 changed files with 4,134 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Code changes will send PR to following users.
* @veeqtoh
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: veeqtoh
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Motivation and Context ###
Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here.



### Dependencies ###
Note if this change has any dependencies, e.g. a library (write the command to install it here e.g composer install or update )



### Test Instructions ###
Provide a list of tests the reviewer must complete to appropriately QA this work. This may include automated or manual tests. Consider the complexity of the change when compiling this list, and be sure to include any build instructions e.g. composer install.
48 changes: 48 additions & 0 deletions .github/workflows/ci-phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: run-phpstan

on:
pull_request:

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3]
laravel: [10.*, 11.*]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
exclude:
- laravel: 11.*
php: 8.1

name: PHP${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- name: Update apt
run: sudo apt-get update --fix-missing

- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-suggest
- name: Run Larastan
run: vendor/bin/phpstan analyse
48 changes: 48 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: run-tests

on:
pull_request:

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3]
laravel: [10.*, 11.*]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
exclude:
- laravel: 11.*
php: 8.1

name: PHP${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- name: Update apt
run: sudo apt-get update --fix-missing

- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/pest
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.idea/
vendor/
composer.lock
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
/.phpunit.cache
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
preset: laravel
69 changes: 69 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"name": "veeqtoh/laravel-active-email",
"description": "A Laravel package providing validation rule against disposable email addresses.",
"type": "library",
"homepage": "https://github.com/veeqtoh/laravel-active-email",
"license": "MIT",
"authors": [
{
"name": "Victor Ukam",
"email": "[email protected]"
}
],
"keywords": [
"veeqtoh",
"victor-ukam",
"disposable-email",
"disposable-emails",
"disposable-emails-domains",
"disposable-email-domains",
"validation",
"validation-rule",
"laravel-validation",
"active-email-address",
"laravel",
"laravel-package"
],
"require": {
"php": "^8.1",
"nesbot/carbon": "^2.0|^3.0",
"illuminate/container": "^10.0|^11.0",
"illuminate/database": "^10.0|^11.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^8.0|^9.0",
"larastan/larastan": "^2.0",
"pestphp/pest-plugin-laravel": "^2.3"
},
"autoload": {
"psr-4": {
"Veeqtoh\\ActiveEmail\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Veeqtoh\\ActiveEmail\\Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"providers": [
"Veeqtoh\\ActiveEmail\\Providers\\ActiveEmailProvider"
],
"aliases": {
"ActiveEmail": "Veeqtoh\\ActiveEmail\\Facades\\ActiveEmail"
}
}
},
"scripts": {
"test": "vendor/bin/pest"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
46 changes: 46 additions & 0 deletions config/active-email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Strict Mode
|--------------------------------------------------------------------------
|
| This value determines the strictness level of this feature.
|
*/

'strict_mode' => env('DISPOSABLE_EMAIL_STRICT_MODE', true),

/*
|--------------------------------------------------------------------------
| Blacklist
|--------------------------------------------------------------------------
|
| This is a list of base domains without the TLD that are blacklisted by
| default. Add a domain to this list to blacklist it.
|
*/

'blacklist' => [
//
],

/*
|--------------------------------------------------------------------------
| Greylist
|--------------------------------------------------------------------------
|
| This is a list of base domains without the TLD that aren't blacklisted by
| default except when in strict mode. Add a domain to this list to whitelist
| it when the feature is not set to strict mode. Ensure that the domain is not
| on the blacklist above.
|
*/

'greylist' => [
//
],

];
13 changes: 13 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
includes:
- ./vendor/larastan/larastan/extension.neon

parameters:

paths:
- src

level: 4

ignoreErrors:

checkMissingIterableValueType: false
30 changes: 30 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd"
bootstrap="vendor/autoload.php"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnFailure="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">

<testsuites>
<testsuite name="Active Email Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>

<php>
<env name="APP_ENV" value="testing"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
</php>

<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>

</phpunit>
Loading

0 comments on commit c5b2052

Please sign in to comment.