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

php 8.2 compatibility fixes #12

Merged
merged 2 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 2 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
include:
- php: '8.2'
allow-failure: true
php: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/Cli/AnsiColorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function formatSection($section, $text, $size = null)
{
$width = 9 + strlen($this->format('', 'INFO'));

return sprintf(">> %-${width}s %s", $this->format($section, 'INFO'), $this->excerpt($text, $size));
return sprintf(">> %-{$width}s %s", $this->format($section, 'INFO'), $this->excerpt($text, $size));
}

/**
Expand Down
1 change: 0 additions & 1 deletion lib/Doctrine/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,6 @@ public function clear()
public function evictTables()
{
$this->tables = array();
$this->exported = array();
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/Hydrator/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
abstract class Doctrine_Hydrator_Graph extends Doctrine_Hydrator_Abstract
{
protected $_tables = array();
protected $_rootAlias;

/**
* Gets the custom field used for indexing for the specified component alias.
Expand Down
5 changes: 5 additions & 0 deletions lib/Doctrine/Import/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ class Doctrine_Import_Builder extends Doctrine_Builder
*/
protected $_generateTableClasses = false;

/**
* @var boolean
*/
protected $_generateAccessors = false;

/**
* Prefix to use for generated base classes
*
Expand Down
5 changes: 0 additions & 5 deletions lib/Doctrine/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,6 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
*/
protected $_parsers = array();

/**
* @var array $_pendingJoinConditions an array containing pending joins
*/
protected $_pendingJoinConditions = array();

/**
* @var array
*/
Expand Down
5 changes: 5 additions & 0 deletions lib/Doctrine/Query/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ abstract class Doctrine_Query_Abstract
*/
protected $_preQueried = false;

/**
* @var array $_pendingJoinConditions an array containing pending joins
*/
protected $_pendingJoinConditions = array();

