Thanks to visit codestin.com
Credit goes to github.com

Skip to content

clean up remaining deprecations #32393

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

Merged
merged 1 commit into from
Jul 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ protected function doFetch(array $ids)
$values[$id] = null;
} elseif (!\is_object($value)) {
$values[$id] = $value;
} elseif (!$value instanceof LazyValue) {
// calling a Closure is for @deprecated BC and should be removed in Symfony 5.0
$values[$id] = $value();
} elseif (false === $values[$id] = include $value->file) {
unset($values[$id], $this->values[$id]);
$missingIds[] = $id;
Expand Down
4 changes: 0 additions & 4 deletions src/Symfony/Component/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,6 @@ 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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we throw instead?

Copy link
Member Author

@xabbuh xabbuh Jul 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another PR adding a type hint for this argument.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

return strspn($file, '/\\', 0, 1)
|| (\strlen($file) > 3 && ctype_alpha($file[0])
&& ':' === $file[1]
Expand Down
9 changes: 0 additions & 9 deletions src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1400,15 +1400,6 @@ public function providePathsForIsAbsolutePath()
];
}

/**
* @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;
Expand Down
4 changes: 0 additions & 4 deletions src/Symfony/Component/PropertyAccess/PropertyAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,10 +820,6 @@ private function getPropertyPath($propertyPath): PropertyPath
*/
public static function createCache(string $namespace, int $defaultLifetime, string $version, LoggerInterface $logger = null)
{
if (null === $defaultLifetime) {
@trigger_error(sprintf('Passing null as "$defaultLifetime" 2nd argument of the "%s()" method is deprecated since Symfony 4.4, pass 0 instead.', __METHOD__), E_USER_DEPRECATED);
}

if (!class_exists('Symfony\Component\Cache\Adapter\ApcuAdapter')) {
throw new \LogicException(sprintf('The Symfony Cache component must be installed to use %s().', __METHOD__));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ public function setPlural(int $number)
*/
public function setCode(?string $code)
{
if (null !== $code && !\is_string($code)) {
@trigger_error(sprintf('Not using a string as the error code in %s() is deprecated since Symfony 4.4. A type-hint will be added in 5.0.', __METHOD__), E_USER_DEPRECATED);
}

$this->code = $code;

return $this;
Expand Down