Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to PHP8 versions of dependencies #1518

Closed
wants to merge 88 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
d3cd34c
Upgrade Guzzle and Platform.sh client library
pjcdawkins Nov 25, 2024
a72e505
Upgrade Symfony dependencies from v3 to v7
pjcdawkins Nov 26, 2024
af2b52e
Migrate command config to attributes
pjcdawkins Nov 26, 2024
403fab0
Fix running shell process with a string
pjcdawkins Nov 26, 2024
734b7fb
WIP: autowired/compiled service container
pjcdawkins Nov 26, 2024
309d1d7
WIP: Refactor CommandBase code to services
pjcdawkins Nov 29, 2024
40fc5eb
Add new rector rule for DI and other sets
pjcdawkins Dec 2, 2024
705a8a6
Apply rector rules for PHP upgrade and DI
pjcdawkins Dec 2, 2024
8f157a1
Fix Selector, and fix welcome commands
pjcdawkins Dec 2, 2024
a86ab77
Remove redundant var tags
pjcdawkins Dec 2, 2024
afd0bd2
Write Rector rule for new services
pjcdawkins Dec 2, 2024
a9e2ee6
Apply Rector rule for new services
pjcdawkins Dec 3, 2024
fc025d5
Re-apply Rector and add some manual fixes
pjcdawkins Dec 2, 2024
4aec0e5
Fix selectEnvironment() config usage
pjcdawkins Dec 3, 2024
642c452
Manual fixes for undefined $selection and other selector errors
pjcdawkins Dec 3, 2024
e597071
Manually fix completion command
pjcdawkins Dec 3, 2024
efed2c8
Handle new login methods via Rector
pjcdawkins Dec 3, 2024
1a2339f
Run Rector again for selector fixes
pjcdawkins Dec 3, 2024
5f215e8
More manual fixes for the selector
pjcdawkins Dec 3, 2024
24d2b5c
Fix user command dependencies with new AccessApi service
pjcdawkins Dec 3, 2024
9ddbd39
Fix variable command dependencies with new VariableCommandUtil service
pjcdawkins Dec 3, 2024
949eaf9
Fix currentEnvironment property type in env list command
pjcdawkins Dec 3, 2024
fba2522
Fix auto login
pjcdawkins Dec 3, 2024
5279589
Fix loading a host from selection
pjcdawkins Dec 3, 2024
05b58d0
Make services private by default
pjcdawkins Dec 3, 2024
c9f53d9
Update Box config
pjcdawkins Dec 3, 2024
b8df15c
Fix multi command
pjcdawkins Dec 3, 2024
99df173
Restore options to metrics commands
pjcdawkins Dec 3, 2024
f1c6aba
Restore project option to two commands
pjcdawkins Dec 3, 2024
23089d5
Remove unused selector method
pjcdawkins Dec 3, 2024
67a3fd9
Ensure the same config is passed to all commands
pjcdawkins Dec 4, 2024
854e9d1
Fix --quiet behavior
pjcdawkins Dec 4, 2024
27b4dcb
Fix PhpUnit tests
pjcdawkins Dec 4, 2024
37a5cac
Use config from service for help and list commands
pjcdawkins Dec 4, 2024
cd2ae84
Fix commands not being hidden
pjcdawkins Dec 4, 2024
1c3685c
Add missing project options
pjcdawkins Dec 4, 2024
a81f546
Exclude Rector files from Phar build
pjcdawkins Dec 4, 2024
cab9878
Warm container cache during build
pjcdawkins Dec 4, 2024
bfcf883
Remove unused imports
pjcdawkins Dec 4, 2024
bb8b23d
Mark --host option deprecated again
pjcdawkins Dec 5, 2024
32a301a
Restore missing --bytes and --tmp options to disk command
pjcdawkins Dec 5, 2024
7678067
Remove Application as a service
pjcdawkins Dec 5, 2024
9ac3221
Fix inclusion of default options in help
pjcdawkins Dec 5, 2024
4b6f75a
Fix dynamic disabling of lazy-loaded commands
pjcdawkins Dec 5, 2024
fd4c8b7
Fix -h option and refactor command descriptors
pjcdawkins Dec 6, 2024
e03b0bc
Use CountryService
pjcdawkins Dec 9, 2024
a947502
Update box from v3 to v4
pjcdawkins Dec 9, 2024
3a62d89
Install giggsey/libphonenumber-for-php-lite
pjcdawkins Dec 9, 2024
afed8cc
Fix phpstan-identified errors to level 1
pjcdawkins Dec 16, 2024
4827bd9
Fix some phpstan level 2 errors
pjcdawkins Dec 16, 2024
c58cf7e
Fix phpstan level 3 errors
pjcdawkins Dec 17, 2024
106575b
Fix some phpstan level 4 errors
pjcdawkins Dec 17, 2024
5afac3a
Fix some phpstan level 5 errors
pjcdawkins Dec 17, 2024
73779b5
Add type hints to most code
pjcdawkins Dec 17, 2024
2bde8e6
Fix auto exit after subcommand
pjcdawkins Dec 17, 2024
9b2c322
Use Symfony built-in autocompletion
pjcdawkins Dec 17, 2024
5986121
Update Symfony from 7.1 to 7.2
pjcdawkins Dec 17, 2024
f4b40de
Remove unused guzzlehttp/ringphp dependency
pjcdawkins Dec 18, 2024
c342732
Remove unnecessary paragonie/random_compat dependency
pjcdawkins Dec 18, 2024
7f3aff6
Remove unnecessary PHP <8.1 condition
pjcdawkins Dec 18, 2024
96c8fd4
Skip cache for Go tests by default
pjcdawkins Dec 18, 2024
27819fd
Add Config::getStr()
pjcdawkins Dec 18, 2024
6cc8083
Add Rector rule to remove unnecessary service variables
pjcdawkins Dec 18, 2024
f870add
Apply Rector rule to remove unnecessary service variables
pjcdawkins Dec 18, 2024
df9e183
Remove straggling unnecessary service variables
pjcdawkins Dec 18, 2024
52909fb
Clarify Activity type
pjcdawkins Dec 18, 2024
d39d408
Clarify getCurrentDeployment type
pjcdawkins Dec 18, 2024
141a30c
Clarify table header and default columns types
pjcdawkins Dec 18, 2024
ef33b63
Fix inactive environment handling in ssh command
pjcdawkins Dec 18, 2024
807ad3d
Refactor tunnels
pjcdawkins Dec 21, 2024
1109fba
Fix some phpstan level 7 errors
pjcdawkins Dec 18, 2024
f5040c6
Apply php-cs-fixer with default PSR12 ruleset
pjcdawkins Dec 23, 2024
5c87b50
Generate container when needed for linting
pjcdawkins Dec 23, 2024
2444076
Apply php-cs-fixer to other files
pjcdawkins Dec 23, 2024
85a9098
Apply PER coding standard
pjcdawkins Dec 23, 2024
f569845
Apply PHP84Migration ruleset
pjcdawkins Dec 23, 2024
b2b3c68
Apply PHPStan to files other than src and tests
pjcdawkins Dec 23, 2024
d0eadb7
Fix typo in sync command description
pjcdawkins Dec 23, 2024
e4496c1
Declare strict_types everywhere
pjcdawkins Dec 23, 2024
d644ec8
Fix assumption of true on no output from executing a command
pjcdawkins Dec 23, 2024
fde6f54
Various type fixes
pjcdawkins Dec 23, 2024
143d510
Type fixes in repo commands
pjcdawkins Dec 23, 2024
67422f6
Type fix in variable:list command
pjcdawkins Dec 23, 2024
3d633f4
Restore command examples in help
pjcdawkins Dec 23, 2024
efd8bbd
Remove more unnecessary variables
pjcdawkins Dec 24, 2024
b2cf200
Fix type issue in Git service
pjcdawkins Dec 24, 2024
c96a639
Fix activity command bugs shown in Go tests
pjcdawkins Dec 25, 2024
461ac1f
Fix creating a project variable without a selected env
pjcdawkins Dec 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 9 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = true

