Skip to content

Commit f9f37a7

Browse files
author
Illia Sakovich
committed
fixer
1 parent e0d3713 commit f9f37a7

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check & fix styling
2+
3+
on: [push]
4+
5+
jobs:
6+
style:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v1
12+
13+
- name: Fix style
14+
uses: docker://oskarstark/php-cs-fixer-ga
15+
with:
16+
args: --config=.php_cs --allow-risky=yes
17+
18+
- name: Extract branch name
19+
shell: bash
20+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
21+
id: extract_branch
22+
23+
- name: Commit changes
24+
uses: stefanzweifel/[email protected]
25+
with:
26+
commit_message: Fix styling
27+
branch: ${{ steps.extract_branch.outputs.branch }}
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.php_cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->notPath('spark')
5+
->notPath('bootstrap')
6+
->notPath('storage')
7+
->notPath('vendor')
8+
->in(__DIR__)
9+
->name('*.php')
10+
->name('_ide_helper')
11+
->notName('*.blade.php')
12+
->ignoreDotFiles(true)
13+
->ignoreVCS(true);
14+
15+
16+
return PhpCsFixer\Config::create()
17+
->setRules([
18+
'@PSR2' => true,
19+
'array_syntax' => ['syntax' => 'short'],
20+
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
21+
'no_unused_imports' => true,
22+
])
23+
->setFinder($finder);

src/SharedData.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ public function getJsHelperName(): string
146146
return $this->jsHelperName;
147147
}
148148

149-
public function setJsHelperName(string $jsHelperName): self
149+
public function setJsHelperName
150+
(string $jsHelperName)
151+
: self
150152
{
151153
$this->jsHelperName = $jsHelperName;
152154

0 commit comments

Comments
 (0)