instantiation = $instantiation; } /** * Do the actual service instantiation and return the real service. * * @since 1.6.0 * * @throws InvalidService If the service could not be properly instantiated. * * @return Service Properly instantiated service. */ public function instantiate(): Service { $instantiation = $this->instantiation; // Because uniform variable syntax not supported in PHP 5.6. $service = $instantiation(); if ( ! $service instanceof Service ) { throw InvalidService::from_service( $service ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped } return $service; } }