• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

chdemko / php-sorted-collections / 12390158994

18 Dec 2024 09:33AM UTC coverage: 100.0%. Remained the same
12390158994

push

github

chdemko
Fix style in benchmarks

754 of 754 relevant lines covered (100.0%)

113.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/SortedCollection/SortedCollection.php
1
<?php
2

3
/**
4
 * chdemko\SortedCollection\SortedCollection interface
5
 *
6
 * @author    Christophe Demko <chdemko@gmail.com>
7
 * @copyright Copyright (C) 2012-2024 Christophe Demko. All rights reserved.
8
 *
9
 * @license BSD 3-Clause License
10
 *
11
 * This file is part of the php-sorted-collections package https://github.com/chdemko/php-sorted-collections
12
 */
13

14
// Declare chdemko\SortedCollection namespace
15
namespace chdemko\SortedCollection;
16

17
/**
18
 * The SortedCollection interface is the root of the hierarchy. It extends:
19
 *
20
 * * :php:class:`ArrayAccess`
21
 * * :php:class:`IteratorAggregate`
22
 * * :php:class:`JsonSerializable`
23
 * * :php:class:`Countable`
24
 *
25
 * And it is implemented by two classes: :php:class:`chdemko\\SortedCollection\\SortedMap`
26
 * and :php:class:`chdemko\\SortedCollection\\SortedSet`
27
 *
28
 * @package SortedCollection
29
 *
30
 * @since 1.0.0
31
 */
32
interface SortedCollection extends \ArrayAccess, \Countable, \IteratorAggregate, \JsonSerializable
33
{
34
    /**
35
     * Get the comparator
36
     *
37
     * @return callable The comparator
38
     *
39
     * @since 1.0.0
40
     */
41
    public function comparator();
42

43
    /**
44
     * Get the first element
45
     *
46
     * @return mixed The first element
47
     *
48
     * @throws OutOfBoundsException If there is no element
49
     *
50
     * @since 1.0.0
51
     */
52
    public function first();
53

54
    /**
55
     * Get the last element
56
     *
57
     * @return mixed The last element
58
     *
59
     * @throws OutOfBoundsException If there is no element
60
     *
61
     * @since 1.0.0
62
     */
63
    public function last();
64

65
    /**
66
     * Returns the greatest element lesser than the given key
67
     *
68
     * @param mixed $key The searched key
69
     *
70
     * @return mixed The found node
71
     *
72
     * @throws OutOfBoundsException If there is no lower element
73
     *
74
     * @since 1.0.0
75
     */
76
    public function lower($key);
77

78
    /**
79
     * Returns the greatest element lesser than or equal to the given key
80
     *
81
     * @param mixed $key The searched key
82
     *
83
     * @return mixed The found node
84
     *
85
     * @throws OutOfBoundsException If there is no floor element
86
     *
87
     * @since 1.0.0
88
     */
89
    public function floor($key);
90

91
    /**
92
     * Returns the element equal to the given key
93
     *
94
     * @param mixed $key The searched key
95
     *
96
     * @return mixed The found node
97
     *
98
     * @throws OutOfBoundsException If there is no such element
99
     *
100
     * @since 1.0.0
101
     */
102
    public function find($key);
103

104
    /**
105
     * Returns the lowest element greater than or equal to the given key
106
     *
107
     * @param mixed $key The searched key
108
     *
109
     * @return mixed The found node
110
     *
111
     * @throws OutOfBoundsException If there is no ceiling element
112
     *
113
     * @since 1.0.0
114
     */
115
    public function ceiling($key);
116

117
    /**
118
     * Returns the lowest element greater than to the given key
119
     *
120
     * @param mixed $key The searched key
121
     *
122
     * @return mixed The found node
123
     *
124
     * @throws OutOfBoundsException If there is no higher element
125
     *
126
     * @since 1.0.0
127
     */
128
    public function higher($key);
129
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc