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
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ jobs:
os: [ubuntu-18.04, ubuntu-20.04]
php: ['7.4', '8.0']
experimental: [false]
composer-flags: ['--prefer-dist']
phpstan-args: ['']
include:
- php: '8.1'
os: ubuntu-latest
experimental: true
composer-flags: '--prefer-dist --ignore-platform-req=php'
phpstan-args: '--debug'
steps:
- name: Checkout the code
uses: actions/checkout@v2
Expand All @@ -75,13 +79,13 @@ jobs:
with:
timeout_seconds: 45
max_attempts: 3
command: composer install --no-interaction --no-progress --prefer-dist
command: composer install --no-interaction --no-progress ${{ matrix.composer-flags }}
- name: Install application
run: bash .github/scripts/install.sh
- name: Check for code style issues
run: |
echo "::group::$ vendor/bin/php-cs-fixer fix"
make phpcsf CS_ARGS="--verbose"
export PHP_CS_FIXER_IGNORE_ENV=1 && make phpcsf CS_ARGS="--verbose"
echo -e "::endgroup::\n::group::$ vendor/bin/phpcs --standard=PSR12"
make phpcs
echo "::endgroup::"
Expand All @@ -92,7 +96,7 @@ jobs:
- name: Run static analysis checks
run: |
echo "::group::$ vendor/bin/phpstan analyze"
make phpstan
make phpstan STAN_ARGS=${{ matrix.phpstan-args }}
echo -e "::endgroup::\n::group::$ vendor/bin/phan"
make phan
echo -e "::endgroup::\n::group::$ vendor/bin/psalm"
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GNU_SED := $(shell command -v gsed || command -v sed)
now := `date '+%Y-%m-%d_%H%M'`
PHP_CSF_ARGS := --diff --dry-run $(CS_ARGS)
PHP_MND_ARGS := --progress $(MND_ARGS) --exclude tests
PHP_STAN_CMD := analyze $(STAN_ARGS)

installer: thinkdifferent
@echo -n "Building unified install script... "
Expand Down Expand Up @@ -81,7 +82,7 @@ phan:
vendor/bin/phan --config-file build/phan/config.php --color

phpstan:
php -d memory_limit=-1 vendor/bin/phpstan analyze -c build/phpstan/config.neon
php -d memory_limit=-1 vendor/bin/phpstan $(PHP_STAN_CMD) -c build/phpstan/config.neon

psalm:
vendor/bin/psalm -c build/psalm/psalm.xml
Expand Down
17 changes: 11 additions & 6 deletions app/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Illuminate\Contracts\Config\Repository;

class Database
{
Expand All @@ -16,12 +17,16 @@ private function connection(): Connection
return $this->connection;
}

$this->connection = DriverManager::getConnection([
'user' => config('database.dbal.user'),
'password' => config('database.dbal.password'),
'host' => config('database.connections.mysql.host'),
'driver' => 'pdo_mysql',
]);
$config = config();
assert($config instanceof Repository);
$socket = (string) $config->get('database.connections.mysql.unix_socket');

$this->connection = DriverManager::getConnection(
array_merge((array) config('database.dbal'), [
'driver' => 'pdo_mysql',
'unix_socket' => $socket,
]),
);

return $this->connection;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/System/CreateUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CreateUser extends SaveUser
public function rules(): array
{
return array_merge(parent::rules(), [
'gid' => 'integer|required_unless:user_group,1',
'gid' => 'integer|required_unless:user_group,true',
'system' => 'boolean|nullable',
'create_home' => 'boolean',
'user_group' => 'boolean',
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"doctrine/dbal": "^2.12",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"laravel/framework": "^8.29",
"laravel/sanctum": "^2.9",
"laravel/framework": "^8.34",
"laravel/sanctum": "2.9.2",
"laravel/tinker": "^2.6"
},
"require-dev": {
Expand All @@ -32,6 +32,7 @@
"phpunit/phpunit": "^9.5",
"povils/phpmnd": "dev-php8",
"psalm/plugin-laravel": "^1.4",
"spatie/macroable": "^1.0.1",
"squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^4.4"
},
Expand Down
Loading