Skip to content

Commit

Permalink
Prepare for PhpSpec 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavis1982 committed Jul 22, 2016
1 parent dd784df commit 7204c8c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ To install this, make sure you are using the latest release of PHPSpec, and then
```json
"require-dev": {
...,
"phpspec/nyan-formatters": "1.*"
"phpspec/nyan-formatters": "2.*"
}
```

Install or update your dependencies, and then in a `phpspec.yml` file in the root of your project, add the following:

```yaml
extensions:
- PhpSpec\NyanFormattersExtension\Extension
PhpSpec\NyanFormattersExtension\Extension: ~
```
Then, you can add a `--format` switch to your `phpspec` command with one of the following values:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "MIT",
"require": {
"php": ">=5.3.3",
"phpspec/phpspec": "~2.0",
"phpspec/phpspec": "~3.0",
"whatthejeff/nyancat-scoreboard": "~1.1"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion phpspec.yml.dist
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
extensions:
- PhpSpec\NyanFormattersExtension\Extension
PhpSpec\NyanFormattersExtension\Extension: ~
8 changes: 4 additions & 4 deletions src/PhpSpec/NyanFormattersExtension/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace PhpSpec\NyanFormattersExtension;

use PhpSpec\Extension\ExtensionInterface;
use PhpSpec\Extension as PhpSpecExtension;
use PhpSpec\ServiceContainer;

/**
Expand All @@ -12,12 +12,12 @@
*
* @author Matthew Davis <[email protected]>
*/
class Extension implements ExtensionInterface
class Extension implements PhpSpecExtension
{
/**
* {@inheritdoc}
*/
public function load(ServiceContainer $container)
public function load(ServiceContainer $container, array $params)
{
$this->addFormatter($container, 'cat', 'PhpSpec\NyanFormattersExtension\Formatter\NyanFormatter');
$this->addFormatter($container, 'dino', 'PhpSpec\NyanFormattersExtension\Formatter\DinoFormatter');
Expand All @@ -33,7 +33,7 @@ public function load(ServiceContainer $container)
*/
protected function addFormatter(ServiceContainer $container, $name, $class)
{
$container->set('formatter.formatters.nyan.' . $name, function ($c) use ($class) {
$container->define('formatter.formatters.nyan.' . $name, function ($c) use ($class) {
/** @var ServiceContainer $c */
return new $class(
$c->get('formatter.presenter'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpSpec\Event\SuiteEvent;
use PhpSpec\Event\ExampleEvent;
use PhpSpec\Formatter\DotFormatter;
use PhpSpec\Formatter\ConsoleFormatter;

use NyanCat\Cat;
use NyanCat\Rainbow;
Expand All @@ -21,7 +21,7 @@
* @author Jeff Welch <[email protected]>
* @author Matthew Davis <[email protected]>
*/
class NyanFormatter extends DotFormatter
class NyanFormatter extends ConsoleFormatter
{
/**
* The number of examples
Expand Down

0 comments on commit 7204c8c

Please sign in to comment.