1 | <?php |
||
2 | |||
3 | namespace Thinktomorrow\AssetLibrary\Application; |
||
4 | |||
5 | use Thinktomorrow\AssetLibrary\Asset; |
||
6 | use Thinktomorrow\AssetLibrary\HasAsset; |
||
7 | use Spatie\MediaLibrary\MediaCollections\Exceptions\FileCannotBeAdded; |
||
8 | |||
9 | class ReplaceAsset |
||
10 | { |
||
11 | /** |
||
12 | * Remove the asset and attaches a new one. |
||
13 | * |
||
14 | * @param $replace |
||
15 | * @param $with |
||
16 | * @param $type |
||
17 | * @param $locale |
||
18 | * @throws FileCannotBeAdded |
||
19 | */ |
||
20 | 3 | public function handle(HasAsset $model, $replace, $with, $type, $locale) |
|
21 | { |
||
22 | 3 | $old = $model->assetRelation()->findOrFail($replace); |
|
23 | |||
24 | 3 | app(AddAsset::class)->add($model, Asset::findOrFail($with), $type, $locale); |
|
25 | |||
26 | 3 | app(DetachAsset::class)->detach($model, $old->id, $type, $locale); |
|
0 ignored issues
–
show
The type
Thinktomorrow\AssetLibrary\Application\DetachAsset 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...
|
|||
27 | 3 | } |
|
28 | } |
||
29 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.