Issues (24)

examples/multisource_mispelling_finder.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
use PhpSpellcheck\MisspellingFinder;
6
use PhpSpellcheck\MisspellingHandler\EchoHandler;
7
use PhpSpellcheck\Spellchecker\Aspell;
8
9
require_once __DIR__ . '/../vendor/autoload.php';
10
11
$misspellingFinder = new MisspellingFinder(
12
    Aspell::create(), // Creates aspell spellchecker pointing to "aspell" as it's binary path
13
    new EchoHandler() // Handles all the misspellings found by echoing their information
14
);
15
/** @var \Generator|\PhpSpellcheck\Misspelling[] $misspellings */
16
$misspellings = $misspellingFinder->find(
17
    new \PhpSpellcheck\Source\MultiSource(
0 ignored issues
show
new PhpSpellcheck\Source...ures/Text/Directory'))) of type PhpSpellcheck\Source\MultiSource is incompatible with the type iterable expected by parameter $source of PhpSpellcheck\MisspellingFinder::find(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

17
    /** @scrutinizer ignore-type */ new \PhpSpellcheck\Source\MultiSource(
Loading history...
18
        [
19
            new \PhpSpellcheck\Source\File(__DIR__ . '/../tests/Fixtures/Text/mispelling1.txt'),
20
            new \PhpSpellcheck\Source\Directory(__DIR__ . '/../tests/Fixtures/Text/Directory'),
21
        ]
22
    ),
23
    ['en_US'],
24
    ['from' => 'aspell spellchecker']
25
);
26