Autowire.php

<?php

namespace Tlf\Js;

/**
 * Integration class to get absolute file paths.
 */
class Autowire {
    
    /**
     * Get the path to the file or null
     * @param $name name of the js file to get, or 'Autowire.js' by default
     */
    static public function filePath(string $name="Autowire.js"): ?string {
        $file = dirname(__DIR__).$name;
        if (file_exists($file))return $file;

        return null;
    }
}