Completed
Push — brickrouge3 ( 23d6f2...241af5 )
by Olivier
08:26
created

DeleteOperation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 9 2
1
<?php
2
3
/*
4
 * This file is part of the Icybee package.
5
 *
6
 * (c) Olivier Laviale <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Icybee\Modules\Users\Operation;
13
14
use ICanBoogie\ErrorCollection;
15
16
use Icybee\Modules\Users\User;
17
18
/**
19
 * Deletes a user.
20
 *
21
 * @property User $record
22
 */
23
class DeleteOperation extends \ICanBoogie\Module\Operation\DeleteOperation
24
{
25
	/**
26
	 * @inheritdoc
27
	 */
28
	protected function validate(ErrorCollection $errors)
29
	{
30
		if ($this->key == 1)
31
		{
32
			$errors->add('uid', "Daddy cannot be deleted.");
33
		}
34
35
		return parent::validate($errors);
36
	}
37
}
38