Skip to content

Commit 825b4f3

Browse files
tongyifanRhilip
authored andcommitted
fix: typo setSouce
1 parent 36ba9cd commit 825b4f3

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ try {
155155
}
156156
$name = $torrent->getName();
157157

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

161161
$private = $torrent->isPrivate(); // true or false

src/TorrentFile.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,18 @@ public function getSource()
467467
* clients supporting it natively. Returns a boolean on whether or not the source was changed
468468
* so that an appropriate screen can be shown to the user.
469469
*/
470-
public function setSouce($souce)
470+
public function setSource($source)
471471
{
472472
$this->unsetInfoField('x_cross_seed')->unsetInfoField('unique');
473-
return $this->setInfoField('source', $souce);
473+
return $this->setInfoField('source', $source);
474+
}
475+
476+
/**
477+
* @deprecated typo of function `setSource`
478+
*/
479+
public function setSouce($source)
480+
{
481+
return $this->setSource($source);
474482
}
475483

476484
public function isPrivate()

tests/traits/TorrentFileCommonTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function testSource()
178178
$this->assertEquals($this->source, $this->torrent->getSource());
179179

180180
$source = "new source";
181-
$this->torrent->setSouce($source);
181+
$this->torrent->setSource($source);
182182
$this->assertEquals($source, $this->torrent->getSource());
183183
}
184184

0 commit comments

Comments
 (0)