Table   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 20
dl 0
loc 34
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 28 1
1
<?php
2
namespace phoponent\app\component\core;
3
4
    use Exception;
5
	use phoponent\app\component\core\Table\mvc\model\table_model;
0 ignored issues
show
Bug introduced by
The type phoponent\app\component\...e\mvc\model\table_model was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
	use phoponent\framework\classe\xphp_tag;
7
	use phoponent\framework\service\translation;
8
9
	class Table extends xphp_tag {
10
11
		/**
12
		 * @return string
13
		 * @throws Exception
14
		 */
15
		public function render():string {
16
			/**
17
			 * @var table_model $model
18
			 */
19
			$model = $this->get_model('table');
20
			$my_name = 'Nicolas';
21
			$json_datas = $model->get_datas_from_json($this->attribute('file'));
22
23
24
			$header_view = $model->genere_header(
25
				$json_datas,
26
				$this->get_view('tr'),
27
				$this->get_view('th')
28
			);
29
			$lines = $model->genere_body(
30
				$json_datas,
31
				$this->get_view('tr'),
32
				$this->get_view('td')
33
			);
34
            $table = $this->get_view('table')
35
						  ->set_vars([
36
						  	  'text_in_french' => translation::__($this->attribute('text_to_translate'), [$my_name], 'fr'),
37
						  	  'text_in_english' => translation::__($this->attribute('text_to_translate'), [$my_name]),
38
						 	  'header' => $header_view,
39
							  'lines' => $lines
40
						  ])->render();
41
42
            return $table;
43
        }
44
    }