Skip to content

Commit

Permalink
Allow Twig 2 (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeFr authored and Florian Eckerstorfer committed Mar 23, 2017
1 parent 42ab8c9 commit 7623d7b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 22 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ removing these characters, Slugify approximates them (e.g., `ae` replaces `ä`).
- PSR-4 compatible.
- Compatible with PHP >= 5.5.9, PHP 7 and [HHVM](http://hhvm.com).
- Integrations for [Symfony2](http://symfony.com), [Silex (1 and 2)](http://silex.sensiolabs.org), [Laravel](http://laravel.com),
[Twig](http://twig.sensiolabs.org), [Zend Framework 2](http://framework.zend.com/), [Nette Framework](http://nette.org/),
[Twig (1 and 2)](http://twig.sensiolabs.org), [Zend Framework 2](http://framework.zend.com/), [Nette Framework](http://nette.org/),
[Latte](http://latte.nette.org/) and [Plum](https://github.com/plumphp/plum).


Expand Down Expand Up @@ -95,7 +95,7 @@ You can find a list of the available rulesets in `Resources/rules`.

### More options

The constructor takes an options array, you have already seen the `rulesets` options above. You can also change the
The constructor takes an options array, you have already seen the `rulesets` options above. You can also change the
regular expression that is used to replace characters with the separator.

```php
Expand Down Expand Up @@ -654,7 +654,7 @@ inform us if a transliteration is wrong. We would highly appreciate it if you ca
Github. If you have never contributed to a project on Github we are happy to help you. Just ask on Twitter or directly
join our Gitter.

You always can help me (Florian, the original developer and maintainer) out by
You always can help me (Florian, the original developer and maintainer) out by
[sending me an Euro or two](https://paypal.me/florianec/2).


Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"symfony/config": "~2.4|~3.0",
"symfony/dependency-injection": "~2.4|~3.0",
"symfony/http-kernel": "~2.4|~3.0",
"twig/twig": "~1.12",
"twig/twig": "~1.26|~2.0",
"zendframework/zend-modulemanager": "~2.2",
"zendframework/zend-servicemanager": "~2.2",
"zendframework/zend-view": "~2.2"
Expand Down
8 changes: 0 additions & 8 deletions src/Bridge/Twig/SlugifyExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,4 @@ public function slugifyFilter($string, $separator = null)
{
return $this->slugify->slugify($string, $separator);
}

/**
* {@inheritDoc}
*/
public function getName()
{
return 'slugify_extension';
}
}
3 changes: 2 additions & 1 deletion tests/Bridge/Silex/SlugifySilexProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Cocur\Slugify\Tests\Bridge\Silex;

use Cocur\Slugify\Bridge\Silex\SlugifyServiceProvider;
use Cocur\Slugify\Bridge\Twig\SlugifyExtension;
use Silex\Application;
use Silex\Provider\TwigServiceProvider;

Expand Down Expand Up @@ -54,6 +55,6 @@ public function registerWithTwig()
$app->register(new TwigServiceProvider());
$app->register(new SlugifyServiceProvider());

$this->assertTrue($app['twig']->hasExtension('slugify_extension'));
$this->assertTrue($app['twig']->hasExtension(SlugifyExtension::class));
}
}
9 changes: 0 additions & 9 deletions tests/Bridge/Twig/SlugifyExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ protected function setUp()
$this->extension = new SlugifyExtension($this->slugify);
}

/**
* @test
* @covers Cocur\Slugify\Bridge\Twig\SlugifyExtension::getName()
*/
public function getNameReturnsNameOfExtension()
{
$this->assertEquals('slugify_extension', $this->extension->getName());
}

/**
* @test
* @covers Cocur\Slugify\Bridge\Twig\SlugifyExtension::getFilters()
Expand Down

0 comments on commit 7623d7b

Please sign in to comment.