Completed
Pull Request — master (#1399)
by Ingo
02:43
created

ErrorPageFileExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getErrorRecordFor() 0 3 1
1
<?php
2
3
/**
4
 * Decorates {@see File} with ErrorPage support
5
 */
6
class ErrorPageFileExtension extends DataExtension {
7
8
	/**
9
	 * Used by {@see File::handle_shortcode}
10
	 *
11
	 * @param int $statusCode HTTP Error code
12
	 * @return DataObject Substitute object suitable for handling the given error code
13
	 */
14
	public function getErrorRecordFor($statusCode) {
15
		return ErrorPage::get()->filter("ErrorCode", $statusCode)->first();
16
	}
17
18
}
19