1{
2 fetchFromGitHub,
3 lib,
4 php,
5 versionCheckHook,
6}:
7
8php.buildComposerProject2 (finalAttrs: {
9 pname = "phpstan";
10 version = "2.1.29";
11
12 src = fetchFromGitHub {
13 owner = "phpstan";
14 repo = "phpstan-src";
15 tag = finalAttrs.version;
16 hash = "sha256-8HPMXJ64qkV6fXfdr6fZTp2m1EhcWiq0cE51VQHuyro=";
17 };
18
19 vendorHash = "sha256-mSlxWkqhniphYUOjE0zucOqN9gKe3Th0GEikB7DyYVY=";
20 composerStrictValidation = false;
21
22 doInstallCheck = true;
23 nativeInstallCheckInputs = [ versionCheckHook ];
24 versionCheckProgramArg = "--version";
25
26 meta = {
27 changelog = "https://github.com/phpstan/phpstan/releases/tag/${finalAttrs.version}";
28 description = "PHP Static Analysis Tool";
29 homepage = "https://github.com/phpstan/phpstan";
30 longDescription = ''
31 PHPStan focuses on finding errors in your code without actually
32 running it. It catches whole classes of bugs even before you write
33 tests for the code. It moves PHP closer to compiled languages in the
34 sense that the correctness of each line of the code can be checked
35 before you run the actual line.
36 '';
37 license = lib.licenses.mit;
38 mainProgram = "phpstan";
39 maintainers = [ lib.maintainers.patka ];
40 };
41})