Skip to content

Commit cdefad9

Browse files
authored
Merge pull request #17 from mediact/feature/MG-973
2.1.0 Update file templates to comply to PSR-12
2 parents 32cf646 + b000839 commit cdefad9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+159
-37
lines changed

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"email": "[email protected]"
1010
}
1111
],
12-
"version": "2.0.6",
12+
"version": "2.1.0",
1313
"require": {
1414
"php": "^7.1",
1515
"composer-plugin-api": "^1.0"
@@ -18,7 +18,7 @@
1818
"phpunit/phpunit": "^7.5",
1919
"composer/composer": "^1.3",
2020
"kint-php/kint": "@stable",
21-
"mediact/testing-suite": "^1.20",
21+
"mediact/testing-suite": "^2.0",
2222
"mikey179/vfsstream": "^1.6"
2323
},
2424
"autoload": {
@@ -43,7 +43,8 @@
4343
"/phpmd.xml",
4444
"/phpstan.neon",
4545
"/phpcs.xml",
46-
"/grumphp.yml"
46+
"/grumphp.yml",
47+
"/pdepend.xml"
4748
]
4849
},
4950
"config": {

files/fileTemplates/M2-Class-Backend-Controller.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
2+
23
#parse("M2-PHP-File-Header")
34

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

files/fileTemplates/M2-Class-Block.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
2+
23
#parse("M2-PHP-File-Header")
34

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

files/fileTemplates/M2-Class-Helper.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
2+
23
#parse("M2-PHP-File-Header")
34

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

files/fileTemplates/M2-Class-Observer.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
2+
23
#parse("M2-PHP-File-Header")
34

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

files/fileTemplates/M2-Class-ViewModel.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
2+
23
#parse("M2-PHP-File-Header")
34

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

files/fileTemplates/M2-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
2+
23
#parse("M2-PHP-File-Header")
34

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

files/fileTemplates/M2-Registration.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
2+
23
#parse("M2-PHP-File-Header")
34

5+
declare(strict_types=1);
6+
47
use Magento\Framework\Component\ComponentRegistrar;
58

69
ComponentRegistrar::register(
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#set( $Company = "MediaCT" )
2+
#set( $Vendor = "MediaCT" )
3+
#set( $Website = "https://www.mediact.nl")
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
#parse("Company Settings")
12
/**
2-
* Copyright MediaCT. All rights reserved.
3-
* https://www.mediact.nl
4-
*/
3+
* Copyright $Company. All rights reserved.
4+
* $Website
5+
*/

files/fileTemplates/internal/PHP Class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
2-
#parse("PHP File Header")
32

3+
#parse("PHP File Header")
44

55
declare(strict_types=1);
66

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
#parse("PHP File Header")
32

3+
#parse("PHP File Header")
44

55
declare(strict_types=1);

files/fileTemplates/internal/PHP Interface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
2-
#parse("PHP File Header")
32

3+
#parse("PHP File Header")
44

55
declare(strict_types=1);
66

files/fileTemplates/internal/PHP Trait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
2-
#parse("PHP File Header")
32

3+
#parse("PHP File Header")
44

55
declare(strict_types=1);
66

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
PHPUnit Test.php
1+
<?php
2+
3+
#parse("PHP File Header")
4+
5+
declare(strict_types=1);
6+
7+
#if (${NAMESPACE})
8+
namespace ${NAMESPACE};
9+
#end
10+
11+
use PHPUnit\Framework\TestCase;
12+
use ${TESTED_NAMESPACE}\\${TESTED_NAME};
13+
14+
/**
15+
* @coversDefaultClass \\${TESTED_NAMESPACE}\\${TESTED_NAME}
16+
*/
17+
class ${NAME} extends TestCase
18+
{
19+
}

files/fileTemplates/internal/PHPUnit Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
2-
#parse("PHP File Header")
32

3+
#parse("PHP File Header")
44

55
declare(strict_types=1);
66

pdepend.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0"?>
2+
<symfony:container xmlns:symfony="http://symfony.com/schema/dic/services"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns="http://pdepend.org/schema/dic/pdepend"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
6+
<config>
7+
<cache>
8+
<driver>memory</driver>
9+
</cache>
10+
</config>
11+
</symfony:container>

src/Environment.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl

src/EnvironmentInterface.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm;
811

912
use Composer\Composer;

src/Filesystem.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm;
811

912
use RecursiveDirectoryIterator;

src/FilesystemInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl

src/InstallerPlugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
* @deprecated
67
*/
78

9+
declare(strict_types=1);
10+
811
namespace Mediact\CodingStandard\PhpStorm;
912

1013
use Composer\Composer;

src/Patcher/CodeStylePatcher.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm\Patcher;
811

912
use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;

src/Patcher/ConfigPatcher.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm\Patcher;
811

912
use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;

src/Patcher/ConfigPatcherInterface.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm\Patcher;
811

912
use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;

src/Patcher/CopyFilesTrait.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm\Patcher;
811

912
use Mediact\CodingStandard\PhpStorm\FilesystemInterface;

src/Patcher/FileTemplatesPatcher.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm\Patcher;
811

912
use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;

src/Patcher/InspectionsPatcher.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm\Patcher;
811

912
use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
@@ -14,8 +17,8 @@ class InspectionsPatcher implements ConfigPatcherInterface
1417
{
1518
use CopyFilesTrait;
1619

17-
const PROJECT_PHPCS = 'phpcs.xml';
18-
const INSPECTION_PROFILE = 'inspectionProfiles/MediaCT.xml';
20+
public const PROJECT_PHPCS = 'phpcs.xml';
21+
public const INSPECTION_PROFILE = 'inspectionProfiles/MediaCT.xml';
1922

2023
/**
2124
* @var XmlAccessorInterface

src/Patcher/LiveTemplatesPatcher.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm\Patcher;
811

912
use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;

src/Patcher/TemplateSettingsPatcher.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm\Patcher;
811

912
use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;

src/Plugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
23
/**
34
* Copyright MediaCT. All rights reserved.
45
* https://www.mediact.nl
56
*/
67

8+
declare(strict_types=1);
9+
710
namespace Mediact\CodingStandard\PhpStorm;
811

912
use Composer\Composer;

0 commit comments

Comments
 (0)