Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Twig 2.* #162

Merged
merged 1 commit into from
Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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