Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto generated glossary of all Metrics & Report definitions in Piwik #8793

Merged
merged 12 commits into from Oct 2, 2015

Conversation

mattab
Copy link
Member

@mattab mattab commented Sep 15, 2015

#6773

Todo:

  • gather feedback
  • add widgetized so we can embed the glossary
  • fix tests
  • embed into website eg. developer guide

@mattab mattab added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Sep 15, 2015
@mattab mattab self-assigned this Sep 15, 2015
@mattab mattab added this to the 2.15.0 milestone Sep 15, 2015
{
Piwik::checkUserHasSomeViewAccess();

$glossary = new Glossary($this->idSite);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this PR is still a work in progress, but I want to mention that classes that encapsulate application logic should be stateless or immutable service classes and should be obtained through DI. Instead of creating an instance of this type manually here, you should get it through StaticContainer.

To do this, you must:

  • Remove the idSite as a constructor parameter and move to individual methods.
  • Add constructor arguments for all dependencies in Glossary class. Dependencies that aren't set via DI (ie, singletons that are not yet in DI) should be set in the constructor, but not as constructor arguments. (These I'll change manually when getting rid of Singleton/StaticContainer).


namespace Piwik\Plugins\API;

class Glossary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add tests for this class?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

mattab pushed a commit that referenced this pull request Oct 2, 2015
Auto generated glossary of all Metrics & Report definitions in Piwik
@mattab mattab merged commit ae209c6 into master Oct 2, 2015
@mattab mattab deleted the 6773_glossary branch October 2, 2015 12:11
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants