preinheimer / xhprof

XHGUI is a GUI for the XHProf PHP extension, using a database backend, and pretty graphs to make it easy to use and interpret.
Other
834 stars 185 forks source link

Update code to PSR-2 standard #107

Closed michaelbutler closed 6 years ago

michaelbutler commented 7 years ago

Ran phpcbf (php code sniffer fixer) over the codebase with the PSR-2 standard enabled. Added composer.json and php_codesniffer to the require-dev section.

No functionality was changed, except in index.php.

For index.php, a die message was added when config.php could not be found. Some include_once and include statements were changed to require_once, since those files are required for xhprof ui to work.

A few double quoted strings were changed to single quotes.

aik099 commented 7 years ago

I see you've added PHP_CodeSniffer, but not calling it from .travis.yml. Any reason for that?

michaelbutler commented 7 years ago

Unless I'm mistaken this project doesn't have a .travis.yml or build system yet, but would be good to get that going!

aik099 commented 7 years ago

Ups. Then why not adding it right away.

michaelbutler commented 7 years ago

sure, I can add it to this PR. I think to activate it on the travis-ci end there needs to be an API key exchange or something?

aik099 commented 7 years ago

OK, that one is tricky. To make it happen we need to:

  1. have .travis.yml file present already (I guess in separate merged PR)
  2. have @preinheimer activate this repo on travis
  3. then rebase this PR on what we have on master
  4. see nice tests running
michaelbutler commented 7 years ago

Yeah, true. And add to that list, I'll have to fix some other things or customize the standards XML... phpcbf can't auto fix everything (e.g. no namespace violations). We probably don't want pure PSR-2 just yet.

preinheimer commented 7 years ago

A while back I moved XHGui to its own organisation so that admin rights could go to more than one person.

Should we move this to its own organisation so that I'm not a blocker on anything?

michaelbutler commented 7 years ago

@preinheimer maybe it could be moved to the same org, perftools? Also, if XHGui is more up to date I could use that in my project but the MongoDB requirement is a bit of a blocker. Can that be overridden to use the filesystem (or memcached, etc) for saving and loading of data?

aik099 commented 7 years ago

👍 for moving into organization and that way we can have more fine grained control over permissions.

aik099 commented 7 years ago

While making changes for CS compliance watch not to break BC 😉