Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change frame path, php-cs-fixer #4

Merged
merged 1 commit into from
Dec 11, 2024
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
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=27ece57ba8aa437809ed5e6ef26e4636
APP_SECRET=dccfd2bb9b2a23fe2abef3a0214c2d67

PRIVATE_PATH=private/
###< symfony/framework-bundle ###
9 changes: 3 additions & 6 deletions .github/workflows/ci-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-dev --prefer-dist
run: composer install --prefer-dist
# - name: Get npm cache directory
# id: npm-cache
# run: |
Expand All @@ -36,8 +36,5 @@ jobs:
# ${{ runner.os }}-node-
# - name: Install JavaScript dependencies
# run: npm install
- name: Deploy over FTPS
env:
USERNAME: ${{ secrets.DEPLOY_USERNAME }}
PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}
run: php ./Deploy.php --target=cyon --environment=prod --username="$USERNAME"
- name: PHP Code style check
run: composer fixdiff
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
node_modules/
public/frame/
private/
var/
vendor/

###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###
38 changes: 38 additions & 0 deletions .php_cs_config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/')
->exclude('_/library/')
->exclude('deploy/')
->exclude('node_modules/')
->exclude('var/')
;

$config = new PhpCsFixer\Config();
return $config
->setRules([
'@DoctrineAnnotation' => true,
'@PSR1' => true,
'@PSR2' => true,
'@PSR12' => true,
'@PhpCsFixer' => true,
'@Symfony' => true,
'@PHP82Migration' => true,
'blank_line_before_statement' => false,
'braces_position' => [
'functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'same_line',
],
'increment_style' => [
'style' => 'post',
],
'single_quote' => false,
'yoda_style' => [
'always_move_variable' => false,
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],
])
->setFinder($finder)
;
5 changes: 4 additions & 1 deletion Deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public function getRemotePrivatePath(): string {

/** @return array<string, string> */
public function install(string $public_path): array {
$fs = new Symfony\Component\Filesystem\Filesystem();
$fs->copy(__DIR__.'/../../.env.local', __DIR__.'/.env.local');

$getPublicPathForSubdomain = function (string $subdomain) use ($public_path): string {
return str_replace($this->getRemotePublicPath(), "public_html/{$subdomain}", $public_path);
};
Expand Down Expand Up @@ -85,4 +88,4 @@ protected function installForSubdomain(string $public_path): void {
$logger->pushHandler(new ErrorLogHandler());
$deploy->setLogger($logger);
$deploy->cli();
}
}
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
"symfony/polyfill-php80": "*"
},
"scripts": {
"fix": "php-cs-fixer fix --config=./.php_cs_config.php -v",
"fixdiff": "php-cs-fixer fix --config=./.php_cs_config.php -v --dry-run --diff",
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
Expand All @@ -78,5 +80,8 @@
"allow-contrib": false,
"require": "7.1.*"
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.65"
}
}
Loading
Loading