Code Duplication    Length = 8-8 lines in 2 locations

src/system/RoutesModule/Entity/Base/AbstractRouteEntity.php 1 location

@@ 856-863 (lines=8) @@
853
        $validator = ServiceUtil::get('validator');
854
        $errors = $validator->validate($this);
855
    
856
        if (count($errors) > 0) {
857
            $flashBag = ServiceUtil::get('session')->getFlashBag();
858
            foreach ($errors as $error) {
859
                $flashBag->add('error', $error->getMessage());
860
            }
861
    
862
            return false;
863
        }
864
    
865
        return true;
866
    }

src/system/RoutesModule/Entity/Historical/v110/Base/AbstractRouteEntity.php 1 location

@@ 1067-1074 (lines=8) @@
1064
        $validator = $serviceManager->get('validator');
1065
        $errors = $validator->validate($this);
1066
1067
        if (count($errors) > 0) {
1068
            $flashBag = $serviceManager->get('session')->getFlashBag();
1069
            foreach ($errors as $error) {
1070
                $flashBag->add('error', $error->getMessage());
1071
            }
1072
1073
            return false;
1074
        }
1075
1076
        return true;
1077
    }