Skip to content

Commit a4fcb41

Browse files
committed
new filepathMap config / logResposne - check for BOM / new Utility::callSuppressed() method
1 parent d3ae31d commit a4fcb41

67 files changed

Lines changed: 852 additions & 593 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ It is installable and autoloadable via [Composer](https://getcomposer.org/) as [
4444
```json
4545
{
4646
"require": {
47-
"bdk/debug": "^3.4",
47+
"bdk/debug": "^3.5",
4848
}
4949
}
5050
```
@@ -106,7 +106,8 @@ $monolog->critical('all your base are belong to them');
106106

107107
![Supported PHP versions](https://img.shields.io/static/v1?label=PHP&message=5.4%20-%208.5&color=blue)
108108
![Build Status](https://img.shields.io/github/actions/workflow/status/bkdotcom/PHPDebugConsole/phpunit.yml.svg?branch=master&logo=github)
109-
[![Codacy Score](https://img.shields.io/codacy/grade/e950849edfd9463b993386080d39875e/master.svg?logo=codacy)](https://app.codacy.com/gh/bkdotcom/PHPDebugConsole/dashboard)
109+
[![Maintainability](https://img.shields.io/badge/A-B?style=flat&logo=codeclimate&label=Maintainability&labelColor=5b5b5b&color=4cc71e)](https://qlty.sh/gh/bkdotcom/projects/PHPDebugConsole)
110+
[![Coverage](https://img.shields.io/badge/98%25-B?style=flat&logo=codeclimate&label=Coverage&labelColor=5b5b5b&color=4cc71e)](https://qlty.sh/gh/bkdotcom/projects/PHPDebugConsole)
110111

111112
## Changelog
112113

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
}
3939
},
4040
"replace": {
41-
"bdk/backtrace": "2.2.3",
41+
"bdk/backtrace": "2.2.4",
4242
"bdk/curl-http-message": "1.0",
4343
"bdk/errorhandler": "3.3.4",
4444
"bdk/promise": "1.0",
45-
"bdk/pubsub": "3.2.1",
45+
"bdk/pubsub": "3.2.2",
4646
"bdk/slack": "1.0",
4747
"bdk/teams": "1.0"
4848
},

dev/UpdateCharData.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public static function update()
3131
$parsedData = self::loadData();
3232
$charData = self::build($parsedData);
3333
$filepathOut = \realpath(__DIR__ . '/' . self::$filepathOut);
34-
$php = '<?php // phpcs:ignore SlevomatCodingStandard.Files.FileLength' . "\n\n"
35-
. self::buildComment() . "\n"
34+
$php = '<?php' . "\n\n"
35+
. self::buildComment() . "\n\n"
3636
. 'return ' . self::varExportPretty($charData) . ";\n";
3737
$php = \preg_replace_callback('/[\'"](.)[\'"] => /u', static function ($matches) {
3838
$char = $matches[1];
@@ -135,8 +135,6 @@ private static function buildComment()
135135
* url: https://www.unicode.org/Public/security/latest/confusables.txt
136136
* date: ' . self::$sourceMeta['date'] . '
137137
* version: ' . self::$sourceMeta['version'] . '
138-
*
139-
* @phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys
140138
*/';
141139
return \preg_replace('/^[ ]{12}/m', ' ', $comment);
142140
}

phpcs.slevomat.xml

Lines changed: 131 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,136 @@
11
<?xml version="1.0"?>
22
<ruleset name="Slevomat Sniffs">
33

4-
<!--
5-
composer require slevomat/coding-standard - -dev
6-
-->
7-
<description>Selected Slevomat Coding Standard Sniffs (PHP 7.2+)</description>
8-
9-
<!--
10-
ComposerScripts::postUpdate will update this
11-
-->
12-
<config name="installed_paths" value="vendor/slevomat/coding-standard" />
13-
14-
<rule ref="SlevomatCodingStandard.Arrays" />
15-
16-
<rule ref="SlevomatCodingStandard.Classes.ClassStructure">
17-
<properties>
18-
<property name="groups" type="array">
19-
<element value="uses" />
20-
<element value="public constants" />
21-
<element value="protected constants" />
22-
<element value="private constants" />
23-
<element value="enum cases" />
24-
<element value="public static properties, public properties" />
25-
<element value="protected properties, protected static properties, private properties, private static properties" />
26-
<element value="constructor" />
27-
<element value="destructor, magic methods" />
28-
<element value="public methods, public static methods, static constructors, public abstract methods, public static abstract methods, public static final methods, public final methods" />
29-
<element value="protected methods, protected static methods, private methods, private static methods, protected abstract methods, protected static abstract methods, protected static final methods, protected final methods" />
30-
</property>
31-
</properties>
32-
</rule>
33-
<rule ref="SlevomatCodingStandard.Classes.MethodSpacing" />
34-
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration" />
35-
<rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding" />
36-
37-
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
38-
<properties>
39-
<property name="forbiddenCommentPatterns" type="array">
40-
<element value="#\[\w*\s+description\]#" />
41-
<element value="#^Undocumented \w+$#" />
42-
</property>
43-
</properties>
44-
</rule>
45-
46-
<rule ref="SlevomatCodingStandard.Complexity.Cognitive">
47-
<properties>
48-
<property name="warningThreshold" value="6" />
49-
<property name="errorThreshold" value="10" />
50-
</properties>
51-
</rule>
52-
53-
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses" />
54-
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" />
55-
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" />
56-
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" />
57-
58-
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch">
59-
<exclude name="SlevomatCodingStandard.Exceptions.DeadCatch.CatchAfterThrowableCatch" />
60-
</rule>
61-
62-
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" />
63-
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue" />
64-
<rule ref="SlevomatCodingStandard.Functions.FunctionLength">
65-
<properties>
66-
<property name="maxLinesLength" value="25" />
67-
</properties>
68-
</rule>
69-
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall" />
70-
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse" />
71-
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration" />
72-
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" />
73-
<rule ref="SlevomatCodingStandard.Functions.StrictCall" />
74-
75-
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" />
76-
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions" />
77-
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
78-
<properties>
79-
<property name="searchAnnotations" value="true" />
80-
</properties>
81-
</rule>
82-
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" />
83-
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" />
84-
<rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking" />
85-
<rule ref="SlevomatCodingStandard.PHP.RequireExplicitAssertion" />
86-
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses" />
87-
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" />
88-
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable" />
89-
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable" />
90-
<rule ref="SlevomatCodingStandard.Variables.UselessVariable" />
91-
92-
<rule ref="SlevomatCodingStandard.Files.FileLength">
93-
<properties>
94-
<property name="maxLinesLength" value="250" />
95-
</properties>
96-
</rule>
97-
<!--
98-
<rule ref="SlevomatCodingStandard.Classes.ClassLength">
99-
<properties>
100-
<property name="maxLinesLength" value="250" />
101-
</properties>
102-
</rule>
103-
-->
104-
105-
<!--
106-
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" />
107-
108-
Rule seems to be broken on codacy..
109-
Not necessary to catch here... will be caught by unit test
110-
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
111-
<properties>
112-
<property name="rootNamespaces" type="array">
113-
<element key="src" value="bdk"/>
114-
</property>
115-
</properties>
116-
<exclude-pattern>src/Backtrace/Backtrace.php</exclude-pattern>
117-
<exclude-pattern>src/Debug/Debug.php</exclude-pattern>
118-
<exclude-pattern>src/ErrorHandler/ErrorHandler.php</exclude-pattern>
119-
</rule>
120-
121-
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
122-
<property name="forbiddenAnnotations" type="array">
123-
<element value="@author, @created, @version, @package, @copyright, @license, @throws" />
124-
</property>
125-
</rule>
126-
-->
4+
<!--
5+
composer require slevomat/coding-standard - -dev
6+
-->
7+
<description>Selected Slevomat Coding Standard Sniffs (PHP 7.2+)</description>
8+
9+
<!--
10+
ComposerScripts::postUpdate will update this
11+
-->
12+
<config name="installed_paths" value="vendor/slevomat/coding-standard" />
13+
14+
<rule ref="SlevomatCodingStandard.Arrays" />
15+
16+
<rule ref="SlevomatCodingStandard.Classes.ClassStructure">
17+
<properties>
18+
<property name="groups" type="array">
19+
<element value="uses" />
20+
<element value="public constants" />
21+
<element value="protected constants" />
22+
<element value="private constants" />
23+
<element value="enum cases" />
24+
<element value="public static properties, public properties" />
25+
<element value="protected properties, protected static properties, private properties, private static properties" />
26+
<element value="constructor" />
27+
<element value="destructor, magic methods" />
28+
<element value="public methods, public static methods, static constructors, public abstract methods, public static abstract methods, public static final methods, public final methods" />
29+
<element value="protected methods, protected static methods, private methods, private static methods, protected abstract methods, protected static abstract methods, protected static final methods, protected final methods" />
30+
</property>
31+
</properties>
32+
</rule>
33+
<rule ref="SlevomatCodingStandard.Classes.MethodSpacing" />
34+
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration" />
35+
<rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding" />
36+
37+
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
38+
<properties>
39+
<property name="forbiddenCommentPatterns" type="array">
40+
<element value="#\[\w*\s+description\]#" />
41+
<element value="#^Undocumented \w+$#" />
42+
</property>
43+
</properties>
44+
</rule>
45+
46+
<rule ref="SlevomatCodingStandard.Complexity.Cognitive">
47+
<properties>
48+
<property name="warningThreshold" value="6" />
49+
<property name="errorThreshold" value="10" />
50+
</properties>
51+
</rule>
52+
53+
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses" />
54+
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" />
55+
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" />
56+
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" />
57+
58+
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch">
59+
<exclude name="SlevomatCodingStandard.Exceptions.DeadCatch.CatchAfterThrowableCatch" />
60+
</rule>
61+
62+
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" />
63+
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue" />
64+
<rule ref="SlevomatCodingStandard.Functions.FunctionLength">
65+
<properties>
66+
<property name="maxLinesLength" value="25" />
67+
</properties>
68+
</rule>
69+
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall" />
70+
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse" />
71+
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration" />
72+
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" />
73+
<rule ref="SlevomatCodingStandard.Functions.StrictCall" />
74+
75+
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" />
76+
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions" />
77+
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
78+
<properties>
79+
<property name="searchAnnotations" value="true" />
80+
</properties>
81+
</rule>
82+
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" />
83+
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" />
84+
<rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking" />
85+
<rule ref="SlevomatCodingStandard.PHP.RequireExplicitAssertion" />
86+
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses" />
87+
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" />
88+
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable" />
89+
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable" />
90+
<rule ref="SlevomatCodingStandard.Variables.UselessVariable" />
91+
92+
<rule ref="SlevomatCodingStandard.Files.FileLength">
93+
<properties>
94+
<property name="maxLinesLength" value="250" />
95+
</properties>
96+
</rule>
97+
<!--
98+
<rule ref="SlevomatCodingStandard.Classes.ClassLength">
99+
<properties>
100+
<property name="maxLinesLength" value="250" />
101+
</properties>
102+
</rule>
103+
-->
104+
105+
<!--
106+
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" />
107+
108+
Rule seems to be broken on codacy..
109+
Not necessary to catch here... will be caught by unit test
110+
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
111+
<properties>
112+
<property name="rootNamespaces" type="array">
113+
<element key="src" value="bdk"/>
114+
</property>
115+
</properties>
116+
<exclude-pattern>src/Backtrace/Backtrace.php</exclude-pattern>
117+
<exclude-pattern>src/Debug/Debug.php</exclude-pattern>
118+
<exclude-pattern>src/ErrorHandler/ErrorHandler.php</exclude-pattern>
119+
</rule>
120+
121+
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
122+
<property name="forbiddenAnnotations" type="array">
123+
<element value="@author, @created, @version, @package, @copyright, @license, @throws" />
124+
</property>
125+
</rule>
126+
-->
127+
128+
<rule ref="SlevomatCodingStandard.Files.FileLength">
129+
<exclude-pattern>*/src/Debug/Dump/charData.php</exclude-pattern>
130+
</rule>
131+
132+
<rule ref="SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys">
133+
<exclude-pattern>*/src/Debug/Dump/charData.php</exclude-pattern>
134+
</rule>
127135

128136
</ruleset>

0 commit comments

Comments
 (0)