30 lines
		
	
	
		
			744 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			744 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
declare(strict_types=1);
 | 
						|
 | 
						|
namespace App\Services\WorkingDays;
 | 
						|
 | 
						|
use App\Services\Utils\DurationConvertor;
 | 
						|
 | 
						|
class DurationSolverFactory
 | 
						|
{
 | 
						|
    public function __construct(
 | 
						|
        private readonly WorkingDayDeterminerFactory $workingDayDeterminerFactory,
 | 
						|
        private readonly DurationConvertor $durationConvertor,
 | 
						|
    ) {
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Create DurationSolver instance for a specific country
 | 
						|
     * @param string $countryCode
 | 
						|
     * @return DurationSolver
 | 
						|
     */
 | 
						|
    public function createDurationSolverForCountry(string $countryCode): DurationSolver
 | 
						|
    {
 | 
						|
        return new DurationSolver(
 | 
						|
            $this->workingDayDeterminerFactory->createForCountry($countryCode),
 | 
						|
            $this->durationConvertor,
 | 
						|
        );
 | 
						|
    }
 | 
						|
}
 |