Skip to content
Permalink
Browse files

minor #32315 [Filesystem] deprecate calling isAbsolutePath with a nul…

…l (smoench)

This PR was merged into the 4.4 branch.

Discussion
----------

[Filesystem] deprecate calling isAbsolutePath with a null

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This PR is a result of #32247 and deprecates calling `Filesystem::isAbsolutePath()` with a `null` value.

Commits
-------

9319018 [Filesystem] depreacte calling isAbsolutePath with a null
  • Loading branch information...
fabpot committed Jul 3, 2019
2 parents c3e914c + 9319018 commit 802dc1b1b26cc79c3b5da760a39afb6552475279
@@ -41,6 +41,11 @@ DependencyInjection
arguments: [!tagged_iterator app.handler]
```

Filesystem
----------

* Support for passing a `null` value to `Filesystem::isAbsolutePath()` is deprecated.

Form
----

@@ -134,6 +134,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 @@ public function mirror($originDir, $targetDir, \Traversable $iterator = null, $o
*/
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 @@ public function providePathsForIsAbsolutePath()
['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;

0 comments on commit 802dc1b

Please sign in to comment.
You can’t perform that action at this time.