GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (11)

src/ShowUntranslatedCommand.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProcyonWeb\TranslationGenerator;
6
7
use Illuminate\Console\Command;
8
9
class ShowUntranslatedCommand extends Command
10
{
11
    protected $signature = 'translation:show-missing {lang=hu}';
12
13
    protected $description = 'Show untranslated strings';
14
15
    public function handle(): void
16
    {
17
        $lang = $this->argument('lang');
18
19
        if (!file_exists('resources/lang/' . $lang . '.json')) {
0 ignored issues
show
Are you sure $lang of type null|string|string[] can be used in concatenation? ( Ignorable by Annotation )

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

19
        if (!file_exists('resources/lang/' . /** @scrutinizer ignore-type */ $lang . '.json')) {
Loading history...
20
            $this->error($lang . '.json doesn\'t exist');
21
            return;
22
        }
23
24
        $jsonFile = file_get_contents('resources/lang/' . $lang . '.json');
25
26
        $count = collect(json_decode($jsonFile, true))
27
            ->filter(
28
                function ($value, $key) {
29
                    return $key === $value;
30
                }
31
            )->each(
32
                function ($value) {
33
                    $this->line($value);
34
                }
35
            )->count();
36
37
        $this->info('Untranslated lines: ' . $count);
38
    }
39
}