Skip to content

Commit 18749c2

Browse files
authored
[Maintenance] Add missing attributes mapping to entities (#390)
| Q | A | --------------- | ----- | Branch? | 1.7 | Bug fix? | kinda | New feature? | no | Related tickets | -
2 parents 79c58cd + 0e7f490 commit 18749c2

4 files changed

Lines changed: 75 additions & 34 deletions

File tree

.github/workflows/build.yaml

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
matrix:
2222
php: ["8.3"]
2323
symfony: ["^5.4.21", "^6.4"]
24-
sylius: ["~1.13.0", "~1.14.0"]
24+
sylius: ["~1.14.0"]
2525
database: ["mysql", "postgres"]
2626
mysql: ["8.4"]
2727
postgres: ["15.8"]
@@ -30,7 +30,7 @@ jobs:
3030

3131
include:
3232
-
33-
php: "8.1"
33+
php: "8.3"
3434
symfony: "^6.4"
3535
sylius: "~1.14.0"
3636
database: "mysql"
@@ -39,7 +39,7 @@ jobs:
3939
wkhtmltopdf: "0.12.6-1"
4040
state_machine_adapter: "symfony_workflow"
4141
-
42-
php: "8.2"
42+
php: "8.3"
4343
symfony: "^6.4"
4444
sylius: "~1.14.0"
4545
database: "mysql"
@@ -48,7 +48,7 @@ jobs:
4848
wkhtmltopdf: "0.12.6-1"
4949
state_machine_adapter: "winzou_state_machine"
5050
-
51-
php: "8.2"
51+
php: "8.3"
5252
symfony: "^6.4"
5353
sylius: "~1.14.0"
5454
database: "mysql"
@@ -103,14 +103,6 @@ jobs:
103103
postgresql version: "${{ matrix.postgres }}"
104104
postgresql password: "postgres"
105105

106-
-
107-
name: Run Chrome Headless
108-
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &
109-
110-
-
111-
name: Run webserver
112-
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)
113-
114106
-
115107
name: Get Composer cache directory
116108
id: composer-cache
@@ -143,6 +135,53 @@ jobs:
143135
name: Install PHP dependencies
144136
run: composer install --no-interaction
145137

138+
- name: Run security checks
139+
run: |
140+
set -e
141+
142+
IGNORED=$(jq -r '.config.audit.ignore[]?' composer.json | sort || true)
143+
144+
if [ -n "$IGNORED" ]; then
145+
echo "Ignored CVEs:"
146+
echo "$IGNORED"
147+
echo
148+
fi
149+
150+
composer audit --no-interaction --abandoned=ignore --no-dev
151+
152+
symfony security:check --format=json > symfony-audit.json || true
153+
154+
FOUND=$(jq -r '.[]?.advisories[]?.cve? // empty' symfony-audit.json | sort | uniq)
155+
DIFF=$(comm -23 <(echo "$FOUND") <(echo "$IGNORED"))
156+
157+
if [ -n "$DIFF" ]; then
158+
echo "❌ New vulnerabilities found by Symfony security:check:"
159+
echo "$DIFF"
160+
exit 1
161+
else
162+
echo "✅ No new vulnerabilities found by Symfony security:check."
163+
fi
164+
165+
-
166+
name: Run ECS
167+
run: vendor/bin/ecs check
168+
169+
-
170+
name: Validate composer.json
171+
run: composer validate --ansi --strict
172+
173+
-
174+
name: Run analysis
175+
run: composer analyse
176+
177+
-
178+
name: Run PHPStan
179+
run: vendor/bin/phpstan analyse -c phpstan.neon.dist src/
180+
181+
-
182+
name: Run PHPSpec
183+
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
184+
146185
-
147186
name: Get Yarn cache directory
148187
id: yarn-cache
@@ -193,32 +232,16 @@ jobs:
193232
run: (cd tests/Application && bin/console sylius:fixtures:load -n)
194233

195234
-
196-
name: Run security check
197-
run: symfony security:check
198-
199-
-
200-
name: Run ECS
201-
run: vendor/bin/ecs check
202-
203-
-
204-
name: Validate composer.json
205-
run: composer validate --ansi --strict
206-
207-
-
208-
name: Run analysis
209-
run: composer analyse
210-
211-
-
212-
name: Run PHPStan
213-
run: vendor/bin/phpstan analyse -c phpstan.neon.dist src/
235+
name: Run PHPUnit
236+
run: vendor/bin/phpunit --colors=always
214237

215238
-
216-
name: Run PHPSpec
217-
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
239+
name: Run Chrome Headless
240+
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &
218241

219242
-
220-
name: Run PHPUnit
221-
run: vendor/bin/phpunit --colors=always
243+
name: Run webserver
244+
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)
222245

223246
-
224247
name: Run Behat

composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464
"symfony/flex": true,
6565
"symfony/thanks": false,
6666
"php-http/discovery": true
67+
},
68+
"audit": {
69+
"ignore": [
70+
"CVE-2025-31481",
71+
"CVE-2025-31485"
72+
]
6773
}
6874
},
6975
"conflict": {

etc/travis/Order.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
* @ORM\Entity
1212
* @ORM\Table(name="sylius_order")
1313
*/
14+
#[ORM\Entity]
15+
#[ORM\Table(name: 'sylius_order')]
1416
final class Order extends BaseOrder
1517
{
1618
/**
1719
* @var string
1820
*
1921
* @ORM\Column(type="string", nullable=true)
2022
*/
23+
#[ORM\Column(type: 'string', nullable: true)]
2124
private $test;
2225
}

src/Entity/PayPalCredentials.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,36 @@
2020
* @ORM\Entity
2121
* @ORM\Table(name="sylius_paypal_plugin_pay_pal_credentials")
2222
*/
23+
#[ORM\Entity]
24+
#[ORM\Table(name: 'sylius_paypal_plugin_pay_pal_credentials')]
2325
class PayPalCredentials implements PayPalCredentialsInterface
2426
{
2527
/**
2628
* @ORM\Id
2729
* @ORM\Column(type="string")
2830
*/
31+
#[ORM\Id]
32+
#[ORM\Column(type: 'string')]
2933
private string $id;
3034

3135
/**
3236
* @ORM\ManyToOne(targetEntity="Sylius\Component\Core\Model\PaymentMethodInterface")
3337
* @ORM\JoinColumn(name="payment_method_id", referencedColumnName="id")
3438
*/
39+
#[ORM\ManyToOne(targetEntity: PaymentMethodInterface::class)]
40+
#[ORM\JoinColumn(name: 'payment_method_id', referencedColumnName: 'id')]
3541
private PaymentMethodInterface $paymentMethod;
3642

3743
/** @ORM\Column(type="string", name="access_token") */
44+
#[ORM\Column(name: 'access_token', type: 'string')]
3845
private string $accessToken;
3946

4047
/** @ORM\Column(type="datetime", name="creation_time") */
48+
#[ORM\Column(name: 'creation_time', type: 'datetime')]
4149
private \DateTime $creationTime;
4250

4351
/** @ORM\Column(type="datetime", name="expiration_time") */
52+
#[ORM\Column(name: 'expiration_time', type: 'datetime')]
4453
private \DateTime $expirationTime;
4554

4655
public function __construct(

0 commit comments

Comments
 (0)