aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-registry/index/php-cs-fixer/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-02-20 22:19:39 +0100
committerGitHub <noreply@github.com>2023-02-20 22:19:39 +0100
commitb8a6632a0f2d263199d5d480ca85477fe0f414ab (patch)
tree57e1ee0f3cef078ec144ecdf1b2fa861acf47755 /lua/mason-registry/index/php-cs-fixer/init.lua
parentchore: autogenerate (#1015) (diff)
downloadmason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.gz
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.bz2
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.lz
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.xz
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.zst
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.zip
feat: configurable registries (#1016)
Diffstat (limited to 'lua/mason-registry/index/php-cs-fixer/init.lua')
-rw-r--r--lua/mason-registry/index/php-cs-fixer/init.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/lua/mason-registry/index/php-cs-fixer/init.lua b/lua/mason-registry/index/php-cs-fixer/init.lua
new file mode 100644
index 00000000..84dd0078
--- /dev/null
+++ b/lua/mason-registry/index/php-cs-fixer/init.lua
@@ -0,0 +1,37 @@
+local Pkg = require "mason-core.package"
+local _ = require "mason-core.functional"
+local github = require "mason-core.managers.github"
+local std = require "mason-core.managers.std"
+local platform = require "mason-core.platform"
+
+return Pkg.new {
+ name = "php-cs-fixer",
+ desc = _.dedent [[
+ The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; whether you want to
+ follow PHP coding standards as defined in the PSR-1, PSR-2, etc., or other community driven ones like the
+ Symfony one. You can also define your (team's) style through configuration.')
+ ]],
+ homepage = "https://github.com/FriendsOfPHP/PHP-CS-Fixer",
+ languages = { Pkg.Lang.PHP },
+ categories = { Pkg.Cat.Formatter },
+ ---@async
+ ---@param ctx InstallContext
+ install = function(ctx)
+ github
+ .download_release_file({
+ repo = "FriendsOfPHP/PHP-CS-Fixer",
+ asset_file = "php-cs-fixer.phar",
+ out_file = platform.is.win and "php-cs-fixer.phar" or "php-cs-fixer",
+ })
+ .with_receipt()
+ platform.when {
+ unix = function()
+ std.chmod("+x", { "php-cs-fixer" })
+ ctx:link_bin("php-cs-fixer", "php-cs-fixer")
+ end,
+ win = function()
+ ctx:link_bin("php-cs-fixer", ctx:write_php_exec_wrapper("php-cs-fixer", "php-cs-fixer.phar"))
+ end,
+ }
+ end,
+}