Skip to content

Commit

Permalink
Merge pull request #542 from TonisOrmisson/php80
Browse files Browse the repository at this point in the history
V2: dump php 7.4 support
  • Loading branch information
maxxer authored Sep 18, 2024
2 parents 17b72ad + 184bff9 commit 5796aae
Show file tree
Hide file tree
Showing 28 changed files with 42 additions and 71 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.3', '8.2','8.1', '8.0','7.4']
php-versions: ['8.3', '8.2','8.1', '8.0']

services:
mariadb:
Expand All @@ -38,7 +38,7 @@ jobs:
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug

- uses: actions/checkout@v2
- uses: actions/checkout@v4


- name: Verify MariaDB connection
Expand All @@ -52,7 +52,7 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

- Enh: Keycloak auth client (e.luhr)
- Fix: Social Network Auth (eluhr)
- Enh: Added Bootstrap 5 UI, UI related dependencies are suggested not required (you may choose your UI frmawork) (TonisOrmisson)
- Enh: Raised phpstan static code analyzer level 1=>5 with fixes (TonisOrmisson)
- Enh: Raised minimum PHP version 7.4=>8.0 (TonisOrmisson)

## 1.6.2 Jan 4th, 2024

Expand Down
2 changes: 1 addition & 1 deletion codeception.dist.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
actor: Tester
paths:
tests: tests
log: tests/_output
output: tests/_output
data: tests/_data
helpers: tests/_support
bootstrap: _bootstrap.php
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=5.5",
"php": ">=8.0",
"yiisoft/yii2-authclient": "^2.1",
"yiisoft/yii2-httpclient": "^2.0",
"yetopen/yii2-sms-sender-interface": "^0.1.1"
Expand All @@ -54,7 +54,6 @@
"2amigos/qrcode-library": "Needed if you want to enable 2FA with QR Code generation. Require version ^1.1"
},
"require-dev": {
"php": ">=7.4",
"kartik-v/yii2-widget-select2": "^2.2",
"yiisoft/yii2-bootstrap5": "^2.0",
"2amigos/2fa-library": "^2.0",
Expand All @@ -63,7 +62,7 @@
"yiisoft/yii2-symfonymailer": "^2|^3",
"squizlabs/php_codesniffer": "*",
"phpmd/phpmd": "@stable",
"codeception/codeception": "^4|^5",
"codeception/codeception": "^5",
"roave/security-advisories": "dev-master",
"codeception/module-filesystem": "^2|^3",
"codeception/module-yii2": "^1.1",
Expand All @@ -83,7 +82,7 @@
},
"config": {
"platform": {
"php": "7.4"
"php": "8.0"
},
"preferred-install": {
"*": "auto"
Expand Down
1 change: 0 additions & 1 deletion src/User/Controller/RegistrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Da\User\Factory\MailFactory;
use Da\User\Form\RegistrationForm;
use Da\User\Form\ResendForm;
use Da\User\Helper\SecurityHelper;
use Da\User\Model\SocialNetworkAccount;
use Da\User\Model\User;
use Da\User\Query\SocialNetworkAccountQuery;
Expand Down
2 changes: 0 additions & 2 deletions src/User/Controller/SecurityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
use Da\User\Service\SocialNetworkAuthenticateService;
use Da\User\Traits\ContainerAwareTrait;
use Da\User\Traits\ModuleAwareTrait;
use Da\User\Validator\TwoFactorEmailValidator;
use Da\User\Validator\TwoFactorTextMessageValidator;
use Yii;
use yii\authclient\AuthAction;
use yii\base\InvalidConfigException;
Expand Down
4 changes: 0 additions & 4 deletions src/User/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,9 @@
use Da\User\Traits\ContainerAwareTrait;
use Da\User\Traits\ModuleAwareTrait;
use Da\User\Validator\AjaxRequestModelValidator;
use Da\User\Validator\TwoFactorCodeValidator;
use Da\User\Validator\TwoFactorEmailValidator;
use Da\User\Validator\TwoFactorTextMessageValidator;
use http\Exception\InvalidArgumentException;
use Yii;
use yii\base\DynamicModel;
use yii\base\InvalidParamException;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
use yii\helpers\ArrayHelper;
Expand Down
3 changes: 1 addition & 2 deletions src/User/Factory/MailFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ public static function makeWelcomeMailerService(User $user, $showPassword = fals

/**
* @param string $email
* @param Token $token
*
* @throws InvalidConfigException
* @return MailService
*/
public static function makeRecoveryMailerService($email, Token $token = null)
public static function makeRecoveryMailerService($email, ?Token $token = null)
{
/** @var Module $module */
$module = Yii::$app->getModule('user');
Expand Down
1 change: 0 additions & 1 deletion src/User/Filter/AccessRuleFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Da\User\Filter;

use Closure;
use Da\User\Model\User;
use Da\User\Traits\ModuleAwareTrait;
use Yii;
Expand Down
1 change: 0 additions & 1 deletion src/User/Filter/TwoFactorAuthenticationEnforceFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Da\User\Filter;

use Da\User\Model\User;
use Da\User\Module;
use Da\User\Traits\AuthManagerAwareTrait;
use Da\User\Traits\ModuleAwareTrait;
use Yii;
Expand Down
4 changes: 0 additions & 4 deletions src/User/Form/LoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@
use Da\User\Query\UserQuery;
use Da\User\Traits\ContainerAwareTrait;
use Da\User\Traits\ModuleAwareTrait;
use Da\User\Validator\TwoFactorCodeValidator;
use Da\User\Validator\TwoFactorEmailValidator;
use Da\User\Validator\TwoFactorTextMessageValidator;
use Yii;
use yii\base\InvalidParamException;
use yii\base\Model;
use yii\helpers\ArrayHelper;
use yii\web\IdentityInterface;

class LoginForm extends Model
{
Expand Down
1 change: 0 additions & 1 deletion src/User/Form/RegistrationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Da\User\Traits\ModuleAwareTrait;
use Yii;
use yii\base\Model;
use yii\helpers\Html;

class RegistrationForm extends Model
{
Expand Down
1 change: 0 additions & 1 deletion src/User/Helper/AuthHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Da\User\Helper;

use Da\User\Model\AbstractAuthItem;
use Da\User\Module;
use Da\User\Traits\AuthManagerAwareTrait;
use Da\User\Traits\ModuleAwareTrait;
use Yii;
Expand Down
1 change: 0 additions & 1 deletion src/User/Service/MailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Da\User\Traits\ModuleAwareTrait;
use Yii;
use yii\mail\BaseMailer;
use yii\mail\MailerInterface;

class MailService implements ServiceInterface
{
Expand Down
52 changes: 26 additions & 26 deletions src/User/Service/SessionHistory/SessionHistoryDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public function getHasSessionId()
}

/** @inheritdoc */
public function setHasSessionId($value)
public function setHasSessionId($value) : void
{
return $this->session->setHasSessionId($value);
$this->session->setHasSessionId($value);
}

/** @inheritdoc */
Expand All @@ -85,9 +85,9 @@ public function getId()
}

/** @inheritdoc */
public function setId($value)
public function setId($value) : void
{
return $this->session->setId($value);
$this->session->setId($value);
}

/** @inheritdoc */
Expand Down Expand Up @@ -125,9 +125,9 @@ public function getName()
}

/** @inheritdoc */
public function setName($value)
public function setName($value) : void
{
return $this->session->setName($value);
$this->session->setName($value);
}

/** @inheritdoc */
Expand All @@ -137,9 +137,9 @@ public function getSavePath()
}

/** @inheritdoc */
public function setSavePath($value)
public function setSavePath($value) : void
{
return $this->session->setSavePath($value);
$this->session->setSavePath($value);
}

/** @inheritdoc */
Expand All @@ -149,9 +149,9 @@ public function getCookieParams()
}

/** @inheritdoc */
public function setCookieParams(array $value)
public function setCookieParams(array $value) : void
{
return $this->session->setCookieParams($value);
$this->session->setCookieParams($value);
}

/** @inheritdoc */
Expand All @@ -161,9 +161,9 @@ public function getUseCookies()
}

/** @inheritdoc */
public function setUseCookies($value)
public function setUseCookies($value) : void
{
return $this->session->setUseCookies($value);
$this->session->setUseCookies($value);
}

/** @inheritdoc */
Expand All @@ -173,9 +173,9 @@ public function getGCProbability()
}

