Code Duplication    Length = 5-5 lines in 2 locations

Event/SlugEvent.php 1 location

@@ 26-30 (lines=5) @@
23
     */
24
    public function __construct($entity, $property)
25
    {
26
        if (!is_object($entity)) {
27
            throw new \InvalidArgumentException('The "$entity" parameter must be an object.');
28
        } elseif (!empty($property) && is_string($property)) {
29
            throw new \InvalidArgumentException('The "$property" parameter must be a non empty string.');
30
        }
31
32
        $this->entity = $entity;
33
        $this->property = $property;

Twig/Extension/TranslationExtension.php 1 location

@@ 74-78 (lines=5) @@
71
    public function translationSourceProperty($object, $property)
72
    {
73
74
        if (!is_object($object)) {
75
            throw new \InvalidArgumentException('The "$object" parameter must be an object.');
76
        } else if (empty($property) || !is_string($property)) {
77
            throw new \InvalidArgumentException('The "$property" parameter must be a non empty string.');
78
        }
79
80
        if ($this->isTranslatable($object) && $object->getTranslationSource() !== null) {
81
            $object = $object->getTranslationSource();