Commit e630c782 authored by catch's avatar catch

Issue #2572631 by ZeiP, Mile23, mfernea, pk188, dimaro, kporras07, attiks,...

Issue #2572631 by ZeiP, Mile23, mfernea, pk188, dimaro, kporras07, attiks, klausi, dawehner: Fix 'Drupal.Classes.InterfaceName' coding standard
parent 5da4584d
<?php <?php
// @codingStandardsIgnoreFile
namespace Drupal\Core\Database; namespace Drupal\Core\Database;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/ClassCreateInstanceSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/ClassCreateInstanceSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/ClassDeclarationSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/ClassDeclarationSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/FullyQualifiedNamespaceSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/FullyQualifiedNamespaceSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/InterfaceNameSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/UnusedUseStatementSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/UnusedUseStatementSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/UseLeadingBackslashSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Classes/UseLeadingBackslashSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php"/>
......
...@@ -96,9 +96,9 @@ public function testGetWildcardArgument() { ...@@ -96,9 +96,9 @@ public function testGetWildcardArgument() {
* Tests getArgument() with a Route, Request, and Account object. * Tests getArgument() with a Route, Request, and Account object.
*/ */
public function testGetArgumentOrder() { public function testGetArgumentOrder() {
$a1 = $this->getMock('\Drupal\Tests\Component\Utility\TestInterface1'); $a1 = $this->getMock('\Drupal\Tests\Component\Utility\Test1Interface');
$a2 = $this->getMock('\Drupal\Tests\Component\Utility\TestClass'); $a2 = $this->getMock('\Drupal\Tests\Component\Utility\TestClass');
$a3 = $this->getMock('\Drupal\Tests\Component\Utility\TestInterface2'); $a3 = $this->getMock('\Drupal\Tests\Component\Utility\Test2Interface');
$objects = [ $objects = [
't1' => $a1, 't1' => $a1,
...@@ -107,12 +107,12 @@ public function testGetArgumentOrder() { ...@@ -107,12 +107,12 @@ public function testGetArgumentOrder() {
$wildcards = [$a3]; $wildcards = [$a3];
$resolver = new ArgumentsResolver([], $objects, $wildcards); $resolver = new ArgumentsResolver([], $objects, $wildcards);
$callable = function(TestInterface1 $t1, TestClass $tc, TestInterface2 $t2) {}; $callable = function(Test1Interface $t1, TestClass $tc, Test2Interface $t2) {};
$arguments = $resolver->getArguments($callable); $arguments = $resolver->getArguments($callable);
$this->assertSame([$a1, $a2, $a3], $arguments); $this->assertSame([$a1, $a2, $a3], $arguments);
// Test again, but with the arguments in a different order. // Test again, but with the arguments in a different order.
$callable = function(TestInterface2 $t2, TestClass $tc, TestInterface1 $t1) {}; $callable = function(Test2Interface $t2, TestClass $tc, Test1Interface $t1) {};
$arguments = $resolver->getArguments($callable); $arguments = $resolver->getArguments($callable);
$this->assertSame([$a3, $a2, $a1], $arguments); $this->assertSame([$a3, $a2, $a1], $arguments);
} }
...@@ -123,7 +123,7 @@ public function testGetArgumentOrder() { ...@@ -123,7 +123,7 @@ public function testGetArgumentOrder() {
* Without the typehint, the wildcard object will not be passed to the callable. * Without the typehint, the wildcard object will not be passed to the callable.
*/ */
public function testGetWildcardArgumentNoTypehint() { public function testGetWildcardArgumentNoTypehint() {
$a = $this->getMock('\Drupal\Tests\Component\Utility\TestInterface1'); $a = $this->getMock('\Drupal\Tests\Component\Utility\Test1Interface');
$wildcards = [$a]; $wildcards = [$a];
$resolver = new ArgumentsResolver([], [], $wildcards); $resolver = new ArgumentsResolver([], [], $wildcards);
...@@ -196,13 +196,13 @@ public function access($foo) { ...@@ -196,13 +196,13 @@ public function access($foo) {
/** /**
* Provides a test interface. * Provides a test interface.
*/ */
interface TestInterface1 { interface Test1Interface {
} }
/** /**
* Provides a different test interface. * Provides a different test interface.
*/ */
interface TestInterface2 { interface Test2Interface {
} }
function test_access_arguments_resolver_access($foo) { function test_access_arguments_resolver_access($foo) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment