Resolve "Remove ENV implementation" #1134

Merged
korina.cordero merged 3 commits from 275-remove-env-implementation into master 2019-11-28 06:51:17 +00:00
2 changed files with 8 additions and 8 deletions
Showing only changes of commit 0372dc5a5a - Show all commits

View file

@ -97,6 +97,11 @@ services:
$policy_third_party: "%env(POLICY_THIRD_PARTY)%"
$policy_mobile: "%env(POLICY_MOBILE)%"
App\Command\CreateCustomerFromWarrantyCommand:
arguments:
$cvu_mfg_id: "%env(CVU_MFG_ID)%"
$cvu_brand_id: "%env(CVU_BRAND_ID)%"
Catalyst\APIBundle\Security\APIKeyUserProvider:
arguments:
$em: "@doctrine.orm.entity_manager"

View file

@ -34,17 +34,12 @@ class CreateCustomerFromWarrantyCommand extends Command
protected $cvu_mfg_id;
protected $cvu_brand_id;
public function __construct(ObjectManager $em)
public function __construct(ObjectManager $em, $cvu_mfg_id, $cvu_brand_id)
{
$this->em = $em;
// get the default ids from .env
// TODO: DO NOT USE $_ENV
$dotenv = new Dotenv();
$dotenv->loadEnv(__DIR__.'/../../.env');
$this->cvu_mfg_id = $_ENV['CVU_MFG_ID'];
$this->cvu_brand_id = $_ENV['CVU_BRAND_ID'];
$this->cvu_mfg_id = $cvu_mfg_id;
$this->cvu_brand_id = $cvu_brand_id;
parent::__construct();
}