Skip to content

Commit 20d2b30

Browse files
author
Nikola
committed
Release 1.0.0
2 parents 436b21f + 114545a commit 20d2b30

60 files changed

Lines changed: 292 additions & 184 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.php]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.{json,yml,yaml}]
14+
indent_style = space
15+
indent_size = 4
16+
17+
[*.md]
18+
trim_trailing_whitespace = false
19+
20+
[Makefile]
21+
indent_style = tab

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, develop]
6+
pull_request:
7+
branches: [master, develop]
8+
9+
jobs:
10+
tests:
11+
name: PHP ${{ matrix.php-version }}
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
php-version: ["8.2", "8.3", "8.4"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php-version }}
25+
extensions: mbstring, sodium
26+
coverage: none
27+
28+
- name: Install dependencies
29+
run: composer install --no-interaction --prefer-dist
30+
31+
- name: Run tests
32+
run: composer test
33+
34+
cs:
35+
name: Code Style
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Setup PHP
42+
uses: shivammathur/setup-php@v2
43+
with:
44+
php-version: "8.3"
45+
coverage: none
46+
47+
- name: Install dependencies
48+
run: composer install --no-interaction --prefer-dist
49+
50+
- name: Run phpcs
51+
run: composer cs
52+
53+
stan:
54+
name: Static Analysis
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
60+
- name: Setup PHP
61+
uses: shivammathur/setup-php@v2
62+
with:
63+
php-version: "8.3"
64+
coverage: none
65+
66+
- name: Install dependencies
67+
run: composer install --no-interaction --prefer-dist
68+
69+
- name: Run phpstan
70+
run: composer stan 2>/dev/null || vendor/bin/phpstan analyse

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function initialize(): void
106106
parent::initialize();
107107
$this->loadComponent('Flash');
108108
$this->loadComponent('Authentication.Authentication');
109-
$this->loadComponent('Verification.Verification');
109+
$this->loadComponent('CakeVerification.Verification');
110110
}
111111
```
112112

composer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
"description": "Verification and step-up authentication for CakePHP 5: email verification links, Email OTP, SMS OTP, and TOTP.",
44
"type": "cakephp-plugin",
55
"license": "MIT",
6+
"keywords": ["cakephp", "plugin", "verification", "authentication", "otp", "totp", "2fa", "mfa", "sms", "email"],
67
"require": {
78
"php": "^8.2",
89
"cakephp/cakephp": "^5.3",
910
"cakephp/authentication": "^4.0"
1011
},
1112
"autoload": {
1213
"psr-4": {
13-
"Verification\\": "src/"
14+
"CakeVerification\\": "src/"
1415
}
1516
},
1617
"autoload-dev": {
1718
"psr-4": {
18-
"Verification\\Test\\": "tests/"
19+
"CakeVerification\\Test\\": "tests/"
1920
}
2021
},
2122
"suggest": {
@@ -29,7 +30,8 @@
2930
"scripts": {
3031
"test": "phpunit",
3132
"cs": "phpcs -p",
32-
"cbf": "phpcbf"
33+
"cbf": "phpcbf",
34+
"stan": "phpstan analyse --memory-limit=512M"
3335
},
3436
"support": {
3537
"issues": "https://github.com/salines/cakephp-verification/issues",
@@ -42,6 +44,9 @@
4244
"url": "https://www.paypal.me/paradzikn"
4345
}
4446
],
47+
"extra": {
48+
"installer-name": "CakeVerification"
49+
},
4550
"config": {
4651
"allow-plugins": {
4752
"dealerdirect/phpcodesniffer-composer-installer": true

config/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
try {
1111
Configure::config('default', new PhpConfig());
1212
// Load plugin defaults (false = overwrite), then restore app overrides on top.
13-
Configure::load('Verification.verification', 'default', false);
13+
Configure::load('CakeVerification.verification', 'default', false);
1414
} catch (Exception $e) {
1515
exit($e->getMessage() . "\n");
1616
}

config/verification.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22
declare(strict_types=1);
33

4-
use Verification\Transport\Sms\Driver\DummyTransport;
5-
use Verification\Verificator\Driver\EmailOtpVerificator;
6-
use Verification\Verificator\Driver\EmailVerifyVerificator;
7-
use Verification\Verificator\Driver\SmsOtpVerificator;
8-
use Verification\Verificator\Driver\TotpVerificator;
4+
use CakeVerification\Transport\Sms\Driver\DummyTransport;
5+
use CakeVerification\Verificator\Driver\EmailOtpVerificator;
6+
use CakeVerification\Verificator\Driver\EmailVerifyVerificator;
7+
use CakeVerification\Verificator\Driver\SmsOtpVerificator;
8+
use CakeVerification\Verificator\Driver\TotpVerificator;
99

1010
/**
1111
* salines/verification — default configuration.

docs/api/sms_transport.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ see [sms_verification.md](../sms_verification.md).
99

1010
## TransportInterface
1111

12-
Every SMS transport must implement `Verification\Transport\Sms\TransportInterface`:
12+
Every SMS transport must implement `CakeVerification\Transport\Sms\TransportInterface`:
1313

1414
```php
15-
namespace Verification\Transport\Sms;
15+
namespace CakeVerification\Transport\Sms;
1616

1717
interface TransportInterface
1818
{
@@ -46,9 +46,9 @@ interface TransportInterface
4646
```php
4747
namespace App\Sms;
4848

49-
use Verification\Transport\Sms\Message;
50-
use Verification\Transport\Sms\Result;
51-
use Verification\Transport\Sms\TransportInterface;
49+
use CakeVerification\Transport\Sms\Message;
50+
use CakeVerification\Transport\Sms\Result;
51+
use CakeVerification\Transport\Sms\TransportInterface;
5252

5353
class TwilioTransport implements TransportInterface
5454
{

docs/api/verificator_interface.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ If you need a custom step (e.g. backup codes, hardware key), implement this inte
1010
## Interface
1111

1212
```php
13-
namespace Verification\Verificator;
13+
namespace CakeVerification\Verificator;
1414

1515
use Authentication\IdentityInterface;
1616
use Psr\Http\Message\ServerRequestInterface;
@@ -54,7 +54,7 @@ namespace App\Verification;
5454

5555
use Authentication\IdentityInterface;
5656
use Psr\Http\Message\ServerRequestInterface;
57-
use Verification\Verificator\VerificationVerificatorInterface;
57+
use CakeVerification\Verificator\VerificationVerificatorInterface;
5858

5959
class BackupCodeVerificator implements VerificationVerificatorInterface
6060
{

docs/email_verification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ bundled templates:
267267

268268
```php
269269
$this->viewBuilder()
270-
->setPlugin('Verification')
270+
->setPlugin('CakeVerification')
271271
->setTemplate('email_otp');
272272
```
273273

docs/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This adds an entry to `config/plugins.php`. Alternatively, add it manually in
2424
`src/Application.php`:
2525

2626
```php
27-
$this->addPlugin('Verification');
27+
$this->addPlugin('CakeVerification');
2828
```
2929

3030
## 3) Publish config
@@ -45,7 +45,7 @@ public function initialize(): void
4545
parent::initialize();
4646
$this->loadComponent('Flash');
4747
$this->loadComponent('Authentication.Authentication');
48-
$this->loadComponent('Verification.Verification');
48+
$this->loadComponent('CakeVerification.Verification');
4949
}
5050
```
5151

0 commit comments

Comments
 (0)