# give/4.16.8.1/src/Framework/FieldsAPI/Factory.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.8.1. 33 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.8.1/code/src/Framework/FieldsAPI/Factory.php
- Raw: https://pluginprobe.com/plugins/give/4.16.8.1/raw/src/Framework/FieldsAPI/Factory.php
- Modified: 2021-11-23T23:55:18+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/give/4.16.8.1/code/src/Framework/FieldsAPI/Factory.php#L10-L20`.

```php
<?php

namespace Give\Framework\FieldsAPI;

use Give\Framework\FieldsAPI\Contracts\Node;
use Give\Framework\FieldsAPI\Exceptions\TypeNotSupported;

/**
 * @since 2.12.0
 */
class Factory
{

    /**
     * @since 2.12.0
     *
     * @param string $type
     * @param        ...$args
     *
     * @return Node
     * @throws TypeNotSupported
     */
    public function make($type, ...$args)
    {
        $class = 'Give\\Framework\\FieldsAPI\\' . ucfirst($type);
        if ( ! class_exists($class)) {
            throw new TypeNotSupported($type);
        }

        return new $class(...$args);
    }
}

```
