Skip to content

Commit

Permalink
Update code style action. (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaeljorhult authored Mar 10, 2023
1 parent d0d3b5f commit d06923a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/run-php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ jobs:
fix-php-code-style:
name: Fix PHP Code Style
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 2
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga:2.18.6
uses: docker://oskarstark/php-cs-fixer-ga

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor
composer.lock
/.idea
/.idea
.php-cs-fixer.cache
12 changes: 12 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude('node_modules')
->exclude('vendor')
->in(__DIR__);

$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR2' => true,
])
->setFinder($finder);
3 changes: 2 additions & 1 deletion src/FlashMessage/FlashMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ public function get(string $key)
public function toArray()
{
return array_merge(
$this->attributes, [
$this->attributes,
[
'content' => $this->content,
'title' => $this->title,
'type' => $this->type,
Expand Down

0 comments on commit d06923a

Please sign in to comment.