<?php  namespace App\Services\ImportersAndHandlers\PriceFromPricePerMeasureUnit;  use App\Models\Product; use App\Contracts\UnitOfMeasure; use App\Exceptions\UnavailableMeasureCombinationException;  class PriceFromPricePerMeasureUnitFactory { 	public static function make(int $unitOfMeasure, float|string $price, ?int $alternativeUnitOfMeasure = null, ?float $conversionToQuantity = null, ?float $weight = null): UnitOfMeasure 	{ 		if (($unitOfMeasure == array_search('KG', Product::MEASURE_UNITS)) && !$alternativeUnitOfMeasure) { 			return new PriceFromUnitOfMeasure($price, $weight); 			// cijena je za kilogram, mora se izračunati konačna cijena proizvoda 		}  		if ($alternativeUnitOfMeasure && $conversionToQuantity) { 			return new PriceFromPriceWithAlternativeUnitOfMeasure($price, $alternativeUnitOfMeasure, $conversionToQuantity); 			// cijena je za komad, al za prikaz cijene za kg/litru koristimu conversion to quantity 		}  		if (($unitOfMeasure == array_search('KOM', Product::MEASURE_UNITS)) && !$alternativeUnitOfMeasure) { 			return new PriceFromPrice($price); 			// cijena je za komad, i ne postoji prikaz cijene po kg/litri 		}  		throw new UnavailableMeasureCombinationException; 	} }