Validator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 22
rs 10
c 2
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
A passes() 0 10 2
1
<?php namespace JeroenG\LaravelPhotoGallery\Validators;
2
3
abstract class Validator {
4
5
	protected $input;
6
7
	public $errors;
8
9
	public function __construct($input = null)
10
	{
11
		$this->input = $input ?: \Input::all();
12
	}
13
14
	public function passes()
15
  	{
16
    	$validation = \Validator::make($this->input, static::$rules);
17
 
18
    	if($validation->passes()) return true;
19
     
20
    	$this->errors = $validation->messages();
21
 
22
    	return false;
23
  }
24
}