If you want to become a phpCollab3 developer you should use Test-Driven Development and Domain Driven Design. It means that for each task you accept as yours you should:
The Domain-Driven Design is involved in each of this steps and it means that you should naming classes and function to express what they do. As some says “The code should speak by itself to the reader”.
This steps should be used for tasks, bugs and any other “issue” you are going to accept.
Go to the issue page and edit it adding yourself as the user that will work on that issue (“Assign to” field).
First of all: if you are new with Git, read the documentation on github and Git.
git branch [name of your new branch; ex: issue_3627 ]
git checkout [name of your new branch; ex: issue_3627 ]
git add .
git commit -m '<message>'
git push <remote_repository_name> <your_branch> (example : git push origin issue_3627 )
After your notification the branch will be merged into the master by the lead developer and the branch will be deleted.
Part of the coding standard used in phpCollab3 is based on the Symfony coding standad.
<?php
class sfFoo
{
public function bar()
{
sfCoffee::make();
}
}<?php if ($myVar == getRequestValue($name)) // correct if ( $myVar == getRequestValue($name) ) // incorrect
<?php
function makeCoffee()
{
if (false !== isSleeping() && false !== hasEnoughCafeineForToday())
{
canMakeCoffee();
return 1;
}
else
{
cantMakeCoffee();
}
return null;
}<?php
public function notify(sfEvent $event)
{
// ...
}<?php /** * Notifies all listeners of a given event. * * @param sfEvent $event A sfEvent instance * * @return sfEvent The sfEvent instance */ public function notify(sfEvent $event)
<?php
// wrong
Class Foo
{
}
// right
class Foo
{
}
// wrong
Function foo()
{
}
// right
function foo()
{
}
<?php
$string = 'something';
$newString = "$string is awesome!"; // bad, not awesome
$newString = $string.' is awesome!'; // better
$newString = sprintf('%s is awesome', $string); // for exception messages and strings with a lot of substitutions<?php
class sfCoffee
{
const HAZ_SUGAR = true;
}
var_dump(sfCoffee::HAZ_SUGAR);<?php
if (!is_null($coffee))
{
echo 'I can haz coffee';
}<?php if (1 === $variable)
<?php // space first, with no full stop needed