PHP code example of mottaviani-dev / laravel-reductor

1. Go to this page and download the library: Download mottaviani-dev/laravel-reductor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mottaviani-dev / laravel-reductor example snippets


return [
    'analysis' => [
        // Default clustering algorithm
        'algorithm' => env('REDUCTOR_ALGORITHM', 'kmeans'),
        
        // Similarity thresholds
        'similarity_thresholds' => [
            'conservative' => 0.95,  // High confidence
            'balanced' => 0.85,      // Default
            'aggressive' => 0.75,    // More reduction
        ],
        
        // DBSCAN parameters
        'dbscan' => [
            'eps' => null,  // Auto-detect
            'min_samples' => 3,
            'metric' => 'euclidean',
        ],
    ],
    
    'coverage' => [
        // Coverage file search paths
        'auto_detect_paths' => [
            storage_path('coverage.txt'),
            storage_path('coverage.cov'),
            base_path('coverage/coverage.txt'),
        ],
    ],
];
bash
php artisan vendor:publish --provider="Reductor\ReductorServiceProvider"
bash
php artisan migrate
bash
pip install -r vendor/mottaviani-dev/laravel-reductor/
bash
php artisan reductor:ingest-coverage storage/coverage.cov