[*.yaml]
indent_size = 2

Expand All @@ -22,3 +19,12 @@ indent_size = 2

[*.go]
indent_style = tab

[*.json]
indent_size = 2

[composer.json]
indent_size = 4

[*.neon]
indent_style = tab
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
CI_COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | head -c8)
./bin/platform self:build --no-composer-rebuild --yes --replace-version "$CI_COMMIT_REF_NAME"-"$CI_COMMIT_SHORT_SHA" --output platform.phar

- name: Lint PHP files
run: make lint-php-cs-fixer lint-phpstan

- name: Run PHPUnit tests
run: |
composer install --no-interaction --no-scripts
Expand All @@ -55,6 +58,9 @@ jobs:
go-version: 1.22
cache-dependency-path: cli/go.sum

- name: Lint Go files
run: make lint-gofmt

- name: Run integration tests
run: |
export TEST_CLI_PATH=$(realpath "./platform.phar")
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/release-changelog*.md
/local-php-security-checker
/.phpunit.result.cache
/.phpunit.cache
/.php-cs-fixer.cache
18 changes: 18 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->notPath([
'config/cache/container.php', // Ignore generated file
'dist/installer.php', // Keep old PHP compatibility
'tests/data', // Ignore test data
])
;

return (new PhpCsFixer\Config())
->setRules([
'@PER-CS' => true,
'@PHP84Migration' => true,
])
->setFinder($finder)
;
Empty file removed .platform/services.yaml
Empty file.
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
GO_TESTS_DIR=go-tests

