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
10 changes: 6 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ jobs:
# PHP 8.3
- {php-version: "8.3", os: ubuntu-latest, dependencies: highest}
- {php-version: "8.3", os: ubuntu-latest, dependencies: lowest}
# PHP 8.4 (current stable)
# aura/sql 5.x (lowest) is skipped on PHP 8.4: PDO::connect() static/non-static conflict (upstream bug)
- {php-version: "8.4", os: windows-latest, dependencies: highest}
- {php-version: "8.4", os: ubuntu-latest, dependencies: highest}
# PHP 8.4
# aura/sql 5.x (lowest) is skipped on PHP 8.4+: PDO::connect() static/non-static conflict (upstream bug)
- {php-version: "8.4", os: ubuntu-latest, dependencies: highest}
# PHP 8.5
- {php-version: "8.5", os: windows-latest, dependencies: highest}
- {php-version: "8.5", os: ubuntu-latest, dependencies: highest}

steps:
- name: Disable autocrlf on Windows
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
sa:
uses: ray-di/.github/.github/workflows/static-analysis.yml@v1
with:
php_version: 8.4
php_version: 8.5
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.11.1] - 2026-03-03

### Added
- PHP 8.5 support

### Removed
- `koriym/param-reader` dependency — replaced with native `ReflectionParameter::getAttributes()`

## [0.11.0] - 2026-03-01

### Added
- PHP 8.2, 8.3, and 8.4 support

### Changed
- **Require PHP ^8.2** — dropped PHP 8.1 (EOL December 2024)
- Replaced `doctrine/annotations` with native PHP 8 Attributes for all annotation classes
- Upgraded `vimeo/psalm` to v6
- Tightened `ray/di` constraint to `^2.20` (parameter-level `#[Named]` requires 2.20+)
- Upgraded `aura/sql` constraint to `^5.0.3 | ^6.0`

### Removed
- `doctrine/annotations` dependency

## [0.10.0] - 2024-12-18

### Added
- PHP 8.4 support
- Fix SQL with comments can be executed ([#33](https://github.com/ray-di/Ray.QueryModule/pull/33))

### Changed
- Refactored type annotations for query result handling
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"aura/sql": "^5.0.3 | ^6.0",
"bear/resource": "^1.15",
"guzzlehttp/guzzle": "^6.3 || ^7.0",
"koriym/param-reader": "^1.0",
"koriym/query-locator": "^1.4",
"nikic/php-parser": "^v4.13",
"ray/aop": "^2.10.3",
Expand Down
20 changes: 5 additions & 15 deletions src/SqlFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Ray\Query;

use Koriym\ParamReader\ParamReaderInterface;
use Ray\Query\Annotation\Sql;
use Ray\Query\Exception\SqlFileNotFoundException;
use Ray\Query\Exception\SqlNotAnnotatedException;
Expand All @@ -17,29 +16,20 @@
/** @psalm-api */
final class SqlFinder
{
/** @var ParamReaderInterface<object> */
private $reader;

/** @var SqlDir */
private $sqlDir;

/** @param ParamReaderInterface<object> $reader */
public function __construct(
ParamReaderInterface $reader,
SqlDir $sqlDir
private readonly SqlDir $sqlDir,
) {
$this->reader = $reader;
$this->sqlDir = $sqlDir;
}

public function __invoke(ReflectionParameter $param): string
{
/** @var ?Sql $sqlAnnotation */
$sqlAnnotation = $this->reader->getParametrAnnotation($param, Sql::class);
if ($sqlAnnotation === null) {
$attrs = $param->getAttributes(Sql::class);
if ($attrs === []) {
throw new SqlNotAnnotatedException((string) $param);
}

$sqlAnnotation = $attrs[0]->newInstance();

$file = sprintf('%s/%s.sql', $this->sqlDir->value, $sqlAnnotation->sql);
if (! file_exists($file)) {
$msg = sprintf('%s:%s', (string) $param, $file);
Expand Down
3 changes: 0 additions & 3 deletions src/SqlQueryProviderModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Ray\Query;

use Koriym\ParamReader\ParamReader;
use Koriym\ParamReader\ParamReaderInterface;
use Ray\Di\AbstractModule;
use Ray\Di\Scope;

Expand All @@ -23,7 +21,6 @@ public function __construct(?AbstractModule $module = null)
protected function configure()
{
$this->bind(SqlFinder::class)->in(Scope::SINGLETON);
$this->bind(ParamReaderInterface::class)->to(ParamReader::class)->in(Scope::SINGLETON);
$this->bind(RowInterface::class)->toProvider(RowInterfaceProvider::class)->in(Scope::SINGLETON);
$this->bind(RowListInterface::class)->toProvider(RowListInterfaceProvider::class)->in(Scope::SINGLETON);
$this->bind(InvokeInterface::class)->toProvider(RowListInterfaceProvider::class)->in(Scope::SINGLETON);
Expand Down
Loading