PEAR Coding Standards

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PEAR Coding Standards

Ken Guest-2
Hi everyone,

After updating the Header Comments Block in the Coding Standards to include
mention of PHP 7, I've been looking over the PEAR Coding Standards today,
spotting a few things to update and thought to check over  a few things.

on https://pear.php.net/manual/en/standards.arrays.php correct indents for
assignments in arrays are described:

<?php

$some_array = array(
    'foo'  => 'bar',
    'spam' => 'ham',
);
?>

In my opinion. that should also include short array syntax (which is a long
overdue update I think)


<?php

$some_array = [
    'foo'  => 'bar',
    'spam' => 'ham',
];
?>


Comments....

Is there any specific reason why comments can't be started with an
octothorpe, i.e.
# a comment ? (If only just to answer the question "why?" asked there at
https://pear.php.net/manual/en/standards.comments.php )


Tags...
On the "tags page" ( https://pear.php.net/manual/en/standards.tags.php )
it's anbiguous whether the closing php tag needs to be included or not (if
the file contains nothing but PHP code.)


I'm also wondering if we want to at least refer to PSRs 0-2 at this stage?

Thanks

Ken
--
http://about.me/kenguest/
Reply | Threaded
Open this post in threaded view
|

Re: PEAR Coding Standards

Vasil Rangelov
There are conflicts between PSR-2 and PEAR, so I'm not sure about
referring to them... Unless it is to clarify the specific conflicts
(key one being the switch/case rules).

For the "#" comment... My guess is it's there just for consistency's
sake. I mean, when it comes to coding standards, the primary purpose
is readability, and keeping things consistent is one way of doing
that. There is no more of a "why" reason for "#" as there is for the
"why" to any particular naming convention.

BTW, Ken, GMail tells me "pair.com" didn't encrypt your message...
"pair.com"?!? Was that a typo made during the reconfiguration of the
PEAR server? The new host? Both? Does anyone know?

2016-03-17 23:18 GMT+02:00 Ken Guest <[hidden email]>:

> Hi everyone,
>
> After updating the Header Comments Block in the Coding Standards to include
> mention of PHP 7, I've been looking over the PEAR Coding Standards today,
> spotting a few things to update and thought to check over  a few things.
>
> on https://pear.php.net/manual/en/standards.arrays.php correct indents for
> assignments in arrays are described:
>
> <?php
>
> $some_array = array(
>     'foo'  => 'bar',
>     'spam' => 'ham',
> );
> ?>
>
> In my opinion. that should also include short array syntax (which is a long
> overdue update I think)
>
>
> <?php
>
> $some_array = [
>     'foo'  => 'bar',
>     'spam' => 'ham',
> ];
> ?>
>
>
> Comments....
>
> Is there any specific reason why comments can't be started with an
> octothorpe, i.e.
> # a comment ? (If only just to answer the question "why?" asked there at
> https://pear.php.net/manual/en/standards.comments.php )
>
>
> Tags...
> On the "tags page" ( https://pear.php.net/manual/en/standards.tags.php )
> it's anbiguous whether the closing php tag needs to be included or not (if
> the file contains nothing but PHP code.)
>
>
> I'm also wondering if we want to at least refer to PSRs 0-2 at this stage?
>
> Thanks
>
> Ken
> --
> http://about.me/kenguest/

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php