Skip to content

Commit

Permalink
fix: typo setSouce
Browse files Browse the repository at this point in the history
  • Loading branch information
tongyifan authored and Rhilip committed Apr 2, 2022
1 parent 36ba9cd commit 825b4f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ try {
}
$name = $torrent->getName();

$torrent->setSouce('Rhilip\'s blog');
$torrent->setSource('Rhilip\'s blog');
$source = $torrent->getSource();

$private = $torrent->isPrivate(); // true or false
Expand Down
12 changes: 10 additions & 2 deletions src/TorrentFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,18 @@ public function getSource()
* clients supporting it natively. Returns a boolean on whether or not the source was changed
* so that an appropriate screen can be shown to the user.
*/
public function setSouce($souce)
public function setSource($source)
{
$this->unsetInfoField('x_cross_seed')->unsetInfoField('unique');
return $this->setInfoField('source', $souce);
return $this->setInfoField('source', $source);
}

/**
* @deprecated typo of function `setSource`
*/
public function setSouce($source)
{
return $this->setSource($source);
}

public function isPrivate()
Expand Down
2 changes: 1 addition & 1 deletion tests/traits/TorrentFileCommonTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function testSource()
$this->assertEquals($this->source, $this->torrent->getSource());

$source = "new source";
$this->torrent->setSouce($source);
$this->torrent->setSource($source);
$this->assertEquals($source, $this->torrent->getSource());
}

Expand Down

0 comments on commit 825b4f3

Please sign in to comment.