- Fork the repository. If you are not used to Github, please check out fork a repository.
- Branch your repository, to commit the desired changes.
- Test your code.
- Send a pull request to us.
- Visual Studio Code (all OS), or PHPStorm (all OS)
- SmartGit (all OS), or Git Extensions (Windows), or GitHub Desktop (macOS, Windows)
- Use bug report or feature request templates.
- Check if the develop branch exists. If it exist use it to pull your request into.
- If you want to send a bug fix, use
Fix
word in the title of your PR (i.e.Fix page permissions
). - If you want to send a new feature, use
Add
word in the title of your PR (i.eAdd a new frontpage template
).
In any case, the title of each of your commits should continue such a phrase — If applied, this commit will ...
(Update HelloPortal addon
, etc.)
- Use PHP 8.1+ with tabs instead of spaces
/**
* Get array with bubble sorting
*
* @param array $array
* @return array
*/
function getBubbleSortedArray(array $array): array
{
$count = count($array);
for ($j = 0; $j < $count - 1; $j++) {
for ($i = 0; $i < $count - $j - 1; $i++) {
if ($array[$i] > $array[$i + 1]){
$tmp_var = $array[$i + 1];
$array[$i + 1] = $array[$i];
$array[$i] = $tmp_var;
}
}
}
return $array;
}
$array = [5, 3, 2, 6, 1, 4, 7];
$result = getBubbleSortedArray($array);
var_dump($result);
- Variable names:
$camelCase = true
- Function names:
snake_case()
- Class names:
class PascalCase
- Method names:
$this->camelCase()
- Array key names:
$var['snake_case']
- Object key names:
$obj->camelCase
- Constant names:
CONSTANT_NAME
- Use HTML5
- Use LESS (
portal.less
) to modify desired rules.
#comment_form {
textarea {
width: 100%;
height: 30px;
}
button {
&[name='comment'] {
margin-top: 10px;
float: right;
display: none;
}
}
}
- Use native JavaScript, or Alpine.js (3.x), or Vue.js (3.x) instead of jQuery.
- Use
const
orlet
instead ofvar
.
'use strict';
Array.prototype.bubbleSort = function () {
let swapped;
do {
swapped = false;
this.forEach((item, index) => {
if (item > this[index + 1]) {
let temp = item;
this[index] = this[index + 1];
this[index + 1] = temp;
swapped = true;
}
});
} while (swapped);
return this;
};
const arr = [5, 3, 2, 6, 1, 4, 7];
console.log('Source array: ', arr);
// Source array: (7) [5, 3, 2, 6, 1, 4, 7]
console.log('Sorted array: ', arr.bubbleSort());
// Sorted array: (7) [1, 2, 3, 4, 5, 6, 7]
We try using Major.Minor.Patch for releases.