chore: cleanup, update workflows, codestyle

This commit is contained in:
2025-07-28 15:14:59 +03:00
parent 8c67190431
commit 0fdb31cb75
10 changed files with 11 additions and 34 deletions

View File

@@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # 2.34.1
- uses: shivammathur/setup-php@34a5396826718e0013f08e3e639d1c315d5f6b23 # 2.35.0
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run PHP_CodeSniffer (PSR-12)

View File

@@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup PHP
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # 2.34.1
uses: shivammathur/setup-php@34a5396826718e0013f08e3e639d1c315d5f6b23 # 2.35.0
with:
coverage: pcov

View File

@@ -25,6 +25,8 @@ ENABLE_LINTERS:
- JSON_PRETTIER
- JAVASCRIPT_ES
- TYPESCRIPT_ES
- PHP_PHPCS
- PHP_PSALM
YAML_YAMLLINT_CONFIG_FILE: .yamllint.yml
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .markdownlint.json
@@ -32,4 +34,4 @@ JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json
TYPESCRIPT_ES_CONFIG_FILE: .eslintrc.json
FILTER_REGEX_EXCLUDE: >
(node_modules|\.automation/test|docs/json-schemas|\.github/workflows)
(vendor|node_modules|\.automation/test|docs/json-schemas)

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2025 Ismo Vuorinen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,8 +1,9 @@
{
"$ref": "https://getcomposer.org/schema.json",
"$schema": "https://getcomposer.org/schema.json",
"name": "ivuorinen/monolog-gdpr-filter",
"description": "Monolog processor for GDPR masking with regex and dot-notation paths",
"version": "1.0.0",
"license": "MIT",
"type": "library",
"scripts": {
"lint": [

View File

@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<ruleset name="PSR12"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>PHP_CodeSniffer configuration for PSR-12 coding standard.</description>
<rule ref="PSR12" />
<file>src/</file>

View File

@@ -264,9 +264,6 @@ class GdprProcessor implements ProcessorInterface
/**
* Set the audit logger callable.
*
* @param callable|null $auditLogger
* @return void
*/
public function setAuditLogger(?callable $auditLogger): void
{

View File

@@ -127,8 +127,6 @@ class GdprDefaultPatternsTest extends TestCase
$this->assertSame($notApiKey, $processor->maskMessage($notApiKey));
}
public function testPatternMac(): void
{
$patterns = GdprProcessor::getDefaultPatterns();

View File

@@ -303,6 +303,7 @@ class GdprProcessorTest extends TestCase
};
$processor = new GdprProcessor($invalidPattern);
$processor->setAuditLogger($logger);
$result = $processor->regExpMessage('test');
$this->assertTrue($called, 'Audit logger should be called on preg_replace error');
$this->assertSame('test', $result, 'Message should be unchanged if preg_replace fails');

View File

@@ -13,8 +13,6 @@ use Monolog\JsonSerializableDateTimeImmutable;
use Monolog\Level;
use Monolog\Logger;
use Monolog\LogRecord;
use ReflectionClass;
use ReflectionException;
use ReflectionMethod;
use Stringable;
@@ -62,7 +60,7 @@ trait TestHelpers
object|string $object,
string $methodName = '',
): ReflectionMethod {
if (empty($methodName) && is_string($object)) {
if (($methodName === '' || $methodName === '0') && is_string($object)) {
$method = new ReflectionMethod($object);
} else {
$method = new ReflectionMethod($object, $methodName);