Skip to content
Snippets Groups Projects

Issue #3364706: Refactor transactions

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
276 292 $this->connection = NULL;
277 293 }
278 294
295 /**
296 * Returns the client-level database connection object.
297 *
298 * This method should normally be used only within database driver code. Not
299 * doing so constitutes a risk of introducing code that is not database
300 * independent.
301 *
302 * @return object
303 * The client-level database connection, for example \PDO.
304 */
305 public function getClientConnection(): object {
  • IIRC it was protected for reason but can't recall why

  • Author Contributor

    Well I can't either, hard to figure out an answer without more context. What I remember is that at some point in [#3174662] I was trying to add the same method, but then it was abandoned on the basis it was not strictly necessary and could be added at a later stage when there were a specific use case (comments #50-#53). Now we have that use case.

  • Suggested change
    305 public function getClientConnection(): object {
    305 public function getClientConnection(): ?object {

    Default value for the property is NULL

  • Author Contributor

    Umm, I disagree... $this->connection is set in the constructor and unset in the destructor, so during the whole lifecycle of the Connection object, this property should not be null. If it is, then it's a problem and it's good to get a TypeError.

  • Please register or sign in to reply
  • mondrake added 35 commits

    added 35 commits

    Compare with previous version

  • mondrake added 4 commits

    added 4 commits

    Compare with previous version

  • daffie
  • daffie
  • daffie
  • daffie
  • mondrake added 66 commits

    added 66 commits

    Compare with previous version

  • mondrake added 119 commits

    added 119 commits

    Compare with previous version

  • daffie
  • daffie
  • daffie
  • daffie
  • daffie
  • daffie
  • daffie
  • daffie
  • daffie
  • daffie
  • mondrake added 83 commits

    added 83 commits

    Compare with previous version

  • mondrake added 1 commit
  • mondrake added 1 commit
  • mondrake added 1 commit

    added 1 commit

    • 7f9be9e0 - strict types and doc updates

    Compare with previous version

  • mondrake added 5 commits

    added 5 commits

    Compare with previous version

  • mondrake added 6 commits

    added 6 commits

    Compare with previous version

  • mondrake added 5 commits

    added 5 commits

    Compare with previous version

  • mondrake added 1 commit

    added 1 commit

    Compare with previous version

  • mondrake added 74 commits

    added 74 commits

    Compare with previous version

  • mondrake added 1 commit

    added 1 commit

    • 2679527c - CR reference and PHPStan ignores

    Compare with previous version

  • catch added 1 commit

    added 1 commit

    Compare with previous version

  • catch added 1 commit

    added 1 commit

    Compare with previous version

  • catch added 1 commit

    added 1 commit

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading