Skip to content

Commit

Permalink
since "String" is a reserved word in PHP7, had to replace all instanc…
Browse files Browse the repository at this point in the history
…es of the class name
  • Loading branch information
Ben Dubuisson committed Jun 12, 2017
1 parent d4a78be commit 6ddcff6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Four things are required to generate a pdf or an image:
### Available Inputs

- Request (generates content from a request)
- String (content is specified by a string)
- TextString (content is specified by a string)
- Template (generates content from a SilverStripe template)
- Url (generates content from a GET request to a Url)
- Viewer (generates contetn from an SSViewer instance)
Expand All @@ -37,7 +37,7 @@ Four things are required to generate a pdf or an image:
- Browser (outputs to the browser)
- File (outputs to a file)
- RandomFile (outputs to a random filename)
- String (outputs to a string)
- TextString (outputs to a string)

### Available Generators

Expand Down Expand Up @@ -82,7 +82,7 @@ new \Heyday\SilverStripe\WkHtml\Input\Request(
#### String

```php
new \Heyday\SilverStripe\WkHtml\Input\String(
new \Heyday\SilverStripe\WkHtml\Input\TextString(
<<<HTML
<h1>Title</h1>
HTML
Expand Down Expand Up @@ -187,7 +187,7 @@ new \Heyday\SilverStripe\WkHtml\Output\RandomFile(BASE_PATH);
#### String

```php
new \Heyday\SilverStripe\WkHtml\Output\String();
new \Heyday\SilverStripe\WkHtml\Output\TextString();
```

##Unit Testing
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
}
},
"require": {
"php": "^7.0",
"composer/installers": "~1.0",
"knplabs/knp-snappy": "~0.2.0",
"symfony/process": "~2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Heyday\SilverStripe\WkHtml\Input;

/**
* Class String
* Class TextString
* @package Heyday\SilverStripe\WkHtml\Input
*/
class String implements InputInterface
class TextString implements InputInterface
{
/**
* @var string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Knp\Snappy\GeneratorInterface;

class String implements OutputInterface
class TextString implements OutputInterface
{
/**
* @param $input
Expand Down
4 changes: 2 additions & 2 deletions tests/Heyday/SilverStripe/WkHtml/Input/StringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
class StringTest extends \PHPUnit_Framework_TestCase
{
/**
* @var String
* @var TextString
*/
protected $object;
/**
*
*/
protected function setUp()
{
$this->object = new String('test');
$this->object = new TextString('test');
}
/**
*
Expand Down
6 changes: 3 additions & 3 deletions tests/Heyday/SilverStripe/WkHtml/Output/StringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class StringTest extends \PHPUnit_Framework_TestCase
{
/**
* @var String
* @var TextString
*/
protected $object;

Expand All @@ -17,7 +17,7 @@ class StringTest extends \PHPUnit_Framework_TestCase
*/
protected function setUp()
{
// $this->object = new String;
// $this->object = new TextString;
}

/**
Expand All @@ -29,7 +29,7 @@ protected function tearDown()
}

/**
* @covers Heyday\SilverStripe\WkHtml\Output\String::process
* @covers Heyday\SilverStripe\WkHtml\Output\TextString::process
* @todo Implement testProcess().
*/
public function testProcess()
Expand Down

0 comments on commit 6ddcff6

Please sign in to comment.