spadefoot / kohana-orm-leap

An ORM module for the Kohana PHP framework that is designed to work with all major databases.
http://spadefoot.github.io/kohana-orm-leap/
100 stars 25 forks source link

Conventions and Coding Style #49

Closed taai closed 12 years ago

taai commented 12 years ago

It would be great if we stick to Kohana's Conventions and Coding Style: http://kohanaframework.org/3.2/guide/kohana/conventions

bluesnowman commented 12 years ago

The reason the project slightly doesn't conform to all of Kohana's style and coding conventions is because we internally have different style and coding conventions that we follow, but we have tried to write the project as close them as possible for the community's sake.

taai commented 12 years ago

Ok, no bracket's in separate lines. And always update the version date. What else? Otherways you're spending time to fix my code. :)

bluesnowman commented 12 years ago

At the moment, here is a list of the style differences between Kohana and Leap:

  1. Use the Compact Control Readability Style.
  2. Always use brackets with single line if/else statements.
  3. When creating an instance of a class, always use parentheses even if you're not passing something to the constructor (e.g. $db = new Database();).
  4. Put spaces around the concatenation operator (e.g. $str = 'one' . $var . 'two';).
  5. Use && and || for Boolean comparisons, except use OR on line 1 of the class file.
  6. Use else if.
taai commented 12 years ago

Wow, that's almost opposite from Kohana's style! Well, I'll try to keep this in mind.

bluesnowman commented 12 years ago

Here are a few other style differences between Kohana and Leap:

  1. Protected and private variables are NOT preceded by an underscore.
  2. Protected and private functions/methods are NOT preceded by an underscore.
bluesnowman commented 12 years ago

For this module, we have decided to change bullet point 5 (above) to read: