Skip to content
Snippets Groups Projects
Commit caf4c3b8 authored by David Prévot's avatar David Prévot
Browse files

New upstream version 4.1.0

parents c81c45fc a95037b6
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,7 @@ jobs: ...@@ -64,6 +64,7 @@ jobs:
- "8.1" - "8.1"
- "8.2" - "8.2"
- "8.3" - "8.3"
- "8.4"
steps: steps:
- name: "Checkout" - name: "Checkout"
......
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
/.php-cs-fixer.php /.php-cs-fixer.php
/.php-cs-fixer.cache /.php-cs-fixer.cache
/composer.lock /composer.lock
/.phpunit.result.cache /.phpunit.cache
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive"> <phive xmlns="https://phar.io/phive">
<phar name="php-cs-fixer" version="^3.0" installed="3.16.0" location="./tools/php-cs-fixer" copy="true"/> <phar name="php-cs-fixer" version="^3.0" installed="3.24.0" location="./tools/php-cs-fixer" copy="true"/>
<phar name="psalm" version="^5.0" installed="5.11.0" location="./tools/psalm" copy="true"/> <phar name="psalm" version="^5.0" installed="5.15.0" location="./tools/psalm" copy="true"/>
<phar name="composer" version="^2.0.3" installed="2.5.5" location="./tools/composer" copy="true"/> <phar name="composer" version="^2.0.3" installed="2.5.8" location="./tools/composer" copy="true"/>
</phive> </phive>
...@@ -26,10 +26,18 @@ $config->setFinder($finder) ...@@ -26,10 +26,18 @@ $config->setFinder($finder)
'binary_operator_spaces' => [ 'binary_operator_spaces' => [
'operators' => [ 'operators' => [
'=' => 'align_single_space_minimal', '=' => 'align_single_space_minimal',
'+=' => 'align_single_space_minimal',
'-=' => 'align_single_space_minimal',
'*=' => 'align_single_space_minimal',
'/=' => 'align_single_space_minimal',
'=>' => 'align_single_space_minimal', '=>' => 'align_single_space_minimal',
], ],
], ],
'blank_line_after_namespace' => true, 'blank_line_after_namespace' => true,
'blank_lines_before_namespace' => [
'max_line_breaks' => 1,
'min_line_breaks' => 0,
],
'blank_line_before_statement' => [ 'blank_line_before_statement' => [
'statements' => [ 'statements' => [
'break', 'break',
...@@ -106,9 +114,10 @@ $config->setFinder($finder) ...@@ -106,9 +114,10 @@ $config->setFinder($finder)
'implode_call' => true, 'implode_call' => true,
'include' => true, 'include' => true,
'increment_style' => [ 'increment_style' => [
'style' => PhpCsFixer\Fixer\Operator\IncrementStyleFixer::STYLE_POST, 'style' => 'post',
], ],
'indentation_type' => true, 'indentation_type' => true,
'integer_literal_case' => true,
'is_null' => true, 'is_null' => true,
'lambda_not_used_import' => true, 'lambda_not_used_import' => true,
'line_ending' => true, 'line_ending' => true,
...@@ -122,6 +131,8 @@ $config->setFinder($finder) ...@@ -122,6 +131,8 @@ $config->setFinder($finder)
'method_argument_space' => [ 'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline', 'on_multiline' => 'ensure_fully_multiline',
], ],
'method_chaining_indentation' => true,
'modernize_strpos' => true,
'modernize_types_casting' => true, 'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true, 'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true, 'multiline_whitespace_before_semicolons' => true,
...@@ -143,7 +154,6 @@ $config->setFinder($finder) ...@@ -143,7 +154,6 @@ $config->setFinder($finder)
'no_binary_string' => true, 'no_binary_string' => true,
'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true, 'no_blank_lines_after_phpdoc' => true,
'no_blank_lines_before_namespace' => true,
'no_break_comment' => true, 'no_break_comment' => true,
'no_closing_tag' => true, 'no_closing_tag' => true,
'no_empty_comment' => true, 'no_empty_comment' => true,
...@@ -154,15 +164,15 @@ $config->setFinder($finder) ...@@ -154,15 +164,15 @@ $config->setFinder($finder)
'no_leading_import_slash' => true, 'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true, 'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => ['use' => 'print'], 'no_mixed_echo_print' => ['use' => 'print'],
'no_multiple_statements_per_line' => true,
'no_multiline_whitespace_around_double_arrow' => true, 'no_multiline_whitespace_around_double_arrow' => true,
'no_multiple_statements_per_line' => true,
'no_null_property_initialization' => true, 'no_null_property_initialization' => true,
'no_php4_constructor' => true, 'no_php4_constructor' => true,
'no_short_bool_cast' => true, 'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true, 'no_singleline_whitespace_before_semicolons' => true,
'no_space_around_double_colon' => true,
'no_spaces_after_function_name' => true, 'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true, 'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'no_superfluous_elseif' => true, 'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => [ 'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true, 'allow_mixed' => true,
...@@ -179,7 +189,9 @@ $config->setFinder($finder) ...@@ -179,7 +189,9 @@ $config->setFinder($finder)
'no_unset_cast' => true, 'no_unset_cast' => true,
'no_unset_on_property' => true, 'no_unset_on_property' => true,
'no_unused_imports' => true, 'no_unused_imports' => true,
'no_useless_concat_operator' => true,
'no_useless_else' => true, 'no_useless_else' => true,
'no_useless_nullsafe_operator' => true,
'no_useless_return' => true, 'no_useless_return' => true,
'no_useless_sprintf' => true, 'no_useless_sprintf' => true,
'no_whitespace_before_comma_in_array' => true, 'no_whitespace_before_comma_in_array' => true,
...@@ -187,6 +199,7 @@ $config->setFinder($finder) ...@@ -187,6 +199,7 @@ $config->setFinder($finder)
'non_printable_character' => true, 'non_printable_character' => true,
'normalize_index_brace' => true, 'normalize_index_brace' => true,
'object_operator_without_whitespace' => true, 'object_operator_without_whitespace' => true,
'octal_notation' => true,
'operator_linebreak' => [ 'operator_linebreak' => [
'only_booleans' => true, 'only_booleans' => true,
'position' => 'end', 'position' => 'end',
...@@ -217,9 +230,9 @@ $config->setFinder($finder) ...@@ -217,9 +230,9 @@ $config->setFinder($finder)
], ],
'ordered_imports' => [ 'ordered_imports' => [
'imports_order' => [ 'imports_order' => [
PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CONST, 'const',
PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_FUNCTION, 'function',
PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CLASS, 'class',
] ]
], ],
'ordered_interfaces' => [ 'ordered_interfaces' => [
...@@ -227,6 +240,7 @@ $config->setFinder($finder) ...@@ -227,6 +240,7 @@ $config->setFinder($finder)
'order' => 'alpha', 'order' => 'alpha',
], ],
'ordered_traits' => true, 'ordered_traits' => true,
'ordered_types' => true,
'php_unit_set_up_tear_down_visibility' => true, 'php_unit_set_up_tear_down_visibility' => true,
'php_unit_test_case_static_method_calls' => [ 'php_unit_test_case_static_method_calls' => [
'call_type' => 'this', 'call_type' => 'this',
...@@ -250,6 +264,7 @@ $config->setFinder($finder) ...@@ -250,6 +264,7 @@ $config->setFinder($finder)
'uses', 'uses',
], ],
], ],
'phpdoc_param_order' => true,
'phpdoc_return_self_reference' => true, 'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true, 'phpdoc_scalar' => true,
'phpdoc_separation' => true, 'phpdoc_separation' => true,
...@@ -257,7 +272,7 @@ $config->setFinder($finder) ...@@ -257,7 +272,7 @@ $config->setFinder($finder)
'phpdoc_summary' => true, 'phpdoc_summary' => true,
'phpdoc_tag_casing' => true, 'phpdoc_tag_casing' => true,
'phpdoc_tag_type' => true, 'phpdoc_tag_type' => true,
'phpdoc_to_comment' => true, 'phpdoc_to_comment' => false,
'phpdoc_trim' => true, 'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true, 'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types' => ['groups' => ['simple', 'meta']], 'phpdoc_types' => ['groups' => ['simple', 'meta']],
...@@ -279,15 +294,20 @@ $config->setFinder($finder) ...@@ -279,15 +294,20 @@ $config->setFinder($finder)
'single_class_element_per_statement' => true, 'single_class_element_per_statement' => true,
'single_import_per_statement' => true, 'single_import_per_statement' => true,
'single_line_after_imports' => true, 'single_line_after_imports' => true,
'single_line_comment_spacing' => true,
'single_quote' => true, 'single_quote' => true,
'single_space_around_construct' => true, 'single_space_around_construct' => true,
'single_trait_insert_per_statement' => true, 'single_trait_insert_per_statement' => true,
'space_after_semicolon' => true, 'space_after_semicolon' => true,
'spaces_inside_parentheses' => [
'space' => 'none',
],
'standardize_increment' => true, 'standardize_increment' => true,
'standardize_not_equals' => true, 'standardize_not_equals' => true,
'statement_indentation' => true, 'statement_indentation' => true,
'static_lambda' => true, 'static_lambda' => true,
'strict_param' => true, 'strict_param' => true,
'string_length_to_empty'=> true,
'string_line_ending' => true, 'string_line_ending' => true,
'switch_case_semicolon_to_colon' => true, 'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true, 'switch_case_space' => true,
...@@ -297,13 +317,18 @@ $config->setFinder($finder) ...@@ -297,13 +317,18 @@ $config->setFinder($finder)
'ternary_to_null_coalescing' => true, 'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline' => [ 'trailing_comma_in_multiline' => [
'elements' => [ 'elements' => [
'arrays' 'arguments',
'arrays',
'match',
] ]
], ],
'trim_array_spaces' => true, 'trim_array_spaces' => true,
'types_spaces' => [ 'type_declaration_spaces' => [
'space' => 'none', 'elements' => [
'function',
],
], ],
'types_spaces' => true,
'unary_operator_spaces' => true, 'unary_operator_spaces' => true,
'visibility_required' => [ 'visibility_required' => [
'elements' => [ 'elements' => [
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
## [4.1.0] - 2023-08-31
### Added
* [#81](https://github.com/sebastianbergmann/php-file-iterator/issues/81): Accept `array|string $paths` in `Facade::getFilesAsArray()`
## [4.0.2] - 2023-05-07 ## [4.0.2] - 2023-05-07
### Fixed ### Fixed
...@@ -144,6 +150,7 @@ No changes ...@@ -144,6 +150,7 @@ No changes
* [#23](https://github.com/sebastianbergmann/php-file-iterator/pull/23): Added support for wildcards (glob) in exclude * [#23](https://github.com/sebastianbergmann/php-file-iterator/pull/23): Added support for wildcards (glob) in exclude
[4.1.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/4.0.2...4.1.0
[4.0.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/4.0.1...4.0.2 [4.0.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/4.0.1...4.0.2
[4.0.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/4.0.0...4.0.1 [4.0.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/4.0.0...4.0.1
[4.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.6...4.0.0 [4.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.6...4.0.0
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php" bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects" executionOrder="depends,defects"
requireCoverageMetadata="true" requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="true" beStrictAboutCoverageMetadata="true"
...@@ -10,12 +11,14 @@ ...@@ -10,12 +11,14 @@
failOnWarning="true" failOnWarning="true"
colors="true"> colors="true">
<testsuites> <testsuites>
<testsuite name="default"> <testsuite name="unit">
<directory suffix="Test.php">tests/unit</directory> <directory>tests/unit</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<source> <source restrictDeprecations="true"
restrictNotices="true"
restrictWarnings="true">
<include> <include>
<directory>src</directory> <directory>src</directory>
</include> </include>
......
...@@ -20,15 +20,16 @@ use SplFileInfo; ...@@ -20,15 +20,16 @@ use SplFileInfo;
final class Facade final class Facade
{ {
/** /**
* @psalm-param list<string>|string $suffixes * @psalm-param list<non-empty-string>|non-empty-string $paths
* @psalm-param list<string>|string $prefixes * @psalm-param list<non-empty-string>|string $suffixes
* @psalm-param list<string> $exclude * @psalm-param list<non-empty-string>|string $prefixes
* @psalm-param list<non-empty-string> $exclude
* *
* @psalm-return list<string> * @psalm-return list<non-empty-string>
*/ */
public function getFilesAsArray(string $path, array|string $suffixes = '', array|string $prefixes = '', array $exclude = []): array public function getFilesAsArray(array|string $paths, array|string $suffixes = '', array|string $prefixes = '', array $exclude = []): array
{ {
$iterator = (new Factory)->getFileIterator($path, $suffixes, $prefixes, $exclude); $iterator = (new Factory)->getFileIterator($paths, $suffixes, $prefixes, $exclude);
$files = []; $files = [];
......
...@@ -29,10 +29,10 @@ use RecursiveIteratorIterator; ...@@ -29,10 +29,10 @@ use RecursiveIteratorIterator;
final class Factory final class Factory
{ {
/** /**
* @psalm-param list<string>|string $paths * @psalm-param list<non-empty-string>|non-empty-string $paths
* @psalm-param list<string>|string $suffixes * @psalm-param list<non-empty-string>|string $suffixes
* @psalm-param list<string>|string $prefixes * @psalm-param list<non-empty-string>|string $prefixes
* @psalm-param list<string> $exclude * @psalm-param list<non-empty-string> $exclude
*/ */
public function getFileIterator(array|string $paths, array|string $suffixes = '', array|string $prefixes = '', array $exclude = []): AppendIterator public function getFileIterator(array|string $paths, array|string $suffixes = '', array|string $prefixes = '', array $exclude = []): AppendIterator
{ {
...@@ -83,9 +83,9 @@ final class Factory ...@@ -83,9 +83,9 @@ final class Factory
} }
/** /**
* @psalm-param list<string> $paths * @psalm-param list<non-empty-string> $paths
* *
* @psalm-return list<string> * @psalm-return list<non-empty-string>
*/ */
private function resolveWildcards(array $paths): array private function resolveWildcards(array $paths): array
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment