View Single Post
Old 01-06-2008, 11:01 PM   #8 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

I generally follow a similar approach to the last post, by sjaq, except that indent depths are always the same (one tab; don't hate me for using tabs) whereas the initial indent is double the length in the code posted above.

I know the following is not strictly about indentation, but I feel it applies here. I like to keep all of the 'key value' (=>) operators nicely lined up as well (using spaces as padding).

All in all, it's just personal preference and one that I've adopted over time.

PHP Code:
// If I were feeling really pernickety,
// I'd order the keys alphabetically ;-)
$aSample = array (
    
'errorController' => 'error',
    
'defaultAction'   => 'index',
    
'debug'           => true,
    
'rootSafety'      => true,
    
'fileCommand'     => 'usr/bin/file',
    
'logs'            => array (
        
'error'       => 'error.log',
        
'default'     => 'log.log'
    
),
    
'timezone'        => 'Europe/Amsterdam'
); 
Salathe is offline  
Reply With Quote