absences_Xls   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 40
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 28 1
1
<?php
2
/************************************************************************
3
 * OVIDENTIA http://www.ovidentia.org                                   *
4
 ************************************************************************
5
 * Copyright (c) 2003 by CANTICO ( http://www.cantico.fr )              *
6
 *                                                                      *
7
 * This file is part of Ovidentia.                                      *
8
 *                                                                      *
9
 * Ovidentia is free software; you can redistribute it and/or modify    *
10
 * it under the terms of the GNU General Public License as published by *
11
 * the Free Software Foundation; either version 2, or (at your option)  *
12
 * any later version.													*
13
 *																		*
14
 * This program is distributed in the hope that it will be useful, but  *
15
 * WITHOUT ANY WARRANTY; without even the implied warranty of			*
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.					*
17
 * See the  GNU General Public License for more details.				*
18
 *																		*
19
 * You should have received a copy of the GNU General Public License	*
20
 * along with this program; if not, write to the Free Software			*
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,*
22
 * USA.																	*
23
************************************************************************/
24
25
26
27
/**
28
 * 
29
 */
30
class absences_Xls
31
{
32
	/**
33
	 * @var Workbook
34
	 */
35
	protected $workbook;
36
	
37
	
38
	public function __construct($name)
39
	{
40
41
		$instance = bab_functionality::get('ExcelExport');
42
		/*@var $instance Func_ExcelExport */
43
		$instance->setDownloadFilename(sprintf('%s.xls', bab_removeDiacritics(str_replace(' ', '-',$name))));
44
		
45
		$this->workbook = $instance->getWorkbook('0.9.2');
46
		
47
		
48
		$this->workbook->setCustomColor(15, 192, 192, 192);
0 ignored issues
show
Bug introduced by
The method setCustomColor() does not seem to exist on object<Workbook>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
49
		$this->header = $this->workbook->addFormat();
0 ignored issues
show
Bug introduced by
The property header does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
50
		$this->header->setBold();
51
		$this->header->setPattern(1);
52
		$this->header->setFgColor(15);
53
		
54
		
55
		$this->date = $this->workbook->addFormat();
0 ignored issues
show
Bug introduced by
The property date does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
56
		$this->date->setNumFormat('D MMM YYYY');
57
		
58
		$this->datetime = $this->workbook->addFormat();
0 ignored issues
show
Bug introduced by
The property datetime does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
59
		$this->datetime->setNumFormat('D/M/YYYY h:mm');
60
		
61
		$this->quantity = $this->workbook->addFormat();
0 ignored issues
show
Bug introduced by
The property quantity does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
62
		$this->quantity->setNumFormat('0.00');
63
		
64
		bab_setTimeLimit(3600);
65
	}
66
	
67
	
68
	
69
}
70
71
72