Code Duplication    Length = 12-12 lines in 2 locations

PHPDaemon/Core/Bootstrap.php 2 locations

@@ 293-304 (lines=12) @@
290
291
        Daemon::$appResolver = require Daemon::$appResolverPath;
292
293
        if (isset(Daemon::$config->group->value) && is_callable('posix_getgid')) {
294
            if (($sg = posix_getgrnam(Daemon::$config->group->value)) === false) {
295
                Daemon::log(
296
                    'Unexisting group \'' . Daemon::$config->group->value . '\'. You have to replace config-variable \'group\' with existing group-name.'
297
                );
298
                $error = true;
299
            }
300
            else if (($sg['gid'] != posix_getgid()) && (posix_getuid() != 0)) {
301
                Daemon::log('You must have the root privileges to change group.');
302
                $error = true;
303
            }
304
        }
305
306
        if (isset(Daemon::$config->user->value) && is_callable('posix_getuid')) {
307
            if (($su = posix_getpwnam(Daemon::$config->user->value)) === false) {
@@ 306-317 (lines=12) @@
303
            }
304
        }
305
306
        if (isset(Daemon::$config->user->value) && is_callable('posix_getuid')) {
307
            if (($su = posix_getpwnam(Daemon::$config->user->value)) === false) {
308
                Daemon::log(
309
                    'Unexisting user \'' . Daemon::$config->user->value . '\', user not found. You have to replace config-variable \'user\' with existing username.'
310
                );
311
                $error = true;
312
            }
313
            else if (($su['uid'] != posix_getuid()) && (posix_getuid() != 0)) {
314
                Daemon::log('You must have the root privileges to change user.');
315
                $error = true;
316
            }
317
        }
318
319
        if (isset(Daemon::$config->minspareworkers->value)
320
            && Daemon::$config->minspareworkers->value > 0