[Filesystem] depreacte calling isAbsolutePath with a null
This commit is contained in:
parent
64eaf7e3a6
commit
93190182f6
|
@ -41,6 +41,11 @@ DependencyInjection
|
|||
arguments: [!tagged_iterator app.handler]
|
||||
```
|
||||
|
||||
Filesystem
|
||||
----------
|
||||
|
||||
* Support for passing a `null` value to `Filesystem::isAbsolutePath()` is deprecated.
|
||||
|
||||
Form
|
||||
----
|
||||
|
||||
|
|
|
@ -135,6 +135,7 @@ EventDispatcher
|
|||
Filesystem
|
||||
----------
|
||||
|
||||
* The `Filesystem::isAbsolutePath()` method no longer supports `null` in the `$file` argument.
|
||||
* The `Filesystem::dumpFile()` method no longer supports arrays in the `$content` argument.
|
||||
* The `Filesystem::appendToFile()` method no longer supports arrays in the `$content` argument.
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
CHANGELOG
|
||||
=========
|
||||
|
||||
4.4.0
|
||||
-----
|
||||
|
||||
* support for passing a `null` value to `Filesystem::isAbsolutePath()` is deprecated and will be removed in 5.0
|
||||
|
||||
4.3.0
|
||||
-----
|
||||
|
||||
|
|
|
@ -600,6 +600,10 @@ class Filesystem
|
|||
*/
|
||||
public function isAbsolutePath($file)
|
||||
{
|
||||
if (null === $file) {
|
||||
@trigger_error(sprintf('Calling "%s()" with a null in the $file argument is deprecated since Symfony 4.4.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
return strspn($file, '/\\', 0, 1)
|
||||
|| (\strlen($file) > 3 && ctype_alpha($file[0])
|
||||
&& ':' === $file[1]
|
||||
|
|
|
@ -1397,10 +1397,18 @@ class FilesystemTest extends FilesystemTestCase
|
|||
['var/lib', false],
|
||||
['../var/lib', false],
|
||||
['', false],
|
||||
[null, false],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedDeprecation Calling "Symfony\Component\Filesystem\Filesystem::isAbsolutePath()" with a null in the $file argument is deprecated since Symfony 4.4.
|
||||
*/
|
||||
public function testIsAbsolutePathWithNull()
|
||||
{
|
||||
$this->assertFalse($this->filesystem->isAbsolutePath(null));
|
||||
}
|
||||
|
||||
public function testTempnam()
|
||||
{
|
||||
$dirname = $this->workspace;
|
||||
|
|
Reference in New Issue