/** @inheritdoc */
public function setGCProbability($value)
public function setGCProbability($value) : void
{
return $this->session->setGCProbability($value);
$this->session->setGCProbability($value);
}

/** @inheritdoc */
Expand All @@ -185,9 +185,9 @@ public function getUseTransparentSessionID()
}

/** @inheritdoc */
public function setUseTransparentSessionID($value)
public function setUseTransparentSessionID($value) : void
{
return $this->session->setUseTransparentSessionID($value);
$this->session->setUseTransparentSessionID($value);
}

/** @inheritdoc */
Expand All @@ -197,9 +197,9 @@ public function getTimeout()
}

/** @inheritdoc */
public function setTimeout($value)
public function setTimeout($value) : void
{
return $this->session->setTimeout($value);
$this->session->setTimeout($value);
}

/** @inheritdoc */
Expand Down Expand Up @@ -313,9 +313,9 @@ public function remove($key)
}

/** @inheritdoc */
public function removeAll()
public function removeAll() : void
{
return $this->session->removeAll();
$this->session->removeAll();
}

/** @inheritdoc */
Expand All @@ -337,15 +337,15 @@ public function getAllFlashes($delete = false)
}

/** @inheritdoc */
public function setFlash($key, $value = true, $removeAfterAccess = true)
public function setFlash($key, $value = true, $removeAfterAccess = true) : void
{
return $this->session->setFlash($key, $value, $removeAfterAccess);
$this->session->setFlash($key, $value, $removeAfterAccess);
}

