PolymorphicTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A generatePolyObject() 0 9 3
1
<?php
2
3
	namespace Vivait\BootstrapBundle\Model;
4
5
	/**
6
	 * Class PolymorphicTrait
7
	 * @mixin PolymorphicInterface
8
	 * @package Vivait\BootstrapBundle\Model
9
	 */
10
	trait PolymorphicTrait {
11
		/**
12
		 * @return $this
13
		 */
14
		public static function generatePolyObject($poly_alias) {
15
			$objs = self::generateAllPolyObjects();
0 ignored issues
show
Bug introduced by
The method generateAllPolyObjects() does not exist on Vivait\BootstrapBundle\Model\PolymorphicTrait. Did you maybe mean generatePolyObject()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
16
			foreach($objs as $obj) {
17
				if($obj->getPolyAlias() == $poly_alias) {
18
					return $obj;
19
				}
20
			}
21
			return null;
22
		}
23
24
	}
25