diff mbox series

[bug#67902,v4,25/98] gnu: Add php-phpstan-phpdoc-parser.

Message ID 20241007214530.4420-25-ngraves@ngraves.fr
State New
Headers show
Series [bug#67902,v4,01/98] gnu: Add abnfgen. | expand

Commit Message

Nicolas Graves Oct. 7, 2024, 9:43 p.m. UTC
* gnu/packages/php-xyz.scm (php-phpstan-phpdoc-parser): New variable.

Change-Id: Ia6fc12ef3b3ccccde0dec0528f473369c0ddc4a1
---
 gnu/packages/php-xyz.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm
index 9822bba3de..7f48a9cf67 100644
--- a/gnu/packages/php-xyz.scm
+++ b/gnu/packages/php-xyz.scm
@@ -639,3 +639,43 @@  (define-public php-phpspec-prophecy
     (home-page "https://github.com/phpspec/prophecy")
     (license license:expat)))
 
+(define-public php-phpstan-phpdoc-parser
+  (package
+    (name "php-phpstan-phpdoc-parser")
+    (version "1.24.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/phpstan/phpdoc-parser")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0sdnij33y0baqi4wzspzr67id00vk1p0n851s2a056njpyym65lv"))
+       (snippet '(begin
+                   (delete-file "tests/abnfgen-0.20.tar.gz")
+                   (delete-file "build-abnfgen.sh")))))
+    (build-system composer-build-system)
+    (arguments
+     (list
+      #:test-flags ''("--bootstrap" "vendor/autoload.php")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'unbundle-abnfgen
+            (lambda _
+              (substitute* "tests/PHPStan/Parser/FuzzyTest.php"
+                (("__DIR__ \\. '/\\.\\./\\.\\./\\.\\./tools/abnfgen/abnfgen'")
+                 (string-append "'" #$(this-package-native-input "abnfgen")
+                                "/bin/abnfgen'"))))))))
+    (native-inputs
+     (list abnfgen
+           php-phpunit-phpunit
+           php-symfony-process
+           php-doctrine-annotations))
+    (synopsis "PHPDoc parser")
+    (description
+     "This package provides a PHPDoc parser with support for nullable,
+intersection and generic types.")
+    (home-page "https://github.com/phpstan/phpdoc-parser")
+    (license license:expat)))
+