<?php

/**
 * Functions
 *
 * @package GrottoPress\Jentil
 * @since 0.1.0
 *
 * @see https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @author GrottoPress <info@grottopress.com>
 * @author N Atta Kusi Adusei
 */

declare (strict_types = 1);

/**
 * Autoloader
 *
 * @since 0.1.0
 */
(function (string $basePath) {
    $path = $basePath.'/vendor/autoload.php';

    \file_exists($path) && require($path);
})(__DIR__);

/**
 * Run this theme.
 *
 * @action after_setup_theme
 *
 * @since 0.1.0
 */
\add_action('after_setup_theme', function () {
    \Jentil()->run();
}, 0);

<?php

/**
 * Functions
 *
 * @package GrottoPress\Jentil
 * @since 0.1.0
 *
 * @see https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @author GrottoPress <info@grottopress.com>
 * @author N Atta Kusi Adusei
 */

declare (strict_types = 1);

/**
 * Autoloader
 *
 * @since 0.1.0
 */
require __DIR__.'/vendor/autoload.php';

/**
 * Run this theme.
 *
 * @action after_setup_theme
 *
 * @since 0.1.0
 */
\add_action('after_setup_theme', function () {
    \Jentil()->run();
}, 0);

Revert conditional require of autoloader
Revert conditional require of autoloader

If using Jentil as parent theme, Jentil is supposed to be installed
via `composer create-project`, in which case the autoloader would
exist in Jentil's root.

If installed as a package, it's supposed to be installed from
the consuming theme's root (eg: `wp-content/themes/my-theme),
and not from the web root.

In this case, Jentil's autoloader would not exist, but we
shouldn't get an error because Jentil's functions.php would not
be loaded.
