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
21 changes: 3 additions & 18 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# There is no code, we don't have to test old PHP versions
php-versions:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
dependency-levels:
- 'highest'
experimental:
- false
include:
- php-versions: 5.4
- php-versions: 7.4
dependency-levels: 'lowest'
experimental: false
fail-fast: false
Expand All @@ -41,10 +35,6 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

# Because PHPCS 3 requires PHP 5.4
- run: composer require --dev -W squizlabs/php_codesniffer:^2.0 symfony/yaml:^2.0 phpdocumentor/reflection-docblock:^2.0
if: matrix.php-versions == '5.3'

- name: Install dependencies
uses: ramsey/composer-install@v1
with:
Expand All @@ -53,8 +43,3 @@ jobs:

- name: PhpUnit
run: ./vendor/bin/phpunit

- name: PHPCS
run: ./vendor/bin/phpcs -s --report-source --runtime-set ignore_warnings_on_exit 1
# Because PHPCS 2 does not have PSR-12 rule
if: matrix.php-versions != '5.3'
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [[*next-version*]] - YYYY-MM-DD
Initial release. This ports the test for and from [`psr/log`][], according to
## [1.0.0] - YYYY-MM-DD

- Initial release. This ports the test for and from [`psr/log` v1.1][], according to
[decision][1].


Expand Down
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,51 @@
# PSR - Log Util
Utilities for the [`psr/log`][] package that backs the [PSR-3][] specification.

* `Psr\Log\Test\LoggerInterfaceTest` provides a base test class for ensuring compliance with the LoggerInterface.
* `Psr\Log\Test\TestLogger` is a mock class for testing purposes.

## Installation

This package should be used only for tests.

For PHP 8.0+ only, you may remove support for `psr/log: 1.x`:

```json
{
"require": {
"php": ">=8.0.0",
"psr/log": "^2.0 | ^3.0"
},
"require-dev": {
"psr/log-utils": "^1.1"
}
}
```

If the project supports older versions of PHP:

```json
{
"require": {
"psr/log": "^1.1.14 | ^2.0"
},
"require-dev": {
"psr/log-utils": "^1.0"
}
}
```

> **Note:** In `psr/log: 3.0.0`, `Psr\Log\LoggerInterface` has union types for method arguments.
> Implementing this interface with PHP 7 compatibility is not possible.

## Versions

The version of `psr/log-utils` that is installed after composer dependencies resolution varies with the version of `psr/log`.

| psr/log | psr/log-utils | |
|--------------|---------------|-------------------------------------------------|
| `^1.1.14` | `1.0.*` | Empty package, classes a provided by `psr/log`. |
| `^2.0|^3.0` | `^1.1` | Imports test classes removed from `psr/log`. |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just seen the table is not correctly rendered.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be

| psr/log       | psr/log-utils |                                                 |
|---------------|---------------|-------------------------------------------------|
| `^1.1.14`     | `1.0.*`       | Empty package, classes a provided by `psr/log`. |
| `^2.0\|^3.0`  | `^1.1`        | Imports test classes removed from `psr/log`.    |
psr/log psr/log-utils
^1.1.14 1.0.* Empty package, classes a provided by psr/log.
^2.0|^3.0 ^1.1 Imports test classes removed from psr/log.


[`psr/log`]: https://packagist.org/packages/psr/log
[PSR-3]: https://www.php-fig.org/psr/psr-3/
17 changes: 3 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,25 @@
{
"name": "psr/log-util",
"description": "Utilities for the psr/log package that backs the PSR-3 specification.",
"minimum-stability": "dev",
"license": "MIT",
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/",
"role": "Organisation"
},
{
"name": "Anton Ukhanev",
"email": "xedin.unknown@gmail.com",
"role": "Developer"
}
],
"require": {
"php": "^5.3 | ^7.0 | ^8.0",
"psr/log": "^1.1.4"
"psr/log": "^1.1.1"
},
"require-dev": {
"phpunit/phpunit": "^4.0 | ^5.0 | ^6.0 | ^7.0 | ^8.0 | ^9.0",
"phpunit/phpunit": "^8.0 | ^9.0",
"squizlabs/php_codesniffer": "^3.6"
},
"autoload": {
"psr-4": {
"Psr\\Log\\Util\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Psr\\Log\\Util\\Tests\\": "tests"
"Psr\\Log\\Tests\\": "tests"
}
}
}
Loading