MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/artinside/public_html/lhh/vendor/frenet/frenet-php/src/Framework/Object/FactoryAbstract.php
<?php

declare(strict_types = 1);

namespace Frenet\Framework\Object;

/**
 * Class FactoryAbstract
 * @package Frenet\Framework\Object
 */
abstract class FactoryAbstract implements FactoryInterface
{
    /**
     * @var string
     */
    protected $objectClass = null;

    /**
     * @var \Frenet\Framework\ObjectManager
     */
    private $objectManager;

    /**
     * FactoryAbstract constructor.
     * @param \Frenet\Framework\ObjectManager $objectManager
     */
    public function __construct(
        \Frenet\Framework\ObjectManager $objectManager
    ) {
        $this->objectManager = $objectManager;
    }

    /**
     * @param array $parameters
     * @return mixed
     */
    public function create(array $parameters = [])
    {
        try {
            /** @var \GuzzleHttp\ClientInterface $instance */
            $instance = $this->objectManager->create($this->objectClass, $parameters);
        } catch (\Exception $e) {
            /** @todo debug error or throw exception. */
            return false;
        }

        return $instance;
    }
}