tpaksu /
laravel-todobar
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace TPaksu\TodoBar\Controllers; |
||||
| 4 | |||||
| 5 | use App\Http\Controllers\Controller; |
||||
|
0 ignored issues
–
show
|
|||||
| 6 | use Illuminate\Http\Response; |
||||
|
0 ignored issues
–
show
The type
Illuminate\Http\Response 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. 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\Support\Facades\View; |
||||
|
0 ignored issues
–
show
The type
Illuminate\Support\Facades\View 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 8 | |||||
| 9 | class TodoBarController extends Controller { |
||||
| 10 | |||||
| 11 | public function getScripts() { |
||||
| 12 | return "<script type='text/javascript'>" . file_get_contents($this->assets_path("todobar.js")) . "</script>"; |
||||
| 13 | } |
||||
| 14 | |||||
| 15 | public function getDrawer() { |
||||
| 16 | return View::make("laravel-todobar::todobar"); |
||||
| 17 | } |
||||
| 18 | |||||
| 19 | public function getStyles() { |
||||
| 20 | $dark_mode = config("todobar.dark_mode", false); |
||||
|
0 ignored issues
–
show
The function
config 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
Loading history...
|
|||||
| 21 | $file = "todobar.css"; |
||||
| 22 | if ($dark_mode) { |
||||
| 23 | $file = "todobar-dark.css"; |
||||
| 24 | } |
||||
| 25 | $path = $this->assets_path($file); |
||||
| 26 | return "<style>" . file_get_contents($path) . "</style>"; |
||||
| 27 | } |
||||
| 28 | |||||
| 29 | public function getInjection() |
||||
| 30 | { |
||||
| 31 | return $this->getStyles() . $this->getDrawer() . $this->getScripts(); |
||||
| 32 | } |
||||
| 33 | |||||
| 34 | public function inject(Response $response) { |
||||
| 35 | $response->setContent(str_replace("</body>", "</body>" . $this->getInjection(), $response->getContent())); |
||||
| 36 | } |
||||
| 37 | |||||
| 38 | public function assets_path($file) |
||||
| 39 | { |
||||
| 40 | return implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "assets", $file]); |
||||
| 41 | } |
||||
| 42 | } |
||||
| 43 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths