-
Notifications
You must be signed in to change notification settings - Fork 0
3528: AVRO-4194: remove PHP EOL versions and use new language features #17
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
base: main
Are you sure you want to change the base?
Changes from all commits
92706e9
a04b5f1
65f83a4
4a5fd28
e045464
ae12b4f
cb9193e
c7738f3
f344d14
a8adb23
3b872f5
c63059b
5775b27
4154e56
5dcd744
d650ca1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| pkg | ||
| vendor | ||
| .phpunit.result.cache | ||
| .phpunit.cache | ||
| .php-cs-fixer.cache |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; | ||
|
|
||
| /** | ||
| * PHP CS Fixer documentation: | ||
| * - Homepage: https://cs.symfony.com/ | ||
| * - List of all available rules: https://cs.symfony.com/doc/rules/index.html | ||
| * - List of all available rule sets: https://cs.symfony.com/doc/ruleSets/index.html | ||
| * | ||
| * To inspect a specific rule (e.g. `blank_line_before_statement`), run: | ||
| * | ||
| * ```console | ||
| * > php-cs-fixer describe blank_line_before_statement | ||
| * ``` | ||
| */ | ||
| $finder = PhpCsFixer\Finder::create() | ||
| ->in(['test']) | ||
| ->append(['.php-cs-fixer.dist.php']); | ||
|
Comment on lines
+37
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify that lib directory should be included. The Finder only targets the Run this script to check if there are PHP files in the lib directory that should be linted: 🏁 Script executed: #!/bin/bash
# Check if lib directory exists and contains PHP files
cd lang/php
if [ -d "lib" ]; then
echo "lib directory exists"
fd -e php . lib | head -20
else
echo "lib directory not found"
fiLength of output: 576 Include the The 🤖 Prompt for AI Agents
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. value:good-to-have; category:bug; feedback:The AI reviewer is correct that the tool is used only for the PHP files in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @martin-augment, thank you for confirming! You're absolutely right—applying the same code style improvements to the Task: Include
|
||
|
|
||
| return (new PhpCsFixer\Config()) | ||
| ->setRiskyAllowed(true) | ||
| ->setParallelConfig(ParallelConfigFactory::detect()) | ||
| ->setRules([ | ||
| // —— CS Rule Sets ————————————————————————————————————————————————————— | ||
| '@Symfony' => true, | ||
| '@PHP8x0Migration' => true, | ||
|
|
||
| // —— Overriden rules —————————————————————————————————————————————————— | ||
|
|
||
| // @Symfony: `['statements' => ['return']]` | ||
| // Here using: default, `['statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try']]` | ||
| 'blank_line_before_statement' => true, | ||
|
|
||
| // @Symfony: `['tokens' => [['attribute', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use']]]` | ||
| // Here using: default, `['tokens' => ['extra']]` | ||
| 'no_extra_blank_lines' => true, | ||
|
|
||
| // @Symfony: `['allow_hidden_params' => true, 'remove_inheritdoc' => true]` | ||
| 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'allow_unused_params' => true, 'remove_inheritdoc' => false], | ||
|
|
||
| // @Symfony: `['after_heredoc' => true]` | ||
| // Here using: default, `['after_heredoc' => false]` | ||
| 'no_whitespace_before_comma_in_array' => true, | ||
|
|
||
| // @Symfony: `['order' => ['use_trait']]` | ||
| // Here using: default, `['order' => ['use_trait', 'case', 'constant_public', 'constant_protected', 'constant_private', 'property_public', 'property_protected', 'property_private', 'construct', 'destruct', 'magic', 'phpunit', 'method_public', 'method_protected', 'method_private']]`) | ||
| 'ordered_class_elements' => true, | ||
|
|
||
| // @Symfony: `['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha']` | ||
| // Here using: default, all import types (classes, functions, and constants) are sorted together alphabetically without grouping them by type | ||
| 'ordered_imports' => true, | ||
|
|
||
| // @Symfony: `['order' => ['param', 'return', 'throws']]` | ||
| // Here using: default, `['param', 'throws', 'return']` | ||
| 'phpdoc_order' => true, | ||
|
|
||
| // @Symfony: `['null_adjustment' => 'always_last', 'sort_algorithm' => 'none']` | ||
| 'phpdoc_types_order' => ['null_adjustment' => 'always_first'], | ||
|
|
||
| // @Symfony: `['case' => 'camel_case']` | ||
| 'php_unit_method_casing' => ['case' => 'snake_case'], | ||
|
|
||
| // —— Overriden rules (disabled) ———————————————————————————————————————— | ||
| // @Symfony | ||
| 'increment_style' => false, | ||
| 'phpdoc_align' => false, | ||
| 'phpdoc_separation' => false, | ||
| 'phpdoc_summary' => false, | ||
| 'phpdoc_to_comment' => false, | ||
| 'single_line_comment_style' => false, | ||
| 'single_line_throw' => false, | ||
| 'single_quote' => false, | ||
|
|
||
| // —— Additional rules —————————————————————————————————————————————————— | ||
| 'no_useless_else' => true, | ||
| 'phpdoc_add_missing_param_annotation' => true, | ||
| 'protected_to_private' => true, | ||
| 'psr_autoloading' => true, | ||
| ]) | ||
| ->setFinder($finder) | ||
| ; | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix incorrect conditional syntax.
The condition
matrix.php.version == '8.1'is incorrect. Thematrix.phpvariable is a string, not an object with aversionproperty. This condition will never evaluate to true, so the lint step will never run.Apply this fix:
📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.8)
71-71: receiver of object dereference "version" must be type of object but got "number"
(expression)
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value:useful; category:bug; feedback:The AI reviewer is correct that the name of the property is
php, notphp.version. Due to this error the CI job was not executed for all tested versions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martin-augment, thank you for confirming the issue! I'm glad the review helped catch this before it caused further problems with the CI execution across different PHP versions. The fix ensures the lint step will now run correctly for PHP 8.1.