piwik/piwik — pull request #6446 by mnapoli (2014-10-15 03:00:04+00:00)
Title: Extracted `Piwik::getJavascriptCode()` into a separate, non static class

Extracted `Piwik::getJavascriptCode()` into a separate, non static class: `Piwik\Tracker\TrackerCodeGenerator`.

The content of the methods hasn't been modified, I have just moved them.

**Why?**

- clear up the almighty `Piwik` class which has too many responsibilities
- a class with non-static methods means it's open to dependency injection
- tests are in a separate class dedicated to this new class, so that's also simpler/cleaner

`Piwik::getJavascriptCode()` is now deprecated in favor of the new class (I have changed the places where it was called). I added the deprecation to the changelog.

I haven't renamed the `Piwik.getJavascriptCode` event for backward compatibility.

Feedback welcome.