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