ShoppingCartTest_TestShoppingCartHooksExtension   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 42
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A reset() 0 3 1
A afterAdd() 0 3 1
A beforeRemove() 0 3 1
A afterRemove() 0 3 1
A beforeAdd() 0 3 1
A onStartOrder() 0 3 1
A afterSetQuantity() 0 3 1
A beforeSetQuantity() 0 3 1
1
<?php
2
3
namespace SilverShop\Tests\Cart;
4
5
use SilverStripe\Core\Extension;
6
use SilverStripe\Dev\TestOnly;
7
8
class ShoppingCartTest_TestShoppingCartHooksExtension extends Extension implements TestOnly
9
{
10
    public static $stack = [];
11
12
    public static function reset()
13
    {
14
        self::$stack = [];
15
    }
16
17
    public function onStartOrder()
18
    {
19
        self::$stack[] = 'onStartOrder';
20
    }
21
22
    public function beforeAdd($buyable, $quantity, $filter)
0 ignored issues
show
Unused Code introduced by
The parameter $buyable 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

22
    public function beforeAdd(/** @scrutinizer ignore-unused */ $buyable, $quantity, $filter)

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...
Unused Code introduced by
The parameter $filter 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

22
    public function beforeAdd($buyable, $quantity, /** @scrutinizer ignore-unused */ $filter)

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...
Unused Code introduced by
The parameter $quantity 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

22
    public function beforeAdd($buyable, /** @scrutinizer ignore-unused */ $quantity, $filter)

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...
23
    {
24
        self::$stack[] = 'beforeAdd';
25
    }
26
27
    public function afterAdd($item, $buyable, $quantity, $filter)
0 ignored issues
show
Unused Code introduced by
The parameter $item 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

27
    public function afterAdd(/** @scrutinizer ignore-unused */ $item, $buyable, $quantity, $filter)

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...
Unused Code introduced by
The parameter $buyable 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

27
    public function afterAdd($item, /** @scrutinizer ignore-unused */ $buyable, $quantity, $filter)

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...
Unused Code introduced by
The parameter $filter 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

27
    public function afterAdd($item, $buyable, $quantity, /** @scrutinizer ignore-unused */ $filter)

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...
Unused Code introduced by
The parameter $quantity 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

27
    public function afterAdd($item, $buyable, /** @scrutinizer ignore-unused */ $quantity, $filter)

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...
28
    {
29
        self::$stack[] = 'afterAdd';
30
    }
31
32
    public function beforeRemove($buyable, $quantity, $filter)
0 ignored issues
show
Unused Code introduced by
The parameter $buyable 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

32
    public function beforeRemove(/** @scrutinizer ignore-unused */ $buyable, $quantity, $filter)

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...
Unused Code introduced by
The parameter $quantity 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

32
    public function beforeRemove($buyable, /** @scrutinizer ignore-unused */ $quantity, $filter)

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...
Unused Code introduced by
The parameter $filter 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

32
    public function beforeRemove($buyable, $quantity, /** @scrutinizer ignore-unused */ $filter)

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...
33
    {
34
        self::$stack[] = 'beforeRemove';
35
    }
36
37
    public function afterRemove($buyable, $quantity, $filter)
0 ignored issues
show
Unused Code introduced by
The parameter $filter 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

37
    public function afterRemove($buyable, $quantity, /** @scrutinizer ignore-unused */ $filter)

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...
Unused Code introduced by
The parameter $buyable 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

37
    public function afterRemove(/** @scrutinizer ignore-unused */ $buyable, $quantity, $filter)

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...
Unused Code introduced by
The parameter $quantity 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

37
    public function afterRemove($buyable, /** @scrutinizer ignore-unused */ $quantity, $filter)

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...
38
    {
39
        self::$stack[] = 'afterRemove';
40
    }
41
42
    public function beforeSetQuantity($buyable, $quantity, $filter)
0 ignored issues
show
Unused Code introduced by
The parameter $filter 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

42
    public function beforeSetQuantity($buyable, $quantity, /** @scrutinizer ignore-unused */ $filter)

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...
Unused Code introduced by
The parameter $buyable 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

42
    public function beforeSetQuantity(/** @scrutinizer ignore-unused */ $buyable, $quantity, $filter)

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...
Unused Code introduced by
The parameter $quantity 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

42
    public function beforeSetQuantity($buyable, /** @scrutinizer ignore-unused */ $quantity, $filter)

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...
43
    {
44
        self::$stack[] = 'beforeSetQuantity';
45
    }
46
47
    public function afterSetQuantity($item, $buyable, $quantity, $filter)
0 ignored issues
show
Unused Code introduced by
The parameter $filter 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

47
    public function afterSetQuantity($item, $buyable, $quantity, /** @scrutinizer ignore-unused */ $filter)

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...
Unused Code introduced by
The parameter $buyable 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

47
    public function afterSetQuantity($item, /** @scrutinizer ignore-unused */ $buyable, $quantity, $filter)

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...
Unused Code introduced by
The parameter $item 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

47
    public function afterSetQuantity(/** @scrutinizer ignore-unused */ $item, $buyable, $quantity, $filter)

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...
Unused Code introduced by
The parameter $quantity 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

47
    public function afterSetQuantity($item, $buyable, /** @scrutinizer ignore-unused */ $quantity, $filter)

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...
48
    {
49
        self::$stack[] = 'afterSetQuantity';
50
    }
51
}
52