Skip to content

Commit

Permalink
drop 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach committed Jun 11, 2024
1 parent 1513982 commit f4067e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.3, 8.2, 8.1]
php: [8.3, 8.2]
laravel: [11.*, 10.*]
stability: [prefer-lowest, prefer-stable]
carbon: [^2.63]
Expand All @@ -26,9 +26,6 @@ jobs:
testbench: 8.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 11.*
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand Down
7 changes: 4 additions & 3 deletions src/Config/BackupConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

namespace Spatie\Backup\Config;

use Spatie\Backup\Exceptions\InvalidConfig;
use Spatie\Backup\Support\Data;

class BackupConfig extends Data
{
/**
* @param positive-int $tries
*/
protected function __construct(
public string $name,
public SourceConfig $source,
Expand All @@ -24,6 +22,9 @@ protected function __construct(
public int $retryDelay,
public ?MonitoredBackupsConfig $monitoredBackups,
) {
if ($this->tries < 1) {
throw InvalidConfig::integerMustBePositive('tries');
}
}

/** @param array<mixed> $data */
Expand Down
5 changes: 5 additions & 0 deletions src/Exceptions/InvalidConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ public static function missingSender(): static
{
return new static('No sender email address specified.');
}

public static function integerMustBePositive(string $name): static
{
return new static("`{$name}` must be a positive number.");
}
}

0 comments on commit f4067e0

Please sign in to comment.