code: private function addProductAttributesToVariation(Product $product, array $candidatesForProcessing = [])
      {
          return array_map(function (TransferObjectInterface $object) use ($product) {
              if (!($object instanceof Variation)) {
                  return $object;
              }
  
              $object->setAttributes(array_merge($object->getAttributes(), $product->getAttributes()));
  
              return $object;
          }, $candidatesForProcessing);
      }
docs: @param Product                   $product
  @param TransferObjectInterface[] $candidatesForProcessing
  
  @return TransferObjectInterface[]