[TASK] Make ArrayDimensionMatcherTest notice free 86/56186/2
authorJan Helke <typo3@helke.de>
Thu, 15 Mar 2018 19:16:38 +0000 (20:16 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 15 Mar 2018 20:37:33 +0000 (21:37 +0100)
Resolves: #84313
Releases: master
Change-Id: I0834cf0cf8fb8aa802b1e4b1a005192cd5e2c276
Reviewed-on: https://review.typo3.org/56186
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/ArrayDimensionMatcher.php
typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/ArrayDimensionMatcherTest.php

index c7aa3db..5c95b5e 100644 (file)
@@ -48,6 +48,7 @@ class ArrayDimensionMatcher extends AbstractCoreMatcher
         if (!$this->isFileIgnored($node)
             && !$this->isLineIgnored($node)
             && $node instanceof ArrayDimFetch
+            && isset($node->dim->value)
             && in_array($node->dim->value, array_keys($this->flatMatcherDefinitions), true)
         ) {
             $match = [
index 7643bfa..37e5ab7 100644 (file)
@@ -27,11 +27,6 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 class ArrayDimensionMatcherTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @test
      */
     public function hitsFromFixtureAreFound()
@@ -68,7 +63,7 @@ class ArrayDimensionMatcherTest extends UnitTestCase
     /**
      * @return array
      */
-    public function matchesReturnsExpectedRestFilesDataProvider()
+    public function matchesReturnsExpectedRestFilesDataProvider(): array
     {
         return [
             'two candidates' => [
@@ -130,6 +125,9 @@ class ArrayDimensionMatcherTest extends UnitTestCase
     /**
      * @test
      * @dataProvider matchesReturnsExpectedRestFilesDataProvider
+     * @param array $configuration
+     * @param string $phpCode
+     * @param array $expected
      */
     public function matchesReturnsExpectedRestFiles(array $configuration, string $phpCode, array $expected)
     {