Passed
Push — master ( d6ccbc...d5a1e0 )
by Carlos
57s queued 11s
created

src/Events/Event.php (4 issues)

1
<?php
2
3
/*
4
 * This file is part of the overtrue/laravel-follow
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Overtrue\LaravelFollow\Events;
13
14
use Illuminate\Broadcasting\InteractsWithSockets;
15
use Illuminate\Database\Eloquent\Model;
16
use Illuminate\Foundation\Events\Dispatchable;
17
use Illuminate\Queue\SerializesModels;
18
use Overtrue\LaravelFollow\Follow;
19
20
/**
21
 * Class Event.
22
 *
23
 * @author overtrue <[email protected]>
24
 */
25
class Event
26
{
27
    use Dispatchable;
28
    use InteractsWithSockets;
29
    use SerializesModels;
0 ignored issues
show
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by Overtrue\LaravelFollow\Events\Event: $id, $relations, $connection, $keyBy
Loading history...
30
31
    public $causer;
32
33
    public $relation;
34
35
    public $targets;
36
37
    public $class;
38
39
    /**
40
     * Event constructor.
41
     *
42
     * @param \Illuminate\Database\Eloquent\Model   $causer
43
     * @param \Overtrue\LaravelFollow\Events\string $relation
0 ignored issues
show
The type Overtrue\LaravelFollow\Events\string 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...
44
     * @param int|array                             $targets
45
     * @param \Overtrue\LaravelFollow\Events\string $class
46
     */
47
    public function __construct(Model $causer, string $relation, $targets, string $class)
48
    {
49
        $this->causer = $causer;
50
        $this->relation = $relation;
51
        $this->targets = $targets;
52
        $this->class = $class;
53
    }
54
55
    public function getRelationType()
56
    {
57
        return Follow::RELATION_TYPES[$this->relation];
58
    }
59
60
    public function getTargetsCollection()
61
    {
62
        return \forward_static_call([$this->targets->classname, 'find'], (array) $this->targets->ids);
0 ignored issues
show
The property classname does not exist on integer.
Loading history...
The property ids does not exist on integer.
Loading history...
63
    }
64
}
65