Code Duplication    Length = 20-20 lines in 2 locations

src/PhpGitHooks/Module/Git/Service/PreCommitTool.php 1 location

@@ 159-178 (lines=20) @@
156
157
        $phpunitResponse = $preCommitResponse->getPhpUnit();
158
159
        if (true === $phpunitResponse->isPhpunit()) {
160
            $this->commandBus->handle(
161
                new PhpUnitToolCommand(
162
                    $phpunitResponse->isPhpunitRandomMode(),
163
                    $phpunitResponse->getPhpunitOptions(),
164
                    $preCommitResponse->getErrorMessage()
165
                )
166
            );
167
168
            $phpunitStrictCoverageResponse = $preCommitResponse->getPhpUnitStrictCoverage();
169
170
            if (true === $phpunitStrictCoverageResponse->isPhpunitStrictCoverage()) {
171
                $this->commandBus->handle(
172
                    new StrictCoverageCommand(
173
                        $phpunitStrictCoverageResponse->getMinimum(),
174
                        $preCommitResponse->getErrorMessage()
175
                    )
176
                );
177
            }
178
        }
179
    }
180
}
181

src/PhpGitHooks/Module/Git/Service/PrePushTool.php 1 location

@@ 75-94 (lines=20) @@
72
            
73
            $phpunitResponse = $prePushResponse->getPhpUnit();
74
75
            if (true === $phpunitResponse->isPhpunit()) {
76
                $this->commandBus->handle(
77
                    new PhpUnitToolCommand(
78
                        $phpunitResponse->isPhpunitRandomMode(),
79
                        $phpunitResponse->getPhpunitOptions(),
80
                        $prePushResponse->getErrorMessage()
81
                    )
82
                );
83
                
84
                $phpunitStrictCoverageResponse = $prePushResponse->getPhpUnitStrictCoverage();
85
86
                if (true === $phpunitStrictCoverageResponse->isPhpunitStrictCoverage()) {
87
                    $this->commandBus->handle(
88
                        new StrictCoverageCommand(
89
                            $phpunitStrictCoverageResponse->getMinimum(),
90
                            $prePushResponse->getErrorMessage()
91
                        )
92
                    );
93
                }
94
            }
95
96
            $this->output->writeln(GoodJobLogoResponse::paint($prePushResponse->getRightMessage()));
97
        }