Code Duplication    Length = 8-8 lines in 3 locations

src/IPub/Widgets/Components/Control.php 1 location

@@ 157-164 (lines=8) @@
154
			}
155
156
			// If template was not defined before...
157
			if ($this->template->getFile() === NULL) {
158
				// Get component actual dir
159
				$dir = dirname($this->getReflection()->getFileName());
160
161
				// ...try to get base component template file
162
				$templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default.latte';
163
				$this->template->setFile($templateFile);
164
			}
165
166
			// Render component template
167
			$this->template->render();

src/IPub/Widgets/Decorators/Decorator.php 1 location

@@ 56-63 (lines=8) @@
53
			}
54
55
			// If template was not defined before...
56
			if ($this->template->getFile() === NULL) {
57
				// Get component actual dir
58
				$dir = dirname($this->getReflection()->getFileName());
59
60
				// ...try to get base component template file
61
				$templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default.latte';
62
				$this->template->setFile($templateFile);
63
			}
64
65
			// Render component template
66
			$this->template->render();

src/IPub/Widgets/Widgets/Widget.php 1 location

@@ 183-190 (lines=8) @@
180
		}
181
182
		// If template was not defined before...
183
		if ($templateFile === NULL) {
184
			// Get component actual dir
185
			$dir = dirname($this->getReflection()->getFileName());
186
187
			// ...try to get base component template file
188
			$templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default.latte';
189
			$this->template->setFile($templateFile);
190
		}
191
	}
192
193
	/**