src/Mouf/MoufManager.php
public function purgeUnreachableWeakInstances() {
		foreach ($this->declaredInstances as $key=>$instance) {
			if (!isset($instance['weak']) || $instance['weak'] == false) {
				$this->walkForGarbageCollection($key);
			}
		}

		// At this point any instance with the "noGarbageCollect" attribute should be kept. Others should be eliminated.
		$keptInstances = array();
		foreach ($this->declaredInstances as $key=>$instance) {
			if (isset($instance['noGarbageCollect']) && $instance['noGarbageCollect'] == true) {
				// Let's clear the flag
				unset($this->declaredInstances[$key]['noGarbageCollect']);
			} else {
				// Let's delete the weak instance
				unset($this->declaredInstances[$key]);
			}
		}


	}
public function purgeUnreachableWeakInstances() {
		foreach ($this->declaredInstances as $key=>$instance) {
			if (!isset($instance['weak']) || $instance['weak'] == false) {
				$this->walkForGarbageCollection($key);
			}
		}

		// At this point any instance with the "noGarbageCollect" attribute should be kept. Others should be eliminated.
		$keptInstances = array();
		foreach ($this->declaredInstances as $key=>$instance) {
			if (isset($instance['noGarbageCollect']) && $instance['noGarbageCollect'] == true) {
				// Let's clear the flag
				unset($this->declaredInstances[$key]['noGarbageCollect']);
			} else {
				// Let's delete the weak instance
				unset($this->declaredInstances[$key]);
			}
		}


	}
public function purgeUnreachableWeakInstances ( ) { foreach ( $ this -> declaredInstances as $ key => $ instance ) { if ( ! isset ( $ instance [ 'weak' ] ) || $ instance [ 'weak' ] == false ) { $ this -> walkForGarbageCollection ( $ key ) ; } } // At this point any instance with the "noGarbageCollect" attribute should be kept. Others should be eliminated.
 $ keptInstances = array ( ) ; foreach ( $ this -> declaredInstances as $ key => $ instance ) { if ( isset ( $ instance [ 'noGarbageCollect' ] ) && $ instance [ 'noGarbageCollect' ] == true ) { // Let's clear the flag
 unset ( $ this -> declaredInstances [ $ key ] [ 'noGarbageCollect' ] ) ; } else { // Let's delete the weak instance
 unset ( $ this -> declaredInstances [ $ key ] ) ; } } }
This function will delete any weak instance that would not be referred anymore.
This is used to garbage-collect any unused weak instances.

This is public only for test purposes
This function will delete any weak instance that would not be referred anymore . This is used to garbage - collect any unused weak instances .