Remove file __toString behaviour

Casting a file to a string to get the content is a bit of a dirty
pattern.
This commit is contained in:
adlawson 2015-07-21 12:30:08 +01:00
parent 407af5ef5b
commit 30e428df47
3 changed files with 0 additions and 20 deletions

View File

@ -103,12 +103,4 @@ class File implements FileInterface
{ {
return strlen($this->content); return strlen($this->content);
} }
/**
* {@inheritdoc}
*/
public function __toString()
{
return $this->content;
}
} }

View File

@ -20,9 +20,4 @@ interface FileInterface extends NodeInterface
* @param string $content * @param string $content
*/ */
public function setContent($content); public function setContent($content);
/**
* @return string The file content
*/
public function __toString();
} }

View File

@ -29,13 +29,6 @@ class FileTest extends UnitTestCase
$this->assertEquals('foo', $file->getContent()); $this->assertEquals('foo', $file->getContent());
} }
public function testToString()
{
$file = new File('foo');
$this->assertEquals('foo', (string) $file);
}
public function testGetDateAccessed() public function testGetDateAccessed()
{ {
$file = new File(); $file = new File();