It will not void your warranty, however, there are a few clauses in the warranty and repair TOS about “damage from unauthorized modifications” and them charging extra to fix it. They will be able to tell that your computer was opened, but I’m not sure if they will use that to claim any damage as caused by you. I would be cautious.
+
+
[https://www.apple.com/support/macbookpro/en/service_body.html#warranty1|Macbook Pro Warranty FAQ]
It will not void your warranty, however, there are a few clauses in the warranty and repair TOS about “damage from unauthorized modifications” and them charging extra to fix it. They will be able to tell that your computer was opened, but I’m not sure if they will use that to claim any damage as caused by you. I would be cautious.