Completed
Push — master ( 23d5f0...daf9a4 )
by Kamil
05:58
created

PriorityQueue   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 102
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 14
lcom 0
cbo 0
dl 0
loc 102
rs 10
c 0
b 0
f 0

14 Methods

Rating   Name   Duplication   Size   Complexity  
A insert() 0 1 1
A remove() 0 1 1
A isEmpty() 0 1 1
A count() 0 1 1
A top() 0 1 1
A extract() 0 1 1
A getIterator() 0 1 1
A serialize() 0 1 1
A unserialize() 0 1 1
A toArray() 0 1 1
A setInternalQueueClass() 0 1 1
A contains() 0 1 1
A hasPriority() 0 1 1
A __clone() 0 1 1
1
<?php
2
3
// This stub is created to support Psalm generics.
4
5
/**
6
 * Zend Framework (http://framework.zend.com/)
7
 *
8
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
9
 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
10
 * @license   http://framework.zend.com/license/new-bsd New BSD License
11
 */
12
13
namespace Zend\Stdlib;
14
15
use Countable;
16
use IteratorAggregate;
17
use Serializable;
18
19
/**
20
 * @psalm-template T
21
 * @template-extends IteratorAggregate<int, T>
22
 * @template-extends ArrayAccess<int|null, T>
23
 */
24
class PriorityQueue implements Countable, IteratorAggregate, Serializable
25
{
26
    const EXTR_DATA = 0x00000001;
27
    const EXTR_PRIORITY = 0x00000002;
28
    const EXTR_BOTH = 0x00000003;
29
30
    /**
31
     * @param mixed $data
32
     * @param int $priority
33
     *
34
     * @return PriorityQueue
0 ignored issues
show
Documentation introduced by
Should the return type not be PriorityQueue|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
35
     *
36
     * @psalm-param T $data
37
     * @psalm-return PriorityQueue<T>
38
     */
39
    public function insert($data, $priority = 1) { }
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from 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 $priority is not used and could be removed.

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

Loading history...
40
41
    /**
42
     * @param mixed $datum
43
     *
44
     * @return bool False if the item was not found, true otherwise.
0 ignored issues
show
Documentation introduced by
Should the return type not be boolean|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
45
     *
46
     * @psalm-param T $datum
47
     */
48
    public function remove($datum) { }
0 ignored issues
show
Unused Code introduced by
The parameter $datum is not used and could be removed.

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

Loading history...
49
50
    /**
51
     * @return bool
0 ignored issues
show
Documentation introduced by
Should the return type not be boolean|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
52
     */
53
    public function isEmpty() { }
54
55
    /**
56
     * @return int
0 ignored issues
show
Documentation introduced by
Should the return type not be integer|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
57
     */
58
    public function count() { }
59
60
    /**
61
     * @return mixed
62
     */
63
    public function top() { }
64
65
    /**
66
     * @return mixed
67
     */
68
    public function extract() { }
69
70
    /**
71
     * @return SplPriorityQueue
0 ignored issues
show
Documentation introduced by
Should the return type not be SplPriorityQueue|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
72
     *
73
     * @psalm-return SplPriorityQueue<T>
74
     */
75
    public function getIterator() { }
76
77
    /**
78
     * @return string
0 ignored issues
show
Documentation introduced by
Should the return type not be string|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
79
     */
80
    public function serialize() { }
81
82
    /**
83
     * @param string $data
84
     *
85
     * @return void
86
     */
87
    public function unserialize($data) { }
88
89
    /**
90
     * @param int $flag
91
     *
92
     * @return array
0 ignored issues
show
Documentation introduced by
Should the return type not be array|null? Also, consider making the array more specific, something like array<String>, or String[].

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

If the return type contains the type array, this check recommends the use of a more specific type like String[] or array<String>.

Loading history...
93
     */
94
    public function toArray($flag = self::EXTR_DATA) { }
0 ignored issues
show
Unused Code introduced by
The parameter $flag is not used and could be removed.

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

Loading history...
95
96
    /**
97
     * @param string $class
98
     *
99
     * @return PriorityQueue
0 ignored issues
show
Documentation introduced by
Should the return type not be PriorityQueue|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
100
     *
101
     * @psalm-return PriorityQueue<T>
102
     */
103
    public function setInternalQueueClass($class) { }
0 ignored issues
show
Unused Code introduced by
The parameter $class is not used and could be removed.

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

Loading history...
104
105
    /**
106
     * @param mixed $datum
107
     *
108
     * @return bool
0 ignored issues
show
Documentation introduced by
Should the return type not be boolean|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
109
     *
110
     * @psalm-param T $datum
111
     */
112
    public function contains($datum) { }
0 ignored issues
show
Unused Code introduced by
The parameter $datum is not used and could be removed.

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

Loading history...
113
114
    /**
115
     * @param int $priority
116
     *
117
     * @return bool
0 ignored issues
show
Documentation introduced by
Should the return type not be boolean|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
118
     */
119
    public function hasPriority($priority) { }
0 ignored issues
show
Unused Code introduced by
The parameter $priority is not used and could be removed.

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

Loading history...
120
121
    /**
122
     * @return void
123
     */
124
    public function __clone() { }
125
}
126