Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this

### Changed
* Migrate form PHP_CodeSniffer to Mago for code linting and formatting.
* Migrate form PHPStan to Mago for code analysis.

### Deprecated
* *Nothing*
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
},
"require-dev": {
"carthage-software/mago": "^1.28",
"phpstan/phpstan": "^2.1",
"shlinkio/shlink-mago-config": "^1.0"
},
"autoload": {
Expand All @@ -27,21 +26,22 @@
"scripts": {
"ci": [
"@cs",
"@stan"
"@analyze"
],
"lint": "mago lint",
"lint:fix": "mago lint --fix",
"format": "mago format",
"format:check": "mago format --check",
"cs": ["@lint", "@format:check"],
"cs:fix": ["@lint:fix", "@format"],
"stan": "phpstan analyse"
"analyze": "mago analyze",
"stan": "@analyze"
},
"scripts-descriptions": {
"ci": "<fg=blue;options=bold>Alias for \"cs\" and \"stan\"</>",
"ci": "<fg=blue;options=bold>Alias for \"cs\" and \"analyze\"</>",
"cs": "<fg=blue;options=bold>Checks coding styles</>",
"cs:fix": "<fg=blue;options=bold>Fixes coding styles, when possible</>",
"stan": "<fg=blue;options=bold>Inspects code with phpstan</>"
"analyze": "<fg=blue;options=bold>Inspects code with mago analyze</>"
},
"config": {
"sort-packages": true,
Expand Down
3 changes: 2 additions & 1 deletion functions/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/
function json_decode(string $json): array
{
return spl_json_decode($json, true, 512, JSON_THROW_ON_ERROR);
// @mago-expect analysis:mixed-return-statement
return spl_json_decode($json, associative: true, flags: JSON_THROW_ON_ERROR);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions mago.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ extends = "vendor/shlinkio/shlink-mago-config/mago.toml"

[source]
workspace = "."
paths = ["config", "functions", "src", "test"]
excludes = ["vendor"]
paths = ["functions"]
includes = ["vendor"]

[source.glob]
literal-separator = true
Expand All @@ -17,3 +17,5 @@ literal-separator = true
no-literal-password = { exclude = ["test"] }
no-empty-catch-clause = { exclude = ["test"] }
no-empty-loop = { exclude = ["test"] }

[analyzer]
4 changes: 0 additions & 4 deletions phpstan.neon

This file was deleted.