I disagree with this suggestion. There should be two cases:

1. For mixed HTML/PHP files, the first line should be:

<?php declare(strict_types=1); ?>
...

2. For pure PHP files, the first lines should be:

<?php

declare(strict_types=1);

...

This is consistent with current standards regarding namespace, use, and
class declarations.

--
Woody Gilk
http://about.me/shadowhand

On Fri, Dec 2, 2016 at 9:56 PM, Michael Sheakoski <
[email protected]> wrote:

> Dear FIG,
>
> In https://github.com/php-fig/fig-standards/blob/
> d8e761e20a14112f6d209c8f719e2960af4ca3b2/proposed/extended-
> coding-style-guide.md there are 3 different examples
> of declare(strict_types=1): one directly below <?php, another several lines
> below the <?php after a doc block, and another on the same line.
>
> Please consider a single standard of putting declare(strict_types=1) on
> the same line as <?php for consistency across PHP-only and HTML+PHP files.
> It is much clearer to the developer that this file is running a special
> mode of PHP, not the usual non-strict mode, and they don't need to scan
> around doc blocks and namespace declarations to figure that out.
>
> <?php declare(strict_types=1);
>
> use Foo\Bar\Baz;
>
> class Thing extends Baz
> {
> }
>
> Best regards,
> Michael
>
> --
> You received this message because you are subscribed to the Google Groups
> "PHP Framework Interoperability Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/php-fig/6a81f1f0-f2b7-4429-9cf7-4cfe4db7768d%40googlegroups.com
> <https://groups.google.com/d/msgid/php-fig/6a81f1f0-f2b7-4429-9cf7-4cfe4db7768d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/CAGOJM6%2BNHk0eiWV_XOk2V%3DwNKVM8Ghe%2BJHLkRYW3oPA_sxF3LA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to