mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-02-16 15:19:55 +03:00
[NFLRUSBridge] Remove byte-order-mark (#2777)
With UTF-8 byte-order mark in the file, the `ListActionTest::testOutput` would fail after converting tests to PSR-4 namespaces: invalid JSON output: Syntax error Failed asserting that null is not null. This is because ListAction::execute tries to create the bridge objects and, when the files containing the bridge classes are not loaded yet, the autoloader starts including them. Since this happens after output buffering has begun, any text in the PHP file before the `<?php` tag such as the BOM will end up in the buffer to be parsed by `json_decode`. Previously, it worked by chance thanks to some other test including the file before `ListActionTest`. With the restructuring, `Actions\ListActionTest` will run sooner and become responsible for triggering the autoloader. To prevent this in the future, I also disallowed BOM in the coding style.
This commit is contained in:
parent
190c95fa62
commit
19ad2584da
2 changed files with 3 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
class NFLRUSBridge extends BridgeAbstract {
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
|
||||
<!-- Do not override methods to call their parent -->
|
||||
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
|
||||
<!-- Do not allow UTF-8 byte-order mark -->
|
||||
<rule ref="Generic.Files.ByteOrderMark"/>
|
||||
<!-- Make sure the concatenation operator has spaces around it -->
|
||||
<rule ref="Squiz.Strings.ConcatenationSpacing">
|
||||
<properties>
|
||||
|
|
Loading…
Add table
Reference in a new issue