Code Duplication    Length = 15-19 lines in 6 locations

src/AppserverIo/Appserver/Core/AbstractContainerThread.php 1 location

@@ 552-566 (lines=15) @@
549
     *
550
     * @return void
551
     */
552
    public function shutdown()
553
    {
554
        // check if there was a fatal error caused shutdown
555
        if ($lastError = error_get_last()) {
556
            // initialize type + message
557
            $type = 0;
558
            $message = '';
559
            // extract the last error values
560
            extract($lastError);
561
            // query whether we've a fatal/user error
562
            if ($type === E_ERROR || $type === E_USER_ERROR) {
563
                $this->getInitialContext()->getSystemLogger()->critical($message);
564
            }
565
        }
566
    }
567
568
    /**
569
     * Validates that the container's application and temporary directory is available.

src/AppserverIo/Appserver/Core/AbstractDaemonThread.php 1 location

@@ 261-276 (lines=16) @@
258
     *
259
     * @return void
260
     */
261
    public function defaultShutdown()
262
    {
263
264
        // check if there was a fatal error caused shutdown
265
        if ($lastError = error_get_last()) {
266
            // initialize error type and message
267
            $type = 0;
268
            $message = '';
269
            // extract the last error values
270
            extract($lastError);
271
            // query whether we've a fatal/user error
272
            if ($type === E_ERROR || $type === E_USER_ERROR) {
273
                $this->log(LogLevel::ERROR, $message);
274
            }
275
        }
276
    }
277
}
278

src/AppserverIo/Appserver/Core/AbstractExecutorThread.php 1 location

@@ 156-171 (lines=16) @@
153
     *
154
     * @return void
155
     */
156
    public function defaultShutdown()
157
    {
158
159
        // check if there was a fatal error caused shutdown
160
        if ($lastError = error_get_last()) {
161
            // initialize error type and message
162
            $type = 0;
163
            $message = '';
164
            // extract the last error values
165
            extract($lastError);
166
            // query whether we've a fatal/user error
167
            if ($type === E_ERROR || $type === E_USER_ERROR) {
168
                $this->log(LogLevel::ERROR, $message);
169
            }
170
        }
171
    }
172
}
173

src/AppserverIo/Appserver/MessageQueue/Callback.php 1 location

@@ 137-152 (lines=16) @@
134
     *
135
     * @return void
136
     */
137
    public function shutdown()
138
    {
139
140
        // check if there was a fatal error caused shutdown
141
        if ($lastError = error_get_last()) {
142
            // initialize type + message
143
            $type = 0;
144
            $message = '';
145
            // extract the last error values
146
            extract($lastError);
147
            // query whether we've a fatal/user error
148
            if ($type === E_ERROR || $type === E_USER_ERROR) {
149
                $this->getApplication()->getInitialContext()->getSystemLogger()->error($message);
150
            }
151
        }
152
    }
153
}
154

src/AppserverIo/Appserver/MessageQueue/Job.php 1 location

@@ 171-189 (lines=19) @@
168
     *
169
     * @return void
170
     */
171
    public function shutdown()
172
    {
173
174
        // check if there was a fatal error caused shutdown
175
        if ($lastError = error_get_last()) {
176
            // initialize type + message
177
            $type = 0;
178
            $message = '';
179
            // extract the last error values
180
            extract($lastError);
181
            // query whether we've a fatal/user error
182
            if ($type === E_ERROR || $type === E_USER_ERROR) {
183
                $this->getApplication()->getInitialContext()->getSystemLogger()->error($message);
184
            }
185
        }
186
187
        // mark the job finished
188
        $this->finished = true;
189
    }
190
}
191

src/AppserverIo/Appserver/Provisioning/Steps/AbstractStep.php 1 location

@@ 458-472 (lines=15) @@
455
     * @return void
456
     * @see http://php.net/register_shutdown_function
457
     */
458
    public function shutdown()
459
    {
460
        // check if there was a fatal error caused shutdown
461
        if ($lastError = error_get_last()) {
462
            // initialize error type and message
463
            $type = 0;
464
            $message = '';
465
            // extract the last error values
466
            extract($lastError);
467
            // query whether we've a fatal/user error
468
            if ($type === E_ERROR || $type === E_USER_ERROR) {
469
                $this->getInitialContext()->getSystemLogger()->critical($message);
470
            }
471
        }
472
    }
473
}
474