Are theme .php files stored in the database?

No, a theme’s .php files are not stored in the database. Themes should not be hardcoding URLs in their files. However, it’s totally possible for this to happen, particularly with a custom theme or plugins whose developer did not follow best practices.

I’d suggest using a search utility such as grep (grepwin is nice for Windows) to look within your files just to be sure if your domain appears or not.

Also, when doing a search and replace on the DB, remember to use a utility that is able to handle serialized arrays, since a simple string replacement will damage data. WP CLI’s search-replace is one option. WP DB Migrate is really nice too.

Be sure to make a backup of everything before you make changes.