1 | <?php namespace Sofa\Revisionable\Laravel; |
||
7 | class Listener implements ListenerInterface |
||
8 | { |
||
9 | /** |
||
10 | * User provider instance. |
||
11 | * |
||
12 | * @var mixed |
||
13 | */ |
||
14 | protected $userProvider; |
||
15 | |||
16 | /** |
||
17 | * Create new listener. |
||
18 | * |
||
19 | * @param UserProvider $userProvider |
||
20 | */ |
||
21 | public function __construct(UserProvider $userProvider) |
||
25 | |||
26 | /** |
||
27 | * Handle created event. |
||
28 | * |
||
29 | * @param \Sofa\Revisionable\Revisionable $revisioned |
||
30 | * @return null |
||
31 | */ |
||
32 | public function onCreated(Revisionable $revisioned) |
||
36 | |||
37 | /** |
||
38 | * Handle updated event. |
||
39 | * |
||
40 | * @param \Sofa\Revisionable\Revisionable $revisioned |
||
41 | * @return null |
||
42 | */ |
||
43 | public function onUpdated(Revisionable $revisioned) |
||
44 | { |
||
45 | if (count($revisioned->getDiff())) { |
||
46 | $this->log('updated', $revisioned); |
||
47 | } |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Handle deleted event. |
||
52 | * |
||
53 | * @param \Sofa\Revisionable\Revisionable $revisioned |
||
54 | * @return null |
||
55 | */ |
||
56 | public function onDeleted(Revisionable $revisioned) |
||
60 | |||
61 | /** |
||
62 | * Handle restored event. |
||
63 | * |
||
64 | * @param \Sofa\Revisionable\Revisionable $revisioned |
||
65 | * @return null |
||
66 | */ |
||
67 | public function onRestored(Revisionable $revisioned) |
||
71 | |||
72 | /** |
||
73 | * Get currently logged in user. |
||
74 | * |
||
75 | * @return string|null |
||
76 | */ |
||
77 | public function getCurrentUser() |
||
81 | |||
82 | /** |
||
83 | * Log the revision. |
||
84 | * |
||
85 | * @param string $action |
||
86 | * @param \Sofa\Revisionable\Revisionable $revisioned |
||
87 | * @return null |
||
88 | */ |
||
89 | protected function log($action, Revisionable $revisioned) |
||
122 | } |
||
123 |
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.