MyBB thrives upon support and patches from the public. In order to keep the contribution process as simple as possible and to ease the lives of core team members, there are a few guidelines that contributors must follow so that we have a chance to keep on top of things.
Feature suggestions should be posted in the official MyBB 2.0 feature requests forum, where they can be discussed fully and team members can provide any help or support to get your feature implemented. Once a feature is accepted, it will be moved to an issue on this GitHub repository, where it will be tagged appropriately and assigned a milestone.
Bug reports should be posted in the official MyBB 2.0 bug reports forum or (in the case of small confirmed bugs and users experienced with Git) as in issue within this GitHub repository. Once a bug is confirmed, it will be moved to an issue on this GitHub repository, tagged appropriately and assigned a milestone for completion.
Please do not report security issues on GitHub or in the public forums. Instead, please post a topic within the official Private Inquiries forum, where your issue will be discussed in private. THis ensures that security issues are patched in a timely manner without causing harm to existing MyBB installs.
Translations of the core language files are more than welcome. Additional translations ar stored within the MyBB 2.0 Translations Repository and changes to existing translations or new translations should be submitted against that repository. Translations should not be duplicated - if a translation for your language already exists, please provide contributions to that existing translations et rather than creating your own.
Pull requests may be submitted against this repository, but we request that users follow the GitHub flow principal of working, and that all pull requests are linked to an existing issue (be it either a bug report or a feature request). Pull requests for features or fixes not already discussed within an existing forum topic or GitHub issue will be closed.
We also ask that pull requests follow our coding standards, as defined below.
PHP code must follow the PSR-2 coding style guide. PHP CodeSniffer will be ran against all contributions to ensure that code follows this standard.
In addition to the PSR-2 standard, we have other standards and best practices that must be ahered to:
- All interface names MUST be suffixed with
Interface
. (e.g.ForumInterface
). - All abstract class names MUST be prefixed with
Abstract
(e.g.AbstractForum
). - All repository class names MUST be suffixed with
Repository
(e.g.ForumRepository
). - All factory class names MUST be suffixed with
Factory
(e.g.ForumFactory
). - All presenter class names MUST be suffixed with
Presenter
(e.g.ForumPresenter
). - The
Interface
suffix MUST take priority over other suffixes. (e.g.ForumRepositoryInterface
,ForumFactoryInterface
. - Getters MUST be used when retrieving the property of a non-Eloquent object.
- Setters MUST be used when manipulating the property of a non-Eloquent object.
- Properties on an object SHOULD have
protected
orprivate
visibility.
/**
* @property string magic
*/
class Foo
{
/**
* @var string
*/
protected $bar;
/**
* @return string;
*/
public function getBar()
{
return $this->bar;
}
/**
* @param string $bar
*/
public function setBar($bar)
{
$this->bar = $bar;
}
/**
* @param string $name
*/
public function __get($name)
{
return 'magic';
}
}
- Methods with a return value and/or arguments MUST have a document block.
- Object properties MUST have a document block with
@var
tag denoting their type. - Magic properties on an object MUST be declared in a doc block at the top of the class using the
@property
tag. - Method arguments that are required MUST NOT have a default value.
Should your pull request not follow these standards, you will be requested to reformat your code to suit.
The MyBB team utilise both PHP CodeSniffer and PHP Coding Standards Fixer in order to analyse and correct code style for all contributors. These tools are run as Git pre-commit hooks.
JavaScript should follow the JavaScript conventions laid out by Douglas Crockford.
Core CSS styling is built using the SASS pre-processor. CSS code should follow the enhanced BEM syntax where fitting, and focus upon providing reusable CSS components rather than replicating styles. CSS should follow the standards laid out by @mdo.
Contributors to this project should understand and ensure they agree to the terms described in our Code of Conduct available at https://mybb.com/about/conduct/.