Skip to content

Commit fc32175

Browse files
Merge pull request #28 from quant-php/dev
refactor: add Arrayable- and Equatable-contracts to Core package
2 parents 387af51 + fbcbfa6 commit fc32175

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the quant project.
5+
*
6+
* (c) 2023 Thorsten Suckow-Homberg <[email protected]>
7+
*
8+
* For full copyright and license information, please consult the LICENSE-file distributed
9+
* with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Quant\Core\Contract;
15+
16+
interface Arrayable
17+
{
18+
/**
19+
* Returns an array representation of an instance of this class.
20+
*
21+
* @return array<int, mixed>
22+
*/
23+
public function toArray(): array;
24+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the quant project.
5+
*
6+
* (c) 2023 Thorsten Suckow-Homberg <[email protected]>
7+
*
8+
* For full copyright and license information, please consult the LICENSE-file distributed
9+
* with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Quant\Core\Contract;
15+
16+
interface Equatable
17+
{
18+
public function equals(Equatable $target): bool;
19+
}

0 commit comments

Comments
 (0)