/** * @param AttributeInterface $productAttribute * * @return mixed */ private function getRandomValueForProductAttribute(AttributeInterface $productAttribute) { switch ($productAttribute->getStorageType()) { case AttributeValueInterface::STORAGE_BOOLEAN: return $this->faker->boolean; case AttributeValueInterface::STORAGE_INTEGER: return $this->faker->numberBetween(0, 10000); case AttributeValueInterface::STORAGE_FLOAT: return $this->faker->randomFloat(4, 0, 10000); case AttributeValueInterface::STORAGE_TEXT: return $this->faker->sentence; case AttributeValueInterface::STORAGE_DATE: case AttributeValueInterface::STORAGE_DATETIME: return $this->faker->dateTimeThisCentury; default: throw new \BadMethodCallException(); } }