linuscash/with-global-state (packagist): a simple way to make global state clear in order to bring it back under control
Keywords: global-state|refactoring|state-management|testability