Skip to content

Commit d361610

Browse files
committed
reworked CypherMap to work with array under the hood
1 parent 5e36e22 commit d361610

File tree

3 files changed

+250
-77
lines changed

3 files changed

+250
-77
lines changed

psalm.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
<directory name="src"/>
4242
</errorLevel>
4343
</DeprecatedInterface>
44+
<UnusedForeachValue>
45+
<errorLevel type="suppress">
46+
<directory name="tests"/>
47+
<directory name="src"/>
48+
</errorLevel>
49+
</UnusedForeachValue>
4450
</issueHandlers>
4551
<stubs>
4652
<file name="./vendor/vimeo/psalm/stubs/ext-ds.phpstub"/>

src/Databags/Pair.php

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,54 @@
11
<?php
22

3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the Laudis Neo4j package.
7+
*
8+
* (c) Laudis technologies <http://laudis.tech>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
314
namespace Laudis\Neo4j\Databags;
415

5-
class Pair
16+
/**
17+
* @template TKey
18+
* @template TValue
19+
*
20+
* @psalm-immutable
21+
*/
22+
final class Pair
623
{
24+
/** @var TKey */
25+
private $key;
26+
/** @var TValue */
27+
private $value;
28+
29+
/**
30+
* @param TKey $key
31+
* @param TValue $value
32+
*/
33+
public function __construct($key, $value)
34+
{
35+
$this->key = $key;
36+
$this->value = $value;
37+
}
38+
39+
/**
40+
* @return TKey
41+
*/
42+
public function getKey()
43+
{
44+
return $this->key;
45+
}
746

47+
/**
48+
* @return TValue
49+
*/
50+
public function getValue()
51+
{
52+
return $this->value;
53+
}
854
}

0 commit comments

Comments
 (0)