-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c467d1
commit f4e841d
Showing
10 changed files
with
179 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Unleash\Client\DTO; | ||
|
||
final class DefaultSegment implements Segment | ||
{ | ||
/** | ||
* @param array<Constraint> $constraints | ||
*/ | ||
public function __construct( | ||
private readonly int $id, | ||
private readonly array $constraints, | ||
) { | ||
} | ||
|
||
public function getId(): int | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function getConstraints(): array | ||
{ | ||
return $this->constraints; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Unleash\Client\DTO; | ||
|
||
interface Segment | ||
{ | ||
public function getId(): int; | ||
|
||
/** | ||
* @return array<Constraint> | ||
*/ | ||
public function getConstraints(): array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Unleash\Client\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Unleash\Client\DTO\DefaultSegment; | ||
|
||
/** | ||
* This class is only for triggering code that doesn't really make sense to test and is here to achieve 100% code coverage. | ||
* The reason is to catch potential problems during transpilation to lower versions of php. | ||
*/ | ||
final class CoverageOnlyTest extends TestCase | ||
{ | ||
public function testDefaultSegment(): void | ||
{ | ||
$instance = new DefaultSegment(1, []); | ||
self::assertEquals(1, $instance->getId()); | ||
} | ||
} |
Submodule client-specification
updated
12 files
+1 −0 | .github/stale.yml | |
+14 −0 | .github/workflows/add-to-project.yml | |
+2 −2 | .github/workflows/node.js.yml | |
+29 −0 | .github/workflows/release.yml | |
+4 −3 | README.md | |
+1 −0 | index.js | |
+2 −2 | package.json | |
+1 −1 | schema/context-schema.js | |
+16 −0 | schema/features-schema.js | |
+68 −0 | specifications/13-constraint-operators.json | |
+201 −0 | specifications/15-global-constraints.json | |
+3 −2 | specifications/index.json |