Skip to content

Commit 976e12e

Browse files
author
Ashoka de Wit
committed
Format declare according to PSR 12
According to PSR12 the order of blocks in a PHP file is: - Opening <?php tag. - File-level docblock. - One or more declare statements. - The namespace declaration of the file. - One or more class-based use import statements. - One or more function-based use import statements. - One or more constant-based use import statements. - The remainder of the code in the file.
1 parent 5e2e58d commit 976e12e

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

files/fileTemplates/internal/PHP Class.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<?php declare(strict_types=1);
1+
<?php
22
#parse("PHP File Header")
33

4+
5+
declare(strict_types=1);
6+
47
#if (${NAMESPACE})
58
namespace ${NAMESPACE};
69
#end
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
<?php declare(strict_types=1);
1+
<?php
22
#parse("PHP File Header")
3+
4+
5+
declare(strict_types=1);

files/fileTemplates/internal/PHP Interface.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<?php declare(strict_types=1);
1+
<?php
22
#parse("PHP File Header")
33

4+
5+
declare(strict_types=1);
6+
47
#if (${NAMESPACE})
58
namespace ${NAMESPACE};
69
#end

files/fileTemplates/internal/PHP Trait.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<?php declare(strict_types=1);
1+
<?php
22
#parse("PHP File Header")
33

4+
5+
declare(strict_types=1);
6+
47
#if (${NAMESPACE})
58
namespace ${NAMESPACE};
69
#end

files/fileTemplates/internal/PHPUnit Test.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<?php declare(strict_types=1);
1+
<?php
22
#parse("PHP File Header")
33

4+
5+
declare(strict_types=1);
6+
47
#if (${NAMESPACE})
58
namespace ${NAMESPACE};
69
#end

0 commit comments

Comments
 (0)