HEX
Server: Apache
System: Linux sxb1plmcpnl510113.prod.sxb1.secureserver.net 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User: acnbijigo78q (10488831)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/acnbijigo78q/public_html/wp-content/plugins/wpml-cms-nav/app/Presentation/App.php
<?php

namespace WPML\Nav\Presentation;

use WPML\Container\Container;
use WPML\Nav\Application\Filter\SidebarSectionsFilterInterface;
use WPML\Nav\Application\Repository\CacheRepositoryInterface;
use WPML\Nav\Application\Repository\PostRepositoryInterface;
use WPML\Nav\Application\Repository\NavigationRepositoryInterface;
use WPML\Nav\Application\Repository\SettingsRepositoryInterface;
use WPML\Nav\Application\Repository\TranslationRepositoryInterface;
use WPML\Nav\Infrastructure\Adapter\Request;
use WPML\Nav\Infrastructure\Filter\SidebarSectionsFilter;
use WPML\Nav\Infrastructure\Repository\CacheRepository;
use WPML\Nav\Infrastructure\Repository\NavigationRepository;
use WPML\Nav\Infrastructure\Repository\PostRepository;
use WPML\Nav\Infrastructure\Repository\SettingsRepository;
use WPML\Nav\Infrastructure\Repository\TranslationRepository;
use WPML\Nav\Presentation\Controller\PageNavigationController;
use WPML\Nav\Presentation\Controller\RequestInterface;
use function WPML\Container\make;

final class App {
	const CONTROLLERS = [
		PageNavigationController::class,
	];

	const INFRASTRUCTURE_CLASSES = [
		//Presentation Layer
		RequestInterface::class => Request::class,

		//Application Repositories
		PostRepositoryInterface::class => PostRepository::class,
		TranslationRepositoryInterface::class => TranslationRepository::class,
		SettingsRepositoryInterface::class => SettingsRepository::class,
		NavigationRepositoryInterface::class => NavigationRepository::class,
		CacheRepositoryInterface::class => CacheRepository::class,

		//Application Filters
		SidebarSectionsFilterInterface::class => SidebarSectionsFilter::class,
	];

	public function run() {
		$this->connectInterfacesToInfrastructure();

		$this->registerControllers();
	}

	private function connectInterfacesToInfrastructure() {
		Container::alias( self::INFRASTRUCTURE_CLASSES );
	}

	private function registerControllers() {
		foreach( self::CONTROLLERS as $controllerClass ) {
			$controller = make( $controllerClass );
			$controller->register();
		}
	}
}