# solid-performance/1.1.0/src/Performance/App.php

Solid Performance – Your No-Code Caching, Performance, &amp; Page Speed Solution, version 1.1.0. 75 lines.

- Page: https://pluginprobe.com/plugins/solid-performance/1.1.0/code/src/Performance/App.php
- Raw: https://pluginprobe.com/plugins/solid-performance/1.1.0/raw/src/Performance/App.php
- Modified: 2024-09-03T15:51:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/solid-performance/1.1.0/code/src/Performance/App.php#L10-L20`.

```php
<?php
/**
 * A global service locator for the plugin.
 *
 * @since 0.1.0
 *
 * @deprecated We really should not use a service locator.
 *
 * @package SolidWP\Performance
 */

namespace SolidWP\Performance;

use SolidWP\Performance\lucatume\DI52\App as DI52App;
use SolidWP\Performance\StellarWP\ContainerContract\ContainerInterface;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Provides a global facade for easy access to the container.
 *
 * @deprecated We really should not use a service locator.
 *
 * @since 0.1.0
 *
 * @package SolidWP\Performance
 */
class App extends DI52App {

	/**
	 * A reference to the singleton instance of the DI container
	 * the application uses as Service Locator.
	 *
	 * @since 0.1.0
	 *
	 * @var ContainerInterface
	 *
	 * @phpstan-ignore-next-line
	 */
	protected static $container;


	/**
	 * Sets the container instance the Application should use as a Service Locator.
	 *
	 * If the Application already stores a reference to a Container instance, then
	 * this will be replaced by the new one.
	 *
	 * @since 0.1.0
	 *
	 * @param ContainerInterface $container A reference to the Container instance the Application
	 *                                      should use as a Service Locator.
	 *
	 * @return void The method does not return any value.
	 */
	public static function setContainer( $container ) {
		static::$container = $container;
	}

	/**
	 * Returns the singleton instance of the DI container the application
	 * will use as Service Locator.
	 *
	 * @since 0.1.0
	 *
	 * @return ContainerInterface The singleton instance of the Container used as Service Locator
	 *                            by the application.
	 */
	public static function container() {
		return static::$container;
	}
}

```
