Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | <?php declare(strict_types=1); |
||
| 47 | class GSDownstreamService { |
||
| 48 | |||
| 49 | |||
| 50 | /** @var string */ |
||
| 51 | private $userId = ''; |
||
| 52 | |||
| 53 | /** @var IURLGenerator */ |
||
| 54 | private $urlGenerator; |
||
| 55 | |||
| 56 | /** @var GSEventsRequest */ |
||
| 57 | private $gsEventsRequest; |
||
| 58 | |||
| 59 | /** @var CirclesRequest */ |
||
| 60 | private $circlesRequest; |
||
| 61 | |||
| 62 | /** @var ConfigService */ |
||
| 63 | private $configService; |
||
| 64 | |||
| 65 | /** @var MiscService */ |
||
| 66 | private $miscService; |
||
| 67 | |||
| 68 | |||
| 69 | /** |
||
| 70 | * GSUpstreamService constructor. |
||
| 71 | * |
||
| 72 | * @param $userId |
||
| 73 | * @param IURLGenerator $urlGenerator |
||
| 74 | * @param GSEventsRequest $gsEventsRequest |
||
| 75 | * @param CirclesRequest $circlesRequest |
||
| 76 | * @param ConfigService $configService |
||
| 77 | * @param MiscService $miscService |
||
| 78 | */ |
||
| 79 | View Code Duplication | public function __construct( |
|
| 94 | |||
| 95 | |||
| 96 | /** |
||
| 97 | * @param GSEvent $event |
||
| 98 | * |
||
| 99 | * @throws GSKeyException |
||
| 100 | */ |
||
| 101 | public function onNewEvent(GSEvent $event) { |
||
| 106 | |||
| 107 | |||
| 108 | /** |
||
| 109 | * @param GSEvent $event |
||
| 110 | */ |
||
| 111 | private function manageEvent(GSEvent $event) { |
||
| 125 | |||
| 126 | |||
| 127 | /** |
||
| 128 | * @return string |
||
| 129 | */ |
||
| 130 | public function getKey(): string { |
||
| 133 | |||
| 134 | |||
| 135 | /** |
||
| 136 | * @param string $key |
||
| 137 | * |
||
| 138 | * @throws GSKeyException |
||
| 139 | */ |
||
| 140 | public function checkKey(string $key) { |
||
| 145 | |||
| 146 | |||
| 147 | /** |
||
| 148 | * @param GSEvent $event |
||
| 149 | * |
||
| 150 | * @throws GSKeyException |
||
| 151 | */ |
||
| 152 | private function checkEvent(GSEvent $event) { |
||
| 155 | |||
| 156 | |||
| 157 | /** |
||
| 158 | * @param GSEvent $event |
||
| 159 | * |
||
| 160 | * @return bool |
||
| 161 | */ |
||
| 162 | private function isLocalEvent(GSEvent $event): bool { |
||
| 165 | |||
| 166 | |||
| 167 | // private function |
||
| 168 | } |
||
| 169 | |||
| 170 |
Scrutinizer analyzes your
composer.json/composer.lockfile if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.