<?php

use FiloBlu\Refilo\Remote\Entity\Provider\PriceProvider;
use Magento\Framework\App\Bootstrap;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\State;
use Magento\Store\Model\StoreManagerInterface;

require __DIR__ . '/../../../../../app/bootstrap.php';
$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);
$obj = $bootstrap->getObjectManager();
$state = $obj->get(State::class);
$state->setAreaCode('adminhtml');
$objectManager = ObjectManager::getInstance();

/** @var StoreManagerInterface $storeManager */
$storeManager = $objectManager->get(StoreManagerInterface::class);
/** @var \FiloBlu\Refilo\Remote\Entity\Provider\ProductAttributeProvider  $attribute */
$attribute = $objectManager->get(\FiloBlu\Refilo\Remote\Entity\Provider\ProductAttributeProvider::class);

$data = [];
foreach ($attribute->forStore($storeManager->getStore(2)) as $at)
{
    $data[] = $at->toArray();
}

echo json_encode($data, JSON_PRETTY_PRINT);
