Compare commits

..

2 Commits

Author SHA1 Message Date
Eduardo Gulias Davis 0311a5f117 Fix for secrets on PRs 2024-12-27 20:13:05 +01:00
Eduardo Gulias Davis 9d48c27245 Test for #317 2024-12-27 01:51:44 +01:00
7 changed files with 22 additions and 48 deletions
+1
View File
@@ -3,6 +3,7 @@ name: static analysis
on:
push:
branches:
- master
- '*.x'
pull_request:
+12 -1
View File
@@ -1,10 +1,13 @@
name: unit-tests
name: build
on:
push:
branches:
- master
- '*.x'
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
tests:
@@ -22,6 +25,7 @@ jobs:
name: PHP ${{ matrix.php }} / ${{ matrix.deps }}
environment: Test
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -45,6 +49,13 @@ jobs:
- name: Execute tests
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml --exclude-group flaky
- name: Coverage
if: ${{ matrix.php == '8.1' && matrix.deps == 'lowest' }}
shell: bash
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r build/logs/clover.xml
- name: Store artifacts
if: ${{ matrix.php == '8.1' && matrix.deps == 'lowest' }}
uses: actions/upload-artifact@v4
-34
View File
@@ -1,34 +0,0 @@
name: upload-coverage-to-codacy
on:
workflow_run:
workflows: ["unit-tests"]
types:
- completed
jobs:
upload:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
strategy:
fail-fast: true
name: upload-coverage
steps:
- name: Setup logs directory
run: mkdir -p build/coverage
- name: Download clover.xml artifact
uses: dawidd6/action-download-artifact@v7
with:
workflow: unit-tests
name: clover.xml
path: build/coverage
- name: Upload Coverage to Codacy
shell: bash
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r build/coverage/clover.xml
+3 -3
View File
@@ -34,7 +34,7 @@ This library aims to support RFCs:
* [Spoofchecking](/src/Validation/Extra/SpoofCheckValidation.php) and
[DNSCheckValidation](/src/Validation/DNSCheckValidation.php) validation
requires that your PHP system has the
[PHP Internationalization Libraries](https://php.net/manual/en/book.intl.php)
[PHP Internationalization Libraries](https://php.net/manual/en/book.intl.php)
(also known as PHP Intl)
**Note**: `PHP version upgrades will happen to accomodate to the pace of major
@@ -109,6 +109,7 @@ Validations not present in the RFCs
1. [SpoofCheckValidation](/src/Validation/Extra/SpoofCheckValidation.php):
Will check for multi-utf-8 chars that can signal an erroneous email name.
### How to extend
It's easy! You just need to implement
@@ -125,8 +126,7 @@ Is short and simple and will help a lot.
(You can find current contributors
[here](https://github.com/egulias/EmailValidator/graphs/contributors))
As this is a port from another library and work, here are other people related
to the previous one:
As this is a port from another library and work, here are other people related to the previous one:
* Ricard Clau [@ricardclau](https://github.com/ricardclau):
Performance against PHP built-in filter_var (v2 and earlier)
+1 -1
View File
@@ -11,6 +11,6 @@ class NoDNSRecord implements Reason
public function description() : string
{
return 'No MX or A DNS record was found for this email';
return 'No MX or A DSN record was found for this email';
}
}
+4 -8
View File
@@ -6,26 +6,22 @@ interface Result
{
/**
* Is validation result valid?
*
*/
public function isValid(): bool;
public function isValid() : bool;
/**
* Is validation result invalid?
* Usually the inverse of isValid()
*
*/
public function isInvalid(): bool;
public function isInvalid() : bool;
/**
* Short description of the result, human readable.
*
*/
public function description(): string;
public function description() : string;
/**
* Code for user land to act upon.
*
*/
public function code(): int;
public function code() : int;
}
+1 -1
View File
@@ -15,7 +15,7 @@ class DNSGetRecordWrapper
// A workaround to fix https://bugs.php.net/bug.php?id=73149
set_error_handler(
static function (int $errorLevel, string $errorMessage): never {
throw new \RuntimeException(sprintf('Unable to get DNS record for the host: %s', $errorMessage));
throw new \RuntimeException("Unable to get DNS record for the host: $errorMessage");
}
);
try {