public function salvage( SalvageableService $other ) {
Assert::parameterType( self::class, $other, '$other' );
- /** @var ConfigRepository $other */
- $otherCurrentObj = $other->current();
foreach ( $other->configItems['public'] as $name => $otherConfig ) {
if ( isset( $this->configItems['public'][$name] ) ) {
continue;
}
$this->add( $name, $otherConfig );
-
- // recover the pointer of the other config repository
- if ( $otherCurrentObj === $otherConfig ) {
- end( $this->configItems['public'] );
- }
}
foreach ( $other->configItems['private'] as $name => $otherConfig ) {
if ( isset( $this->configItems['private'][$name] ) ) {
}
$this->add( $name, $otherConfig );
-
- // recover the pointer of the other config repository
- if ( $otherCurrentObj === $otherConfig ) {
- end( $this->configItems['private'] );
- }
}
// disable $other