Controller::__debug()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: egorov
5
 * Date: 12.02.2015
6
 * Time: 11:33
7
 */
8
namespace samsonphp\compressor;
9
10
use samson\core\Service;
11
use samsonphp\event\Event;
12
13
/**
14
 * UI module controller
15
 * @package samsonphp\compressor
16
 * @author Vitaly Iegorov <[email protected]>
17
 */
18
class Controller extends Service
0 ignored issues
show
Deprecated Code introduced by
The class samson\core\Service has been deprecated.

This class, trait or interface has been deprecated.

Loading history...
19
{
20
    /** Module identifier */
21
    protected $id = 'compressor';
22
23
    /** Output path for compressed web application */
24
    public $output = 'out/';
25
26
    /** @var array Configuration parameters key => value collection */
27
	public $configuration = array();
28
29
	/**
30
	 * @param mixed $entityConfiguration current instance for configuration
31
	 * @return boolean False if something went wrong otherwise true
32
	 */
33
	public function configure($entityConfiguration)
34
	{
35
		// Convert object to array
36
		$this->configuration = (array)$entityConfiguration;
37
		// Set fileServiceClassName parameter from config
38
		if (!empty($this->configuration['output']{0})) {
39
			$this->output = $this->configuration['output'];
40
		}
41
	}
42
43
44
45
    /**
46
     * Panel render handler
47
     * @param string    $output HTML output
48
     * @param array     $data   View variables collection
49
     * @param \samson\core\Module $module Active module pointer
50
     */
51
    public function panelRenderer(&$output, $data, $module)
0 ignored issues
show
Unused Code introduced by
The parameter $output is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $module is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
52
    {
53
        //$output .= $this->view('panel/index')->output();
54
    }
55
56
    /**
57
     * Compress web-application
58
     * @param boolean   $debug 	        Disable errors output
59
     * @param string    $environment 	Configuration environment
60
     * @param string    $phpVersion 	PHP version to support
61
     */
62
    public function __handler($debug = false, $environment = 'prod', $phpVersion = PHP_VERSION)
63
    {
64
        $compressor = new Compressor($this->output, $debug, $environment, $phpVersion, $this->configuration);
65
        $compressor->compress($debug, $environment, $phpVersion);
66
    }
67
68
    /** Controller action for compressing debug version of web-application */
69
    public function __debug($environment = '')
70
    {
71
        $this->__HANDLER(true, $environment);
72
    }
73
}
74