diff --git a/.travis.yml b/.travis.yml index 6ba7bab..c2339a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,24 @@ -language: php - -php: - - 5.3.3 - - 5.3 - - 5.4 - - 5.5 - - -matrix: - allow_failures: - - php: 5.5 - -before_script: - - composer install --dev --prefer-source - -script: phpunit --coverage-text - -notifications: - email: - - helios.ag@gmail.com \ No newline at end of file +language: php + +php: + - 5.4 + - 5.5 + - 5.6 + - hhvm + + +matrix: + allow_failures: + - php: 5.6 + - hhvm + +before_script: +- travis_retry composer self-update +- travis_retry composer install --dev --prefer-source + +script: phpunit --coverage-text + +notifications: + email: + - helios.ag@gmail.com + diff --git a/Command/DumpEmoticonsCommand.php b/Command/DumpEmoticonsCommand.php index 9eff8e6..63acda5 100644 --- a/Command/DumpEmoticonsCommand.php +++ b/Command/DumpEmoticonsCommand.php @@ -31,7 +31,7 @@ protected function configure() * @param $src * @param $dst */ - private function recurse_copy($src,$dst) + private function recurseCopy($src,$dst) { $dir = opendir($src); @mkdir($dst); @@ -62,11 +62,11 @@ protected function execute(InputInterface $input, OutputInterface $output) $emoticonsFolder = $this->getContainer()->getParameter('kernel.root_dir').$input->getOption('emoticons-folder'); - if (!file_exists($emoticonsFolder) and !is_dir($emoticonsFolder)) { + if (!file_exists($emoticonsFolder) && !is_dir($emoticonsFolder)) { return $output->writeln('Emoticons folder does not exist'); } - $this->recurse_copy($emoticonsFolder,$webFolder); + $this->recurseCopy($emoticonsFolder,$webFolder); $output->writeln('Emoticons dumped succesfully'); } diff --git a/Composer/ScriptHandler.php b/Composer/ScriptHandler.php index a066d32..c30405d 100644 --- a/Composer/ScriptHandler.php +++ b/Composer/ScriptHandler.php @@ -2,7 +2,6 @@ namespace FM\BbcodeBundle\Composer; -use Symfony\Component\Process\Process; use Sensio\Bundle\DistributionBundle\Composer\ScriptHandler as BaseHandler; /** @@ -21,3 +20,4 @@ public static function installEmoticons($event) } } + diff --git a/Decoda/Decoda.php b/Decoda/Decoda.php index 6063d99..f3933d9 100644 --- a/Decoda/Decoda.php +++ b/Decoda/Decoda.php @@ -2,7 +2,6 @@ namespace FM\BbcodeBundle\Decoda; -use Decoda\Component; use Decoda\Loader\DataLoader; use Decoda\Loader; use Decoda\Hook; diff --git a/Decoda/Hook/EmoticonHook.php b/Decoda/Hook/EmoticonHook.php index 8d507ab..c00faf3 100644 --- a/Decoda/Hook/EmoticonHook.php +++ b/Decoda/Hook/EmoticonHook.php @@ -8,7 +8,6 @@ use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; -use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\Config\ConfigCache; use Decoda\Decoda; diff --git a/Emoticon/EmoticonCollection.php b/Emoticon/EmoticonCollection.php index c99415d..5298821 100644 --- a/Emoticon/EmoticonCollection.php +++ b/Emoticon/EmoticonCollection.php @@ -185,4 +185,5 @@ public function addResource(ResourceInterface $resource) { $this->resources[] = $resource; } -} \ No newline at end of file +} + diff --git a/Emoticon/Loader/YamlFileLoader.php b/Emoticon/Loader/YamlFileLoader.php index 0abdd10..4921757 100644 --- a/Emoticon/Loader/YamlFileLoader.php +++ b/Emoticon/Loader/YamlFileLoader.php @@ -82,7 +82,7 @@ private function validate($content, $file) } if (!is_array($content)) { - throw new InvalidArgumentException(sprintf('The emoticon file "%s" is not valid.', $file)); + throw new \InvalidArgumentException(sprintf('The emoticon file "%s" is not valid.', $file)); } return $content; diff --git a/Emoticon/Matcher/Matcher.php b/Emoticon/Matcher/Matcher.php index 459f090..1c45c23 100644 --- a/Emoticon/Matcher/Matcher.php +++ b/Emoticon/Matcher/Matcher.php @@ -52,4 +52,5 @@ public function getSmilies() { return $this->emoticons->getSmilies(); } -} \ No newline at end of file +} + diff --git a/README.md b/README.md index df55160..730f9d6 100644 --- a/README.md +++ b/README.md @@ -1,265 +1,260 @@ -FMBBCodeBundle -============== - -[![Build Status](https://travis-ci.org/helios-ag/FMBbCodeBundle.png?branch=master)](https://travis-ci.org/helios-ag/FMBbCodeBundle) - -[![knpbundles.com](http://knpbundles.com/helios-ag/FMBbCodeBundle/badge)](http://knpbundles.com/helios-ag/FMBbCodeBundle) - -[![Total Downloads](https://poser.pugx.org/helios-ag/fm-bbcode-bundle/d/total.png)](https://packagist.org/packages/helios-ag/fm-bbcode-bundle) - -[![Latest Stable Version](https://poser.pugx.org/helios-ag/fm-bbcode-bundle/version.png)](https://packagist.org/packages/helios-ag/fm-bbcode-bundle) - -[PHP-Decoda](https://github.com/milesj/decoda) integration in Symfony2 - -A lightweight lexical string parser for BBCode styled markup. - -## Installation - -To install this bundle, you'll need both the [Decoda library](https://github.com/milesj/decoda) -and this bundle. Installation depends on how your project is setup: - -### Step 1: Installation - -Using Composer, just add the following configuration to your `composer.json`: - -Or you can use composer to install this bundle: -Add FMBbcodeBundle in your composer.json: - -```json -{ - "require": { - "helios-ag/fm-bbcode-bundle": "6.2.1" - } -} -``` - -Now tell composer to download the bundle by running the command: - -``` bash -$ php composer.phar update helios-ag/fm-bbcode-bundle -``` - -### Step 2: Enable the bundle - -Finally, enable the bundle in the kernel: - -``` php - - xHtml: # Default: - smilies: - - ":my_emoticon:" -``` - -### How to automatically dump emoticons on each deploy - -Add the following commands to you projects composer.json: - -```json -# composer.json - "scripts": { - "post-install-cmd": [ - "FM\\BbcodeBundle\\Composer\\ScriptHandler::installEmoticons" - ], - "post-update-cmd": [ - "FM\\BbcodeBundle\\Composer\\ScriptHandler::installEmoticons" - ] - } -``` - -## Contributors - -* Gaiffe Antoine [toinouu](https://github.com/toinouu) -* Luis Íñiguez [idetia](https://github.com/idetia) -* Sebastian [slider](https://github.com/slider) -* [olleyyy](https://github.com/olleyyy) -* Dirk Olbertz [dolbertz](https://github.com/dolbertz) -* Florian Krauthan [fkrauthan](https://github.com/fkrauthan) -* [predakanga](https://github.com/predakanga) -* Dan [piratadelfuturo](https://github.com/piratadelfuturo) -* Alexandre Quercia [alquerci](https://github.com/alquerci) - - - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/helios-ag/fmbbcodebundle/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - +FMBBCodeBundle +============== + +[![Build Status](https://travis-ci.org/helios-ag/FMBbCodeBundle.png?branch=master)](https://travis-ci.org/helios-ag/FMBbCodeBundle) + +[![Total Downloads](https://poser.pugx.org/helios-ag/fm-bbcode-bundle/d/total.png)](https://packagist.org/packages/helios-ag/fm-bbcode-bundle) + +[![Latest Stable Version](https://poser.pugx.org/helios-ag/fm-bbcode-bundle/version.png)](https://packagist.org/packages/helios-ag/fm-bbcode-bundle) + +[PHP-Decoda](https://github.com/milesj/decoda) integration in Symfony2 + +A lightweight lexical string parser for BBCode styled markup. + +## Installation + +To install this bundle, you'll need both the [Decoda library](https://github.com/milesj/decoda) +and this bundle. Installation depends on how your project is setup: + +### Step 1: Installation + +Using Composer, just add the following configuration to your `composer.json`: + +Or you can use composer to install this bundle: +Add FMBbcodeBundle in your composer.json: + +```json +{ + "require": { + "helios-ag/fm-bbcode-bundle": "6.2.1" + } +} +``` + +Now tell composer to download the bundle by running the command: + +``` bash +$ php composer.phar update helios-ag/fm-bbcode-bundle +``` + +### Step 2: Enable the bundle + +Finally, enable the bundle in the kernel: + +``` php + + xHtml: # Default: + smilies: + - ":my_emoticon:" +``` + +### How to automatically dump emoticons on each deploy + +Add the following commands to you projects composer.json: + +```json +# composer.json + "scripts": { + "post-install-cmd": [ + "FM\\BbcodeBundle\\Composer\\ScriptHandler::installEmoticons" + ], + "post-update-cmd": [ + "FM\\BbcodeBundle\\Composer\\ScriptHandler::installEmoticons" + ] + } +``` + +## Contributors + +* Gaiffe Antoine [toinouu](https://github.com/toinouu) +* Luis Íñiguez [idetia](https://github.com/idetia) +* Sebastian [slider](https://github.com/slider) +* [olleyyy](https://github.com/olleyyy) +* Dirk Olbertz [dolbertz](https://github.com/dolbertz) +* Florian Krauthan [fkrauthan](https://github.com/fkrauthan) +* [predakanga](https://github.com/predakanga) +* Dan [piratadelfuturo](https://github.com/piratadelfuturo) +* Alexandre Quercia [alquerci](https://github.com/alquerci) + + diff --git a/Templating/BbcodeExtension.php b/Templating/BbcodeExtension.php index dc03a4e..5717a56 100644 --- a/Templating/BbcodeExtension.php +++ b/Templating/BbcodeExtension.php @@ -2,8 +2,6 @@ namespace FM\BbcodeBundle\Templating; -use FM\BbcodeBundle\Translation\Loader\FileLoader; - use Symfony\Component\DependencyInjection\ContainerInterface; use FM\BbcodeBundle\Decoda\Decoda as Decoda; use FM\BbcodeBundle\Decoda\DecodaManager as DecodaManager; @@ -88,3 +86,4 @@ public function getName() return 'fm_bbcode'; } } + diff --git a/composer.json b/composer.json index 024a17f..f155474 100644 --- a/composer.json +++ b/composer.json @@ -1,42 +1,42 @@ -{ - "name": "helios-ag/fm-bbcode-bundle", - "type": "symfony-bundle", - "description": "Symfony FMBbCodeBundle", - "keywords": ["bbcode"], - "homepage": "https://github.com/helios-ag/FMBbCodeBundle", - "license": "MIT", - "authors": [ - { - "name": "Albert Ganiev", - "email": "helios.ag@gmail.com" - } - ], - "require": { - "php": ">=5.3.2", - "mjohnson/decoda": "6.*", - "symfony/twig-bundle": "~2.0", - "symfony/assetic-bundle": "~2.0", - "symfony/config": "~2.0", - "symfony/console": "~2.0", - "symfony/dependency-injection": "~2.0", - "symfony/framework-bundle": "~2.1", - "symfony/http-foundation": "~2.1", - "symfony/http-kernel": "~2.0", - "symfony/process": "~2.0", - "symfony/templating": "~2.0", - "symfony/yaml": "~2.0", - "sensio/distribution-bundle": ">=2.1" - }, - "require-dev": { - "symfony/symfony": "~2.1" - }, - "autoload": { - "psr-4": { "FM\\BbcodeBundle\\": "" } - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "6.x-dev" - } - } -} +{ + "name": "helios-ag/fm-bbcode-bundle", + "type": "symfony-bundle", + "description": "Symfony FMBbCodeBundle", + "keywords": ["bbcode"], + "homepage": "https://github.com/helios-ag/FMBbCodeBundle", + "license": "MIT", + "authors": [ + { + "name": "Albert Ganiev", + "email": "helios.ag@gmail.com" + } + ], + "require": { + "php": ">=5.3.2", + "mjohnson/decoda": "6.*", + "symfony/twig-bundle": "~2.0", + "symfony/assetic-bundle": "~2.0", + "symfony/config": "~2.0", + "symfony/console": "~2.0", + "symfony/dependency-injection": "~2.0", + "symfony/framework-bundle": "~2.1", + "symfony/http-foundation": "~2.1", + "symfony/http-kernel": "~2.0", + "symfony/process": "~2.0", + "symfony/templating": "~2.0", + "symfony/yaml": "~2.0", + "sensio/distribution-bundle": ">=2.1" + }, + "require-dev": { + "symfony/symfony": "~2.1" + }, + "autoload": { + "psr-4": { "FM\\BbcodeBundle\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + } + } +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index df20125..67c54cd 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,26 +1,27 @@ - - - - - - - ./Tests - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - - - - - - \ No newline at end of file + + + + + + + ./Tests + + + + + + ./ + + ./Resources + ./Tests + ./vendor + + + + + + + + + +