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

Setup static analysis with Psalm #1

Closed
wants to merge 2 commits into from
Closed
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
16 changes: 16 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

name: "Continuous Integration"

on:
pull_request:

jobs:
static-analysis-psalm:
name: Static Analysis with Psalm
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Psalm
uses: docker://vimeo/psalm-github-actions
216 changes: 216 additions & 0 deletions baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.11.2@d470903722cfcbc1cd04744c5491d3e6d13ec3d9">
<file src="lib/Doctrine/DBAL/Driver/Connection.php">
<InvalidParamDefault occurrences="1">
<code>int</code>
</InvalidParamDefault>
</file>
<file src="lib/Doctrine/DBAL/Driver/DriverException.php">
<MissingImmutableAnnotation occurrences="1">
<code>public function getMessage();</code>
</MissingImmutableAnnotation>
</file>
<file src="lib/Doctrine/DBAL/Driver/PDOSqlsrv/Statement.php">
<UndefinedConstant occurrences="1">
<code>PDO::SQLSRV_ENCODING_BINARY</code>
</UndefinedConstant>
</file>
<file src="lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereConnection.php">
<UndefinedFunction occurrences="14">
<code>sasql_pconnect($dsn)</code>
<code>sasql_connect($dsn)</code>
<code>sasql_set_option($this-&gt;connection, 'verbose_errors', false)</code>
<code>sasql_set_option($this-&gt;connection, 'auto_commit', 'on')</code>
<code>sasql_set_option($this-&gt;connection, 'auto_commit', 'off')</code>
<code>sasql_commit($this-&gt;connection)</code>
<code>sasql_errorcode($this-&gt;connection)</code>
<code>sasql_error($this-&gt;connection)</code>
<code>sasql_real_query($this-&gt;connection, $statement)</code>
<code>sasql_affected_rows($this-&gt;connection)</code>
<code>sasql_insert_id($this-&gt;connection)</code>
<code>sasql_escape_string($this-&gt;connection, $input)</code>
<code>sasql_rollback($this-&gt;connection)</code>
<code>sasql_set_option($this-&gt;connection, 'auto_commit', 'on')</code>
</UndefinedFunction>
</file>
<file src="lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php">
<UndefinedFunction occurrences="8">
<code>sasql_sqlstate($conn)</code>
<code>sasql_sqlstate()</code>
<code>sasql_stmt_errno($stmt)</code>
<code>sasql_stmt_error($stmt)</code>
<code>sasql_errorcode($conn)</code>
<code>sasql_error($conn)</code>
<code>sasql_errorcode()</code>
<code>sasql_error()</code>
</UndefinedFunction>
</file>
<file src="lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php">
<UndefinedConstant occurrences="1">
<code>SASQL_BOTH</code>
</UndefinedConstant>
<UndefinedFunction occurrences="14">
<code>sasql_prepare($conn, $sql)</code>
<code>sasql_stmt_bind_param_ex($this-&gt;stmt, $column - 1, $variable, $type, $variable === null)</code>
<code>sasql_stmt_reset($this-&gt;stmt)</code>
<code>sasql_stmt_field_count($this-&gt;stmt)</code>
<code>sasql_stmt_errno($this-&gt;stmt)</code>
<code>sasql_stmt_error($this-&gt;stmt)</code>
<code>sasql_stmt_execute($this-&gt;stmt)</code>
<code>sasql_stmt_result_metadata($this-&gt;stmt)</code>
<code>sasql_fetch_assoc($this-&gt;result)</code>
<code>sasql_fetch_array($this-&gt;result, SASQL_BOTH)</code>
<code>sasql_fetch_object($this-&gt;result)</code>
<code>sasql_fetch_row($this-&gt;result)</code>
<code>sasql_fetch_object($this-&gt;result)</code>
<code>sasql_stmt_affected_rows($this-&gt;stmt)</code>
</UndefinedFunction>
</file>
<file src="lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php">
<TooFewArguments occurrences="1">
<code>sqlsrv_get_field($this-&gt;stmt, 0)</code>
</TooFewArguments>
</file>
<file src="lib/Doctrine/DBAL/Platforms/AbstractPlatform.php">
<InvalidParamDefault occurrences="1">
<code>int</code>
</InvalidParamDefault>
</file>
<file src="lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php">
<InvalidParamDefault occurrences="1">
<code>string</code>
</InvalidParamDefault>
</file>
<file src="lib/Doctrine/DBAL/Tools/Dumper.php">
<UndefinedClass occurrences="1">
<code>Collection</code>
</UndefinedClass>
</file>
<file src="tests/Doctrine/Tests/DBAL/Driver/PDOPgSql/DriverTest.php">
<UndefinedConstant occurrences="5">
<code>PDO::PGSQL_ATTR_DISABLE_PREPARES</code>
<code>PDO::PGSQL_ATTR_DISABLE_PREPARES</code>
<code>PDO::PGSQL_ATTR_DISABLE_PREPARES</code>
<code>PDO::PGSQL_ATTR_DISABLE_PREPARES</code>
<code>PDO::PGSQL_ATTR_DISABLE_PREPARES</code>
</UndefinedConstant>
</file>
<file src="tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php">
<UndefinedDocblockClass occurrences="93">
<code>MySqlPlatform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
</UndefinedDocblockClass>
</file>
<file src="tests/Doctrine/Tests/DBAL/Platforms/MariaDb1027PlatformTest.php">
<UndefinedDocblockClass occurrences="4">
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
</UndefinedDocblockClass>
</file>
<file src="tests/Doctrine/Tests/DBAL/Platforms/MySQL57PlatformTest.php">
<UndefinedDocblockClass occurrences="4">
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
<code>$this-&gt;platform</code>
</UndefinedDocblockClass>
</file>
<file src="tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php">
<UndefinedDocblockClass occurrences="1">
<code>$this-&gt;platform</code>
</UndefinedDocblockClass>
</file>
</files>
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,18 @@
"jetbrains/phpstorm-stubs": "^2019.1",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^8.4.1",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0"
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
"vimeo/psalm": "^3.11"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"bin": ["bin/doctrine-dbal"],
"config": {
"sort-packages": true
"sort-packages": true,
"platform": {
"php": "7.2.0"
}
},
"autoload": {
"psr-4": { "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" }
Expand Down
Loading