<commit_before><?php
/*
 * WellCommerce Open-Source E-Commerce Platform
 * 
 * This file is part of the WellCommerce package.
 *
 * (c) <NAME> <<EMAIL>>
 * 
 * For the full copyright and license information,
 * please view the LICENSE file that was distributed with this source code.
 */

namespace WellCommerce\Bundle\ProductBundle\Factory;

use Doctrine\Common\Collections\ArrayCollection;
use WellCommerce\Bundle\AppBundle\Entity\Dimension;
use WellCommerce\Bundle\AppBundle\Entity\DiscountablePrice;
use WellCommerce\Bundle\AppBundle\Entity\Price;
use WellCommerce\Bundle\DoctrineBundle\Factory\AbstractEntityFactory;
use WellCommerce\Bundle\ProductBundle\Entity\ProductInterface;
use WellCommerce\Bundle\UnitBundle\Entity\UnitInterface;

/**
 * Class ProductFactory
 *
 * @author  <NAME> <<EMAIL>>
 */
class ProductFactory extends AbstractEntityFactory
{
    /**
     * @var string
     */
    protected $supportsInterface = ProductInterface::class;

    /**
     * @return \WellCommerce\Bundle\ProductBundle\Entity\ProductInterface
     */
    public function create()
    {
        $unit = $this->getDefaultUnit();
        $tax = $this->getDefaultTax();

        /** @var  $product ProductInterface */
        $product = $this->init();
        $product->setCategories(new ArrayCollection());
        $product->setProductPhotos(new ArrayCollection());
        $product->setStatuses(new ArrayCollection());
        $product->setAttributes(new ArrayCollection());
        $product->setShops(new ArrayCollection());
        $product->setEnabled(true);
        $product->setStock(0);
        $product->setWeight(0);
        $product->setPackageSize(1);
        $product->setSellPrice(new DiscountablePrice());
        $product->setDimension(new Dimension());
        $product->setBuyPrice(new Price());
        $product->setBuyPriceTax($tax);
        $product->setSellPriceTax($tax);
        $product->setUnit($unit);

        return $product;
    }

    private function getDefaultUnit() : UnitInterface
    {
        return $this->get('unit.repository')->findOneBy([]);
    }
}<commit_msg>Removed initialized properties from product factory<commit_after><?php
/*
 * WellCommerce Open-Source E-Commerce Platform
 * 
 * This file is part of the WellCommerce package.
 *
 * (c) <NAME> <<EMAIL>>
 * 
 * For the full copyright and license information,
 * please view the LICENSE file that was distributed with this source code.
 */

namespace WellCommerce\Bundle\ProductBundle\Factory;

use Doctrine\Common\Collections\ArrayCollection;
use WellCommerce\Bundle\AppBundle\Entity\Dimension;
use WellCommerce\Bundle\AppBundle\Entity\DiscountablePrice;
use WellCommerce\Bundle\AppBundle\Entity\Price;
use WellCommerce\Bundle\DoctrineBundle\Factory\AbstractEntityFactory;
use WellCommerce\Bundle\ProductBundle\Entity\ProductInterface;
use WellCommerce\Bundle\UnitBundle\Entity\UnitInterface;

/**
 * Class ProductFactory
 *
 * @author  <NAME> <<EMAIL>>
 */
class ProductFactory extends AbstractEntityFactory
{
    /**
     * @var string
     */
    protected $supportsInterface = ProductInterface::class;

    /**
     * @return \WellCommerce\Bundle\ProductBundle\Entity\ProductInterface
     */
    public function create()
    {
        $unit = $this->getDefaultUnit();
        $tax = $this->getDefaultTax();

        /** @var  $product ProductInterface */
        $product = $this->init();
        $product->setCategories(new ArrayCollection());
        $product->setProductPhotos(new ArrayCollection());
        $product->setStatuses(new ArrayCollection());
        $product->setAttributes(new ArrayCollection());
        $product->setShops(new ArrayCollection());
        $product->setEnabled(true);
        $product->setSellPrice(new DiscountablePrice());
        $product->setDimension(new Dimension());
        $product->setBuyPrice(new Price());
        $product->setBuyPriceTax($tax);
        $product->setSellPriceTax($tax);
        $product->setUnit($unit);

        return $product;
    }

    private function getDefaultUnit() : UnitInterface
    {
        return $this->get('unit.repository')->findOneBy([]);
    }
}
{'fraction_non_alphanumeric': 0.12900096993210475, 'fraction_numerical': 0.0007274490785645005, 'mean_word_length': 3.593541202672606, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 52, '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': '6406580', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1118, 'n_words': 222}