.PHONY: composer-dev
composer-dev:
composer install --no-interaction

.PHONY: clean
clean:
rm config/cache/container.php

.PHONY: lint-phpstan
lint-phpstan: composer-dev
./vendor/bin/phpstan analyse

.PHONY: lint-php-cs-fixer
lint-php-cs-fixer: composer-dev
./vendor/bin/php-cs-fixer check --config .php-cs-fixer.dist.php --diff

.PHONY: lint-gofmt
lint-gofmt:
cd $(GO_TESTS_DIR) && go fmt ./...

.PHONY: lint-golangci
lint-golangci:
command -v golangci-lint >/dev/null || go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
cd $(GO_TESTS_DIR) && golangci-lint run

.PHONY: lint
lint: lint-gofmt lint-golangci lint-php-cs-fixer lint-phpstan

.PHONY: test
test:
./vendor/bin/phpunit --exclude-group slow
cd $(GO_TESTS_DIR) && go test -v -count=1 ./...
11 changes: 7 additions & 4 deletions box.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
"chmod": "0755",
"directories": [
"bin",
"resources",
"src"
"config",
"resources"
],
"files": [
"config.yaml",
"config-defaults.yaml",
"constants.php",
"services.yaml",
"shell-config.tmpl.rc",
"shell-config-bash.tmpl.rc",
"shell-config-bash-direct.tmpl.rc",
Expand All @@ -18,6 +17,10 @@
"vendor/composer/ca-bundle/res/cacert.pem"
],
"finder": [
{
"in": "src",
"exclude": ["Rector"]
},
{
"in": "vendor",
"name": "*.php*",
Expand All @@ -33,7 +36,7 @@
],
"main": "bin/platform",
"output": "platform.phar",
"stub": "stub.php",
"stub": "resources/phar-stub.php",
"compactors": [
"KevinGH\\Box\\Compactor\\Json",
"KevinGH\\Box\\Compactor\\Php"
Expand Down
37 changes: 19 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,26 @@
"require": {
"php": ">=8.2",
"doctrine/cache": "~1.5",
"guzzlehttp/guzzle": "^5.3",
"guzzlehttp/ringphp": "^1.1",
"platformsh/console-form": ">=0.0.37 <2.0",
"platformsh/client": ">=0.87.0 <2.0",
"symfony/console": "^3.0 >=3.2",
"symfony/yaml": "^3.0 || ^2.6",
"symfony/finder": "^3.0",
"symfony/filesystem": "^3.0",
"symfony/process": "^3.0 >=3.4",
"stecman/symfony-console-completion": "^0.11",
"symfony/event-dispatcher": "^3.0",
"guzzlehttp/guzzle": "^7",
"platformsh/console-form": "^1@beta",
"platformsh/client": "^3@beta",
"symfony/console": "^7",
"symfony/yaml": "^7",
"symfony/finder": "^7",
"symfony/filesystem": "^7",
"symfony/process": "^7",
"symfony/event-dispatcher": "^7",
"padraic/phar-updater": "^1.0",
"symfony/dependency-injection": "^3.1",
"symfony/config": "^3.1",
"paragonie/random_compat": "^2.0",
"symfony/dependency-injection": "^7",
"symfony/config": "^7",
"ext-json": "*",
"composer/ca-bundle": "^1.3",
"khill/php-duration": "^1.1",
"giggsey/libphonenumber-for-php": "^8.13",
"symfony/polyfill-mbstring": "^1.19",
"symfony/polyfill-iconv": "^1.19",
"padraic/humbug_get_contents": "dev-allow-php-8 as 1.1.3"
"padraic/humbug_get_contents": "dev-allow-php-8 as 1.1.3",
"platformsh/oauth2": "^1@beta",
"giggsey/libphonenumber-for-php-lite": "^8.13"
},
"repositories": [
{
Expand All @@ -49,7 +47,9 @@
}
},
"require-dev": {
"phpunit/phpunit": "^11"
"phpunit/phpunit": "^11",
"rector/rector": "^1.2",
"friendsofphp/php-cs-fixer": "^3.65"
},
"authors": [
{
Expand All @@ -69,6 +69,7 @@
},
"scripts": {
"update-countries": "php scripts/update-countries.php",
"update-known-hosts": "php scripts/update-known-hosts.php"
"update-known-hosts": "php scripts/update-known-hosts.php",
"post-install-cmd": ["Platformsh\\Cli\\Application::warmCaches"]
}
}
Loading
Loading