Jump to content

Recommended Posts

Hi bbalet! Seems to me that you know what you're doing! ;)

 

I looked at the code a bit and the only thing I could say is that some methods are really long.

For example, this one : https://github.com/bbalet/lms/blob/master/application/models/leaves_model.php / get_user_leaves_summary

The first step to break it up would be to make a new method where you put a comment.

For example, where you put the comment "//Fill a list of all existing leave types", you could have a method named "fillList()" and another one "getLeavesExistingTypes()" or something like that. Dunno if it make sense there but you know what I mean.

 

Remember, the first rule is that methods should be small. The second rule is that methods should be smaller than that (from the book Clean Code) ;)

Edited by mogosselin
Link to comment
https://forums.phpfreaks.com/topic/288685-hello-world/#findComment-1480554
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.