Re: cvs: pear /PHP_CompatInfo CompatInfo.php

From: Date: Sat, 02 Sep 2006 09:49:29 +0000
Subject: Re: cvs: pear /PHP_CompatInfo CompatInfo.php
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-43850@lists.php.net to get a copy of this message
Laurent Laville wrote:
farell Sat Sep 2 09:42:01 2006 UTC
  Modified files:                  /pear/PHP_CompatInfo	CompatInfo.php   Log:
more PEAR CS (from PHP_CodeSniffer 0.0.4)
@@ -271,14 +271,12 @@
         $earliest_version = $this->earliest_version;
         $extensions = array();
         $constants = array();
-        $options = array_merge(
-            array(
-                'file_ext' => array('php', 'php4', 'inc', 'phtml'),
-                'is_string' => false,
-                'debug' => false,
-                'ignore_files' => array()
-                ),
-            $options);
+        $options = array_merge(array(
+            'file_ext' => array('php', 'php4', 'inc', 'phtml'),
+            'is_string' => false,
+            'debug' => false,
+            'ignore_files' => array()
+            ), $options);
         $options['ignore_files'] = array_map('strtolower', $options['ignore_files']);
         foreach ($files as $file) {
             if ($options['is_string'] === false) {
While I am sort of indifferent on the placement of the 'array(' (I would probably prefer how things were before), I do believe that the closing ');' should be moved to a new line without identing. Let me show you what I mean: $options = array_merge( array(
    'file_ext' => array('php', 'php4', 'inc', 'phtml'),
    'is_string' => false,
    'debug' => false,
    'ignore_files' => array()
), $options ); This makes the parameters obvious, it makes it obvious where the function call ends etc. BTW I also saw some discussion on multi line if() formatting I prefer: if (something && (somethingelse1
    || somethingelse2
) && otherstuff ) { .. } Again this formatting makes it obvious what belongs together. I also usually order my if statements in such a way that anything I am most likely to disable during debugging/refactoring is not on the first line. This way I can easily disable parts of the if statement For example: if (something && (somethingelse1
#    || somethingelse2
) # && otherstuff ) { .. } regards, Lukas

« previous php.pear.dev (#43850) next »