| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| 1 | <?php |
||
| 22 | 3 | public function setup() { |
|
| 23 | // in order to continue, taxonomy term ID must be specified |
||
| 24 | 3 | if ( ! $this->get_id() ) { |
|
| 25 | 1 | throw new Carbon_Breadcrumb_Exception( 'The term breadcrumb items must have term ID specified.' ); |
|
| 26 | } |
||
| 27 | |||
| 28 | // in order to continue, taxonomy must be specified |
||
| 29 | 2 | if ( ! $this->get_subtype() ) { |
|
| 30 | 1 | throw new Carbon_Breadcrumb_Exception( 'The term breadcrumb items must have taxonomy specified.' ); |
|
| 31 | } |
||
| 32 | |||
| 33 | // retrieve term object |
||
| 34 | 1 | $subtype = $this->get_subtype(); |
|
| 35 | 1 | $this->term_object = get_term_by( 'id', $this->get_id(), $subtype ); |
|
| 36 | |||
| 37 | 1 | parent::setup(); |
|
| 38 | 1 | } |
|
| 39 | |||
| 60 | } |