Skip to content

Commit f49e0f8

Browse files
authored
Merge pull request #1160 from CakeDC/recovered-branch
fix deprecations, PR recovered
2 parents 37747a8 + b1e6054 commit f49e0f8

32 files changed

+215
-191
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php-version: ['8.1', '8.2', '8.3', '8.4']
16+
php-version: ['8.2', '8.3', '8.4']
1717
db-type: [sqlite, mysql, pgsql]
1818
prefer-lowest: ['']
1919

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ composer.lock
55
.php_cs*
66
/coverage
77
.phpunit.result.cache
8+
.phpunit.cache
89
/config/Migrations/schema-dump-default.lock

Docs/Documentation/Events.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ logic will be performed if you don't assign an array to result, but if
2525
you set it we will use as redirect url.
2626

2727
- Create or update file src/Event/UsersListener.php:
28+
2829
```php
2930
<?php
3031

@@ -41,7 +42,7 @@ class UsersListener implements EventListenerInterface
4142
public function implementedEvents(): array
4243
{
4344
return [
44-
\CakeDC\Users\Plugin::EVENT_BEFORE_LOGOUT => 'beforeLogout',
45+
\CakeDC\Users\UsersPlugin::EVENT_BEFORE_LOGOUT => 'beforeLogout',
4546
];
4647
}
4748

@@ -75,6 +76,7 @@ object and the controller object.
7576
You can also populate the new user entity or stop the register process.
7677

7778
- Create or update file src/Event/UsersListener.php:
79+
7880
```php
7981
<?php
8082

@@ -90,7 +92,7 @@ class UsersListener implements EventListenerInterface
9092
public function implementedEvents(): array
9193
{
9294
return [
93-
\CakeDC\Users\Plugin::EVENT_BEFORE_REGISTER => 'beforeRegister',
95+
\CakeDC\Users\UsersPlugin::EVENT_BEFORE_REGISTER => 'beforeRegister',
9496
];
9597
}
9698

@@ -136,6 +138,7 @@ have access to 'location' and 'request' keys in the event object and
136138
the controller object.
137139

138140
- Create or update file src/Event/UsersListener.php:
141+
139142
```php
140143
<?php
141144

@@ -151,7 +154,7 @@ class UsersListener implements EventListenerInterface
151154
public function implementedEvents(): array
152155
{
153156
return [
154-
\CakeDC\Users\Plugin::EVENT_BEFORE_SOCIAL_LOGIN_REDIRECT => 'beforeSocialLoginRedirect',
157+
\CakeDC\Users\UsersPlugin::EVENT_BEFORE_SOCIAL_LOGIN_REDIRECT => 'beforeSocialLoginRedirect',
155158
];
156159
}
157160

@@ -183,6 +186,7 @@ the social behavior object.
183186
You can also set a new user entity object as result.
184187

185188
- Create or update file src/Event/UsersListener.php:
189+
186190
```php
187191
<?php
188192

@@ -198,7 +202,7 @@ class UsersListener implements EventListenerInterface
198202
public function implementedEvents(): array
199203
{
200204
return [
201-
\CakeDC\Users\Plugin::EVENT_BEFORE_SOCIAL_LOGIN_REDIRECT => 'beforeSocialLoginRedirect',
205+
\CakeDC\Users\UsersPlugin::EVENT_BEFORE_SOCIAL_LOGIN_REDIRECT => 'beforeSocialLoginRedirect',
202206
];
203207
}
204208

@@ -229,6 +233,7 @@ have access to user data. You can also set an array as result to
229233
perform a custom redirect.
230234

231235
- Create or update file src/Event/UsersListener.php:
236+
232237
```php
233238
<?php
234239

@@ -247,7 +252,7 @@ class UsersListener implements EventListenerInterface
247252
public function implementedEvents(): array
248253
{
249254
return [
250-
\CakeDC\Users\Plugin::EVENT_AFTER_LOGIN => 'afterLogin',
255+
\CakeDC\Users\UsersPlugin::EVENT_AFTER_LOGIN => 'afterLogin',
251256
];
252257
}
253258

@@ -281,6 +286,7 @@ have access to user data and the controller object. You can also
281286
set an array as result to perform a custom redirect.
282287

283288
- Create or update file src/Event/UsersListener.php:
289+
284290
```php
285291
<?php
286292

@@ -296,7 +302,7 @@ class UsersListener implements EventListenerInterface
296302
public function implementedEvents(): array
297303
{
298304
return [
299-
\CakeDC\Users\Plugin::EVENT_AFTER_LOGOUT => 'afterLogout',
305+
\CakeDC\Users\UsersPlugin::EVENT_AFTER_LOGOUT => 'afterLogout',
300306
];
301307
}
302308

@@ -332,6 +338,7 @@ set a custom http response as result to render a different content
332338
or perform a custom redirect.
333339

