Coding Style #739
Answered
by
marcelfolaron
phulstaert
asked this question in
General
Replies: 1 comment 4 replies
-
Oh I fully agree about the inconsistencies. Over the last year I've tried
to clean things up a bit but there is a lot of code...
Andyes, it should all be PSR-12.
Biggest issue might be around namespaces and folder structure, so we might
want to touch that a little later.
Some general thoughts and source of inconsistencies:
- When Leantime started the controllers only contained a run() method to
execute any request method. Some time ago I changed that to have different
controller methods for the different request methods
Parameters are passed in (but not sanitized in any way right now) The run()
method is still in there but should be considered deprecated.
- Authentication and Authorization was hard coded pretty early on, which is
why it is taking so long to create a flexible user role system. My initial
thoughts would be to take out the authentication and move it into the
controllers (which would also allow us to have public controllers).
Additionally the authorization should be decoupled and added into the
controllers (and templates where needed) as well.
- Abstracting layouts: Once authentication moves into the controllers we
can start decoupling layouts and entry points. Right now Leantime has 3
different entry points, which basically represent the layouts:
Index->content.php : Most logged in pages
Index->login.php : Login page
Install->install.php : Install page
Download->download.php : managing file downloads
In a perfect world we would have 3 layout files: default, twoColumn, empty.
Users could then update then create custom layout files in the future.
- API module: I'd like to be able to offer a restful api, so the API module
is growing and should be thought of as "the" restful api. All responses in
there should be json. Leantime is already using all of the endpoints in
there to offer more asynchronous processing. Once auth is implemented
correctly we can start offering the API.
There is probably more but those are some high level thoughts.
Thank you for asking this question!
…On Mon, Jun 20, 2022 at 9:31 AM Peter Hulstaert ***@***.***> wrote:
Could be I missed it, but is there a coding style we want to use within
this project? PSR-12 for example?
I was looking at some code and have seen inconsistencies. This makes
working on the project by others not as easy as it could be...
—
Reply to this email directly, view it on GitHub
<#739>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALG4EFTZ7BUMAPF23YB7EITVQBXBHANCNFSM5ZI6DYWQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
phulstaert
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Could be I missed it, but is there a coding style we want to use within this project? PSR-12 for example?
I was looking at some code and have seen inconsistencies. This makes working on the project by others not as easy as it could be...
Beta Was this translation helpful? Give feedback.
All reactions