Skip to content

Commit 0a01808

Browse files
committed
Suffix the namespace with Dev. Add the README file.
1 parent 5c3a438 commit 0a01808

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/vendor/
55

66
# PHPStan extracted files
7-
/phpstan
7+
/phpstan/
88

99
# PHPUnit
1010
/app/phpunit.xml

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# xactsystems/phpstan-dev
2+
3+
Package to extract and provide PHPStan source code for developing custom rules.
4+
Author: Ian Foulds.
5+
6+
PHPStan does not provide a method to load the source code via a package manager. Instead it needs extracting from the .phar archive.
7+
8+
If you use PHPStorm of PHP Tools by DEVSENSE then this issue is covered, but not everyone does!
9+
10+
Personally I think this whole approach goes against the ethos of a package manager, it should just be a package!
11+
12+
So, I've created this composer plugin that required phpstan as a dependency, extracts the source code, and links the PHPStan namespace to it.
13+
14+
## Installation
15+
To use this extension, require it in Composer:
16+
17+
```bash
18+
composer require --dev xactsystems/phpstan-dev
19+
```
20+
21+
## Usage
22+
23+
This plugin will expose the \PHPStan namespace so that you can create your custom rules and collectors.
24+
25+
See the following pages for more details:
26+
https://phpstan.org/developing-extensions/rules
27+
https://phpstan.org/developing-extensions/collectors

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"license": "MIT",
1212
"autoload": {
1313
"psr-4": {
14-
"Xact\\PHPStan\\": "src/",
14+
"Xact\\PHPStan\\Dev\\": "src/",
1515
"PHPStan\\": "phpstan/src"
1616
}
1717
},

src/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Xact\Phpstan;
5+
namespace Xact\Phpstan\Dev;
66

77
use Composer\Composer;
88
use Composer\InstalledVersions;

0 commit comments

Comments
 (0)