summary refs log tree commit diff
path: root/pkgs/top-level/php-packages.nix
diff options
context:
space:
mode:
authorElis Hirwing <elis@hirwing.se>2019-01-17 13:04:10 +0100
committerElis Hirwing <elis@hirwing.se>2019-01-17 13:10:23 +0100
commitd580b66fd11ffd4747971c2183823fc53693f852 (patch)
tree23f24fecbf5d39893f04048edcb8b27734e8b119 /pkgs/top-level/php-packages.nix
parent5bc3778ae736e21064ccd3140ff43458459300b4 (diff)
downloadnixpkgs-d580b66fd11ffd4747971c2183823fc53693f852.tar
nixpkgs-d580b66fd11ffd4747971c2183823fc53693f852.tar.gz
nixpkgs-d580b66fd11ffd4747971c2183823fc53693f852.tar.bz2
nixpkgs-d580b66fd11ffd4747971c2183823fc53693f852.tar.lz
nixpkgs-d580b66fd11ffd4747971c2183823fc53693f852.tar.xz
nixpkgs-d580b66fd11ffd4747971c2183823fc53693f852.tar.zst
nixpkgs-d580b66fd11ffd4747971c2183823fc53693f852.zip
phpPackages.phpstan: init at 0.11
PHP Static Analysis Tool
Diffstat (limited to 'pkgs/top-level/php-packages.nix')
-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";