GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( 85972e...e1cfa9 )
by Jan
08:17
created

tl_belegungsplan_calender::loadEndDate()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 6
nc 3
nop 2
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
1
<?php
2
 /**
3
 * Contao Open Source CMS
4
 *
5
 * Copyright (c) Jan Karai
6
 *
7
 * @license LGPL-3.0+
8
 */
9
10
/**
11
* Load tl_content language file
12
*/
13
System::loadLanguageFile('tl_content');
14
 
15
/**
16
 * Table tl_belegungsplan_calender
17
 */
18
$GLOBALS['TL_DCA']['tl_belegungsplan_calender'] = array
19
(
20
	// Config
21
	'config' => array
22
	(
23
		'dataContainer'			=> 'Table',
24
		'ptable'				=> 'tl_belegungsplan_objekte',
25
		'ctable'				=> array('tl_content'),
26
		'switchToEdit'			=> true,
27
		'enableVersioning'		=> true,
28
		'sql' => array
29
		(
30
			'keys' => array
31
			(
32
				'id' => 'primary',
33
				'pid' => 'index'
34
			)
35
		)
36
	),
37
	// List
38
	'list' => array
39
	(
40
		'sorting' => array
41
		(
42
			'mode'                    => 4,
43
			'fields'                  => array('startDate DESC'),
44
			'headerFields'            => array('name'),
45
			'panelLayout'             => 'filter;sort,search,limit',
46
			'child_record_callback'   => array('tl_belegungsplan_calender', 'listCalender')
47
		),
48
		'label' => array
49
		(
50
			'fields'                  => array('gast', 'startDate', 'endDate'),
51
			'format'                  => '%s'
52
		),
53
		'global_operations' => array
54
		(
55
			'all' => array
56
			(
57
				'label'               => &$GLOBALS['TL_LANG']['MSC']['all'],
58
				'href'                => 'act=select',
59
				'class'               => 'header_edit_all',
60
				'attributes'          => 'onclick="Backend.getScrollOffset()" accesskey="e"'
61
			)
62
		),
63
		'operations' => array
64
		(
65
			'edit' => array
66
			(
67
				'label'               => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['edit'],
68
				'href'                => 'act=edit',
69
				'icon'                => 'edit.svg'
70
			),
71
			'delete' => array
72
			(
73
				'label'               => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['delete'],
74
				'href'                => 'act=delete',
75
				'icon'                => 'delete.svg',
76
				'attributes'          => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
77
			)
78
		)
79
	),
80
	// Palettes
81
	'palettes' => array
82
	(
83
		'__selector__'                => array(),
84
		'default'                     => '{title_legend},gast,author;{date_legend},startDate,endDate'
85
	),
86
	// Subpalettes
87
	'subpalettes' => array(
88
	),
89
	// Fields
90
	'fields' => array
91
	(
92
		'id' => array
93
		(
94
			'sql'                     => "int(10) unsigned NOT NULL auto_increment"
95
		),
96
		'pid' => array
97
		(
98
			'foreignKey'              => 'tl_belegungsplan_objekte.name',
99
			'sql'                     => "int(10) unsigned NOT NULL default '0'",
100
			'relation'                => array('type'=>'belongsTo', 'load'=>'eager')
101
		),
102
		'tstamp' => array
103
		(
104
			'sql'                     => "int(10) unsigned NOT NULL default '0'"
105
		),
106
		'gast' => array
107
		(
108
			'label'                   => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['gast'],
109
			'exclude'                 => true,
110
			'search'                  => true,
111
			'filter'                  => true,
112
			'inputType'               => 'text',
113
			'eval'                    => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'long'),
114
			'sql'                     => "varchar(255) NOT NULL default ''"
115
		),
116
		'author' => array
117
		(
118
			'label'                   => &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['author'],
119
			'default'                 => BackendUser::getInstance()->id,
120
			'exclude'                 => true,
121
			'search'                  => true,
122
			'filter'                  => true,
123
			'sorting'                 => true,
124
			'flag'                    => 11,
125
			'inputType'               => 'select',
126
			'foreignKey'              => 'tl_user.name',
127
			'eval'                    => array('doNotCopy'=>true, 'chosen'=>true, 'mandatory'=>true, 'includeBlankOption'=>true, 'tl_class'=>'w50'),
128
			'sql'                     => "int(10) unsigned NOT NULL default '0'",
129
			'relation'                => array('type'=>'belongsTo', 'load'=>'eager')
130
		),
131
		'startDate' => array
132
		(
133
			'label'			=> &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['startDate'],
134
			'exclude'		=> true,
135
			'search'		=> true,
136
			'filter'		=> true,
137
			'sorting'		=> true,
138
			'flag'			=> 8,
139
			'inputType'		=> 'text',
140
			'eval'			=> array('rgxp'=>'date', 'mandatory'=>true, 'doNotCopy'=>true, 'datepicker'=>true, 'tl_class'=>'w50 wizard'),
141
			'sql'			=> "int(10) unsigned NULL"
142
		),
143
		'endDate' => array
144
		(
145
			'label'			=> &$GLOBALS['TL_LANG']['tl_belegungsplan_calender']['endDate'],
146
			'exclude'		=> true,
147
			'search'		=> true,
148
			'filter'		=> true,
149
			'sorting'		=> true,
150
			'flag'			=> 8,
151
			'inputType'		=> 'text',
152
			'eval'			=> array('rgxp'=>'date', 'mandatory'=>true, 'doNotCopy'=>true, 'datepicker'=>true, 'tl_class'=>'w50 wizard'),
153
			'save_callback'		=> array(array('tl_belegungsplan_calender','loadEndDate')),
154
			'sql'			=> "int(10) unsigned NULL"
155
		)
156
	)
157
);
158
159
 /**
160
 * Provide miscellaneous methods that are used by the data configuration array.
161
 *
162
 * @author Jan Karai <https://www.sachsen-it.de>
163
 */
164
class tl_belegungsplan_calender extends Backend
165
{
166
	 /**
167
	 * Import the back end user object
168
	 */
169
	public function __construct() {
170
		parent::__construct();
171
		$this->import('BackendUser', 'User');
172
	}
173
	/**
174
	 * Add the type of input field
175
	 *
176
	 * @param array $arrRow
177
	 *
178
	 * @return string
179
	 */
180
	public function listCalender($arrRow)
181
	{
182
		return '<div class="tl_content_left">' . $arrRow['gast'] . ' <span style="color:#999;padding-left:3px">[' . Date::parse(Config::get('dateFormat'), $arrRow['startDate']) . $GLOBALS['TL_LANG']['MSC']['cal_timeSeparator'] . Date::parse(Config::get('dateFormat'), $arrRow['endDate']) . ']</span></div>';
183
	}
184
	/**
185
	 * Prueft ob Enddatum kleiner Startdatum
186
	 *
187
	 * @param string $varValue
188
	 * @param DataContainer $dc
189
	 * @return string
190
	 */
191
	public function loadEndDate($varValue, DataContainer $dc)
0 ignored issues
show
Unused Code introduced by
The parameter $dc is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

191
	public function loadEndDate($varValue, /** @scrutinizer ignore-unused */ DataContainer $dc)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
192
	{
193
		try
194
		{
195
			if ($this->Input->post('endDate') < $this->Input->post('startDate'))
196
			{
197
				throw new Exception($GLOBALS['TL_LANG']['tl_belegungsplan_calender']['endDateError']); 
198
			} else {
199
				return $varValue;
200
			}
201
		}
202
		catch (\OutOfBoundsException $e)
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
203
		{
204
		}
205
		
206
	}
207
}
208