Secrets don't belong anywhere inside an application code. They're related to the runtime environnement - 'cause you don't use the same password for production and integration, right? - and should come from an external configuration source. That might be as simple as environment variables.
Application deployment should never require modification of a file that resides inside the application itself. PHP and other interpreted languages has a tendancy to promote laziness when it comes to proper release management.
And don't start with "but it makes development complicated": fix your onboarding and then tooling instead of putting the security of your users and customers at risk.