<commit_before><?php

namespace Spatie\Backup\Tasks\Monitor;

use Spatie\Backup\BackupDestination\BackupDestination;

class BackupDestinationStatusFactory
{
    /**
     * @param array $monitorConfiguration
     *
     * @return \Illuminate\Support\Collection
     */
    public static function createForMonitorConfig(array $monitorConfiguration)
    {
        return collect($monitorConfiguration)
            ->map(function (array $monitorProperties) {
                return BackupDestinationStatusFactory::createForSingleMonitor($monitorProperties);
            })
            ->flatten()
            ->sortBy(function (BackupDestinationStatus $backupDestinationStatus) {
                return "{$backupDestinationStatus->getBackupName()}-{$backupDestinationStatus->getFilesystemName()}";
            });
    }

    /**
     * @param array $monitorConfig
     *<commit_msg>fix monitor in Laravel 5.1<commit_after><?php

namespace Spatie\Backup\Tasks\Monitor;

use Spatie\Backup\BackupDestination\BackupDestination;

class BackupDestinationStatusFactory
{
    /**
     * @param array $monitorConfiguration
     *
     * @return \Illuminate\Support\Collection
     */
    public static function createForMonitorConfig(array $monitorConfiguration)
    {
        return collect($monitorConfiguration)
            ->map(function (array $monitorProperties) {
                return BackupDestinationStatusFactory::createForSingleMonitor($monitorProperties);
            })
            ->collapse()
            ->sortBy(function (BackupDestinationStatus $backupDestinationStatus) {
                return "{$backupDestinationStatus->getBackupName()}-{$backupDestinationStatus->getFilesystemName()}";
            });
    }

    /**
     * @param array $monitorConfig
     *
{'fraction_non_alphanumeric': 0.10225988700564972, 'fraction_numerical': 0.0011299435028248588, 'mean_word_length': 2.9887387387387387, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6266704', 'n_tokens_mistral': 418, 'n_tokens_neox': 446, 'n_words': 70}