nixpkgs/pkgs/development/php-packages/phpstan/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.2 KiB
Nix
Raw Normal View History

{ mkDerivation, fetchurl, makeWrapper, lib, php }:
let
pname = "phpstan";
2022-04-08 21:13:23 +00:00
version = "1.5.4";
in
mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/phpstan/phpstan/releases/download/${version}/phpstan.phar";
2022-04-08 21:13:23 +00:00
sha256 = "sha256-6dXYrDpQ3E+z8mcZof7GSXOrUMoceuPTHO21Z8l4Wyw=";
};
2021-08-01 21:53:06 +00:00
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
2022-03-13 15:37:51 +00:00
runHook preInstall
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"
2022-03-13 15:37:51 +00:00
runHook postInstall
'';
meta = with 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 = teams.php.members;
};
}