Code Duplication    Length = 13-14 lines in 2 locations

src/Extensions/Gedmo/Tree.php 1 location

@@ 85-97 (lines=13) @@
82
    /**
83
     * Execute the build process
84
     */
85
    public function build()
86
    {
87
        if (!in_array($this->strategy, $this->strategies)) {
88
            throw new InvalidMappingException("Tree type: $this->strategy is not available.");
89
        }
90
91
        $this->classMetadata->appendExtension($this->getExtensionName(), [
92
            'strategy'         => $this->strategy,
93
            'activate_locking' => $this->activateLocking,
94
            'locking_timeout'  => $this->lockingTimeout,
95
            'closure'          => $this->closure
96
        ]);
97
    }
98
99
    /**
100
     * Return the name of the actual extension.

src/Extensions/Gedmo/TreePath.php 1 location

@@ 70-83 (lines=14) @@
67
    /**
68
     * Execute the build process
69
     */
70
    public function build()
71
    {
72
        if (strlen($this->separator) > 1) {
73
            throw new InvalidMappingException("Tree Path field - [{$this->fieldName}] Separator {$this->separator} is invalid. It must be only one character long.");
74
        }
75
76
        $this->classMetadata->appendExtension($this->getExtensionName(), [
77
            'path'                       => $this->fieldName,
78
            'path_separator'             => $this->separator,
79
            'path_append_id'             => $this->appendId,
80
            'path_starts_with_separator' => $this->startsWithSeparator,
81
            'path_ends_with_separator'   => $this->endsWithSeparator
82
        ]);
83
    }
84
85
    /**
86
     * Return the name of the actual extension.