Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ on:

name: build

permissions:
contents: read

jobs:
phpunit:
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
Expand All @@ -33,3 +36,34 @@ jobs:
php: >-
['8.2', '8.3', '8.4', '8.5']
extensions: sodium, openssl

phpunit-without-openssl:
name: PHP 8.2 without openssl
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
Comment thread
Tigrov marked this conversation as resolved.

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
Comment thread
Tigrov marked this conversation as resolved.

- name: Install Composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0

- name: Prepare PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: xdebug
extensions: :openssl

- name: Run tests with PHPUnit with code coverage
run: vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
24 changes: 24 additions & 0 deletions .github/workflows/rector-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Rector + PHP CS Fixer

on:
pull_request:
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/rector-cs.yml'
- 'composer.json'
- 'rector.php'
- '.php-cs-fixer.dist.php'

permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
rector:
uses: yiisoft/actions/.github/workflows/rector-cs.yml@master
with:
php: '8.2'
24 changes: 0 additions & 24 deletions .github/workflows/rector.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ composer.phar
/phpunit.phar
/phpunit.xml
/.phpunit.cache

# PHP CS Fixer
/.php-cs-fixer.cache
/.php-cs-fixer.php
21 changes: 21 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
use Yiisoft\CodeStyle\ConfigBuilder;

$finder = (new Finder())->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])->notPath('MockHelper.php');

return ConfigBuilder::build()
->setRiskyAllowed(true)
->setParallelConfig(ParallelConfigFactory::detect())
->setRules([
'@Yiisoft/Core' => true,
'@Yiisoft/Core:risky' => true,
])
->setFinder($finder);
85 changes: 0 additions & 85 deletions .styleci.yml

This file was deleted.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
- Bug #72: Fix possibly null offset in `PasswordHasher` (@olegbaturin)
- Chg #75: Bump minimal required PHP version to 8.2 (@vjik)
- Enh #75: Mark `Mac` class as readonly (@vjik)
- Enh #76: Explicitly import classes, functions and constants in "use" section (@vjik)
- Enh #76: Make `ext-openssl` optional, it is required only for `Crypt` class (@vjik)
- Bug #76: Use `ValueError` catching instead of `hash_hmac()` return value check in `Mac` (@vjik)

## 1.2.0 November 25, 2025

Expand Down
10 changes: 8 additions & 2 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"symbol-whitelist": [
"random_bytes"
"php-core-extensions" : [
"Core",
"hash",
"Reflection",
"SPL",
"random",
"standard",
"openssl"
]
}
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@
"require": {
"php": "8.2 - 8.5",
"ext-hash": "*",
"ext-openssl": "*",
"yiisoft/strings": "^2.0"
},
"suggest": {
"ext-openssl": "Required to use Crypt class"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.9.1",
"friendsofphp/php-cs-fixer": "^3.95.10",
"maglnet/composer-require-checker": "^4.17.0",
"phpunit/phpunit": "^11.5.55",
"rector/rector": "^2.4.6",
"spatie/phpunit-watcher": "^1.24.4"
"spatie/phpunit-watcher": "^1.24.4",
"yiisoft/code-style": "^1.0.0"
},
"autoload": {
"psr-4": {
Expand All @@ -67,7 +71,8 @@
"test": "phpunit --display-deprecations",
"test-watch": "phpunit-watcher watch",
"psalm": "psalm",
"rector": "rector"
"rector": "rector",
"cs-fix": "php-cs-fixer fix"
},
"config": {
"sort-packages": true,
Expand Down
4 changes: 3 additions & 1 deletion src/AuthenticationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace Yiisoft\Security;

final class AuthenticationException extends \RuntimeException
use RuntimeException;

final class AuthenticationException extends RuntimeException
{
public function __construct()
{
Expand Down
Loading
Loading