Skip to content

Commit

Permalink
drop support for php <8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
head1328 committed Apr 26, 2023
1 parent 1255eb4 commit 3fc60dc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.2, 7.3, 7.4, 8.0, 8.1]
php: [8.1, 8.2]
steps:
- uses: actions/checkout@v1
- uses: shivammathur/setup-php@v2
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
}
},
"require": {
"php": ">=7.0",
"composer-plugin-api": "^1.0 || ^2.0",
"symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
"symfony/filesystem": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
"symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0"
"php": ">=8.1",
"composer-plugin-api": "^2.3",
"symfony/console": "^6.2",
"symfony/filesystem": "^6.2",
"symfony/process": "^6.2"
},
"require-dev": {
"composer/composer": "^2.4.2",
"phpspec/phpspec": "^6.3 || ^7.0"
"composer/composer": "^2.5",
"phpspec/phpspec": "^7.4"
},
"replace": {
"franzliedke/studio": "self.version"
Expand Down
2 changes: 1 addition & 1 deletion src/Creator/SkeletonCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function create()

protected function installParts()
{
$config = new \stdClass();
$config = (object)[];

foreach ($this->parts as $part) {
$part->setupPackage($config, $this->directory);
Expand Down
2 changes: 1 addition & 1 deletion src/Parts/Composer/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function setupPackage($composer, Directory $target)
// Normalize and store the namespace
$namespace = str_replace('/', '\\', $namespace);
$namespace = rtrim($namespace, '\\');
@$composer->autoload->{'psr-4'}->{"$namespace\\"} = 'src/';
$composer->autoload = (object)['psr-4' => (object)["$namespace\\" => 'src/']];

// Create an example file
$this->copyTo(
Expand Down
2 changes: 1 addition & 1 deletion src/Parts/PhpSpec/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Part extends AbstractPart
public function setupPackage($composer, Directory $target)
{
if ($this->input->confirm('Do you want to set up PhpSpec as a testing tool?')) {
$composer->{'require-dev'}['phpspec/phpspec'] = '^4.0';
$composer->{'require-dev'}['phpspec/phpspec'] = '^7.4';

$psr4Autoloading = (array) $composer->autoload->{'psr-4'};
$namespace = key($psr4Autoloading).'Tests';
Expand Down
4 changes: 2 additions & 2 deletions src/Parts/PhpUnit/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class Part extends AbstractPart
public function setupPackage($composer, Directory $target)
{
if ($this->input->confirm('Do you want to set up PhpUnit as a testing tool?')) {
$composer->{'require-dev'}['phpunit/phpunit'] = '^6.3';
$composer->{'require-dev'}['phpunit/phpunit'] = '^9.6 || ^10';

// Add autoloading rules for tests
$psr4Autoloading = (array) $composer->autoload->{'psr-4'};
$namespace = key($psr4Autoloading).'Tests';

@$composer->{'autoload-dev'}->{'psr-4'}->{"$namespace\\"} = 'tests/';
$composer->{'autoload-dev'} = (object)['psr-4' => (object)["$namespace\\" => 'tests/']];

// Create an example test file
$this->copyTo(
Expand Down

0 comments on commit 3fc60dc

Please sign in to comment.