Completed
Push — master ( db82f0...0ba4b1 )
by Jean-Christophe
03:22
created

BaseTrait::setSize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Ajax\semantic\html\base\traits;
4
5
use Ajax\semantic\html\base\constants\Size;
6
use Ajax\semantic\html\base\constants\Color;
7
trait BaseTrait {
8
	protected $_variations=[];
9
	protected $_states=[];
10
	protected $_baseClass;
11
12
	public function addVariation($variation){
13
		return $this->addToPropertyCtrl("class", $variation, $this->_variations);
0 ignored issues
show
Bug introduced by
It seems like addToPropertyCtrl() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
14
	}
15
16
	public function addState($state){
17
		return $this->addToPropertyCtrl("class", $state, $this->_states);
0 ignored issues
show
Bug introduced by
It seems like addToPropertyCtrl() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
18
	}
19
20
	public function setVariation($variation){
21
		$this->setPropertyCtrl("class", $variation, $this->_variations);
0 ignored issues
show
Bug introduced by
It seems like setPropertyCtrl() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
22
		return $this->addToProperty("class", $this->_baseClass);
0 ignored issues
show
Bug introduced by
It seems like addToProperty() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
23
	}
24
25
	public function setState($state){
26
		$this->setPropertyCtrl("class", $state, $this->_states);
0 ignored issues
show
Bug introduced by
It seems like setPropertyCtrl() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
27
		return $this->addToProperty("class", $this->_baseClass);
0 ignored issues
show
Bug introduced by
It seems like addToProperty() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
28
	}
29
30
	/**
31
	 * {@inheritDoc}
32
	 * @see \Ajax\common\html\HtmlSingleElement::setSize()
33
	 */
34
	public function setSize($size){
35
		return $this->addToPropertyCtrl("class", $size, Size::getConstants());
0 ignored issues
show
Bug introduced by
It seems like addToPropertyCtrl() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
36
	}
37
38
	/**
39
	 * show it is currently unable to be interacted with
40
	 * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement
41
	 */
42
	public function setDisabled(){
43
		return $this->addToProperty("class", "disabled");
0 ignored issues
show
Bug introduced by
It seems like addToProperty() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
44
	}
45
46
	/**
47
	 * @param string $color
48
	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
49
	 */
50
	public function setColor($color){
51
		return $this->addToPropertyCtrl("class", $color,Color::getConstants());
0 ignored issues
show
Bug introduced by
It seems like addToPropertyCtrl() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
52
	}
53
54
	public function setFluid(){
55
		$this->addToProperty("class", "fluid");
0 ignored issues
show
Bug introduced by
It seems like addToProperty() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
56
	}
57
58
	/**
59
	 * can be formatted to appear on dark backgrounds
60
	 */
61
	public function setInverted(){
62
		$this->addToProperty("class", "inverted");
0 ignored issues
show
Bug introduced by
It seems like addToProperty() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
63
	}
64
}