PSR1 recommends that each class should be in its own file to aid autoloaders.
Having each class in a dedicated file usually plays nice with PSR autoloaders
and is therefore a well established practice. If you use other autoloaders, you
might not want to follow this rule.
In camelCase names are written without any punctuation, the start of each new word
being marked by a capital letter. The whole name starts with a capital letter as well.
Thus the name database provider becomes DatabaseProvider.
Loading history...
13
{
14
/**
15
* This function will return a unordered list of all pages on the site.
16
* Watch for the switch between $page and $child in the second line of the
17
* foreach().
18
*
19
* Note that this will only skip ErrorPage's at the top/root level of the site.
20
* If you have an ErrorPage class somewhere else in the hierarchy, it will be
Both the $myVar assignment in line 1 and the $higher assignment in line 2
are dead. The first because $myVar is never used and the second because
$higher is always overwritten for every possible time line.
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.