Skip to content

Commit ca32c20

Browse files
author
Volodymyr Kublytskyi
committed
MAGETWO-64523: Add static test on forbidden "final" keyword and eliminate it usage in code
- final keyword usage removal
1 parent 57d1211 commit ca32c20

File tree

10 files changed

+18
-5
lines changed

10 files changed

+18
-5
lines changed

app/code/Magento/Braintree/Model/Ui/ConfigProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* Class ConfigProvider
1515
*/
16-
final class ConfigProvider implements ConfigProviderInterface
16+
class ConfigProvider implements ConfigProviderInterface
1717
{
1818
const CODE = 'braintree';
1919

app/code/Magento/Vault/Model/Method/Vault.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
2929
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3030
*/
31-
final class Vault implements VaultPaymentInterface
31+
class Vault implements VaultPaymentInterface
3232
{
3333
/**
3434
* @deprecated

app/code/Magento/Vault/Model/Ui/Adminhtml/TokensConfigProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @api
2828
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2929
*/
30-
final class TokensConfigProvider
30+
class TokensConfigProvider
3131
{
3232
/**
3333
* @var PaymentTokenRepositoryInterface

app/code/Magento/Vault/Model/Ui/TokensConfigProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Class ConfigProvider
1616
* @api
1717
*/
18-
final class TokensConfigProvider implements ConfigProviderInterface
18+
class TokensConfigProvider implements ConfigProviderInterface
1919
{
2020
/**
2121
* @var string

dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest/ParentClassWithNamespace.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public static function publicParentStatic()
7878
{
7979
}
8080

81+
/**
82+
* @SuppressWarnings(PHPMD.FinalImplementation) Suppressed as is a fixture but not a real code
83+
*/
8184
final public function publicParentFinal()
8285
{
8386
}

dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest/SourceClassWithNamespace.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ public static function publicChildStatic()
104104
{
105105
}
106106

107+
/**
108+
* @SuppressWarnings(PHPMD.FinalImplementation) Suppressed as is a fixture but not a real code
109+
*/
107110
final public function publicChildFinal()
108111
{
109112
}

dev/tests/integration/testsuite/Magento/Framework/Interception/Fixture/Intercepted.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function D($param1)
4848

4949
/**
5050
* @SuppressWarnings(PHPMD.ShortMethodName)
51+
* @SuppressWarnings(PHPMD.FinalImplementation) Suppressed as is a fixture but not a real code
5152
*/
5253
final public function E($param1)
5354
{

lib/internal/Magento/Framework/Archive/Tar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function _initWriter()
8484
*
8585
* @return string
8686
*/
87-
final protected static function _getFormatParseHeader()
87+
protected static function _getFormatParseHeader()
8888
{
8989
return 'a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2version/' .
9090
'a32uname/a32gname/a8devmajor/a8devminor/a155prefix/a12closer';

lib/internal/Magento/Framework/Code/Test/Unit/Generator/TestAsset/ParentClass.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public static function publicParentStatic()
7878
{
7979
}
8080

81+
/**
82+
* @SuppressWarnings(PHPMD.FinalImplementation) Suppressed as is a fixture but not a real code
83+
*/
8184
final public function publicParentFinal()
8285
{
8386
}

lib/internal/Magento/Framework/Code/Test/Unit/Generator/TestAsset/SourceClass.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ public static function publicChildStatic()
112112
{
113113
}
114114

115+
/**
116+
* @SuppressWarnings(PHPMD.FinalImplementation) Suppressed as is a fixture but not a real code
117+
*/
115118
final public function publicChildFinal()
116119
{
117120
}

0 commit comments

Comments
 (0)