Browse Source

make pool argument optional

PHP-GTK3
yggverse 4 months ago
parent
commit
1d2641dceb
  1. 4
      src/Abstract/Model/Connection.php
  2. 2
      src/Interface/Model/Connection.php

4
src/Abstract/Model/Connection.php

@ -11,10 +11,10 @@ abstract class Connection implements \Yggverse\Yoda\Interface\Model\Connection
private Pool $_pool; private Pool $_pool;
public function __construct( public function __construct(
Pool $pool ?Pool $pool = null
) { ) {
// Use shared memory pool for async operations // Use shared memory pool for async operations
$this->_pool = $pool; $this->_pool = $pool ? $pool : new Pool;
// Set defaults // Set defaults
$this->_pool->set( $this->_pool->set(

2
src/Interface/Model/Connection.php

@ -13,7 +13,7 @@ use \Yggverse\Yoda\Interface\Model\Pool;
interface Connection interface Connection
{ {
public function __construct( public function __construct(
Pool $pool ?Pool $pool = null
); );
public function request( public function request(

Loading…
Cancel
Save