Issues (238)

src/Console/Commands/MergeLangCommand.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 MergeLangCommand extends Command
12
{
13
    /**
14
     * The console command name.
15
     *
16
     * @var string
17
     */
18
    protected $name = 'translation:merge';
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
49
50
        $languagesOptions = $repository->mergeLangs('pt-BR', 'pt');
51
52
        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

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