<?php

declare(strict_types=1);

namespace Maestro\Core\Support;

/**
 * Resolved paths inside the maestro/core Composer package root.
 *
 * Use {@see self::packageRoot()} for loading non-PSR paths (e.g. `routes/modules/*.php`) from any
 * service provider; depth-based `dirname(__DIR__, N)` from nested `Modules/* /Providers` breaks if
 * the module tree is reorganized.
 */
final class CorePaths
{
    public static function packageRoot(): string
    {
        return dirname(__DIR__, 2);
    }

    public static function brandingAssetPath(string $filename): ?string
    {
        $path = self::packageRoot().'/public/vendor/maestro/branding/'.$filename;

        return is_file($path) ? $path : null;
    }
}
