Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: strict type for phpstan #47

Merged
merged 3 commits into from
Dec 8, 2021
Merged

feat: strict type for phpstan #47

merged 3 commits into from
Dec 8, 2021

Conversation

noelma
Copy link
Member

@noelma noelma commented Dec 5, 2021

Renommer les attribute de méthode $table par $tableName pour ne pas confondre avec le type Table.
Renommer l'attribut union par unions car il s'agit d'une liste d'unions.
Renommer les attributs contenant des champs par Field

Renommage des attributs, variables et méthodes contenant des noms de colonnes sans ambiguïté (ayant un type string) par columnName ou columnNames au pluriel.

Déclaration des type phpstan suivant:

/**
 * Between array{min: numeric|string, max: numeric|string}
 * FieldToArray array{
 *      _comment?: string,
 *      default?: null|scalar,
 *      length?: int,
 *      nullable?: bool,
 *      opt?: string,
 *      type: string,
 *      unsigned?: bool,
 * }
 * Join array{type: string, table: string, where: Where}
 * RowData array<string, null|scalar> contient les clé/valeur d'une ligne de données
 * RowValues array<null|scalar> contient les valeur d'une ligne de données
 * TableData RowData[]` contient un ensemble de ligne de données
 * TableToArray array{
 *    fields: array<string, FieldToArray>,
 *    increments?: int|null
 * }
 * Union array{request: RequestInterface, type: string}
 * WhereToArray array{
 *      bool: string,
 *      columnName: string,
 *      columnNames?: array,
 *      condition: string,
 *      not: bool,
 *      type: string,
 *      value: array|Between|null|scalar|Where,
 * }
 * /

@noelma noelma added change Change in functionality evolution New feature or request labels Dec 5, 2021
@noelma noelma self-assigned this Dec 5, 2021
@noelma noelma changed the base branch from master to dev December 5, 2021 19:06
@coveralls
Copy link

coveralls commented Dec 5, 2021

Pull Request Test Coverage Report for Build 1555715377

  • 206 of 209 (98.56%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 95.914%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Request.php 49 50 98.0%
src/Schema.php 46 47 97.87%
src/WhereHandler.php 28 29 96.55%
Totals Coverage Status
Change from base Build 1539668148: 0.08%
Covered Lines: 939
Relevant Lines: 979

💛 - Coveralls

@noelma noelma force-pushed the feat/strict-type-for-phpstan branch from ec915ed to 256d314 Compare December 6, 2021 19:03
@noelma noelma force-pushed the feat/strict-type-for-phpstan branch from 256d314 to e3105e5 Compare December 6, 2021 19:45
@noelma noelma marked this pull request as ready for review December 8, 2021 19:01
@noelma noelma force-pushed the feat/strict-type-for-phpstan branch 2 times, most recently from f9b8814 to e5353a8 Compare December 8, 2021 19:50
@noelma noelma force-pushed the feat/strict-type-for-phpstan branch from e5353a8 to cc47bd3 Compare December 8, 2021 19:53
@noelma noelma merged commit c1d1952 into dev Dec 8, 2021
@noelma noelma deleted the feat/strict-type-for-phpstan branch December 8, 2021 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change Change in functionality evolution New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants