Skip to content

Commit 5ee4887

Browse files
committed
BackupTrait::getValidExtensions() method has been removed
1 parent b757497 commit 5ee4887

File tree

4 files changed

+6
-25
lines changed

4 files changed

+6
-25
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# 2.x branch
22
## 2.7 branch
33
### 2.7.0
4-
* `BackupTrait::getTarget()` and `BackupTrait::getDriverName()` have been removed.
4+
* `BackupTrait::getTarget()`, `BackupTrait::getDriverName()` and
5+
`BackupTrait::getValidExtensions()` methods have been removed.
56

67
## 2.6 branch
78
### 2.6.6

src/BackupTrait.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait BackupTrait
3030
* @since 2.4.0
3131
* @var array
3232
*/
33-
private static $validExtensions = ['sql.bz2' => 'bzip2', 'sql.gz' => 'gzip', 'sql' => false];
33+
protected static $validExtensions = ['sql.bz2' => 'bzip2', 'sql.gz' => 'gzip', 'sql' => false];
3434

3535
/**
3636
* Returns an absolute path
@@ -115,13 +115,13 @@ public function getDriver(ConnectionInterface $connection = null)
115115
* @param string $filename Filename
116116
* @return string|null Extension or `null` if the extension is not found or
117117
* if is an invalid extension
118-
* @uses getValidExtensions()
118+
* @uses $validExtensions
119119
*/
120120
public function getExtension($filename)
121121
{
122122
$extension = get_extension($filename);
123123

124-
return in_array($extension, $this->getValidExtensions()) ? $extension : null;
124+
return in_array($extension, array_keys(self::$validExtensions)) ? $extension : null;
125125
}
126126

127127
/**
@@ -134,15 +134,4 @@ public function getValidCompressions()
134134
{
135135
return array_filter(self::$validExtensions);
136136
}
137-
138-
/**
139-
* Returns all valid extensions
140-
* @return array
141-
* @since 2.4.0
142-
* @uses $validExtensions
143-
*/
144-
public function getValidExtensions()
145-
{
146-
return array_keys(self::$validExtensions);
147-
}
148137
}

src/TestSuite/DriverTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function testExport()
148148
*/
149149
public function testExportAndImport()
150150
{
151-
foreach ($this->getValidExtensions() as $extension) {
151+
foreach (self::$validExtensions as $extension) {
152152
$this->loadFixtures();
153153
$backup = $this->getAbsolutePath(sprintf('example.%s', $extension));
154154

tests/TestCase/BackupTraitTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,4 @@ public function testGetValidCompressions()
160160
{
161161
$this->assertNotEmpty($this->getValidCompressions());
162162
}
163-
164-
/**
165-
* Test for `getValidExtensions()` method
166-
* @test
167-
*/
168-
public function testGetValidExtensions()
169-
{
170-
$this->assertNotEmpty($this->getValidExtensions());
171-
}
172163
}

0 commit comments

Comments
 (0)