Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • B blaupload
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Luke Bratch
  • blaupload
  • Merge requests
  • !4

Psr 2 code

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Phil Burton requested to merge psr-2-code into master Apr 02, 2019
  • Overview 0
  • Commits 4
  • Changes 1

https://www.php-fig.org/psr/psr-2/

Although we've got a function declared in this code which throws a warning for PSR1 (a pre-req for PSR2). Files SHOULD either declare symbols (classes, functions, constants, etc.) or cause side-effects (e.g. generate output, change .ini settings, etc.) but SHOULD NOT do both.

I've also amended spacing a little to prevent code like <?php $this.$that+123 ?> so instead we have

I have removed the old array() syntax and use [] instead as it's cleaner and identical

Finally I have some further recommendations:

  1. We should really avoid so much html and php in the same file. We should probably look at a larger task to split the main html templates out.
  2. In php tags I think it's good to use the full <php tag but in html files it's preferable to use short tags to save space and keep things clean. <?= $that['thing'] ?> instead of
Edited Apr 02, 2019 by Phil Burton
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: psr-2-code