Skip to content

Commit

Permalink
Require PHP 8.1+ (wait for PeachySQL 7 release)
Browse files Browse the repository at this point in the history
  • Loading branch information
theodorejb committed Oct 7, 2024
1 parent 8fa0212 commit e2b2a76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
}
],
"require": {
"php": ">=7.4",
"php": ">=8.1",
"ext-json": "*",
"psr/http-message": "^1.1 || ^2.0",
"shrikeh/teapot": "^2.3.1",
"theodorejb/peachy-sql": "^6.3"
"theodorejb/peachy-sql": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^10.5",
"psalm/plugin-phpunit": "^0.19",
"vimeo/psalm": "^5.26"
},
Expand Down
8 changes: 2 additions & 6 deletions src/Entities.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,7 @@ public function deleteByIds(array $ids): int
}
}

/**
* @param int|string $id
*/
public function updateById($id, array $data): int
public function updateById(int|string $id, array $data): int
{
$row = Helpers::allPropertiesToColumns($this->map, $this->processValues($data, [$id]));
$row = $this->processRow($row, [$id]);
Expand Down Expand Up @@ -307,10 +304,9 @@ private function properException(SqlException $e): \Exception
}

/**
* @param int|string $id
* @param string[] $fields
*/
public function getEntityById($id, array $fields = []): array
public function getEntityById(int|string $id, array $fields = []): array
{
$entities = $this->getEntitiesByIds([$id], $fields);

Expand Down

0 comments on commit e2b2a76

Please sign in to comment.