Add format and type checker tools #13
Merged
maxime.batista
merged 3 commits from quality
into master
1 year ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'quality'
Deleting a branch is permanent. It CANNOT be undone. Continue?
This pull request adds and configures phpstan and php-cs-fixer to type check and format php code, and tsc and prettier to type check and format the typescript code.
please use :
./verify.sh
to verify if your code is typed correctly./format.sh
to verify if your code is formatted correctly.return (new PhpCsFixer\Config())
->setRules([
'@PER-CS' => true,
'@PHP82Migration' => true,
- image: composer:latest
name: "php CI"
commands:
- composer install && composer update
Since there is no lock file committed, there is no need update it.
"test": "vite test"
"test": "vite test",
"format": "prettier --config .prettierrc 'front' --write",
"tsc": "node_modules/.bin/tsc"
The binary is already in the
PATH
.paths:
- src
- public
- sql
SQL files are not read and you ignore errors in the only PHP file.
ignoreErrors:
-
message: '#.*#'
path: sql/database.php
path: sql/database.php
-
message: '#.*#'
path: src/react-display-file.php
* execute a request
* @param string $query
* @param array $args
* @param array<string, array<mixed, int>> $args
It is a tuple, not a array with mixed keys and numeric values.
* @param string $query the SQL request
* @param array $args an array containing the arguments label, value and type: ex: `[":label" => [$value, PDO::PARAM_TYPE]`
* @return array the returned rows of the request
* @param array<string, array<mixed, int>> $args an array containing the arguments label, value and type: ex: `[":label" => [$value, PDO::PARAM_TYPE]`
* @param string $email
* @param string $phoneNumber
* @param AccountUser $user
* @param array<int, Team> $teams
/**
* @var array maps users with their role
* @var array<int, Member> maps users with their role
function listResults(): array {
/**
* @return array<string, mixed>
The gateway return an array of arrays. The inner array shape is described here.
/**
* @param $offset
* @param $value
* @return mixed
}
/**
* @param $offset
class FunctionValidator extends Validator {
/**
* @var callable
class SimpleFunctionValidator extends Validator {
/**
* @var callable
Some code below also use the generic
callable
type in the docs.* @return Validator a validator that validates strings that only contains numbers, letters, accents letters, `-` and `_`.
*/
public static function name($msg = null): Validator {
public static function name(string $msg = null): Validator {
085136e9ed
tobb53114d78
1 year agoe22cb91ba2
into master 1 year agoReviewers
e22cb91ba2
.