Skip to content

Commit

Permalink
Deprecate unused argument 3 in Replicate::write()
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Aug 17, 2021
1 parent 2699135 commit 1409472
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions UPGRADE-3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ UPGRADE FROM 3.x to 3.x

Added implementation for `Gaufrette\Adapter\FileFactory` and `Gaufrette\Adapter\StreamFactory`.
Method `createFileStream()` is deprecated in favor of `createStream()`.
Argument 3 (`?array $metadata = null`) in method `write()` is deprecated.

### Sonata\MediaBundle\Thumbnail\ResizableThumbnailInterface

Expand Down
11 changes: 11 additions & 0 deletions src/Filesystem/Replicate.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,19 @@ public function exists($key)
return $this->primary->exists($key);
}

/**
* NEXT_MAJOR: Remove argument 3.
*/
public function write($key, $content, ?array $metadata = null)
{
if (3 === \func_num_args()) {
@trigger_error(sprintf(
'Argument 3 in "%s()" method is deprecated since sonata-project/media-bundle 3.x'
.' and will be removed in version 4.0.',
__METHOD__
), \E_USER_DEPRECATED);
}

$ok = true;
$return = false;

Expand Down

0 comments on commit 1409472

Please sign in to comment.