forked from RY-Cafemedia/feature
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplifying feature api. Breaking changes. PHP >= 8.0
- Loading branch information
Showing
30 changed files
with
295 additions
and
2,115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
language: php | ||
|
||
php: | ||
- '7.2' | ||
- '8.0' | ||
- nightly | ||
|
||
script: composer install --no-interaction && composer phpstan && composer phpunit | ||
script: composer install --no-interaction && composer test |
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,29 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="1" | ||
resolveFromConfigFile="true" | ||
totallyTyped="true" | ||
reportMixedIssues="true" | ||
strictBinaryOperands="true" | ||
ignoreInternalFunctionFalseReturn="false" | ||
ignoreInternalFunctionNullReturn="false" | ||
findUnusedVariablesAndParams="true" | ||
findUnusedCode="true" | ||
ensureArrayStringOffsetsExist="true" | ||
runTaintAnalysis="true" | ||
reportInfo="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
> | ||
<projectFiles> | ||
<directory name="src" /> | ||
<ignoreFiles> | ||
<directory name="vendor" /> | ||
</ignoreFiles> | ||
</projectFiles> | ||
|
||
<issueHandlers> | ||
<LessSpecificReturnType errorLevel="info" /> | ||
</issueHandlers> | ||
</psalm> |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PabloJoan\Feature\Configurations; | ||
|
||
final class Collection | ||
{ | ||
/** | ||
* @var Config[] | ||
*/ | ||
private array $configurations; | ||
|
||
/** | ||
* @param array<string|int, array{enabled: int|array, bucketing?: string}> $configurations | ||
*/ | ||
public function __construct(array $configurations) | ||
{ | ||
foreach ($configurations as $featureName => $config) { | ||
$this->configurations[(string)$featureName] = new Config(config: $config); | ||
} | ||
} | ||
|
||
public function get(string $featureName): Config | ||
{ | ||
return $this->configurations[$featureName]; | ||
} | ||
} |
Oops, something went wrong.