# disco/1.3.51/vendor/inpsyde/assets/src/Loader/PhpFileLoader.php

Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO, version 1.3.51. 47 lines.

- Page: https://pluginprobe.com/plugins/disco/1.3.51/code/vendor/inpsyde/assets/src/Loader/PhpFileLoader.php
- Raw: https://pluginprobe.com/plugins/disco/1.3.51/raw/vendor/inpsyde/assets/src/Loader/PhpFileLoader.php
- Modified: 2024-09-18T11:17:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/disco/1.3.51/code/vendor/inpsyde/assets/src/Loader/PhpFileLoader.php#L10-L20`.

```php
<?php

/*
 * This file is part of the Assets package.
 *
 * (c) Inpsyde GmbH
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Inpsyde\Assets\Loader;

use Inpsyde\Assets\Exception\FileNotFoundException;

/**
 * @package Inpsyde\Assets\Loader
 */
class PhpFileLoader extends ArrayLoader
{
    /**
     * @param mixed $resource      the path to your php-file.
     * @return array
     *
     * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration
     * @psalm-suppress UnresolvableInclude
     */
    public function load($resource): array
    {

        if (!is_string($resource) || !is_readable($resource)) {
            throw new FileNotFoundException(
                sprintf(
                    'The given file "%s" does not exists or is not readable.',
                    (string) $resource
                )
            );
        }

        $data = require $resource;

        return parent::load($data);
    }
}

```
