Skip to content

Commit d028e6d

Browse files
authored
feat: deprecate php 7 (#59)
* feat!: deprecate PHP 7.4 Signed-off-by: Tom Carrio <[email protected]> build: provide a devenv config style: apply linting updates for providers style: apply phpcbf fixes build: disable root-level phpcbf commit hook until configured style: apply linting fixes to Flagd provider refactor: confirm to new provider interface chore: ignore all composer.lock files build!: target new version of open-feature/sdk Signed-off-by: Tom Carrio <[email protected]> * feat: deprecate php 7 with full test suite passing Signed-off-by: Tom Carrio <[email protected]> --------- Signed-off-by: Tom Carrio <[email protected]>
1 parent f5bb87b commit d028e6d

35 files changed

+280
-108
lines changed

.github/workflows/php-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
operating-system: [ubuntu-latest]
15-
php-version: ['7.4', '8.0', '8.1', '8.2']
15+
php-version: ['8.0', '8.1', '8.2']
1616
project-dir:
1717
- hooks/OpenTelemetry
1818
- hooks/DDTrace

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/captainhook.config.json
2-
/composer.lock
2+
composer.lock
33
/phpcs.xml
44
/phpunit.xml
55
/vendor/
66

77
/build/
88

9-
/proto/
9+
/proto/
10+
11+
/.devenv*

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/nix/store/kjn5c8afbhm6xjdaz5z4z2ldwpknw0z9-pre-commit-config.json

.tool-versions

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# php 7.4.33
2-
# php 8.0.24
1+
php 8.0.24
32
# php 8.1.11
4-
php 8.2.1
3+
# php 8.2.1

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
### System Requirements
66

7-
PHP 8+ is recommended. PHP 7.4 is EOL and support will be removed in an upcoming release.
7+
PHP 8+ is required.
88

99
### Compilation target(s)
1010

11-
We target compatibility with PHP versions 7.4, 8.0, 8.1, and 8.2.
11+
We target compatibility with PHP versions 8.0, 8.1, and 8.2.
1212

1313
### Project Structure
1414

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![a](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
44
[![codecov](https://codecov.io/gh/open-feature/php-sdk-contrib/branch/main/graph/badge.svg?token=3DC5XOEHMY)](https://codecov.io/gh/open-feature/php-sdk-contrib)
5-
![PHP 7.4+](https://img.shields.io/badge/php->=7.4-blue.svg)
5+
![PHP 8.0+](https://img.shields.io/badge/php->=8.0-blue.svg)
66
![License](https://img.shields.io/github/license/open-feature/php-sdk-contrib)
77
![Experimental](https://img.shields.io/badge/Status-Experimental-yellow)
88

@@ -27,9 +27,7 @@ This repository is marked as **experimental** since the repository structure its
2727

2828
### PHP Versioning
2929

30-
This library targets PHP version 7.4 and newer. As long as you have any compatible version of PHP on your system you should be able to utilize the OpenFeature SDK.
31-
32-
⚠️ **PHP 7.4 is EOL and support will be discontinued in these libraries soon.**
30+
This library targets PHP version 8.0 and newer. As long as you have any compatible version of PHP on your system you should be able to utilize the OpenFeature SDK.
3331

3432
This package also has a `.tool-versions` file for use with PHP version managers like `asdf`.
3533

devenv.lock

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1675875772,
7+
"narHash": "sha256-sYXHPZ4tsjdG+UXK0mYnABhiS/RuzHiV9uGOU9YakwE=",
8+
"owner": "cachix",
9+
"repo": "devenv",
10+
"rev": "eac5eb12eb42765f5f252972dc876d1f96b03dfe",
11+
"type": "github"
12+
},
13+
"original": {
14+
"dir": "src/modules",
15+
"owner": "cachix",
16+
"repo": "devenv",
17+
"type": "github"
18+
}
19+
},
20+
"flake-compat": {
21+
"flake": false,
22+
"locked": {
23+
"lastModified": 1673956053,
24+
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
25+
"owner": "edolstra",
26+
"repo": "flake-compat",
27+
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
28+
"type": "github"
29+
},
30+
"original": {
31+
"owner": "edolstra",
32+
"repo": "flake-compat",
33+
"type": "github"
34+
}
35+
},
36+
"flake-utils": {
37+
"locked": {
38+
"lastModified": 1667395993,
39+
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
40+
"owner": "numtide",
41+
"repo": "flake-utils",
42+
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
43+
"type": "github"
44+
},
45+
"original": {
46+
"owner": "numtide",
47+
"repo": "flake-utils",
48+
"type": "github"
49+
}
50+
},
51+
"gitignore": {
52+
"inputs": {
53+
"nixpkgs": [
54+
"pre-commit-hooks",
55+
"nixpkgs"
56+
]
57+
},
58+
"locked": {
59+
"lastModified": 1660459072,
60+
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
61+
"owner": "hercules-ci",
62+
"repo": "gitignore.nix",
63+
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
64+
"type": "github"
65+
},
66+
"original": {
67+
"owner": "hercules-ci",
68+
"repo": "gitignore.nix",
69+
"type": "github"
70+
}
71+
},
72+
"nixpkgs": {
73+
"locked": {
74+
"lastModified": 1675758091,
75+
"narHash": "sha256-7gFSQbSVAFUHtGCNHPF7mPc5CcqDk9M2+inlVPZSneg=",
76+
"owner": "NixOS",
77+
"repo": "nixpkgs",
78+
"rev": "747927516efcb5e31ba03b7ff32f61f6d47e7d87",
79+
"type": "github"
80+
},
81+
"original": {
82+
"owner": "NixOS",
83+
"ref": "nixpkgs-unstable",
84+
"repo": "nixpkgs",
85+
"type": "github"
86+
}
87+
},
88+
"nixpkgs-stable": {
89+
"locked": {
90+
"lastModified": 1673800717,
91+
"narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=",
92+
"owner": "NixOS",
93+
"repo": "nixpkgs",
94+
"rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f",
95+
"type": "github"
96+
},
97+
"original": {
98+
"owner": "NixOS",
99+
"ref": "nixos-22.11",
100+
"repo": "nixpkgs",
101+
"type": "github"
102+
}
103+
},
104+
"nixpkgs_2": {
105+
"locked": {
106+
"lastModified": 1671271357,
107+
"narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=",
108+
"owner": "NixOS",
109+
"repo": "nixpkgs",
110+
"rev": "40f79f003b6377bd2f4ed4027dde1f8f922995dd",
111+
"type": "github"
112+
},
113+
"original": {
114+
"owner": "NixOS",
115+
"ref": "nixos-unstable",
116+
"repo": "nixpkgs",
117+
"type": "github"
118+
}
119+
},
120+
"pre-commit-hooks": {
121+
"inputs": {
122+
"flake-compat": "flake-compat",
123+
"flake-utils": "flake-utils",
124+
"gitignore": "gitignore",
125+
"nixpkgs": "nixpkgs_2",
126+
"nixpkgs-stable": "nixpkgs-stable"
127+
},
128+
"locked": {
129+
"lastModified": 1675688762,
130+
"narHash": "sha256-oit/SxMk0B380ASuztBGQLe8TttO1GJiXF8aZY9AYEc=",
131+
"owner": "cachix",
132+
"repo": "pre-commit-hooks.nix",
133+
"rev": "ab608394886fb04b8a5df3cb0bab2598400e3634",
134+
"type": "github"
135+
},
136+
"original": {
137+
"owner": "cachix",
138+
"repo": "pre-commit-hooks.nix",
139+
"type": "github"
140+
}
141+
},
142+
"root": {
143+
"inputs": {
144+
"devenv": "devenv",
145+
"nixpkgs": "nixpkgs",
146+
"pre-commit-hooks": "pre-commit-hooks"
147+
}
148+
}
149+
},
150+
"root": "root",
151+
"version": 7
152+
}

devenv.nix

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{ pkgs, ... }:
2+
3+
{
4+
5+
# https://devenv.sh/packages/
6+
packages = [ pkgs.git ];
7+
8+
# https://devenv.sh/languages/
9+
languages.nix.enable = true;
10+
languages.php.enable = true;
11+
languages.php.package = pkgs.php80;
12+
13+
# https://devenv.sh/basics/
14+
env.PROJECT_NAME = "openfeature-php-sdk";
15+
16+
# https://devenv.sh/scripts/
17+
scripts.hello.exec = "echo $ Started devenv shell in $PROJECT_NAME";
18+
19+
enterShell = ''
20+
hello
21+
echo
22+
git --version
23+
php --version
24+
echo
25+
26+
# optimization step -- files and directories that match entries
27+
# in the .gitignore will still be traversed, and the .devenv
28+
# directory contains over 5000 files and 121MB.
29+
if ! grep -E "excludesfile.+\.gitignore" .git/config &>/dev/null
30+
then
31+
git config --local core.excludesfile .gitignore
32+
fi
33+
'';
34+
35+
## https://devenv.sh/pre-commit-hooks/
36+
pre-commit.hooks = {
37+
# # general formatting
38+
# prettier.enable = true;
39+
# github actions
40+
actionlint.enable = true;
41+
# nix
42+
deadnix.enable = true;
43+
nixfmt.enable = true;
44+
# php
45+
# phpcbf.enable = true;
46+
# # ensure Markdown code is executable
47+
# mdsh.enable = true;
48+
};
49+
50+
# https://devenv.sh/processes/
51+
# processes.ping.exec = "ping example.com";
52+
}

devenv.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
inputs:
2+
nixpkgs:
3+
url: github:NixOS/nixpkgs/nixpkgs-unstable
4+
pre-commit-hooks:
5+
url: github:cachix/pre-commit-hooks.nix

hooks/DDTrace/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![a](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
44
[![Latest Stable Version](http://poser.pugx.org/open-feature/dd-trace-hook/v)](https://packagist.org/packages/open-feature/dd-trace-hook)
55
[![Total Downloads](http://poser.pugx.org/open-feature/dd-trace-hook/downloads)](https://packagist.org/packages/open-feature/dd-trace-hook)
6-
![PHP 7.4+](https://img.shields.io/badge/php->=7.4-blue.svg)
6+
![PHP 8.0+](https://img.shields.io/badge/php->=8.0-blue.svg)
77
[![License](http://poser.pugx.org/open-feature/dd-trace-hook/license)](https://packagist.org/packages/open-feature/dd-trace-hook)
88

99
## Overview
@@ -47,7 +47,7 @@ For more examples, see the [examples](./examples/).
4747

4848
### PHP Versioning
4949

50-
This library targets PHP version 7.4 and newer. As long as you have any compatible version of PHP on your system you should be able to utilize the OpenFeature SDK.
50+
This library targets PHP version 8.0 and newer. As long as you have any compatible version of PHP on your system you should be able to utilize the OpenFeature SDK.
5151

5252
This package also has a `.tool-versions` file for use with PHP version managers like `asdf`.
5353

0 commit comments

Comments
 (0)