Code Duplication    Length = 22-23 lines in 2 locations

src/Commands/RouteTranslationCacheCommand.php 1 location

@@ 121-143 (lines=23) @@
118
     * @return string
119
     * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
120
     */
121
    protected function buildRouteCacheFile(RouteCollection $routes)
122
    {
123
        $stub = $this->files->get(
124
            realpath(
125
                __DIR__
126
                . DIRECTORY_SEPARATOR . '..'
127
                . DIRECTORY_SEPARATOR . '..'
128
                . DIRECTORY_SEPARATOR . '..'
129
                . DIRECTORY_SEPARATOR . 'stubs'
130
                . DIRECTORY_SEPARATOR . 'routes.stub'
131
            )
132
        );
133
134
        return str_replace(
135
            [
136
                '{{routes}}',
137
            ],
138
            [
139
                base64_encode(serialize($routes))
140
            ],
141
            $stub
142
        );
143
    }
144
}
145

src/Commands/RouteTranslationsCacheCommand.php 1 location

@@ 124-145 (lines=22) @@
121
     * @return string
122
     * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
123
     */
124
    protected function buildRouteCacheFile(RouteCollection $routes)
125
    {
126
        $stub = $this->files->get(
127
            realpath(
128
                __DIR__
129
                . DIRECTORY_SEPARATOR . '..'
130
                . DIRECTORY_SEPARATOR . '..'
131
                . DIRECTORY_SEPARATOR . 'stubs'
132
                . DIRECTORY_SEPARATOR . 'routes.stub'
133
            )
134
        );
135
136
        return str_replace(
137
            [
138
                '{{routes}}',
139
            ],
140
            [
141
                base64_encode(serialize($routes))
142
            ],
143
            $stub
144
        );
145
    }
146
}
147