Skip to content

Commit

Permalink
Setup static analysis with Psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Apr 14, 2020
1 parent 2a440d1 commit 8cce3ab
Show file tree
Hide file tree
Showing 5 changed files with 961 additions and 2 deletions.
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
253 changes: 253 additions & 0 deletions baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
<?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/IBMDB2/DB2Connection.php">
<UndefinedConstant occurrences="3">
<code>DB2_AUTOCOMMIT_OFF</code>
<code>DB2_AUTOCOMMIT_ON</code>
<code>DB2_AUTOCOMMIT_ON</code>
</UndefinedConstant>
</file>
<file src="lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php">
<UndefinedConstant occurrences="6">
<code>DB2_PARAM_IN</code>
<code>DB2_LONG</code>
<code>DB2_PARAM_FILE</code>
<code>DB2_BINARY</code>
<code>DB2_PARAM_IN</code>
<code>DB2_CHAR</code>
</UndefinedConstant>
</file>
<file src="lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php">
<UndefinedClass occurrences="8">
<code>$this-&gt;conn</code>
<code>$this-&gt;conn-&gt;connect_error</code>
<code>$this-&gt;conn-&gt;sqlstate</code>
<code>$this-&gt;conn-&gt;connect_errno</code>
<code>$this-&gt;conn</code>
<code>$this-&gt;conn</code>
<code>$this-&gt;conn-&gt;sqlstate</code>
<code>$this-&gt;conn-&gt;errno</code>
</UndefinedClass>
<UndefinedConstant occurrences="5">
<code>MYSQLI_OPT_CONNECT_TIMEOUT</code>
<code>MYSQLI_OPT_LOCAL_INFILE</code>
<code>MYSQLI_INIT_COMMAND</code>
<code>MYSQLI_READ_DEFAULT_FILE</code>
<code>MYSQLI_READ_DEFAULT_GROUP</code>
</UndefinedConstant>
<UndefinedDocblockClass occurrences="22">
<code>mysqli</code>
<code>mysqli</code>
<code>$this-&gt;conn</code>
<code>$this-&gt;conn-&gt;server_version</code>
<code>$this-&gt;conn-&gt;server_version</code>
<code>$this-&gt;conn-&gt;server_version</code>
<code>$this-&gt;conn</code>
<code>$this-&gt;conn</code>
<code>$this-&gt;conn-&gt;error</code>
<code>$this-&gt;conn-&gt;sqlstate</code>
<code>$this-&gt;conn-&gt;errno</code>
<code>$this-&gt;conn-&gt;affected_rows</code>
<code>$this-&gt;conn-&gt;insert_id</code>
<code>$this-&gt;conn</code>
<code>$this-&gt;conn</code>
<code>$this-&gt;conn</code>
<code>$this-&gt;conn-&gt;errno</code>
<code>$this-&gt;conn-&gt;error</code>
<code>$this-&gt;conn-&gt;sqlstate</code>
<code>$this-&gt;conn-&gt;errno</code>
<code>$this-&gt;conn</code>
<code>$this-&gt;conn</code>
</UndefinedDocblockClass>
</file>
<file src="lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php">
<UndefinedClass occurrences="1">
<code>mysqli</code>
</UndefinedClass>
<UndefinedDocblockClass occurrences="33">
<code>mysqli</code>
<code>mysqli_stmt</code>
<code>$this-&gt;_stmt-&gt;error</code>
<code>$this-&gt;_stmt-&gt;errno</code>
<code>$this-&gt;_stmt</code>
<code>$this-&gt;_stmt-&gt;error</code>
<code>$this-&gt;_stmt-&gt;sqlstate</code>
<code>$this-&gt;_stmt-&gt;errno</code>
<code>$this-&gt;_stmt</code>
<code>$this-&gt;_stmt</code>
<code>$this-&gt;_stmt</code>
<code>$this-&gt;_stmt-&gt;error</code>
<code>$this-&gt;_stmt-&gt;sqlstate</code>
<code>$this-&gt;_stmt-&gt;errno</code>
<code>$this-&gt;_stmt</code>
<code>$this-&gt;_stmt-&gt;error</code>
<code>$this-&gt;_stmt-&gt;sqlstate</code>
<code>$this-&gt;_stmt-&gt;errno</code>
<code>$this-&gt;_stmt</code>
<code>$this-&gt;_stmt-&gt;error</code>
<code>$this-&gt;_stmt-&gt;sqlstate</code>
<code>$this-&gt;_stmt-&gt;errno</code>
<code>$this-&gt;_stmt</code>
<code>$this-&gt;_stmt</code>
<code>$this-&gt;_stmt-&gt;error</code>
<code>$this-&gt;_stmt-&gt;sqlstate</code>
<code>$this-&gt;_stmt-&gt;errno</code>
<code>$this-&gt;_stmt-&gt;errno</code>
<code>$this-&gt;_stmt-&gt;error</code>
<code>$this-&gt;_stmt</code>
<code>$this-&gt;_stmt-&gt;affected_rows</code>
<code>$this-&gt;_stmt-&gt;num_rows</code>
<code>$this-&gt;_stmt-&gt;field_count</code>
</UndefinedDocblockClass>
</file>
<file src="lib/Doctrine/DBAL/Driver/OCI8/Driver.php">
<UndefinedConstant occurrences="1">
<code>OCI_DEFAULT</code>
</UndefinedConstant>
</file>
<file src="lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php">
<UndefinedConstant occurrences="5">
<code>OCI_DEFAULT</code>
<code>OCI_NO_AUTO_COMMIT</code>
<code>OCI_COMMIT_ON_SUCCESS</code>
<code>OCI_COMMIT_ON_SUCCESS</code>
<code>OCI_COMMIT_ON_SUCCESS</code>
</UndefinedConstant>
</file>
<file src="lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php">
<UndefinedClass occurrences="1">
<code>$lob</code>
</UndefinedClass>
<UndefinedConstant occurrences="19">
<code>OCI_D_LOB</code>
<code>OCI_TEMP_BLOB</code>
<code>OCI_B_BIN</code>
<code>OCI_B_BLOB</code>
<code>SQLT_CHR</code>
<code>OCI_RETURN_NULLS</code>
<code>OCI_RETURN_LOBS</code>
<code>OCI_BOTH</code>
<code>OCI_FETCHSTATEMENT_BY_ROW</code>
<code>OCI_FETCHSTATEMENT_BY_COLUMN</code>
<code>OCI_RETURN_NULLS</code>
<code>OCI_RETURN_LOBS</code>
<code>OCI_NUM</code>
<code>OCI_RETURN_NULLS</code>
<code>OCI_RETURN_LOBS</code>
<code>OCI_BOTH</code>
<code>OCI_ASSOC</code>
<code>OCI_NUM</code>
<code>OCI_NUM</code>
</UndefinedConstant>
</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/SQLSrvConnection.php">
<UndefinedConstant occurrences="2">
<code>SQLSRV_ERR_ERRORS</code>
<code>SQLSRV_ERR_ERRORS</code>
</UndefinedConstant>
</file>
<file src="lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php">
<UndefinedConstant occurrences="1">
<code>SQLSRV_ERR_ERRORS</code>
</UndefinedConstant>
</file>
<file src="lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php">
<UndefinedConstant occurrences="9">
<code>SQLSRV_ERR_ERRORS</code>
<code>SQLSRV_ERR_ERRORS</code>
<code>SQLSRV_PARAM_IN</code>
<code>SQLSRV_ENC_BINARY</code>
<code>SQLSRV_PARAM_IN</code>
<code>SQLSRV_ENC_BINARY</code>
<code>SQLSRV_FETCH_BOTH</code>
<code>SQLSRV_FETCH_ASSOC</code>
<code>SQLSRV_FETCH_NUMERIC</code>
</UndefinedConstant>
<UndefinedFunction occurrences="3">
<code>SQLSRV_PHPTYPE_STREAM(SQLSRV_ENC_BINARY)</code>
<code>SQLSRV_SQLTYPE_VARBINARY('max')</code>
<code>SQLSRV_PHPTYPE_STRING(SQLSRV_ENC_BINARY)</code>
</UndefinedFunction>
</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>
</files>
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"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."
Expand Down
Loading

0 comments on commit 8cce3ab

Please sign in to comment.