Code Duplication    Length = 10-10 lines in 2 locations

src/LAG/AdminBundle/Field/Field/Link.php 2 locations

@@ 87-96 (lines=10) @@
84
            '_self',
85
            '_blank',
86
        ]);
87
        $resolver->setNormalizer('route', function(Options $options, $value) {
88
            // route or url should be defined
89
            if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) {
90
                throw new InvalidOptionsException(
91
                    'You must set either an url or a route for the property "'.$this->name.'"'
92
                );
93
            }
94
95
            return $value;
96
        });
97
        $resolver->setNormalizer('admin', function(Options $options, $value) {
98
            // if a Admin is defined, an Action should be defined too
99
            if ($value && !$options->offsetGet('action')) {
@@ 97-106 (lines=10) @@
94
95
            return $value;
96
        });
97
        $resolver->setNormalizer('admin', function(Options $options, $value) {
98
            // if a Admin is defined, an Action should be defined too
99
            if ($value && !$options->offsetGet('action')) {
100
                throw new InvalidOptionsException(
101
                    'An Action should be provided if an Admin is provided for property "'.$this->name.'"'
102
                );
103
            }
104
105
            return $value;
106
        });
107
    }
108
109
    /**