Skip to content

Commit d07db28

Browse files
committed
Fixed coding standard violations in the Framework\Code namespace, so that it will be checked bij PHP CS and no longer be ignored while doing CI checks. Made the following changes:
- Removed @codingStandardsIgnoreFile from the head of the file. - Changed interfaces in tests to actually end with the name "Interface".
1 parent bbe3ee0 commit d07db28

File tree

8 files changed

+27
-43
lines changed

8 files changed

+27
-43
lines changed

lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\Code\Test\Unit;
108

119
use Magento\Framework\Code\Generator;

lib/internal/Magento/Framework/Code/Test/Unit/Reader/_files/ClassesForArgumentsReader.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* See COPYING.txt for license details.
66
*/
77

8-
// @codingStandardsIgnoreFile
9-
108
class ClassWithAllArgumentTypes
119
{
1210
const DEFAULT_VALUE = 'Const Value';

lib/internal/Magento/Framework/Code/Test/Unit/Validator/ConstructorArgumentTypesTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\Code\Test\Unit\Validator;
108

119
class ConstructorArgumentTypesTest extends \PHPUnit_Framework_TestCase

lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForArgumentSequence.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* See COPYING.txt for license details.
66
*/
77

8-
// @codingStandardsIgnoreFile
9-
108
namespace ArgumentSequence;
119

1210
class ContextObject implements \Magento\Framework\ObjectManager\ContextInterface

lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* See COPYING.txt for license details.
66
*/
77

8-
// @codingStandardsIgnoreFile
9-
108
class ClassA
119
{
1210
}
@@ -16,16 +14,16 @@ class ClassB
1614
class ClassC
1715
{
1816
}
19-
interface InterfaceA
17+
interface FirstInterface
2018
{
2119
}
22-
class ImplementationOfInterfaceA implements InterfaceA
20+
class ImplementationOfFirstInterface implements FirstInterface
2321
{
2422
}
25-
interface InterfaceB
23+
interface SecondInterface
2624
{
2725
}
28-
class ImplementationOfInterfaceB implements InterfaceB
26+
class ImplementationOfSecondInterface implements SecondInterface
2927
{
3028
}
3129
class Context implements \Magento\Framework\ObjectManager\ContextInterface
@@ -46,21 +44,21 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface
4644
protected $_exC;
4745

4846
/**
49-
* @var InterfaceA
47+
* @var FirstInterface
5048
*/
5149
protected $_interfaceA;
5250

5351
/**
54-
* @var ImplementationOfInterfaceB
52+
* @var ImplementationOfSecondInterface
5553
*/
5654
protected $_implOfBInterface;
5755

5856
public function __construct(
5957
\ClassA $exA,
6058
\ClassB $exB,
6159
\ClassC $exC,
62-
\InterfaceA $interfaceA,
63-
\ImplementationOfInterfaceB $implOfBInterface
60+
\FirstInterface $interfaceA,
61+
\ImplementationOfSecondInterface $implOfBInterface
6462
) {
6563
$this->_exA = $exA;
6664
$this->_exB = $exB;

lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* See COPYING.txt for license details.
66
*/
77

8-
// @codingStandardsIgnoreFile
9-
108
class ClassFirst
119
{
1210
}
@@ -19,16 +17,16 @@ class ClassThird
1917
class ClassD
2018
{
2119
}
22-
interface InterfaceFirst
20+
interface ThirdInterface
2321
{
2422
}
25-
class ImplementationOfInterfaceFirst implements InterfaceFirst
23+
class ImplementationOfThirdInterface implements ThirdInterface
2624
{
2725
}
28-
interface InterfaceSecond
26+
interface FourthInterface
2927
{
3028
}
31-
class ImplementationOfInterfaceSecond implements InterfaceSecond
29+
class ImplementationOfFourthInterface implements FourthInterface
3230
{
3331
}
3432
class ContextFirst implements \Magento\Framework\ObjectManager\ContextInterface
@@ -49,28 +47,28 @@ class ContextFirst implements \Magento\Framework\ObjectManager\ContextInterface
4947
protected $_exC;
5048

5149
/**
52-
* @var InterfaceFirst
50+
* @var ThirdInterface
5351
*/
5452
protected $_interfaceA;
5553

5654
/**
57-
* @var ImplementationOfInterfaceSecond
55+
* @var ImplementationOfFourthInterface
5856
*/
5957
protected $_implOfBInterface;
6058

6159
/**
6260
* @param ClassFirst $exA
6361
* @param ClassSecond $exB
6462
* @param ClassThird $exC
65-
* @param InterfaceFirst $interfaceA
66-
* @param ImplementationOfInterfaceSecond $implOfBInterface
63+
* @param ThirdInterface $interfaceA
64+
* @param ImplementationOfFourthInterface $implOfBInterface
6765
*/
6866
public function __construct(
6967
\ClassFirst $exA,
7068
\ClassSecond $exB,
7169
\ClassThird $exC,
72-
\InterfaceFirst $interfaceA,
73-
\ImplementationOfInterfaceSecond $implOfBInterface
70+
\ThirdInterface $interfaceA,
71+
\ImplementationOfFourthInterface $implOfBInterface
7472
) {
7573
$this->_exA = $exA;
7674
$this->_exB = $exB;
@@ -109,15 +107,15 @@ class ClassArgumentWithInterfaceImplementation
109107
protected $_context;
110108

111109
/**
112-
* @var ImplementationOfInterfaceFirst
110+
* @var ImplementationOfThirdInterface
113111
*/
114112
protected $_exA;
115113

116114
/**
117115
* @param ContextFirst $context
118-
* @param ImplementationOfInterfaceFirst $exA
116+
* @param ImplementationOfThirdInterface $exA
119117
*/
120-
public function __construct(\ContextFirst $context, \ImplementationOfInterfaceFirst $exA)
118+
public function __construct(\ContextFirst $context, \ImplementationOfThirdInterface $exA)
121119
{
122120
$this->_context = $context;
123121
$this->_exA = $exA;
@@ -131,15 +129,15 @@ class ClassArgumentWithInterface
131129
protected $_context;
132130

133131
/**
134-
* @var InterfaceSecond
132+
* @var FourthInterface
135133
*/
136134
protected $_exB;
137135

138136
/**
139137
* @param ContextFirst $context
140-
* @param InterfaceSecond $exB
138+
* @param FourthInterface $exB
141139
*/
142-
public function __construct(\ContextFirst $context, \InterfaceSecond $exB)
140+
public function __construct(\ContextFirst $context, \FourthInterface $exB)
143141
{
144142
$this->_context = $context;
145143
$this->_exB = $exB;
@@ -153,15 +151,15 @@ class ClassArgumentWithAlreadyInjectedInterface
153151
protected $_context;
154152

155153
/**
156-
* @var InterfaceFirst
154+
* @var ThirdInterface
157155
*/
158156
protected $_exA;
159157

160158
/**
161159
* @param ContextFirst $context
162-
* @param InterfaceFirst $exA
160+
* @param ThirdInterface $exA
163161
*/
164-
public function __construct(\ContextFirst $context, \InterfaceFirst $exA)
162+
public function __construct(\ContextFirst $context, \ThirdInterface $exA)
165163
{
166164
$this->_context = $context;
167165
$this->_exA = $exA;

lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForTypeDuplication.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* See COPYING.txt for license details.
66
*/
77

8-
// @codingStandardsIgnoreFile
9-
108
namespace TypeDuplication;
119

1210
interface ArgumentInterface

lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\SomeModule\Model;
108

119
use Magento\SomeModule\Model\Two\Test as TestTwo;

0 commit comments

Comments
 (0)