334340
- Create or update file src/Event/UsersListener.php:
341+
335342
```php
336343
<?php
337344

@@ -347,7 +354,7 @@ class UsersListener implements EventListenerInterface
347354
public function implementedEvents(): array
348355
{
349356
return [
350-
\CakeDC\Users\Plugin::EVENT_AFTER_REGISTER => 'afterRegister',
357+
\CakeDC\Users\UsersPlugin::EVENT_AFTER_REGISTER => 'afterRegister',
351358
];
352359
}
353360

@@ -383,6 +390,7 @@ you have access to some user data and the controller object. You can also
383390
set an array as result to perform a custom redirect.
384391

385392
- Create or update file src/Event/UsersListener.php:
393+
386394
```php
387395
<?php
388396

@@ -398,7 +406,7 @@ class UsersListener implements EventListenerInterface
398406
public function implementedEvents(): array
399407
{
400408
return [
401-
\CakeDC\Users\Plugin::EVENT_AFTER_CHANGE_PASSWORD => 'afterChangePassword',
409+
\CakeDC\Users\UsersPlugin::EVENT_AFTER_CHANGE_PASSWORD => 'afterChangePassword',
402410
];
403411
}
404412

@@ -433,6 +441,7 @@ When adding a custom logic to execute after sending the token for user
433441
validation you can also set an array as result to perform a custom redirect.
434442

435443
- Create or update file src/Event/UsersListener.php:
444+
436445
```php
437446
<?php
438447

@@ -448,7 +457,7 @@ class UsersListener implements EventListenerInterface
448457
public function implementedEvents(): array
449458
{
450459
return [
451-
\CakeDC\Users\Plugin::EVENT_AFTER_RESEND_TOKEN_VALIDATION => 'afterResendTokenValidation',
460+
\CakeDC\Users\UsersPlugin::EVENT_AFTER_RESEND_TOKEN_VALIDATION => 'afterResendTokenValidation',
452461
];
453462
}
454463

@@ -482,6 +491,7 @@ you have access to some user data and the controller object. You can also
482491
set an array as result to perform a custom redirect.
483492

484493
- Create or update file src/Event/UsersListener.php:
494+
485495
```php
486496
<?php
487497

@@ -497,7 +507,7 @@ class UsersListener implements EventListenerInterface
497507
public function implementedEvents(): array
498508
{
499509
return [
500-
\CakeDC\Users\Plugin::EVENT_AFTER_EMAIL_TOKEN_VALIDATION => 'afterEmailTokenValidation',
510+
\CakeDC\Users\UsersPlugin::EVENT_AFTER_EMAIL_TOKEN_VALIDATION => 'afterEmailTokenValidation',
501511
];
502512
}
503513

@@ -530,6 +540,7 @@ I want to add custom logic after user email is validated to autologin user
530540
This is how you can autologin the user after email is validate:
531541

532542
- Create or update file src/Event/UsersListener.php:
543+
533544
```php
534545
<?php
535546

@@ -545,7 +556,7 @@ class UsersListener implements EventListenerInterface
545556
public function implementedEvents(): array
546557
{
547558
return [
548-
\CakeDC\Users\Plugin::EVENT_AFTER_EMAIL_TOKEN_VALIDATION => 'afterEmailTokenValidation',
559+
\CakeDC\Users\UsersPlugin::EVENT_AFTER_EMAIL_TOKEN_VALIDATION => 'afterEmailTokenValidation',
549560
];
550561
}
551562

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"prefer-stable": true,
3030
"require": {
3131
"php": ">=8.1",
32-
"cakephp/cakephp": "^5.0",
32+
"cakephp/cakephp": "5.3.0-RC2",
3333
"cakedc/auth": "^10.1",
3434
"cakephp/authorization": "^3.0",
3535
"cakephp/authentication": "^3.0"
@@ -88,9 +88,9 @@
8888
"test": "phpunit --stderr",
8989
"stan": "phpstan analyse src/",
9090
"psalm": "php vendor/psalm/phar/psalm.phar --show-info=false src/ ",
91-
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:~1.9.0 psalm/phar:~5.1.0 && mv composer.backup composer.json",
92-
"stan-rebuild-baseline": "phpstan analyse --configuration phpstan.neon --error-format baselineNeon src/ > phpstan-baseline.neon",
93-
"psalm-rebuild-baseline": "php vendor/psalm/phar/psalm.phar --show-info=false --set-baseline=psalm-baseline.xml src/",
91+
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:~2.1.0 psalm/phar:~6.14.0 && mv composer.backup composer.json",
92+
"stan-rebuild-baseline": "phpstan analyse --generate-baseline",
93+
"psalm-rebuild-baseline": "php vendor/psalm/phar/psalm.phar --show-info=false --set-baseline=psalm-baseline.xml",
9494
"rector": "rector process src/",
9595
"rector-setup": "cp composer.json composer.backup && composer require --dev rector/rector:^0.11.2 && mv composer.backup composer.json",
9696
"coverage-test": "phpunit --stderr --coverage-clover=clover.xml"

0 commit comments

Comments
 (0)