Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP-1111] feat: upgrade to php 8.1 #5

Merged
merged 19 commits into from
Dec 16, 2022
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
2 changes: 0 additions & 2 deletions .coveralls.yml

This file was deleted.

137 changes: 137 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Continuous Integration
on:
push:
branches: [master]
pull_request: ~
env:
PHP_VERSION: 8.1
jobs:
code-style-lint:
name: Code style lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
tools: composer:v2
- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer
- name: Store vendor
uses: actions/cache@v1
with:
path: vendor
key: ${{ runner.os }}-vendor
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction

- name: Cache PHP-CS-Fixer
uses: actions/cache@v1
with:
path: .php_cs.cache
key: ${{ runner.os }}-php-cs-fixer
- name: Run code style check
run: composer lint:check
security-check:
name: Security check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
tools: composer:v2
- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer
- name: Store vendor
uses: actions/cache@v1
with:
path: vendor
key: ${{ runner.os }}-vendor
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction

- name: Run security check
run: composer security-check
test-unit-coverage:
name: Unit tests and coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: pcov
tools: composer:v2
- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer
- name: Store vendor
uses: actions/cache@v1
with:
path: vendor
key: ${{ runner.os }}-vendor
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction
- name: Run unit tests check
run: composer test:unit:check
static-analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
tools: composer:v2
- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer
- name: Store vendor
uses: actions/cache@v1
with:
path: vendor
key: ${{ runner.os }}-vendor
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction

- name: Cache PHPStan
uses: actions/cache@v1
with:
path: data/cache/phpstan
key: ${{ runner.os }}-phpstan
- name: Run code static analysis
run: composer static-analysis
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
/phpunit.xml
/vendor
/.idea
/data
/build
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Monolog Cascade [![Build Status](https://travis-ci.org/theorchard/monolog-cascade.svg?branch=master)](https://travis-ci.org/theorchard/monolog-cascade) [![Coverage Status](https://coveralls.io/repos/theorchard/monolog-cascade/badge.svg?branch=master)](https://coveralls.io/r/theorchard/monolog-cascade?branch=master)
Monolog Cascade
===============

Compatibility
-------------

| PHP | Tag | Branch |
|------|-----|--------|
| ^8.1 | 1.X | master |
| ^7.0 | 0.X | 7.2 |

What is Monolog Cascade?
------------------------

Expand Down
81 changes: 54 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,61 @@
"license": "MIT",
"type": "library",
"description": "Monolog extension to configure multiple loggers in the blink of an eye and access them from anywhere",
"keywords": ["monolog", "cascade", "monolog extension", "monolog plugin", "monolog utils", "logger", "log"],
"authors": [
{
"name": "Raphaël Antonmattei",
"email": "[email protected]",
"homepage": "https://github.com/rantonmattei"
}
"keywords": [
"monolog",
"cascade",
"monolog extension",
"monolog plugin",
"monolog utils",
"logger",
"log"
],
"homepage": "https://github.com/theorchard/monolog-cascade",
"require": {
"php": "^7.0",
"symfony/config": "^2.7 || ^3.0 || ^4.0 || ^5.0",
"symfony/options-resolver": "^2.7 || ^3.0 || ^4.0 || ^5.0",
"symfony/serializer": "^2.7 || ^3.0 || ^4.0 || ^5.0",
"symfony/yaml": "^2.7 || ^3.0 || ^4.0 || ^5.0",
"monolog/monolog": "^1.13 || ^2.0"
"php": "^8.1",
"symfony/config": "^6.1",
"symfony/options-resolver": "^6.1",
"symfony/serializer": "^6.1",
"symfony/yaml": "^6.1",
"monolog/monolog": "^3.2"
},
"require-dev": {
"mikey179/vfsstream": "^1.6",
"phpunit/phpcov": "^8.2",
"phpunit/phpunit": "^9.5",
"php-coveralls/php-coveralls": "^2.5",
"squizlabs/php_codesniffer": "^3.7",
"phpstan/phpstan": "^1.8",
"friendsofphp/php-cs-fixer": "^3.12",
"michaelmoussa/php-coverage-checker": "^1.1"
},
"scripts": {
"security-check": [
"curl -sS https://get.symfony.com/cli/installer | bash -s -- --install-dir=/usr/local/bin",
"symfony check:security"
],
"test:unit:base": [
"php -d pcov.enabled=1 vendor/bin/phpunit --color=always"
],
"test:unit": [
"@test:unit:base --log-junit build/junit.xml --coverage-xml build/coverage-xml --coverage-clover build/coverage-clover.xml"
],
"test:unit:with-html-coverage": [
"@test:unit:base --coverage-html build/coverage-html"
],
"test:unit:no-coverage": [
"@test:unit:base --no-coverage"
],
"test:unit:coverage-checker": [
"php-coverage-checker build/coverage-clover.xml 100; # comment trick to allow composer params :D"
],
"test:unit:check": [
"if [ -f build/coverage-clover.xml ]; then rm build/coverage-clover.xml; echo '>>> REMOVED OLD CLOVER.XML BUILD FILE!'; fi;",
"@test:unit",
"@test:unit:coverage-checker"
],
"static-analysis": [
"phpstan analyse --ansi --memory-limit=-1"
]
},
"autoload": {
"psr-4": {
Expand All @@ -30,17 +69,5 @@
"Cascade\\Tests\\": "tests/"
}
},
"require-dev": {
"mikey179/vfsstream": "^1.6",
"phpunit/phpcov": "~4.0.5",
"phpunit/phpunit": "~6.5.14",
"satooshi/php-coveralls": "~2.2",
"squizlabs/php_codesniffer": "~3.0"
},
"prefer-stable": true,
"extra": {
"branch-alias": {
"dev-master": "0.5.x-dev"
}
}
"prefer-stable": true
}
7 changes: 7 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
parameters:
level: 6
paths:
- src
tmpDir: data/cache/phpstan
checkGenericClassInNonGenericObjectType: false
treatPhpDocTypesAsCertain: false
33 changes: 15 additions & 18 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Monolog-Cascade Test Suite">
<directory>tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>

<php>
<ini name="date.timezone" value="UTC"/>
</php>
</phpunit>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Monolog-Cascade Test Suite">
<directory>tests/</directory>
</testsuite>
</testsuites>
<php>
<ini name="date.timezone" value="UTC"/>
</php>
</phpunit>
10 changes: 5 additions & 5 deletions src/Cascade.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public static function getConfig()
/**
* Load configuration options from a file, a JSON or Yaml string or an array.
*
* @param string|array $resource Path to config file or configuration as string or array
* @param string|array<mixed> $resource Path to config file or configuration as string or array
*/
public static function fileConfig($resource)
public static function fileConfig($resource): void
{
self::$config = new Config($resource, new ConfigLoader());
self::$config->load();
Expand All @@ -115,7 +115,7 @@ public static function fileConfig($resource)
*
* @param string $configString Configuration in string form
*/
public static function loadConfigFromString($configString)
public static function loadConfigFromString($configString): void
{
self::fileConfig($configString);
}
Expand All @@ -124,9 +124,9 @@ public static function loadConfigFromString($configString)
* Load configuration options from an array. Alias of fileConfig.
* @see fileConfig
*
* @param array $configArray Configuration in array form
* @param array<mixed> $configArray Configuration in array form
*/
public static function loadConfigFromArray($configArray)
public static function loadConfigFromArray($configArray): void
{
self::fileConfig($configArray);
}
Expand Down
Loading