diff --git a/DependencyInjection/CMENGoogleChartsExtension.php b/DependencyInjection/CMENGoogleChartsExtension.php index ecad9f3..308cd83 100755 --- a/DependencyInjection/CMENGoogleChartsExtension.php +++ b/DependencyInjection/CMENGoogleChartsExtension.php @@ -2,10 +2,10 @@ namespace CMEN\GoogleChartsBundle\DependencyInjection; -use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; class CMENGoogleChartsExtension extends Extension { diff --git a/GoogleCharts/Events.php b/GoogleCharts/Events.php index 1a71741..af662f5 100644 --- a/GoogleCharts/Events.php +++ b/GoogleCharts/Events.php @@ -21,8 +21,6 @@ class Events /** * Events constructor. - * - * @param Chart $chart */ public function __construct(Chart $chart) { diff --git a/GoogleCharts/Options/BarChart/BarChartOptions.php b/GoogleCharts/Options/BarChart/BarChartOptions.php index ab9c183..1a8cd78 100644 --- a/GoogleCharts/Options/BarChart/BarChartOptions.php +++ b/GoogleCharts/Options/BarChart/BarChartOptions.php @@ -3,17 +3,17 @@ namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\BarChart; use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedAnimation; +use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedAnnotations; use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedChartOptions; +use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedLegend; use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedTooltip; use CMEN\GoogleChartsBundle\GoogleCharts\Options\Bar; use CMEN\GoogleChartsBundle\GoogleCharts\Options\DataOpacityTrait; use CMEN\GoogleChartsBundle\GoogleCharts\Options\Explorer; -use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedLegend; use CMEN\GoogleChartsBundle\GoogleCharts\Options\FocusTargetTrait; use CMEN\GoogleChartsBundle\GoogleCharts\Options\HAxis; use CMEN\GoogleChartsBundle\GoogleCharts\Options\IsStackedTrait; use CMEN\GoogleChartsBundle\GoogleCharts\Options\MediumHAxis; -use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedAnnotations; use CMEN\GoogleChartsBundle\GoogleCharts\Options\OrientationTrait; use CMEN\GoogleChartsBundle\GoogleCharts\Options\ReverseCategoriesTrait; use CMEN\GoogleChartsBundle\GoogleCharts\Options\Trendlines; diff --git a/Output/AbstractChartOutput.php b/Output/AbstractChartOutput.php index 4a6161c..4ef808c 100644 --- a/Output/AbstractChartOutput.php +++ b/Output/AbstractChartOutput.php @@ -59,9 +59,7 @@ public function setLanguage($language) protected function checkElementsId(array $charts, array $elementsID) { if (count($charts) != count($elementsID)) { - throw new GoogleChartsException( - 'Array charts and array HTML elements ID do not have the same number of element.' - ); + throw new GoogleChartsException('Array charts and array HTML elements ID do not have the same number of element.'); } foreach ($elementsID as $elementId) { diff --git a/Output/ChartOutputInterface.php b/Output/ChartOutputInterface.php index f905486..bcbf169 100644 --- a/Output/ChartOutputInterface.php +++ b/Output/ChartOutputInterface.php @@ -13,8 +13,6 @@ interface ChartOutputInterface /** * Returns a string to draw the beginning of the chart (Declaration, data and options). * - * @param Chart $chart - * * @return string * * @throws GoogleChartsException @@ -24,8 +22,6 @@ public function startChart(Chart $chart); /** * Returns a string to draw the end of the chart (Events and drawing). * - * @param Chart $chart - * * @return string */ public function endChart(Chart $chart); diff --git a/Output/DataOutputInterface.php b/Output/DataOutputInterface.php index 9a0f705..0b3fc21 100644 --- a/Output/DataOutputInterface.php +++ b/Output/DataOutputInterface.php @@ -13,7 +13,6 @@ interface DataOutputInterface /** * Returns a string to draw data. * - * @param Data $data * @param string $dataName Variable name who will contain the data * * @return string diff --git a/Output/DateOutputInterface.php b/Output/DateOutputInterface.php index 368d6e5..3c707f9 100644 --- a/Output/DateOutputInterface.php +++ b/Output/DateOutputInterface.php @@ -10,8 +10,6 @@ interface DateOutputInterface /** * Returns a string to draw a DateTimeInterface object. * - * @param \DateTimeInterface $date - * * @return string */ public function draw(\DateTimeInterface $date); diff --git a/Output/EventsOutputInterface.php b/Output/EventsOutputInterface.php index b0523ed..8a26e1c 100644 --- a/Output/EventsOutputInterface.php +++ b/Output/EventsOutputInterface.php @@ -10,7 +10,6 @@ interface EventsOutputInterface /** * Returns a string to draw events of a chart. * - * @param Events $events * @param string $chartName * * @return string diff --git a/Output/Javascript/ChartOutput.php b/Output/Javascript/ChartOutput.php index 790d18e..ceb616b 100644 --- a/Output/Javascript/ChartOutput.php +++ b/Output/Javascript/ChartOutput.php @@ -27,11 +27,8 @@ class ChartOutput extends AbstractChartOutput /** * ChartOutput constructor. * - * @param string $version - * @param string $language - * @param OptionsOutputInterface $optionsOutput - * @param DataOutputInterface $dataOutput - * @param EventsOutputInterface $eventsOutput + * @param string $version + * @param string $language */ public function __construct( $version, diff --git a/Output/Javascript/DataOutput.php b/Output/Javascript/DataOutput.php index b5e805d..49cebac 100644 --- a/Output/Javascript/DataOutput.php +++ b/Output/Javascript/DataOutput.php @@ -17,8 +17,6 @@ class DataOutput implements DataOutputInterface /** * DataOutput constructor. - * - * @param DateOutputInterface $dateOutput */ public function __construct(DateOutputInterface $dateOutput) { @@ -33,9 +31,7 @@ public function draw(Data $data, $dataName) $arrayToDataTable = $data->getArrayToDataTable(); if (!$arrayToDataTable) { - throw new GoogleChartsException( - 'There is no data for chart. Use method setArrayToDataTable() to provide data.' - ); + throw new GoogleChartsException('There is no data for chart. Use method setArrayToDataTable() to provide data.'); } $js = "var $dataName = new google.visualization.arrayToDataTable(["; diff --git a/Output/Javascript/OptionsOutput.php b/Output/Javascript/OptionsOutput.php index 5a89ab8..24cbbf3 100644 --- a/Output/Javascript/OptionsOutput.php +++ b/Output/Javascript/OptionsOutput.php @@ -16,8 +16,6 @@ class OptionsOutput extends AbstractOptionsOutput /** * OptionsOutput constructor. - * - * @param DateOutputInterface $dateOutput */ public function __construct(DateOutputInterface $dateOutput) { diff --git a/Output/OptionsOutputInterface.php b/Output/OptionsOutputInterface.php index a1189ff..d71193f 100644 --- a/Output/OptionsOutputInterface.php +++ b/Output/OptionsOutputInterface.php @@ -38,8 +38,7 @@ public function renameRecursivelyKeys($options); * a string or an array. If an option have a null value, an empty array or an empty class, it is not returned : * the default value will be applied. * - * @param ChartOptionsInterface $options - * @param string $optionsName Variable name who will contain the options + * @param string $optionsName Variable name who will contain the options * * @return string */ diff --git a/Tests/GoogleCharts/Charts/AnnotationChartTest.php b/Tests/GoogleCharts/Charts/AnnotationChartTest.php index 080cdae..5a12217 100644 --- a/Tests/GoogleCharts/Charts/AnnotationChartTest.php +++ b/Tests/GoogleCharts/Charts/AnnotationChartTest.php @@ -1,6 +1,6 @@ ['html']]), - new \Twig_SimpleFunction('gc_start', [$this, 'gcStart'], ['is_safe' => ['html']]), - new \Twig_SimpleFunction('gc_end', [$this, 'gcEnd'], ['is_safe' => ['html']]), - new \Twig_SimpleFunction('gc_event', [$this, 'gcEvent'], ['is_safe' => ['html']]), - new \Twig_SimpleFunction('gc_language', [$this, 'gcLanguage']), + new TwigFunction('gc_draw', [$this, 'gcDraw'], ['is_safe' => ['html']]), + new TwigFunction('gc_start', [$this, 'gcStart'], ['is_safe' => ['html']]), + new TwigFunction('gc_end', [$this, 'gcEnd'], ['is_safe' => ['html']]), + new TwigFunction('gc_event', [$this, 'gcEvent'], ['is_safe' => ['html']]), + new TwigFunction('gc_language', [$this, 'gcLanguage']), ]; } diff --git a/composer.json b/composer.json index accbd96..435aa6d 100644 --- a/composer.json +++ b/composer.json @@ -11,13 +11,20 @@ ], "require": { "php": "^5.6 || ^7.0", - "symfony/framework-bundle": "^2.7 || ^3.0 || ^4.0" + "symfony/framework-bundle": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "twig/twig": "^1.42 || ^2.12 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "friendsofphp/php-cs-fixer": "^2.16" }, "autoload": { "psr-4": { "CMEN\\GoogleChartsBundle\\": "" } }, - "require-dev": { - "phpunit/phpunit": "^5.7", - "friendsofphp/php-cs-fixer": "^2.9" + "autoload-dev": { + "psr-4": { "CMEN\\GoogleChartsBundle\\Tests\\": "Tests/" } + }, + "config": { + "sort-packages": true } }