Code Duplication    Length = 10-10 lines in 3 locations

Tests/Sniffs/PHP/NonStaticMagicMethodsSniffTest.php 3 locations

@@ 205-214 (lines=10) @@
202
     *
203
     * @return void
204
     */
205
    public function testWrongMethodVisibility($methodName, $desiredVisibility, $testVisibility, $line, $isTrait = false)
206
    {
207
        if ($isTrait === true && self::$recognizesTraits === false) {
208
            $this->markTestSkipped();
209
            return;
210
        }
211
212
        $file = $this->getTestFile($isTrait);
213
        $this->assertError($file, $line, "Visibility for magic method {$methodName} must be {$desiredVisibility}. Found: {$testVisibility}");
214
    }
215
216
    /**
217
     * Data provider.
@@ 297-306 (lines=10) @@
294
     *
295
     * @return void
296
     */
297
    public function testWrongStaticMethod($methodName, $line, $isTrait = false)
298
    {
299
        if ($isTrait === true && self::$recognizesTraits === false) {
300
            $this->markTestSkipped();
301
            return;
302
        }
303
304
        $file = $this->getTestFile($isTrait);
305
        $this->assertError($file, $line, "Magic method {$methodName} cannot be defined as static.");
306
    }
307
308
    /**
309
     * Data provider.
@@ 368-377 (lines=10) @@
365
     *
366
     * @return void
367
     */
368
    public function testWrongNonStaticMethod($methodName, $line, $isTrait = false)
369
    {
370
        if ($isTrait === true && self::$recognizesTraits === false) {
371
            $this->markTestSkipped();
372
            return;
373
        }
374
375
        $file = $this->getTestFile($isTrait);
376
        $this->assertError($file, $line, "Magic method {$methodName} must be defined as static.");
377
    }
378
379
    /**
380
     * Data provider.