Issues (238)

src/Console/Commands/FixLangCommand.php (4 issues)

Labels
Severity
1
<?php
2
3
namespace Translation\Console\Commands;
4
5
use File;
6
use Illuminate\Console\Command;
0 ignored issues
show
The type Illuminate\Console\Command was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Illuminate\Filesystem\Filesystem;
8
use Illuminate\View\Compilers\BladeCompiler;
0 ignored issues
show
The type Illuminate\View\Compilers\BladeCompiler was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Translation\Repositories\LangResourcesRepository;
10
11
class FixLangCommand extends Command
12
{
13
    /**
14
     * The console command name.
15
     *
16
     * @var string
17
     */
18
    protected $name = 'translation:fixfiles';
19
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = '';
26
27
    /**
28
     * Call fire function
29
     *
30
     * @return void
31
     */
32
    public function handle()
33
    {
34
        $this->fire();
35
    }
36
    
37
    /**
38
     * Execute the console command.
39
     *
40
     * @return void
41
     */
42
    public function fire()
43
    {
44
        $repository = app(LangResourcesRepository::class);
0 ignored issues
show
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

44
        $repository = /** @scrutinizer ignore-call */ app(LangResourcesRepository::class);
Loading history...
45
46
47
48
        $languagesOptions = $repository->getMissingForLang('pt');
49
50
        dd('LinksPedreiro', $languagesOptions);
0 ignored issues
show
The function dd was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

50
        /** @scrutinizer ignore-call */ 
51
        dd('LinksPedreiro', $languagesOptions);
Loading history...
51
        // // Create $outputPath or empty it if already exists
52
        // if (File::isDirectory($outputPath)) {
53
        //     File::cleanDirectory($outputPath);
54
        // } else {
55
        //     File::makeDirectory($outputPath);
56
        // }
57
58
        // // Configure BladeCompiler to use our own custom storage subfolder
59
        // $compiler = new BladeCompiler(new Filesystem, $outputPath);
60
        // $compiled = 0;
61
62
        // // Get all view files
63
        // $allFiles = File::allFiles($inputPath);
64
        // foreach ($allFiles as $f)
65
        // {
66
        //     // Skip not blade templates
67
        //     $file = $f->getPathName();
68
        //     if ('.blade.php' !== substr($file, -10)) {
69
        //         continue;
70
        //     }
71
72
        //     // Compile the view
73
        //     $compiler->compile($file);
74
        //     $compiled++;
75
76
        //     // Rename to human friendly
77
        //     $human = str_replace(DIRECTORY_SEPARATOR, '-', ltrim($f->getRelativePathname(), DIRECTORY_SEPARATOR));
78
        //     File::move($outputPath . DIRECTORY_SEPARATOR . md5($file), $outputPath . DIRECTORY_SEPARATOR . $human . '.php');
79
        // }
80
81
        // if ($compiled) {
82
        //     $this->info("$compiled files compiled.");
83
        // } else {
84
        //     $this->error('No .blade.php files found in '.$inputPath);
85
        // }
86
    }
87
}
88