/** @inheritdoc */
public function addFlash($key, $value = true, $removeAfterAccess = true)
public function addFlash($key, $value = true, $removeAfterAccess = true) : void
{
return $this->session->addFlash($key, $value, $removeAfterAccess);
$this->session->addFlash($key, $value, $removeAfterAccess);
}

/** @inheritdoc */
Expand All @@ -355,9 +355,9 @@ public function removeFlash($key)
}

/** @inheritdoc */
public function removeAllFlashes()
public function removeAllFlashes() : void
{
return $this->session->removeAllFlashes();
$this->session->removeAllFlashes();
}

/** @inheritdoc */
Expand Down
4 changes: 1 addition & 3 deletions src/User/Validator/TwoFactorEmailValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ class TwoFactorEmailValidator extends TwoFactorCodeValidator
*/
public function __construct(User $user, $code, $cycles = 0)
{
$this->user = $user;
$this->code = $code;
$this->cycles = $cycles;
parent::__construct($user, $code, $cycles);
$this->type = 'email';
}

Expand Down
5 changes: 1 addition & 4 deletions src/User/Validator/TwoFactorTextMessageValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ class TwoFactorTextMessageValidator extends TwoFactorCodeValidator
*/
public function __construct(User $user, $code, $cycles = 0)
{
$this->user = $user;

$this->code = $code;
$this->cycles = $cycles;
parent::__construct($user, $code, $cycles);
$this->type = 'sms';
}

Expand Down
1 change: 0 additions & 1 deletion src/User/resources/views/bootstrap3/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use yii\grid\GridView;
use yii\helpers\Html;
use yii\web\View;
use yii\widgets\Pjax;

/**
Expand Down
1 change: 0 additions & 1 deletion src/User/resources/views/bootstrap3/rule/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use yii\grid\ActionColumn;
use yii\grid\GridView;
use yii\helpers\Url;
use yii\rbac\Rule;

/**
* @var \yii\data\ActiveDataProvider $dataProvider
Expand Down
1 change: 0 additions & 1 deletion src/User/resources/views/bootstrap3/security/confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* the LICENSE file that was distributed with this source code.
*/

use Da\User\Widget\ConnectWidget;
use yii\helpers\Html;
use yii\widgets\ActiveForm;

Expand Down
2 changes: 1 addition & 1 deletion src/User/resources/views/bootstrap3/settings/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
->hint(
Html::a(
Yii::t('usuario', 'Change your avatar at Gravatar.com'),
'http://gravatar.com',
'https://gravatar.com',
['target' => '_blank']
)
) ?>
Expand Down
1 change: 0 additions & 1 deletion src/User/resources/views/bootstrap5/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use yii\grid\GridView;
use yii\helpers\Html;
use yii\web\View;
use yii\widgets\Pjax;

/**
Expand Down
Loading

0 comments on commit 5796aae

Please sign in to comment.