From c4f27c0e983d9047f89d2cda22fd59f04e3b655b Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Sat, 10 May 2025 12:11:19 +0400 Subject: [PATCH 1/4] Add fields autocompletion for ORM::make --- resources/orm.meta-storm.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 resources/orm.meta-storm.xml diff --git a/resources/orm.meta-storm.xml b/resources/orm.meta-storm.xml new file mode 100644 index 00000000..14e068e7 --- /dev/null +++ b/resources/orm.meta-storm.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + From 6d780475c89706fb53367f994dbb2057d62effe8 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Sat, 10 May 2025 12:12:12 +0400 Subject: [PATCH 2/4] Comment `GeneratedValue` --- src/Annotation/GeneratedValue.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Annotation/GeneratedValue.php b/src/Annotation/GeneratedValue.php index 79785b56..d4524c2e 100644 --- a/src/Annotation/GeneratedValue.php +++ b/src/Annotation/GeneratedValue.php @@ -8,6 +8,12 @@ use Spiral\Attributes\NamedArgumentConstructor; /** + * Specifies that the field value is generated by the database or ORM. + * + * - before insert: the field is generated before the entity is inserted into the database on PHP side (e.g., UUIDs). + * - on insert: the field is generated by the database on insert (e.g., auto-increment). + * - before update: the field is generated before the entity is updated in the database on PHP side (e.g., `onUpdate`). + * * @Annotation * @NamedArgumentConstructor * @Target({"PROPERTY"}) From 3c7e382911ac779e84c82bc6daeeb5535758b76b Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Sat, 10 May 2025 12:18:36 +0400 Subject: [PATCH 3/4] Fix test workflow --- .github/workflows/main.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d89daf7f..4482218d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,10 @@ jobs: matrix: php-version: ['8.1', '8.2', '8.3', '8.4'] steps: + - name: Install ODBC driver. + run: | + sudo curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list + sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 - name: Checkout uses: actions/checkout@v2 - name: Setup DB services @@ -25,23 +29,9 @@ jobs: coverage: pcov tools: pecl extensions: mbstring, pdo, pdo_sqlite, pdo_pgsql, pdo_sqlsrv-5.11, pdo_mysql - - name: Get Composer Cache Directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Restore Composer Cache - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - name: Install dependencies with composer - if: matrix.php-version != '8.4' - run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - - - name: Install dependencies with composer php 8.4 - if: matrix.php-version == '8.4' - run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi + uses: ramsey/composer-install@v3 - name: Execute Tests run: | From 479935d4e0db801317d4259173a31bbb56141ce4 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Sat, 10 May 2025 12:23:02 +0400 Subject: [PATCH 4/4] Update psalm; fix CI --- .github/workflows/main.yml | 6 ++++-- composer.json | 2 +- psalm-baseline.xml | 3 --- psalm.xml | 4 ++++ tests/bootstrap.php | 1 + 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4482218d..f0fb671d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,6 @@ jobs: name: Test PHP ${{ matrix.php-version }} with Code Coverage runs-on: ubuntu-latest strategy: - fail-fast: false matrix: php-version: ['8.1', '8.2', '8.3', '8.4'] steps: @@ -28,7 +27,10 @@ jobs: php-version: ${{ matrix.php-version }} coverage: pcov tools: pecl - extensions: mbstring, pdo, pdo_sqlite, pdo_pgsql, pdo_sqlsrv-5.11, pdo_mysql + extensions: mbstring, pdo, pdo_sqlite, pdo_pgsql, pdo_sqlsrv, pdo_mysql + + - name: Validate composer.json and composer.lock + run: composer validate --ansi --strict - name: Install dependencies with composer uses: ramsey/composer-install@v3 diff --git a/composer.json b/composer.json index 3707ea55..9fd40ec9 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "require-dev": { "doctrine/annotations": "^1.14.3 || ^2.0.1", "phpunit/phpunit": "^10.1", - "vimeo/psalm": "^5.26", + "vimeo/psalm": "^5.26 || ^6.0", "spiral/code-style": "^2.2", "spiral/dumper": "^3.3" }, diff --git a/psalm-baseline.xml b/psalm-baseline.xml index c16bc32a..39f51773 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -121,9 +121,6 @@ - - - diff --git a/psalm.xml b/psalm.xml index 01d83cc0..3d332824 100644 --- a/psalm.xml +++ b/psalm.xml @@ -14,6 +14,10 @@ + + + + diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 951faf3d..eb42c44b 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -40,6 +40,7 @@ database: 'tempdb', host: '127.0.0.1', port: 11433, + trustServerCertificate: true, user: 'SA', password: 'YourStrong!Passw0rd', ),