summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-01-17 16:04:31 +0100
committerGitHub <noreply@github.com>2019-01-17 16:04:31 +0100
commit6bd544d00d36bfd54a2d79af70dcade4a39956b3 (patch)
tree91705afd6dbe914cb1359312a4fdd633bab03545
parentd428e37ceea439addf7a7f5f13d8050373c514a1 (diff)
parentd580b66fd11ffd4747971c2183823fc53693f852 (diff)
downloadnixpkgs-6bd544d00d36bfd54a2d79af70dcade4a39956b3.tar
nixpkgs-6bd544d00d36bfd54a2d79af70dcade4a39956b3.tar.gz
nixpkgs-6bd544d00d36bfd54a2d79af70dcade4a39956b3.tar.bz2
nixpkgs-6bd544d00d36bfd54a2d79af70dcade4a39956b3.tar.lz
nixpkgs-6bd544d00d36bfd54a2d79af70dcade4a39956b3.tar.xz
nixpkgs-6bd544d00d36bfd54a2d79af70dcade4a39956b3.tar.zst
nixpkgs-6bd544d00d36bfd54a2d79af70dcade4a39956b3.zip
Merge pull request #54171 from etu/init-phpstan
phpPackages.phpstan: init at 0.11
-rw-r--r--pkgs/top-level/php-packages.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix
index cb425b14e1d..3cfa8f6e6d6 100644
--- a/pkgs/top-level/php-packages.nix
+++ b/pkgs/top-level/php-packages.nix
@@ -409,6 +409,40 @@ let
     };
   };
 
+  phpstan = pkgs.stdenv.mkDerivation rec {
+    name = "phpstan-${version}";
+    version = "0.11";
+
+    src = pkgs.fetchurl {
+      url = "https://github.com/phpstan/phpstan/releases/download/${version}/phpstan.phar";
+      sha256 = "09p3cg5ii862p2l44fcv7hh400nsmxvwn1jjr929y21p01wsjhkp";
+    };
+
+    phases = [ "installPhase" ];
+    nativeBuildInputs = [ pkgs.makeWrapper ];
+
+    installPhase = ''
+      mkdir -p $out/bin
+      install -D $src $out/libexec/phpstan/phpstan.phar
+      makeWrapper ${php}/bin/php $out/bin/phpstan \
+        --add-flags "$out/libexec/phpstan/phpstan.phar"
+    '';
+
+    meta = with pkgs.lib; {
+      description = "PHP Static Analysis Tool";
+      longDescription = ''
+        PHPStan focuses on finding errors in your code without actually running
+        it. It catches whole classes of bugs even before you write tests for the
+        code. It moves PHP closer to compiled languages in the sense that the
+        correctness of each line of the code can be checked before you run the
+        actual line.
+      '';
+      license = licenses.mit;
+      homepage = https://github.com/phpstan/phpstan;
+      maintainers = with maintainers; [ etu ];
+    };
+  };
+
   psysh = pkgs.stdenv.mkDerivation rec {
     name = "psysh-${version}";
     version = "0.9.8";