Code Duplication    Length = 18-18 lines in 2 locations

src/Generators/DataTablesHtmlCommand.php 1 location

@@ 233-250 (lines=18) @@
230
     * @param string $name
231
     * @return string
232
     */
233
    protected function qualifyClass($name)
234
    {
235
        $rootNamespace = $this->laravel->getNamespace();
236
237
        if (Str::startsWith($name, $rootNamespace)) {
238
            return $name;
239
        }
240
241
        if (Str::contains($name, '/')) {
242
            $name = str_replace('/', '\\', $name);
243
        }
244
245
        if (! Str::contains(Str::lower($name), 'datatable')) {
246
            $name .= 'DataTableHtml';
247
        }
248
249
        return $this->getDefaultNamespace(trim($rootNamespace, '\\')) . '\\' . $name;
250
    }
251
252
    /**
253
     * Get the default namespace for the class.

src/Generators/DataTablesMakeCommand.php 1 location

@@ 141-158 (lines=18) @@
138
     * @param string $name
139
     * @return string
140
     */
141
    protected function qualifyClass($name)
142
    {
143
        $rootNamespace = $this->laravel->getNamespace();
144
145
        if (Str::startsWith($name, $rootNamespace)) {
146
            return $name;
147
        }
148
149
        if (Str::contains($name, '/')) {
150
            $name = str_replace('/', '\\', $name);
151
        }
152
153
        if (! Str::contains(Str::lower($name), 'datatable')) {
154
            $name .= 'DataTable';
155
        }
156
157
        return $this->getDefaultNamespace(trim($rootNamespace, '\\')) . '\\' . $name;
158
    }
159
160
    /**
161
     * Get the default namespace for the class.