Skip to content

Commit 759666a

Browse files
update
1 parent e45a42c commit 759666a

7 files changed

Lines changed: 94 additions & 34 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Homestead.yaml
2121
Homestead.json
2222
/.vagrant
2323
.phpunit.result.cache
24+
.phpunit.cache/
25+
.php-cs-fixer.cache
2426

2527
/public/build
2628
/storage/pail

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
'single_quote' => true,
1919
'ordered_imports' => ['sort_algorithm' => 'alpha']
2020
])
21+
->setRiskyAllowed(true)
2122
->setFinder($finder)
2223
->setUsingCache(true);

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@
4141
"squizlabs/php_codesniffer": "^3.13"
4242
},
4343
"scripts":{
44-
"types": "phpstan analyse src tests",
45-
"lint": "phpcs --standard=PSR12 src tests",
46-
"fix": "php-cs-fixer fix src tests",
44+
"types": "phpstan analyse --ansi",
45+
"lint": "phpcs src --colors && phpcbf src --colors",
46+
"fix": "php-cs-fixer fix --ansi --diff",
4747
"unit": "phpunit",
4848
"tests": [
4949
"@types",
5050
"@lint",
51+
"@fix",
5152
"@unit"
5253
]
5354
},

phpcs.dist.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Project Standards">
3+
<description>PHPCS configuration for the project</description>
4+
5+
<!-- Show progress and colors in output -->
6+
<arg value="ps"/>
7+
<arg name="extensions" value="php"/>
8+
<arg name="tab-width" value="4"/>
9+
10+
<!-- Paths to scan -->
11+
<file>src</file>
12+
<file>tests</file>
13+
14+
<!-- Exclude specific directories/files -->
15+
<exclude-pattern>vendor/*</exclude-pattern>
16+
<exclude-pattern>storage/*</exclude-pattern>
17+
<exclude-pattern>bootstrap/*</exclude-pattern>
18+
19+
<!-- Base standard -->
20+
<rule ref="PSR12"/>
21+
22+
<!-- Example: Override or exclude specific rules -->
23+
<!-- Disable line length check -->
24+
<rule ref="Generic.Files.LineLength">
25+
<exclude name="Generic.Files.LineLength.TooLong"/>
26+
</rule>
27+
28+
<!-- Enforce strict types declaration -->
29+
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>
30+
31+
<!-- Enforce spacing around operators -->
32+
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
33+
34+
<!-- Custom severity -->
35+
<config name="severity" value="5"/>
36+
<config name="ignore_warnings_on_exit" value="1"/>
37+
</ruleset>

phpcs.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Reloader.php

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
<?php
22

33
declare(strict_types=1);
4+
/**
5+
* Handles the main reloader functionality for file watching and live updates.
6+
*
7+
* PHP version 8.4
8+
*
9+
* @category Development
10+
* @package Reloader
11+
* @author Rahim Sahu <your-email@example.com>
12+
* @license BSD-3-Clause https://opensource.org/licenses/BSD-3-Clause
13+
* @link https://github.com/your-username/reloader
14+
*/
415

5-
namespace Reloader;
6-
16+
/**
17+
* Class Reloader
18+
*
19+
* Provides hot reloading functionality for PHP projects.
20+
*
21+
* @category Development
22+
* @package Reloader
23+
* @author Rahim Sahu <your-email@example.com>
24+
* @license BSD-3-Clause https://opensource.org/licenses/BSD-3-Clause
25+
* @link https://github.com/your-username/reloader
26+
*/
727
final class Reloader
828
{
9-
//
29+
// class code...
1030
}

src/Watcher.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
11
<?php
22

3+
declare(strict_types=1);
4+
/**
5+
* Handles the main reloader functionality for file watching and live updates.
6+
*
7+
* PHP version 8.4
8+
*
9+
* @category Development
10+
* @package Reloader
11+
* @author Rahim Sahu <your-email@example.com>
12+
* @license BSD-3-Clause https://opensource.org/licenses/BSD-3-Clause
13+
* @link https://github.com/your-username/reloader
14+
*/
315

16+
/**
17+
* Class Watcher
18+
*
19+
* Provides hot reloading functionality for PHP projects.
20+
*
21+
* @category Development
22+
* @package Reloader
23+
* @author Rahim Sahu <your-email@example.com>
24+
* @license BSD-3-Clause https://opensource.org/licenses/BSD-3-Clause
25+
* @link https://github.com/your-username/reloader
26+
*/
27+
final class Watcher
28+
{
29+
// class code...
30+
}

0 commit comments

Comments
 (0)