2 Updated code and improved formatting
source | link

Pass modifiers array in your customised fileTry with following updated code.

classnamespace PoolVendor\Module\Ui\DataProvider\Customer\Form;

use implementsMagento\Customer\Model\ResourceModel\Customer\CollectionFactory;
use \Magento\Ui\DataProvider\Modifier\PoolInterfaceMagento\Ui\DataProvider\AbstractDataProvider;
{use Magento\Ui\DataProvider\Modifier\ModifierInterface;
use Magento\Ui\DataProvider\Modifier\PoolInterface;
/**
 * @varDataProvider arrayfor product edit form
 */
class CustomerDataProvider extends AbstractDataProvider implements PoolInterface
{

    protected $modifiers = [];

    protected $modifiersInstances = [];

    /**
     * @var@param string $name
     * @param string $primaryFieldName
     * @param string $requestFieldName
     * @param CollectionFactory $collectionFactory
     * @param PoolInterface $pool
     * @param array $meta
     * @param array $data
     */
protected $modifiersInstances   public function __construct(
        $name,
        $primaryFieldName,
        $requestFieldName,
        CollectionFactory $collectionFactory,
        array $meta = [];[],
        array $data = []
    ) {
        parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
        $this->collection = $collectionFactory->create();
    }
    /**
     * {@inheritdoc}
     */
    public function getData()
    {
        /** @var ModifierFactoryModifierInterface $modifier */
        foreach ($this->pool->getModifiersInstances() as $modifier) {
            $this->data = $modifier->modifyData($this->data);
        }
        return $this->data;
    }
    /**
     * {@inheritdoc}
     */
protected $factory;   public function getMeta()
    {
        $meta = parent::getMeta();
        /** @var ModifierInterface $modifier */
        foreach ($this->pool->getModifiersInstances() as $modifier) {
            $meta = $modifier->modifyMeta($meta);
        }
        return $meta;
    }  

    /**
     * @paramRetrieve ModifierFactorymodifiers
 $factory    *
     * @param@return array $modifiers
     */
    public function __constructgetModifiers()
    ModifierFactory{
 $factory,       return $this->modifiers;
    array}

 $modifiers   /**
     * Retrieve modifiers instantiated
     *
     * @return ModifierInterface[]
     * @throws LocalizedException
     */
    public function getModifiersInstances()
    {
        if ($this->factory>modifiersInstances) ={
 $factory;           return $this->modifiersInstances;
        }

        foreach ($this->modifiers as $modifier) {
            if (empty($modifier['class'])) {
                throw new LocalizedException(__('Parameter "class" must be present.'));
            }

            if (empty($modifier['sortOrder'])) {
                throw new LocalizedException(__('Parameter "sortOrder" must be present.'));
            }

            $this->modifiersInstances[$modifier['class']] = $this->sort>factory->create($modifiers$modifier['class']);
        }

        return $this->modifiersInstances;
    }
}

Pass modifiers array in your customised file

class Pool implements \Magento\Ui\DataProvider\Modifier\PoolInterface
{
/**
 * @var array
 */
protected $modifiers = [];

/**
 * @var array
 */
protected $modifiersInstances = [];

/**
 * @var ModifierFactory
 */
protected $factory;

/**
 * @param ModifierFactory $factory
 * @param array $modifiers
 */
public function __construct(
    ModifierFactory $factory,
    array $modifiers
) {
    $this->factory = $factory;
    $this->modifiers = $this->sort($modifiers);
}

Try with following updated code.

namespace Vendor\Module\Ui\DataProvider\Customer\Form;

use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory;
use Magento\Ui\DataProvider\AbstractDataProvider;
use Magento\Ui\DataProvider\Modifier\ModifierInterface;
use Magento\Ui\DataProvider\Modifier\PoolInterface;
/**
 * DataProvider for product edit form
 */
class CustomerDataProvider extends AbstractDataProvider implements PoolInterface
{

    protected $modifiers = [];

    protected $modifiersInstances = [];

    /**
     * @param string $name
     * @param string $primaryFieldName
     * @param string $requestFieldName
     * @param CollectionFactory $collectionFactory
     * @param PoolInterface $pool
     * @param array $meta
     * @param array $data
     */
    public function __construct(
        $name,
        $primaryFieldName,
        $requestFieldName,
        CollectionFactory $collectionFactory,
        array $meta = [],
        array $data = []
    ) {
        parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
        $this->collection = $collectionFactory->create();
    }
    /**
     * {@inheritdoc}
     */
    public function getData()
    {
        /** @var ModifierInterface $modifier */
        foreach ($this->pool->getModifiersInstances() as $modifier) {
            $this->data = $modifier->modifyData($this->data);
        }
        return $this->data;
    }
    /**
     * {@inheritdoc}
     */
    public function getMeta()
    {
        $meta = parent::getMeta();
        /** @var ModifierInterface $modifier */
        foreach ($this->pool->getModifiersInstances() as $modifier) {
            $meta = $modifier->modifyMeta($meta);
        }
        return $meta;
    }  

    /**
     * Retrieve modifiers
     *
     * @return array
     */
    public function getModifiers()
    {
        return $this->modifiers;
    }

    /**
     * Retrieve modifiers instantiated
     *
     * @return ModifierInterface[]
     * @throws LocalizedException
     */
    public function getModifiersInstances()
    {
        if ($this->modifiersInstances) {
            return $this->modifiersInstances;
        }

        foreach ($this->modifiers as $modifier) {
            if (empty($modifier['class'])) {
                throw new LocalizedException(__('Parameter "class" must be present.'));
            }

            if (empty($modifier['sortOrder'])) {
                throw new LocalizedException(__('Parameter "sortOrder" must be present.'));
            }

            $this->modifiersInstances[$modifier['class']] = $this->factory->create($modifier['class']);
        }

        return $this->modifiersInstances;
    }
}
1
source | link

Pass modifiers array in your customised file

class Pool implements \Magento\Ui\DataProvider\Modifier\PoolInterface
{
/**
 * @var array
 */
protected $modifiers = [];

/**
 * @var array
 */
protected $modifiersInstances = [];

/**
 * @var ModifierFactory
 */
protected $factory;

/**
 * @param ModifierFactory $factory
 * @param array $modifiers
 */
public function __construct(
    ModifierFactory $factory,
    array $modifiers
) {
    $this->factory = $factory;
    $this->modifiers = $this->sort($modifiers);
}