src/Entities/CartItemOption.php
public static function createFromArray(array $selectedOptions, Product $product) // TODO
    {
        $options = [];

        foreach ($selectedOptions as $optionSetId => $optionId) {
            $optionSet = $product->getOptionSetByID($optionSetId);

            $option = $optionSet->getOptionByID($optionId);

            $options[] = new static($optionSet, $option);
        }

        return $options;
    }
public static function createFromArray(array $selectedOptions, Product $product) // TODO
    {
        $options = [];

        foreach ($selectedOptions as $optionSetId => $optionId) {
            $optionSet = $product->getOptionSetByID($optionSetId);

            $option = $optionSet->getOptionByID($optionId);

            $options[] = new static($optionSet, $option);
        }

        return $options;
    }
@param array   $selectedOptions
@param Product $product

@return array|static[]