Hi,

I just stumbled on a little problem with the coding standards regarding
the declaration of multiline arrays.

http://framework.zend.com/manual/en/coding-standard.coding-style.html#coding-standard.coding-style.arrays

In the coding standards this formating is allowed:

  $sampleArray = array(1, 2, 3, 'Zend', 'Studio',
                       $a, $b, $c,
                       56.44, $d, 500);

  $sampleArray = array('firstKey'  => 'firstValue',
                       'secondKey' => 'secondValue');

But when I jump through the codes, the declaration is done differently
in some components. The code is formated like this:

  $sampleArray = array(
      1, 2, 3, 'Zend', 'Studio',
      $a, $b, $c,
      56.44, $d, 500
  );

  $sampleArray = array(
      'firstKey'  => 'firstValue',
      'secondKey' => 'secondValue'
  );

Some randomly picked examples:

- Zend_Cache_Backend_File, line 90
- Zend_Acl_Role_Registry, line 101
- Zend_Translate_Adapter, line 69

Are the coding standards not up-to-date or are some components not
following the rules? I personally would always prefer the second format
but I would follow the rules, if this is the wanted way.

Thanks for clarification.

Best regards,

Ralf

Reply via email to