Skip to content

Releases: staabm/phpstan-dba

0.1.5

11 Jan 16:06
d09d427
Compare
Choose a tag to compare

DEMO

see phpstan-dba in action on the DEMO-PR

Major Features

  • Reuse the SyntaxErrorInPreparedStatementMethodRule within your PHPStan configuration to detect syntax errors in prepared queries, by registering a service:
services:
	-
		class: staabm\PHPStanDba\Rules\SyntaxErrorInPreparedStatementMethodRule
		tags: [phpstan.rules.rule]
		arguments:
			classMethods:
				- 'My\Connection::preparedQuery'

What's Changed

  • BC-Break: mv PdoStatementExecuteErrorMethodRule -> PdoStatementExecuteMethodRule by @staabm in #76
  • readme: added RuntimeConfiguration use-statements by @staabm in #75
  • simplify SyntaxError Rules by @staabm in #77
  • fix RecordingQueryReflector for prepared statements by @staabm in #79
  • added configurable SyntaxErrorInPreparedStatementMethodRule by @staabm in #78

Full Changelog: 0.1.4...0.1.5

0.1.4

11 Jan 12:58
3dcf471
Compare
Choose a tag to compare

DEMO

see phpstan-dba in action on the DEMO-PR

What's Changed

  • support phpstan extension-installer by @staabm in #74

Full Changelog: 0.1.3...0.1.4

0.1.3

11 Jan 08:55
81338e4
Compare
Choose a tag to compare

DEMO

see phpstan-dba in action on the DEMO-PR

What's Changed

Full Changelog: 0.1.2...0.1.3

0.1.2 - prepared statement support

10 Jan 14:33
314d0fc
Compare
Choose a tag to compare

Major new features

  • Initial prepared statement support 🥳
    • Prepared Placeholder validation
    • Prepared Statement type inference
    • Syntax error detection in prepared queries

What's Changed

  • support PDOStatement->columnCount() by @staabm in #42
  • Github Actions: added replay test job by @staabm in #43
  • Update README.md by @staabm in #45
  • Update README.md by @staabm in #46
  • Create LICENSE by @staabm in #47
  • remove false from return types, when error mode is exception by @staabm in #49
  • use proper default return value via ParametersAcceptorSelector by @staabm in #48
  • Support prepared statements type inference by @staabm in #44
  • support null and string-values in prepared statements by @staabm in #52
  • extracted QueryReflection->resolvePreparedQuerystring() by @staabm in #54
  • Refactor MysqliQueryDynamicReturnTypeExtension by @staabm in #55
  • refactor by @staabm in #56
  • refactor PdoStatementFetchDynamicReturnTypeExtension by @staabm in #57
  • extracted PdoStatementReflection by @staabm in #59
  • added PdoStatementExecuteErrorMethodRule by @staabm in #58
  • Update README.md by @staabm in #60

Full Changelog: 0.1.1...0.1.2

0.1.1

07 Jan 10:28
756c419
Compare
Choose a tag to compare

What's Changed

  • refactoring: separated mysqli-escape tests by @staabm in #39
  • support PDOStatement->fetchAll() by @staabm in #40
  • support PDOStatement::fetch() by @staabm in #41

Full Changelog: 0.1...0.1.1

initial release

07 Jan 08:31
960490c
Compare
Choose a tag to compare

This intial release provides following features:

  • the array shape of results can be inferred for PDOStatement and mysqli_result
    • .. when the query string can be resolved at analysis time. This is even possible for queries containing php-variables, as long as their typ is known in most cases.
    • builtin we support mysqli_query, mysqli->query, PDO->query and PDO->prepare
  • PDO->prepare knows the array shape of the returned results and therefore can return a generic PDOStatement
  • mysqli->query knows the array shape of the returned results and therefore can return a generic mysqli_result
  • SyntaxErrorInQueryMethodRule can inspect sql queries and detect syntax errors - SyntaxErrorInQueryFunctionRule can do the same for functions
    • builtin is query syntax error detection for mysqli_query, mysqli->query, PDO->query and PDO->prepare
  • mysqli_real_escape_string and mysqli->real_escape_string dynamic return type extensions
  • pdo->quote dynamic return type extension

see the unit-testsuite to get a feeling about the current featureset.

Its really early days... and this libs has a few rough edges.