1 | <?php |
||||
2 | |||||
3 | namespace Fomvasss\UrlAliases\Traits; |
||||
4 | |||||
5 | trait LocaleScopes |
||||
6 | { |
||||
7 | |||||
8 | /** |
||||
9 | * @param $query |
||||
10 | * @param null $locale |
||||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||||
11 | * @return mixed |
||||
12 | */ |
||||
13 | public function scopeByLocale($query, $locale = null) |
||||
14 | { |
||||
15 | $locale = $locale ?: \UrlAliasLocalization::getCurrentLocale(); |
||||
0 ignored issues
–
show
The type
UrlAliasLocalization 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 ![]() |
|||||
16 | |||||
17 | return $query->whereLocale($locale) |
||||
18 | ->orWhereNull('locale'); |
||||
19 | } |
||||
20 | |||||
21 | |||||
22 | /** |
||||
23 | * @param $query |
||||
24 | * @param null $locales |
||||
0 ignored issues
–
show
|
|||||
25 | * @return mixed |
||||
26 | */ |
||||
27 | public function scopeByLocales($query, $locales = null) |
||||
28 | { |
||||
29 | $locales = $locales ?: session('app_locales'); |
||||
0 ignored issues
–
show
The function
session 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
![]() |
|||||
30 | |||||
31 | if ($locales) { |
||||
32 | return $query->whereIn('locale', is_array($locales) ? $locales : [$locales]) |
||||
33 | ->orWhereNull('locale'); |
||||
34 | } |
||||
35 | } |
||||
36 | } |