<commit_before><?php

declare(strict_types=1);

namespace Rector\FileSystemRector;

use Rector\FileSystemRector\Contract\FileSystemRectorInterface;
use Symplify\SmartFileSystem\SmartFileInfo;

final class FileSystemFileProcessor
{
    /**
     * @var FileSystemRectorInterface[]
     */
    private $fileSystemRectors = [];

    /**
     * @param FileSystemRectorInterface[] $fileSystemRectors
     */
    public function __construct(array $fileSystemRectors = [])
    {
        $this->fileSystemRectors = $fileSystemRectors;
    }

    public function processFileInfo(SmartFileInfo $smartFileInfo): void
    {
        foreach ($this->fileSystemRectors as $fileSystemRector) {
            $fileSystemRector->refactor($smartFileInfo);
        }
    }

    public function getFileSystemRectorsCount(): int
    {
        return count($this->fileSystemRectors);
    }
}<commit_msg>add current file info provide to file system file processor<commit_after><?php

declare(strict_types=1);

namespace Rector\FileSystemRector;

use Rector\FileSystemRector\Contract\FileSystemRectorInterface;
use Rector\NodeTypeResolver\FileSystem\CurrentFileInfoProvider;
use Symplify\SmartFileSystem\SmartFileInfo;

final class FileSystemFileProcessor
{
    /**
     * @var CurrentFileInfoProvider
     */
    private $currentFileInfoProvider;

    /**
     * @var FileSystemRectorInterface[]
     */
    private $fileSystemRectors = [];

    /**
     * @param FileSystemRectorInterface[] $fileSystemRectors
     */
    public function __construct(CurrentFileInfoProvider $currentFileInfoProvider, array $fileSystemRectors = [])
    {
        $this->currentFileInfoProvider = $currentFileInfoProvider;
        $this->fileSystemRectors = $fileSystemRectors;
    }

    public function processFileInfo(SmartFileInfo $smartFileInfo): void
    {
        $this->currentFileInfoProvider ->setCurrentFileInfo($smartFileInfo);

        foreach ($this->fileSystemRectors as $fileSystemRector) {
            $fileSystemRector->refactor($smartFileInfo);
        }
    }

    public function getFileSystemRectorsCount(): int
    {
        return count($this->fileSystemRectors);
    }
}
{'fraction_non_alphanumeric': 0.09767441860465116, 'fraction_numerical': 0.0009302325581395349, 'mean_word_length': 3.7171052631578947, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '529644', 'n_tokens_mistral': 614, 'n_tokens_neox': 596, 'n_words': 101}