Skip to content

Conversation

@DanProgs
Copy link

Hello,
Here is the first part of my changes and adjustments related to PHP 8.x. This includes many, many minor corrections and suggestions from SonarQube Static Code Analysis.

If you want, feel free to use them.

Best regards,
Dan Progs

DanProgs and others added 30 commits June 3, 2025 11:30
The following adjustments were made:
- Files should end with a newline (PHP:S113)
- Sections of code should not be commented out (PHP:S125)
- Mergeable "if" statements should be combined (PHP:S1066)
- Lines should not end with trailing whitespaces (PHP:S1131)
- Unused local variables should be removed (PHP:S1481)
- Identical expressions should not be used on both sides of a binary
operator (PHP:S1764)
- PHP keywords and constants "true", "false", "null" should be lower
case (PHP:S1781)
- "elseif" keyword should be used in place of "else if" keywords
(PHP:S1793)
- Unused assignments should be removed (PHP:S1854)
The following adjustments were made:
- Files should end with a newline (PHP:S113)
- Mergeable "if" statements should be combined (PHP:S1066)
- Empty statements should be removed (PHP:S1116)
- Lines should not end with trailing whitespaces (PHP:S1131)
- Unused function parameters should be removed (PHP:S1172)
- "elseif" keyword should be used in place of "else if" keywords
(PHP:S1793)
- Unused assignments should be removed (PHP:S1854)
- Two branches in a conditional structure should not have exactly the
same implementation (PHP:S1871)
- Array values should not be replaced unconditionally (PHP:S4143)
The following adjustments were made:
- Files should end with a newline (PHP:S113)
- Sections of code should not be commented out (PHP:S125)
- Identical expressions should not be used on both sides of a binary
operator (PHP:S1764)
- PHP keywords and constants "true", "false", "null" should be lower
case (PHP:S1781)
- "elseif" keyword should be used in place of "else if" keywords
(PHP:S1793)
- Two branches in a conditional structure should not have exactly the
same implementation (PHP:S1871)
- Array values should not be replaced unconditionally (PHP:S4143)
The following adjustments were made:
- Files should end with a newline (PHP:S113)
- Unused local variables should be removed (PHP:S1481)
- PHP keywords and constants "true", "false", "null" should be lower
case (PHP:S1781)
The following adjustments were made:
- Files should end with a newline (PHP:S113)
- Mergeable "if" statements should be combined (PHP:S1066)
- Redundant pairs of parentheses should be removed (PHP:1110)
- Unused function parameters should be removed (PHP:S1172)
- Unused local variables should be removed (PHP:S1481)
- The "var" keyword should not be used (PHP:S1765)
- PHP keywords and constants "true", "false", "null" should be lower
case (PHP:S1781)
The following adjustments were made:
- Files should end with a newline (PHP:S113)
- Control structures should use curly braces (PHP:S121)
- Non-empty statements should change control flow or have at least one
side-effect (PHP:S905)
- Mergeable "if" statements should be combined (PHP:S1066)
- Unused "private" fields should be removed (PHP:S1068)
- Redundant pairs of parentheses should be removed (PHP:1110)
- Empty statements should be removed (PHP:S1116)
- The "var" keyword should not be used (PHP:S1765)
The following adjustments were made:
- Files should end with a newline (PHP:S113)
- Empty statements should be removed (PHP:S1116)
- Boolean literals should not be redundant (PHP:S1125)
- "elseif" keyword should be used in place of "else if" keywords
(PHP:S1793)
- Unused assignments should be removed (PHP:S1854)
- Unused local variables should be removed (PHP:S1481)
- Files should end with a newline (PHP:S113)
- Empty statements should be removed (PHP:S1116)
- Boolean literals should not be redundant (PHP:S1125)
- Lines should not end with trailing whitespaces (PHP:S1131)
- PHP keywords and constants "true", "false", "null" should be lower
case (PHP:S1781)
- "elseif" keyword should be used in place of "else if" keywords
(PHP:S1793)
The following adjustments were made:
- Files should end with a newline (PHP:S113)
- Mergeable "if" statements should be combined (PHP:S1066)
- Empty statements should be removed (PHP:S1116)
- Boolean literals should not be redundant (PHP:S1125)
- Lines should not end with trailing whitespaces (PHP:S1131)
- "empty()" should be used to test for emptiness (PHP:S1155)
- Unused function parameters should be removed (PHP:S1172)
- Unused local variables should be removed (PHP:S1481)
- "elseif" keyword should be used in place of "else if" keywords
(PHP:S1793)
- Unused assignments should be removed (PHP:S1854)
- "require_once" and "include_once" should be used instead of "require"
and "include" (PHP:S2003)
The following adjustments were made:
- Files should end with a newline (PHP:S113)
- Control structures should use curly braces (PHP:S121)
- Empty statements should be removed (PHP:S1116)
- Unused function parameters should be removed (PHP:S1172)
- Unused local variables should be removed (PHP:S1481)
- "elseif" keyword should be used in place of "else if" keywords
(PHP:S1793)
- "require_once" and "include_once" should be used instead of "require"
and "include" (PHP:S2003)
- Unnecessary parentheses should not be used for constructs (PHP:S6600)
The following adjustments were made:
- Revision of the parentheses for csv output
The following adjustments were made:
- Files should end with a newline (PHP:S113)
- Sections of code should not be commented out (PHP:S125)
- Boolean literals should not be redundant (PHP:S1125)
- Lines should not end with trailing whitespaces (PHP:S1131)
- Unused local variables should be removed (PHP:S1481)
- "elseif" keyword should be used in place of "else if" keywords
(PHP:S1793)
DanProgs and others added 10 commits August 15, 2025 20:40
The following adjustments were made:
- Formate source code
- Remove trailing whitespaces
- Files should end with a newline (PHP:S113)
- Control structures should use curly braces (PHP:S121)
- Sections of code should not be commented out (PHP:S125)
- Mergeable "if" statements should be combined (PHP:S1066)
- Empty statements should be removed (PHP:S1116)
- Modifiers should be declared in the correct order (PHP:S1124)
- Boolean literals should not be redundant (PHP:S1125)
- Use empty() to check whether the array is empty or not (PHP:S1155)
- Unused function parameters should be removed (PHP:S1172)
- Unused local variables should be removed (PHP:S1481)
- Local variables should not be declared and then immediately returned
or thrown (PHP:1488)
- Method visibility should be explicitly declared (PHP:S1784)
- The "var" keyword should not be used (PHP:S1765)
- PHP keywords and constants "true", "false", "null" should be lower
case (PHP:S1781)
- "elseif" keyword should be used in place of "else if" keywords
(PHP:S1793)
- Unused assignments should be removed (PHP:S1854)
- Jump statements should not be redundant (PHP:3626)
The following adjustments were made:
- Formate source code
- Control structures should use curly braces (PHP:S121)
- Mergeable "if" statements should be combined (PHP:S1066)
- Redundant pairs of parentheses should be removed (PHP:1110)
- Boolean literals should not be redundant (PHP:S1125)
- Return of boolean expressions should not be wrapped into an
"if-then-else" statement (PHP:S1126)
- Use empty() to check whether the array is empty or not (PHP:S1155)
- Unused local variables should be removed (PHP:S1481)
- Local variables should not be declared and then immediately returned
or thrown (PHP:1488)
- "elseif" keyword should be used in place of "else if" keywords
(PHP:S1793)
- Unused assignments should be removed (PHP:S1854)
- "&&" and "||" should be used (PHP:S2010)
- Unnecessary parentheses should not be used for constructs (PHP:S6600)
The following adjustments were made:
- Formate source code
- Files should end with a newline (PHP:S113)
- Control structures should use curly braces (PHP:S121)
- Sections of code should not be commented out (PHP:S125)
- Mergeable "if" statements should be combined (PHP:S1066)
- Empty statements should be removed (PHP:S1116)
- Boolean literals should not be redundant (PHP:S1125)
- Lines should not end with trailing whitespaces (PHP:S1131)
- Use empty() to check whether the array is empty or not (PHP:S1155)
- Unused local variables should be removed (PHP:S1481)
- Local variables should not be declared and then immediately returned
or thrown (PHP:1488)
- Deprecated constructor declarations should not be used (PHP:S1603)
- PHP keywords and constants "true", "false", "null" should be lower
case (PHP:S1781)
- "require_once" and "include_once" should be used instead of "require"
and "include" (PHP:S2003)
- Unnecessary parentheses should not be used for constructs (PHP:S6600)
The following adjustments were made:
- Control structures should use curly braces (PHP:S121)
- Mergeable "if" statements should be combined (PHP:S1066)
- Redundant pairs of parentheses should be removed (PHP:1110)
- Unused local variables should be removed (PHP:S1481)
- Local variables should not be declared and then immediately returned
or thrown (PHP:S1488)
- PHP keywords and constants "true", "false", "null" should be lower
case (PHP:S1781)
- Unused assignments should be removed (PHP:S1854)
- The "print" statement should not be used (python:PrintStatementUsage)
The following adjustments were made:
- Permissions adjusted
The following adjustments were made:
- Formate source code
- Permissions revised
- Sections of code should not be commented out (PHP:S125)
- Mergeable "if" statements should be combined (PHP:S1066)
- Unused local variables should be removed (PHP:S1481)
- Local variables should not be declared and then immediately returned
or thrown (PHP:1488)
- Identical expressions should not be used on both sides of a binary
operator (PHP:S1764)
- Attributes deprecated in HTML5 should not be used (PHP:S1827)
- Unused assignments should be removed (PHP:S1854)
- "default" clauses should be first or last (PHP:4524)
The following adjustments were made:
- Formate source code
- Permissions revised
- Local variable and function parameter names should comply with a
naming convention (PHP:117)
- Unused function parameters should be removed (PHP:S1172)
The following adjustments were made:
- Formate source code
- Permissions revised
- Minor corrections
- Switch cases should end with an unconditional "break" statement
(PHP:128)
- "switch" statements should have "default" clauses (PHP:131)
- "switch" statements should have at least 3 "case" clauses (PHP:1301)
DanProgs and others added 18 commits October 21, 2025 18:20
Applied rules:
 * RemoveUnusedForeachKeyRector
 * VarToPublicPropertyRector
 * ExplicitPublicClassMethodRector
 * CountArrayToEmptyArrayComparisonRector
 * DisallowedEmptyRuleFixerRector
 * RemoveUnusedNonEmptyArrayBeforeForeachRector
 * ExplicitBoolCompareRector
 * TernaryToBooleanOrFalseToBooleanAndRector