/**
* Fix for http://www.doctrine-project.org/jira/browse/DC-701
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/RawSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function __construct(Doctrine_Connection $connection = null, Doctrine_Hydrator_A

protected function clear()
{
$this->_preQuery = false;
$this->_preQueried = false;
$this->_pendingJoinConditions = array();
}

Expand Down
5 changes: 5 additions & 0 deletions lib/Doctrine/Sequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
*/
class Doctrine_Sequence extends Doctrine_Connection_Module
{
/**
* @var array
*/
protected $warnings = array();

/**
* Returns the next free id of a sequence
*
Expand Down
7 changes: 6 additions & 1 deletion lib/Doctrine/Task/BuildAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ class Doctrine_Task_BuildAll extends Doctrine_Task

protected $models,
$tables;


/**
* @var Doctrine_Task_CreateDb
*/
protected $createDb;

public function __construct($dispatcher = null)
{
parent::__construct($dispatcher);
Expand Down
12 changes: 11 additions & 1 deletion lib/Doctrine/Task/BuildAllLoad.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,17 @@ class Doctrine_Task_BuildAllLoad extends Doctrine_Task
public $description = 'Calls build-all, and load-data',
$requiredArguments = array(),
$optionalArguments = array();


/**
* @var Doctrine_Task_BuildAll
*/
protected $buildAll;

/**
* @var Doctrine_Task_LoadData
*/
protected $loadData;

public function __construct($dispatcher = null)
{
parent::__construct($dispatcher);
Expand Down
12 changes: 11 additions & 1 deletion lib/Doctrine/Task/BuildAllReload.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,17 @@ class Doctrine_Task_BuildAllReload extends Doctrine_Task
public $description = 'Calls rebuild-db and load-data',
$requiredArguments = array(),
$optionalArguments = array();


/**
* @var Doctrine_Task_RebuildDb
*/
protected $rebuildDb;

/**
* @var Doctrine_Task_LoadData
*/
protected $loadData;

public function __construct($dispatcher = null)
{
parent::__construct($dispatcher);
Expand Down
17 changes: 16 additions & 1 deletion lib/Doctrine/Task/RebuildDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,22 @@ class Doctrine_Task_RebuildDb extends Doctrine_Task
public $description = 'Drops and re-creates databases',
$requiredArguments = array(),
$optionalArguments = array();


/**
* @var Doctrine_Task_DropDb
*/
protected $dropDb;

/**
* @var Doctrine_Task_CreateDb
*/
protected $createDb;

/**
* @var Doctrine_Task_CreateTables
*/
protected $createTables;

public function __construct($dispatcher = null)
{
parent::__construct($dispatcher);
Expand Down
4 changes: 4 additions & 0 deletions tests/AuditLogTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
*/
class Doctrine_AuditLog_TestCase extends Doctrine_UnitTestCase
{
/**
* @var Doctrine_Connection_Profiler
*/
private $profiler;

public function prepareData()
{ }
Expand Down
5 changes: 5 additions & 0 deletions tests/Cache/DbTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
*/
class Doctrine_Cache_Db_TestCase extends Doctrine_Cache_Abstract_TestCase
{
/**
* @var Doctrine_Cache_Db
*/
private $cache;

public function setUp()
{
parent::setUp();
Expand Down
10 changes: 10 additions & 0 deletions tests/Connection/CustomTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
*/
class Doctrine_Connection_Custom_TestCase extends Doctrine_UnitTestCase
{
/**
* @var Doctrine_Connection
*/
protected $_conn;

/**
* @var Doctrine_Adapter_Interface
*/
protected $_dbh;

public function setUp()
{
$manager = Doctrine_Manager::getInstance();
Expand Down
5 changes: 5 additions & 0 deletions tests/Connection/ProfilerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
*/
class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
{
/**
* @var Doctrine_Connection_Profiler
*/
private $profiler;

public function prepareTables()
{}
public function prepareData()
Expand Down
5 changes: 5 additions & 0 deletions tests/Db/ProfilerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
*/
class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
{
/**
* @var Doctrine_Connection_Profiler
*/
protected $profiler;

public function prepareTables()
{}
public function prepareData()
Expand Down
6 changes: 5 additions & 1 deletion tests/DoctrineTest/Doctrine_UnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ class Doctrine_UnitTestCase extends UnitTestCase
protected $transaction;
protected $_name;


protected $init = false;

protected $query;
protected $exc;
protected $sequence;
protected $import;

public function getName()
{
return $this->_name;
Expand Down
1 change: 1 addition & 0 deletions tests/DoctrineTest/GroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class GroupTest extends UnitTestCase
protected $_name;
protected $_title;
protected $_onlyRunFailed = false;
protected $_formatter;

public function __construct($title, $name)
{
Expand Down
20 changes: 20 additions & 0 deletions tests/ManagerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@
* @version $Revision$
*/
class Doctrine_Manager_TestCase extends Doctrine_UnitTestCase {
/**
* @var string
*/
protected $conn1_database;

/**
* @var string
*/
protected $conn2_database;

/**
* @var Doctrine_Connection
*/
protected $conn1;

/**
* @var Doctrine_Connection
*/
protected $conn2;

public function testGetInstance() {
$this->assertTrue(Doctrine_Manager::getInstance() instanceOf Doctrine_Manager);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/Record/FromArrayTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class Doctrine_Record_FromArray_TestCase extends Doctrine_UnitTestCase
{
private $previous_group;

public function prepareTables()
{
parent::prepareTables();
Expand Down
2 changes: 2 additions & 0 deletions tests/Record/SynchronizeTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class Doctrine_Record_Synchronize_TestCase extends Doctrine_UnitTestCase
{
private $previous_group;

public function prepareTables()
{
parent::prepareTables();
Expand Down
5 changes: 5 additions & 0 deletions tests/Relation/OrderByTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
*/
class Doctrine_Relation_OrderBy_TestCase extends Doctrine_UnitTestCase
{
/**
* @var Doctrine_Connection_Profiler
*/
private $profiler;

public function prepareTables()
{
$this->profiler = new Doctrine_Connection_Profiler();
Expand Down
5 changes: 5 additions & 0 deletions tests/Search/FileTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
*/
class Doctrine_Search_File_TestCase extends Doctrine_UnitTestCase
{
/**
* @var Doctrine_Search_File
*/
private $_search;

public function prepareData()
{ }
public function prepareTables()
Expand Down
4 changes: 2 additions & 2 deletions tests/TableTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ public function testGetData()

public function testSetSequenceName()
{
$this->objTable->sequenceName = 'test-seq';
$this->objTable->setOption('sequenceName', 'test-seq');
$this->assertEqual($this->objTable->sequenceName, 'test-seq');
$this->objTable->sequenceName = null;
$this->objTable->setOption('sequenceName', null);
}

public function testCreate()
Expand Down
2 changes: 2 additions & 0 deletions tests/Ticket/1106TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class Doctrine_Ticket_1106_TestCase extends Doctrine_UnitTestCase
{
private $user_id;

public function prepareTables()
{
parent::prepareTables();
Expand Down
3 changes: 3 additions & 0 deletions tests/Ticket/1131TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
*/
class Doctrine_Ticket_1131_TestCase extends Doctrine_UnitTestCase
{
private $role_one;
private $role_two;

public function prepareTables()
{
//$this->tables = array();
Expand Down
4 changes: 4 additions & 0 deletions tests/Ticket/1436TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
*/
class Doctrine_Ticket_1436_TestCase extends Doctrine_UnitTestCase
{
private $group_one;
private $group_two;
private $group_three;

public function prepareTables()
{
parent::prepareTables();
Expand Down
15 changes: 15 additions & 0 deletions tests/Ticket/1992TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@
*/
class Doctrine_Ticket_1992_TestCase extends Doctrine_UnitTestCase
{
/**
* @var Ticket_1992_Person
*/
private $person;

/**
* @var Ticket_1992_Profile
*/
private $profile1;

/**
* @var Ticket_1992_Profile
*/
private $profile2;

public function prepareTables()
{
$this->tables[] = 'Ticket_1992_Person';
Expand Down
Loading