Source of file Loader.php

Size: 1,139 Bytes - Last Modified: 2015-12-22T09:12:14-05:00

../src/Traits/Loader.php

1234567891011121314151617181920212223242526272829303132333435363738394041
Covered by 11 test(s):
  • MvcLite\LoaderTraitsTest::testGetLoader
  • MvcLite\ViewTest::testGetHelper with data set "Csv helper"
  • MvcLite\ViewTest::testGetHelper with data set "Exception helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputCheckbox helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputPassword helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSelect helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSubmit helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputTextarea helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper, but already has it"
  • MvcLite\ViewTest::testGetHelper with data set "Bad Helper, expect exception"
4243444546474849505152
Covered by 14 test(s):
  • MvcLite\DispatcherTest::testInit
  • MvcLite\DispatcherTest::testDispatch with data set "good controller request"
  • MvcLite\DispatcherTest::testDispatch with data set "bad controller request"
  • MvcLite\LoaderTraitsTest::testSetLoader
  • MvcLite\ViewTest::testGetHelper with data set "Csv helper"
  • MvcLite\ViewTest::testGetHelper with data set "Exception helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputCheckbox helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputPassword helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSelect helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSubmit helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputTextarea helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper, but already has it"
  • MvcLite\ViewTest::testGetHelper with data set "Bad Helper, expect exception"
53
Covered by 14 test(s):
  • MvcLite\DispatcherTest::testInit
  • MvcLite\DispatcherTest::testDispatch with data set "good controller request"
  • MvcLite\DispatcherTest::testDispatch with data set "bad controller request"
  • MvcLite\LoaderTraitsTest::testSetLoader
  • MvcLite\ViewTest::testGetHelper with data set "Csv helper"
  • MvcLite\ViewTest::testGetHelper with data set "Exception helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputCheckbox helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputPassword helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSelect helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSubmit helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputTextarea helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper, but already has it"
  • MvcLite\ViewTest::testGetHelper with data set "Bad Helper, expect exception"
545556
<?php
/**
 * Loader Trait
 *
 * @category   PHP
 * @package    MvcLite
 * @subpackage Traits
 * @since      File available since release 3.0.x
 * @author     Cory Collier <corycollier@corycollier.com>
 */

namespace MvcLite\Traits;

/**
 * Loader Trait.
 *
 * Allows a getter for the loader instance.
 *
 * @category   PHP
 * @package    MvcLite
 * @subpackage Traits
 * @since      File available since release 3.0.x
 * @author     Cory Collier <corycollier@corycollier.com>
 */
trait Loader
{
    /**
     * Loader instance variable.
     *
     * @var \Composer\Autoload\ClassLoader
     */
    protected $loader;

    /**
     * Getter for the Loader instance.
     *
     * @return \Composer\Autoload\ClassLoader The Request instance.
     */
    public function getLoader()
    {
        return $this->loader;
    }

    /**
     * Setter for the Loader instance.
     *
     * @param \Composer\Autoload\ClassLoader $loader The Loader instance
     * @return MvcLite\Traits\Loader Returns $this, for object chaining.
     */
    public function setLoader($loader)
    {
        $this->loader = $loader;
        return $this;
    }
}