HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/meulendijk.komma.pro/app/KommaApp/Routes/AbstractWildCardController.php
<?php
/**
 * Created by PhpStorm.
 * User: julesgraus
 * Date: 16/02/2018
 * Time: 13:38
 */

namespace App\KommaApp\Routes;


use App\Http\Controllers\Controller;

abstract class AbstractWildCardController extends Controller
{
    /**
     * Returns a HandlesWildcardsInterface that can resolve the given wildcard path for us or null if there isn't an interface that can resolve it for us.
     *
     * @param string $path the wildcard path.
     * @return null
     */
    protected function getWildcardResolverController(string $path)
    {
        $wildCardControllers = config('route.wildcardResolverControllers');

        foreach($wildCardControllers as $wildCardController)
        {
            if(!method_exists($wildCardController, 'resolvesWildcardPath')) {
                \Log::error($wildCardController.' is not a wildcard service. Please make sure it implements the HandlesWildCardsInterface or remove it from the route config file\'s wildcardServices array');
                return null;
            }

            /** @var HandlesWildcardsInterface $wildCardController */
            if($wildCardController::resolvesWildcardPath($path))
            {
                return $wildCardController;
            }
        }
    }
};