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
26 changes: 9 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ 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:
- 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
Expand All @@ -24,24 +27,13 @@ jobs:
php-version: ${{ matrix.php-version }}
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-
extensions: mbstring, pdo, pdo_sqlite, pdo_pgsql, pdo_sqlsrv, pdo_mysql

- name: Install dependencies with composer
if: matrix.php-version != '8.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Validate composer.json and composer.lock
run: composer validate --ansi --strict

- 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
- name: Install dependencies with composer
uses: ramsey/composer-install@v3

- name: Execute Tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
3 changes: 0 additions & 3 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@
</InvalidClassConstantType>
</file>
<file src="src/Annotation/Relation/Relation.php">
<MixedInferredReturnType>
<code><![CDATA[non-empty-string]]></code>
</MixedInferredReturnType>
<MixedReturnStatement>
<code><![CDATA[static::TYPE]]></code>
</MixedReturnStatement>
Expand Down
4 changes: 4 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
</ignoreFiles>
</projectFiles>
<issueHandlers>
<PossiblyUnusedMethod errorLevel="suppress"/>
<ClassMustBeFinal errorLevel="suppress"/>
<UnusedClass errorLevel="suppress"/>
<MissingOverrideAttribute errorLevel="suppress"/>
<MissingClassConstType errorLevel="suppress"/>
<UndefinedAttributeClass>
<errorLevel type="suppress">
Expand Down
13 changes: 13 additions & 0 deletions resources/orm.meta-storm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta-storm xmlns="meta-storm">
<definitions>
<!-- ORM Interface -->
<classMethod class="\Cycle\ORM\Service\EntityFactoryInterface" method="make" argument="1" targetInArray="key" targetValue="false">
<properties xpath="$argument[0]">
<filters>
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
</filters>
</properties>
</classMethod>
</definitions>
</meta-storm>
6 changes: 6 additions & 0 deletions src/Annotation/GeneratedValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down
1 change: 1 addition & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
database: 'tempdb',
host: '127.0.0.1',
port: 11433,
trustServerCertificate: true,
user: 'SA',
password: 'YourStrong!Passw0rd',
),
Expand Down
Loading