private function getIndicador($indicador) { $class = 'App\\Business\\IndicadorBusiness'; $indexToFind = strtoupper($indicador); if (!isset($class::${$indexToFind})) { self::indexNotFound($indexToFind); } $indicadorBusiness = new IndicadorBusiness(IndicadorBusiness::${$indexToFind}); $indicador = $indicadorBusiness->getUltimoIndiceXML(); return $indicador; }
public function index() { $indicadorCDI = new IndicadorBusiness(IndicadorBusiness::$CDI); $cdi = $indicadorCDI->getUltimoIndiceXML()->getValue(); $indicadorPoupanca = new IndicadorBusiness(IndicadorBusiness::$POUPANCA); $poupanca = $indicadorPoupanca->getUltimoIndiceXML()->getValue(); $indicadorSELIC = new IndicadorBusiness(IndicadorBusiness::$SELIC); $selic = $indicadorSELIC->getUltimoIndiceXML()->getValue(); $amount = Cookie::get(PreferencesVO::PREFERENCES_AMOUNT, PreferencesVO::DEFAULT_AMOUNT); $period = Cookie::get(PreferencesVO::PREFERENCES_PERIOD, PreferencesVO::DEFAULT_PERIOD); $taxcdb = Cookie::get(PreferencesVO::PREFERENCES_TAXCDB, PreferencesVO::DEFAULT_TAXCDB); $taxlci = Cookie::get(PreferencesVO::DEFAULT_TAXLCI, PreferencesVO::DEFAULT_TAXLCI); return view('welcome', compact('cdi', 'poupanca', 'selic', 'amount', 'period', 'taxcdb', 'taxlci')); }