mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 10:10:48 +01:00
feat: Add Heimerdinger PHP CS rules for Laravel
- Added a new phpcs.xml.dist file with specific coding standards for Laravel development.
This commit is contained in:
67
.phpcs.xml.dist
Normal file
67
.phpcs.xml.dist
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<ruleset name="Heimerdinger">
|
||||||
|
<description>Heimerdinger PHP CS rules for Laravel</description>
|
||||||
|
|
||||||
|
<!-- Ignore normal Laravel files and folders -->
|
||||||
|
<exclude-pattern>*/cache/*</exclude-pattern>
|
||||||
|
<exclude-pattern>*/*.js</exclude-pattern>
|
||||||
|
<exclude-pattern>*/*.css</exclude-pattern>
|
||||||
|
<exclude-pattern>*/*.xml</exclude-pattern>
|
||||||
|
<exclude-pattern>*/*.blade.php</exclude-pattern>
|
||||||
|
<exclude-pattern>*/autoload.php</exclude-pattern>
|
||||||
|
<exclude-pattern>*/storage/*</exclude-pattern>
|
||||||
|
<exclude-pattern>*/docs/*</exclude-pattern>
|
||||||
|
<exclude-pattern>*/vendor/*</exclude-pattern>
|
||||||
|
<exclude-pattern>*/migrations/*</exclude-pattern>
|
||||||
|
|
||||||
|
<!-- Hard-code command-line parameters -->
|
||||||
|
<arg name="colors" />
|
||||||
|
<arg value="p" />
|
||||||
|
|
||||||
|
<!-- PSR1 2.3 Side Effects -->
|
||||||
|
<rule ref="PSR1.Files.SideEffects">
|
||||||
|
<!-- Disable side effects for index file -->
|
||||||
|
<exclude-pattern>/public/index.php</exclude-pattern>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<!-- PSR1 3 Namespaces and classes MUST follow PSR-0. -->
|
||||||
|
<rule ref="PSR1.Classes.ClassDeclaration" />
|
||||||
|
|
||||||
|
<!-- Disable missing namespace rule for tests and database files -->
|
||||||
|
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
|
||||||
|
<exclude-pattern>*/database/*</exclude-pattern>
|
||||||
|
<exclude-pattern>*/tests/*</exclude-pattern>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<!-- PSR1 4.1 Class constants MUST be declared in all upper case with underscore separators. -->
|
||||||
|
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />
|
||||||
|
|
||||||
|
<!-- PSR1 4.3 Method names MUST be declared in camelCase(). -->
|
||||||
|
<rule ref="PSR1.Methods.CamelCapsMethodName" />
|
||||||
|
|
||||||
|
<!-- Disable camel caps rule for tests -->
|
||||||
|
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
|
||||||
|
<exclude-pattern>*/tests/*</exclude-pattern>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<!-- No compact() and no 'dumps' -->
|
||||||
|
<rule ref="Generic.PHP.ForbiddenFunctions">
|
||||||
|
<properties>
|
||||||
|
<property name="forbiddenFunctions" type="array">
|
||||||
|
<element key="compact" value="null" />
|
||||||
|
<element key="dd" value="null" />
|
||||||
|
<element key="dump" value="null" />
|
||||||
|
<element key="var_dump" value="null" />
|
||||||
|
<element key="ray" value="null" />
|
||||||
|
</property>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<!-- Use config() over env() -->
|
||||||
|
<rule ref="Tighten.PHP.UseConfigOverEnv">
|
||||||
|
<exclude-pattern>/config/*</exclude-pattern>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<!-- Class name should match the file name -->
|
||||||
|
<rule ref="Squiz.Classes.ClassFileName" />
|
||||||
|
|
||||||
|
</ruleset>
|
||||||
@@ -19,6 +19,11 @@ class HTMLSitemapController extends Controller
|
|||||||
$icons = Cache::remember('sitemap_iconsCache', $twentyHoursInSeconds, fn () => SummonerIcon::orderBy('title')->get());
|
$icons = Cache::remember('sitemap_iconsCache', $twentyHoursInSeconds, fn () => SummonerIcon::orderBy('title')->get());
|
||||||
$posts = Sheets::all()->sortByDesc('date');
|
$posts = Sheets::all()->sortByDesc('date');
|
||||||
|
|
||||||
return view('sitemap.index', compact('champions', 'skins', 'icons', 'posts'));
|
return view('sitemap.index', [
|
||||||
|
'champions' => $champions,
|
||||||
|
'skins' => $skins,
|
||||||
|
'icons' => $icons,
|
||||||
|
'posts' => $posts,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user