From b52afa7bf5388d699d93f853e312a7847840ee90 Mon Sep 17 00:00:00 2001 From: Luiz Marin <67489841+luizcmarin@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:27:14 -0300 Subject: [PATCH] Docs folder standardization and other fixes Differences from the testing.md file have been added to the internals.md file --- README.md | 4 +-- docs/{en/testing.md => internals.md} | 17 +++++----- docs/pt-BR/testing.md | 51 ---------------------------- phpunit.xml.dist | 2 +- psalm.xml | 2 +- psalm4.xml | 2 +- src/DQLQueryBuilder.php | 2 +- src/Dsn.php | 2 +- src/SqlTokenizer.php | 2 +- src/Transaction.php | 2 +- 10 files changed, 18 insertions(+), 68 deletions(-) rename docs/{en/testing.md => internals.md} (70%) delete mode 100644 docs/pt-BR/testing.md diff --git a/README.md b/README.md index 8b66401e..8ee37330 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,11 @@ perform advanced database operations such as joins and aggregates. The package could be installed via composer: -```php +```shell composer require yiisoft/db-sqlite ``` -## Usage +## Usage For config connection to SQLite database check [Connecting SQLite](https://github.com/yiisoft/db/blob/master/docs/en/connection/sqlite.md). diff --git a/docs/en/testing.md b/docs/internals.md similarity index 70% rename from docs/en/testing.md rename to docs/internals.md index 49d60d0e..30ec7ee4 100644 --- a/docs/en/testing.md +++ b/docs/internals.md @@ -1,4 +1,4 @@ -# Testing +# Internals ## Github actions @@ -8,13 +8,13 @@ All our packages have github actions by default, so you can test your [contribut ## Unit testing -The package is tested with [PHPUnit](https://phpunit.de/). +The package is tested with [PHPUnit](https://phpunit.de/). To run tests: ```shell -vendor/bin/phpunit +./vendor/bin/phpunit ``` -### Mutation testing +## Mutation testing The package tests are checked with [Infection](https://infection.github.io/) mutation framework with [Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it: @@ -33,16 +33,17 @@ The code is statically analyzed with [Psalm](https://psalm.dev/). To run static ## Rector -Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or -use either newest or any specific version of PHP: +Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or +use either newest or any specific version of PHP: ```shell ./vendor/bin/rector ``` -## Composer require checker +## Dependencies -This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if all dependencies are correctly defined in `composer.json`. +Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive +[Composer](https://getcomposer.org/) dependencies. To run the checker, execute the following command: diff --git a/docs/pt-BR/testing.md b/docs/pt-BR/testing.md deleted file mode 100644 index 7d20dbe5..00000000 --- a/docs/pt-BR/testing.md +++ /dev/null @@ -1,51 +0,0 @@ -# Testes - -## Ações do Github - -Todos os nossos pacotes possuem ações do github por padrão, então você pode testar sua [contribuição](https://github.com/yiisoft/db-sqlite/blob/master/.github/CONTRIBUTING.md) na nuvem. - -> Observação: recomendamos a solicitação pull no modo rascunho até que todos os testes sejam aprovados. - -## Teste de unidade - -O pacote é testado com [PHPUnit](https://phpunit.de/). - -```shell -vendor/bin/phpunit -``` - -### Teste de mutação - -Os testes do pacote são verificados com a estrutura de mutação [Infection](https://infection.github.io/) e com -[plugin de análise estática de infecção](https://github.com/Roave/infection-static-analysis-plugin). Para executá-lo: - -```shell -./vendor/bin/roave-infection-static-analysis-plugin -``` - -## Análise estática - -O código é analisado estaticamente com [Psalm](https://psalm.dev/). Para executar a análise estática: - -```shell -./vendor/bin/psalm -``` - -## Reitor - -Use [Rector](https://github.com/rectorphp/rector) para fazer a base de código seguir algumas regras específicas ou -use a versão mais recente ou qualquer versão específica do PHP: - -```shell -./vendor/bin/rector -``` - -## Composer requer verificador - -Este pacote usa [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) para verificar se todas as dependências estão definidas corretamente em `composer.json`. - -Para executar o verificador, execute o seguinte comando: - -```shell -./vendor/bin/composer-require-checker -``` diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c65978bb..b4003563 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ - + diff --git a/psalm.xml b/psalm.xml index 906206a6..0a53528c 100644 --- a/psalm.xml +++ b/psalm.xml @@ -3,7 +3,7 @@ errorLevel="1" findUnusedBaselineEntry="true" findUnusedCode="false" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" > diff --git a/psalm4.xml b/psalm4.xml index 10d319ae..36d7a96e 100644 --- a/psalm4.xml +++ b/psalm4.xml @@ -3,7 +3,7 @@ errorLevel="1" findUnusedBaselineEntry="true" findUnusedCode="false" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" > diff --git a/src/DQLQueryBuilder.php b/src/DQLQueryBuilder.php index 1faa2b0c..6f1bf494 100644 --- a/src/DQLQueryBuilder.php +++ b/src/DQLQueryBuilder.php @@ -92,7 +92,7 @@ public function buildLimit(ExpressionInterface|int|null $limit, ExpressionInterf /** * Limit isn't optional in SQLite. * - * {@see http://www.sqlite.org/syntaxdiagrams.html#select-stmt} + * {@see https://www.sqlite.org/syntaxdiagrams.html#select-stmt} */ $sql = 'LIMIT 9223372036854775807 OFFSET ' . // 2^63-1 ($offset instanceof ExpressionInterface ? $this->buildExpression($offset) : (string)$offset); diff --git a/src/Dsn.php b/src/Dsn.php index 37f0c1cf..8806397a 100644 --- a/src/Dsn.php +++ b/src/Dsn.php @@ -24,7 +24,7 @@ public function __construct(private string $driver, private string|null $databas /** * @return string The Data Source Name, or DSN, has the information required to connect to the database. * - * Please refer to the [PHP manual](http://php.net/manual/en/pdo.construct.php) on the format of the DSN string. + * Please refer to the [PHP manual](https://php.net/manual/en/pdo.construct.php) on the format of the DSN string. * * The `driver` array key is used as the driver prefix of the DSN, all further key-value pairs are rendered as * `key=value` and concatenated by `;`. For example: diff --git a/src/SqlTokenizer.php b/src/SqlTokenizer.php index 54a4154a..7db891d2 100644 --- a/src/SqlTokenizer.php +++ b/src/SqlTokenizer.php @@ -12,7 +12,7 @@ * * It's used to obtain `CHECK` constraint information from a `CREATE TABLE` SQL code. * - * @link http://www.sqlite.org/draft/tokenreq.html + * @link https://www.sqlite.org/draft/tokenreq.html * @link https://sqlite.org/lang.html */ final class SqlTokenizer extends AbstractTokenizer diff --git a/src/Transaction.php b/src/Transaction.php index 2256e473..15731a29 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -29,7 +29,7 @@ final class Transaction extends AbstractPdoTransaction * @throws Throwable When unsupported isolation levels are used. SQLite only supports `SERIALIZABLE` * and `READ UNCOMMITTED`. * - * @link http://www.sqlite.org/pragma.html#pragma_read_uncommitted + * @link https://www.sqlite.org/pragma.html#pragma_read_uncommitted */ protected function setTransactionIsolationLevel(string $level): void {