Skip to content

Commit

Permalink
minor #57795 Use CPP where possible (alexandre-daubois)
Browse files Browse the repository at this point in the history
This PR was merged into the 7.2 branch.

Discussion
----------

Use CPP where possible

| Q             | A
| ------------- | ---
| Branch?       | 7.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Some places cannot be changed as they rely on "PHP magic" things

Commits
-------

877f6b2951 Use CPP where possible
  • Loading branch information
fabpot committed Jul 25, 2024
2 parents 2d17353 + 1b83097 commit 0f7f413
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Iterator/FileTypeFilterIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ class FileTypeFilterIterator extends \FilterIterator
public const ONLY_FILES = 1;
public const ONLY_DIRECTORIES = 2;

private int $mode;

/**
* @param \Iterator<string, \SplFileInfo> $iterator The Iterator to filter
* @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES)
*/
public function __construct(\Iterator $iterator, int $mode)
{
$this->mode = $mode;

public function __construct(
\Iterator $iterator,
private int $mode,
) {
parent::__construct($iterator);
}

Expand Down

0 comments on commit 0f7f413

Please sign in to comment.