Code Duplication    Length = 7-8 lines in 2 locations

src/delivery/cli/InteractiveCliParameterReader.php 1 location

@@ 61-68 (lines=8) @@
58
     * @return \rtens\domin\delivery\cli\CliField
59
     * @throws \Exception
60
     */
61
    private function getField(Parameter $parameter) {
62
        $field = $this->fields->getField($parameter);
63
        if (!($field instanceof CliField)) {
64
            $fieldClass = get_class($field);
65
            throw new \Exception("Not a CliField [$fieldClass]");
66
        }
67
        return $field;
68
    }
69
}

src/delivery/web/ActionForm.php 1 location

@@ 39-45 (lines=7) @@
36
     * @return WebField
37
     * @throws \Exception
38
     */
39
    private function getActionField(Parameter $actionParameter, WebApplication $app) {
40
        $actionField = $app->fields->getField($actionParameter);
41
        if ($actionField instanceof WebField) {
42
            return $actionField;
43
        }
44
        throw new \Exception(get_class($actionField) . " must implement WebField");
45
    }
46
47
    private function readParameters(WebRequest $request, WebApplication $app, Action $action) {
48
        $reader = new RequestParameterReader($request);