<?php

namespace GriffinForms;

use GriffinForms\Traits\MaybeDecode;

class Format {

    use MaybeDecode;
    
    protected $meta;
    protected $config;
    protected $settings;
    protected $heir;
    protected $log;
    
    protected function setConfig()
    {
        $this->config = Config::getInstance();
    }

    protected function setSettings()
    {
        $this->settings = Settings::getInstance();
    }
    
    protected function setHeir()
    {
        $this->heir = Heirarchy::getInstance();
    }
    
    
    protected function setLog()
    {
        $this->log = Log::getInstance();
    }
    
    protected function setMeta()
    {
        $this->meta = (new \ReflectionClass($this))->getShortName();
    }
    
    protected function setAll() 
    {
        foreach ($this as $key => $value) {
            $key = str_replace('_', '', $key);
            $method = 'set' . ucfirst($key);
            if (method_exists($this, $method)) {
                $this->$method();
            }
        }
    }
}