Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/php-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php-ver: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
php-ver: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
steps:
- name: Checkout
uses: actions/checkout@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/php-sa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php-ver: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
composer-ver: [ '~2.3.0', '^2' ]
php-ver: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
composer-ver: [ '~2.7.0', '^2' ]

steps:
- name: Checkout
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/php-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ jobs:
strategy:
fail-fast: false
matrix:
php-ver: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
composer-ver: [ '~2.3.0', '~2.4.0', '~2.5.0', '~2.6.0', '~2.7.0', '~2.8.0' ]
php-ver: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
composer-ver: [ '~2.7.0', '~2.8.0', '~2.9.0' ]
exclude:
- php-ver: '8.4'
composer-ver: '~2.3.0'

steps:
- name: Update "USE_COVERAGE" env var based on matrix
Expand Down
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@ WP Starter is the easiest and fastest way to bootstrap WordPress sites entirely
# System Requirements

- PHP 7.4+
- [Composer](https://getcomposer.org/) 2.3+
- [Composer](https://getcomposer.org/) 2.7+

## Composer - PHP Support Table

| Composer ↓ / PHP → | 7.4 | 8.0 | 8.1 | 8.2 | 8.3 | 8.4 |
|:------------------:|:---:|:---:|:---:|:---:|:---:|:---:|
| 2.3 | ✔ | ✔ | ✔ | ✔ | ✔ | - |
| 2.4 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| 2.5 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| 2.6 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| 2.7 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| 2.8 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Composer ↓ / PHP → | 7.4 | 8.0 | 8.1 | 8.2 | 8.3 | 8.4 | 8.5 |
|:------------------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| 2.7 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| 2.8 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| 2.9 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |

This table shows what versions the package is tested for (in CI, not necessarily in real world).
It _might_ work with other combinations. The combinations explicitly marked as non-supported are
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"source": "https://github.com/wecodemore/wpstarter"
},
"require": {
"php": ">=7.4 < 8.5",
"php": ">=7.4",
"ext-curl": "*",
"ext-dom": "*",
"ext-filter": "*",
Expand Down
6 changes: 3 additions & 3 deletions src/Step/Steps.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ public function name(): string
public function addStep(Step $step, Step ...$steps): Steps
{
if (!$this->running || ($this->runningScripts === 'pre')) {
$this->steps->attach($step);
$this->steps->offsetSet($step);
foreach ($steps as $aStep) {
$this->steps->attach($aStep);
$this->steps->offsetSet($aStep);
}
}

Expand Down Expand Up @@ -251,7 +251,7 @@ private function runStep(Step $step, Config $config, Io $io, Paths $paths): bool
$storage = new \SplObjectStorage();
$this->postProcessSteps = $storage;
}
$this->postProcessSteps->attach($step);
$this->postProcessSteps->offsetSet($step);
}

if (!$this->shouldProcess($step, $paths, $io)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Util/DbChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function check(): void

if (!$success || ($db->connect_errno > 0)) {
$this->setupEnv(false, false, false);
is_resource($db) and \mysqli_close($db);
($db instanceof \mysqli) and \mysqli_close($db);

return;
}
Expand All @@ -101,7 +101,7 @@ public function check(): void
} catch (\Throwable $exception) {
$this->write($exception->getMessage());
} finally {
is_resource($db) and @\mysqli_close($db);
($db instanceof \mysqli) and @\mysqli_close($db);
}

$this->setupEnv(true, $dbExists, $wpInstalled);
Expand Down
6 changes: 6 additions & 0 deletions src/Util/Paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ public function offsetGet($offset): string
*/
public function offsetSet($offset, $value): void
{
if (!is_string($offset)) {
throw new \InvalidArgumentException(
sprintf('%s offset must be a string, %s given.', __CLASS__, gettype($offset))
);
}

if ($this->offsetExists($offset)) {
throw new \BadMethodCallException(
sprintf(
Expand Down