Skip to content

Commit 57a7a22

Browse files
committed
Add php stan
1 parent 1284fc3 commit 57a7a22

5 files changed

Lines changed: 67 additions & 8 deletions

File tree

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ DB_HOST=127.0.0.1
44
DB_PORT=3306
55
DB_NAME=libok_db
66
DB_USER=dbuser
7-
DB_PASSWORD=dbpassword
7+
DB_PASSWORD=dbpassword
8+
9+
# Dev or Prod mode
10+
DEV_MODE=true

.github/workflows/php.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,5 @@ jobs:
3232
- name: Install dependencies
3333
run: composer install --prefer-dist --no-progress
3434

35-
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
36-
# Docs: https://getcomposer.org/doc/articles/scripts.md
37-
3835
- name: Run test suite
3936
run: composer test

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"symfony/cache": "~7.3"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "~10.0"
23+
"phpunit/phpunit": "~10.0",
24+
"phpstan/phpstan": "~2.1"
2425
},
2526
"autoload": {
2627
"psr-4": {

composer.lock

Lines changed: 59 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Create a simple "default" Doctrine ORM configuration
1010
$config = ORMSetup::createAttributeMetadataConfiguration(
1111
paths: [__DIR__ . '/../src/Domain/Entities'],
12-
isDevMode: true,
12+
isDevMode: $_ENV['DEV_MODE'] ?? true,
1313
);
1414

1515
// Database connection configuration
@@ -25,7 +25,7 @@
2525
$connection = DriverManager::getConnection($connectionParams, $config);
2626
$entityManager = new EntityManager($connection, $config);
2727

28-
// Function to access the EntityManager
28+
// Access the EntityManager
2929
function getEntityManager(): EntityManager
3030
{
3131
global $entityManager;

0 commit comments

Comments
 (0)