Skip to content

2.x#2

Merged
muhammetsafak merged 4 commits into
masterfrom
2.x
May 24, 2026
Merged

2.x#2
muhammetsafak merged 4 commits into
masterfrom
2.x

Conversation

@muhammetsafak
Copy link
Copy Markdown
Member

Özet / Summary

Etkilenen paket / Affected package

  • initorm/query-builder
  • initorm/dbal
  • initorm/database
  • initorm/orm

Değişiklik türü / Type of change

  • Hata düzeltmesi / Bug fix
  • Yeni özellik / New feature
  • Geriye dönük uyumsuz değişiklik / Breaking change
  • Dokümantasyon / Documentation
  • Refactor — kullanıcıya görünür değişiklik yok / no user-visible change

İlgili konu / Related issues

Bağımlılık zinciri etkisi / Dependency chain impact

  • Bu değişiklik yalnızca bu paketi etkiler / This change only affects this package
  • Bağımlı paketlerde takip PR'ı açıldı / Follow-up PR opened in dependent package(s): link

Test / Tests

  • php vendor/bin/phpunit yerel olarak çalıştırıldı / ran locally
  • Yeni davranış için test eklendi / Added tests for new behavior
  • Bu paket test suite barındırmıyor — manuel test edildi / This package has no test suite — tested manually

Kontrol listesi / Checklist

  • PSR-12 kod stiline uygun / Code follows PSR-12
  • Public API PHPDoc güncel / Public API PHPDoc is up to date
  • Facade\DB etkilendiyse @method static notları güncellendi / @method static annotations updated if Facade\DB is affected
  • CONTRIBUTING okundu / read

Notlar / Additional notes

Quality push for the 2.0 line. Full diff is documented in CHANGELOG.md.

Bugs

- B1/B7  andWhereNotIn now produces NOT IN (was IN).
- B2     orLike/andLike connector swap fixed.
- B3     orBetween parameter order fixed.
- B4     RawQuery::set() Closure branch was dead — Closure now imported.
- B5/B6  selfJoin/naturalJoin signatures aligned with implementation.
- B8     preg_match() default-branch null-matches guard.
- B9     where() operator type coercion before trim().
- B16    startLike/endLike wildcard semantics fixed (start='val%', end='%val').
- B20/B21 UPDATE exception message corrected.
- B23    Abstract test bases now actually abstract.
- B26    BucketCompiler joins AND/OR buckets with ' OR ' (was ' AND ',
         silently collapsing top-level orWhere() chains to AND).
- B27    in_array() strict-mode so booleans don't loose-match operators.
- B28    FIND_IN_SET parameterization was inverted — raw user strings were
         being inlined as literal SQL. Latent injection vector; fixed.

Architecture

- Drivers: BaseDriver -> AbstractDriver; MySQL/PgSQL/SQLite -> MySqlDriver/
  PostgreSqlDriver/SqliteDriver; new GenericDriver. DriverInterface API:
  escapeIdentify(&) -> escapeIdentifier() and getDriver() -> getName().
- QueryBuilder split: the 1505-line god class becomes 6 clause traits
  (Structure / From / Select / Join / Where / Set), 7 compilers
  (Select/Insert/BatchInsert/Update/BatchUpdate/Delete + Abstract),
  plus Operators / SqlValueDetector / BucketCompiler helpers.
- Interface ↔ impl type contracts realigned (mixed , static
  returns, group()  parameter declared).
- QueryBuilder::__clone deep-clones the parameter bag.

Tooling and CI

- PHP requirement: 8.0 -> 8.1; PHP 8.4 implicit-nullable deprecations
  resolved.
- phpcs.xml (PSR-12, 120-char soft cap), phpstan.neon (level 6).
- composer scripts: test, cs, cs-ci, cs-fix, stan, qa.
- .github/workflows: phpunit (PHP 8.1-8.4 matrix with pcov), phpcs,
  phpstan, composer-validate; dependabot weekly.

Tests and coverage

- 62 baseline tests -> 299 tests / 399 assertions.
- Line coverage 97.28 % (Clover: 100 % methods covered).
- New regression suites: BugfixRegressionTest, WhereOperatorsTest,
  BetweenInLikeTest, SubQueryTest, CrudEdgeCasesTest, ParametersTest,
  RawQueryTest, DriversTest, FactoryAndStructureTest, SelectHelpersTest,
  QueryBuilderBehaviorTest.

Documentation

- README.md rewritten: badges, requirements, install, quick start,
  features, supported drivers, contributing/security pointers.
- CHANGELOG.md (Keep-a-Changelog) with the full v2.0.0 entry.
- docs/en/ (13 chapters, ~2 750 lines) with runnable examples and the
  generated SQL inline.
- Security hardening: identifier validation (V3), LIKE wildcard escape (V4),
  placeholder regex tightening (V6).
- Architecture refactor: clause traits + dedicated compilers; driver renames
  with breaking DriverInterface changes.
- PHP requirement raised to 8.1.
- Test suite: 62 -> 324 tests; line coverage 97.52 %.
- New CI (PHPUnit 8.1-8.4 / PHPStan level 6 / PSR-12), 14-chapter docs/en/.
@muhammetsafak muhammetsafak merged commit 08dfacf into master May 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant