Code Duplication    Length = 14-14 lines in 2 locations

src/Core/Config/Config.php 1 location

@@ 86-99 (lines=14) @@
83
     *
84
     * @return ConfigCollectionInterface
85
     */
86
    public static function unnest()
87
    {
88
        // Unnest unless we would be left at 0 manifests
89
        $loader = ConfigLoader::inst();
90
        if ($loader->countManifests() <= 1) {
91
            user_error(
92
                "Unable to unnest root Config, please make sure you don't have mis-matched nest/unnest",
93
                E_USER_WARNING
94
            );
95
        } else {
96
            $loader->popManifest();
97
        }
98
        return static::inst();
99
    }
100
101
    /**
102
     * Get an accessor that returns results by class by default.

src/Core/Injector/Injector.php 1 location

@@ 266-279 (lines=14) @@
263
     *
264
     * @return Injector Reference to restored active Injector instance
265
     */
266
    public static function unnest()
267
    {
268
        // Unnest unless we would be left at 0 manifests
269
        $loader = InjectorLoader::inst();
270
        if ($loader->countManifests() <= 1) {
271
            user_error(
272
                "Unable to unnest root Injector, please make sure you don't have mis-matched nest/unnest",
273
                E_USER_WARNING
274
            );
275
        } else {
276
            $loader->popManifest();
277
        }
278
        return static::inst();
279
    }
280
281
    /**
282
     * Indicate whether we auto scan injected objects for properties to set.