Applied rules:
 * SimplifyIfReturnBoolRector
 * ReduceAlwaysFalseIfOrRector
Applied rules:
 * WrapEncapsedVariableInCurlyBracesRector
Applied rules:
 * StrictArraySearchRector
 * SplitDoubleAssignRector
Applied rules:
 * RecastingRemovalRector
 * CombineIfRector
Applied rules:
 * ForeachItemsAssignToEmptyArrayToAssignRector
 * SimplifyMirrorAssignRector
Applied rules:
 * RemoveNullPropertyInitializationRector
 * RemoveAlwaysElseRector
Applied rules:
 * RemoveAlwaysElseRector
 * StaticClosureRector
Applied rules:
 * ForRepeatedCountToOwnVariableRector
 * IssetOnPropertyObjectToPropertyExistsRector
Applied rules:
 * TernaryConditionVariableAssignmentRector
 * SwitchNegatedTernaryRector
Applied rules:
 * CompleteMissingIfElseBracketRector
 * CompleteDynamicPropertiesRector
Applied rules:
 * ChangeOrIfContinueToMultiContinueRector
Applied rules:
 * ShortenElseIfRector
Composer and autoload files adjusted
xmlrpc.class.php adjusted
@DanProgs
Copy link
Author

DanProgs commented Dec 7, 2025

Hi Francisco,

I see you're working on some revisions again. I've combined my latest changes into this branch for you. If you'd like, feel free to use them, or let me know how I can help.

Best regards,
Dan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants