Completed
Push — master ( 2b6e28...3d0129 )
by
unknown
10:26
created

Contrib/less.php/Tree/Alpha.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * Alpha
5
 *
6
 * @package Less
7
 * @subpackage tree
8
 */
9
class Less_Tree_Alpha extends Less_Tree{
10
	public $value;
11
	public $type = 'Alpha';
12
13
	public function __construct($val){
14
		$this->value = $val;
15
	}
16
17
	//function accept( $visitor ){
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
18
	//	$this->value = $visitor->visit( $this->value );
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
19
	//}
20
21
	public function compile($env){
22
23
		if( is_object($this->value) ){
24
			$this->value = $this->value->compile($env);
25
		}
26
27
		return $this;
28
	}
29
30
    /**
31
     * @see Less_Tree::genCSS
32
     */
33
	public function genCSS( $output ){
34
35
		$output->add( "alpha(opacity=" );
36
37
		if( is_string($this->value) ){
38
			$output->add( $this->value );
39
		}else{
40
			$this->value->genCSS( $output);
41
		}
42
43
		$output->add( ')' );
44
	}
45
46
	public function toCSS(){
47
		return "alpha(opacity=" . (is_string($this->value) ? $this->value : $this->value->toCSS()) . ")";
48
	}
49
50
51
}