PolymorphicTrait::generatePolyObject()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 3
nc 3
nop 1
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