2021-03-09 03:18:52 +00:00
|
|
|
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
let
|
|
|
|
pname = "phpstan";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "1.9.4";
|
2020-10-16 20:44:37 +00:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
src = fetchurl {
|
2020-10-16 20:44:37 +00:00
|
|
|
url = "https://github.com/phpstan/phpstan/releases/download/${version}/phpstan.phar";
|
2023-01-11 07:51:40 +00:00
|
|
|
sha256 = "sha256-A+F/ZoL6dLYx4MWN0eWXtQnmWJPYBqEcSgY4A1oR3mo=";
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
dontUnpack = true;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-10-16 20:44:37 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
runHook preInstall
|
2020-10-16 20:44:37 +00:00
|
|
|
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-30 09:31:56 +00:00
|
|
|
runHook postInstall
|
2020-10-16 20:44:37 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/phpstan/phpstan/releases/tag/${version}";
|
2020-10-16 20:44:37 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|