Formatting PHP code in Eclipse PDT and Zend Neon

By default, the current Eclipse-based PHP IDE (PDT) uses an indenting style based on One True Brace, and the upcoming Zend Neon version happens to be also Eclipse-based. For developers working with OSInet Drupal modules or PHP-GTK code, or anyone wishing to apply the OSInet coding style, or another form of Whitesmiths / Symbian PHP formatting, Eclipse allows for customizing the bracing/commenting style by hand-tuning, or to make things simpler, by just importing the OSInet rules for Zend Studio / Eclipse PDT.
AttachmentSize
neon_formatting.xml13.16 KB

Importing styles

Hi, Can you post some more details on this? e.g. usage i've been digging PDT without any luck how i can import OSInet rules. thanks.

exporting styles

and ... can you explain how it's possible to EXPORT these styles to help twist the arms of your cow-orkers into formatting The Right Way? thx!

Importing formatting preferences in Zend Studio Neon

It's really simple, at least in Zend Studio Neon: go to Preferences/PHP/Formatter.

Then click on Import and choose the XML file with the conventions. If conventions by the same name exist, you will be asked whether to override them or rename the imported conventions. Apply, and you can now use them.

Not sure how how this relates to the default PDT system, though.

Exporting formatting rules from Zend Studio Neon

It's pretty much like importing them: go to Preferences/PHP/Formatter.

Then click on Export and name the resulting XML file with the formatting preferences.

Importing rules into PDT

Hi,
on PDT still no luck to import OSInet rules, does anybody know how to make it?
Thanks

Zend Studio for Eclipse > PDT

It seems this feature is only present when using the full Zend Studio for Eclipse, which is more featured than the basic PDT.

See the section about "Editor and File Management" at: http://www.zend.com/en/products/studio/compare