From 1127dd16eef4f2a9de7e6db7e78332df7a8e19f1 Mon Sep 17 00:00:00 2001 From: Christophe Meneses Date: Sun, 15 Nov 2020 15:19:58 +0100 Subject: [PATCH] Dropping support for old versions --- .github/workflows/ci.yml | 34 +++--- DependencyInjection/Configuration.php | 3 - GoogleCharts/Chart.php | 49 +++------ GoogleCharts/Charts/AnnotationChart.php | 15 +-- GoogleCharts/Charts/AreaChart.php | 15 +-- GoogleCharts/Charts/BarChart.php | 13 +-- GoogleCharts/Charts/BubbleChart.php | 15 +-- GoogleCharts/Charts/CalendarChart.php | 15 +-- GoogleCharts/Charts/CandlestickChart.php | 15 +-- GoogleCharts/Charts/ColumnChart.php | 13 +-- GoogleCharts/Charts/ComboChart.php | 15 +-- GoogleCharts/Charts/Diff/DiffBarChart.php | 9 +- GoogleCharts/Charts/Diff/DiffChart.php | 4 +- GoogleCharts/Charts/Diff/DiffColumnChart.php | 4 +- GoogleCharts/Charts/Diff/DiffPieChart.php | 32 +----- GoogleCharts/Charts/Diff/DiffScatterChart.php | 22 +--- GoogleCharts/Charts/GanttChart.php | 15 +-- GoogleCharts/Charts/GaugeChart.php | 15 +-- GoogleCharts/Charts/GeoChart.php | 15 +-- GoogleCharts/Charts/Histogram.php | 15 +-- GoogleCharts/Charts/LineChart.php | 15 +-- GoogleCharts/Charts/Map.php | 15 +-- GoogleCharts/Charts/Material/BarChart.php | 11 +- GoogleCharts/Charts/Material/ColumnChart.php | 11 +- GoogleCharts/Charts/Material/LineChart.php | 11 +- GoogleCharts/Charts/Material/ScatterChart.php | 11 +- GoogleCharts/Charts/OrgChart.php | 15 +-- GoogleCharts/Charts/PieChart.php | 10 +- GoogleCharts/Charts/SankeyDiagram.php | 15 +-- GoogleCharts/Charts/ScatterChart.php | 13 +-- GoogleCharts/Charts/SteppedAreaChart.php | 15 +-- GoogleCharts/Charts/TableChart.php | 15 +-- GoogleCharts/Charts/Timeline.php | 15 +-- GoogleCharts/Charts/TreeMapChart.php | 15 +-- GoogleCharts/Charts/WordTree.php | 24 +---- GoogleCharts/Data.php | 9 +- GoogleCharts/EventType.php | 2 +- GoogleCharts/Events.php | 12 +-- GoogleCharts/Listener.php | 17 +-- GoogleCharts/Options/AdvancedAnimation.php | 4 +- GoogleCharts/Options/AdvancedAnnotations.php | 4 +- GoogleCharts/Options/AdvancedChartOptions.php | 5 +- GoogleCharts/Options/AdvancedHAxis.php | 28 ++--- GoogleCharts/Options/AdvancedLegend.php | 4 +- GoogleCharts/Options/AdvancedSeries.php | 8 +- GoogleCharts/Options/AdvancedTextStyle.php | 4 +- GoogleCharts/Options/AdvancedTooltip.php | 4 +- .../Options/AggregationTargetTrait.php | 4 +- GoogleCharts/Options/AllowHtmlTrait.php | 4 +- GoogleCharts/Options/Animation.php | 8 +- .../AnnotationChartOptions.php | 83 ++++---------- .../Options/AnnotationChart/Table.php | 8 +- GoogleCharts/Options/Annotations.php | 36 ++----- .../Options/AreaChart/AreaChartOptions.php | 33 ++---- GoogleCharts/Options/AreaChart/Series.php | 8 +- GoogleCharts/Options/AreaOpacityTrait.php | 4 +- .../Options/AxisTitlesPositionTrait.php | 4 +- .../Options/BarChart/BarChartOptions.php | 42 ++------ GoogleCharts/Options/BarChart/Series.php | 5 +- GoogleCharts/Options/BarsTrait.php | 4 +- GoogleCharts/Options/BasicTooltip.php | 8 +- GoogleCharts/Options/BoldTrait.php | 4 +- GoogleCharts/Options/BoxStyle.php | 16 +-- GoogleCharts/Options/BubbleChart/Bubble.php | 8 +- .../BubbleChart/BubbleChartOptions.php | 62 ++--------- .../Options/BubbleChart/ColorAxis.php | 5 +- GoogleCharts/Options/BubbleChart/Legend.php | 9 +- .../Options/CalendarChart/Calendar.php | 20 +--- .../CalendarChart/CalendarChartOptions.php | 18 +--- .../Options/CalendarChart/NoDataPattern.php | 4 +- GoogleCharts/Options/Candlestick.php | 17 +-- .../CandlestickChartOptions.php | 33 ++---- .../Options/CandlestickChart/Series.php | 13 +-- GoogleCharts/Options/ChartArea.php | 4 +- GoogleCharts/Options/ChartOptions.php | 3 - GoogleCharts/Options/ColorAxis.php | 10 +- GoogleCharts/Options/ColorTrait.php | 4 +- GoogleCharts/Options/ColorsTrait.php | 2 +- .../ColumnChart/ColumnChartOptions.php | 40 ++----- GoogleCharts/Options/ColumnChart/Series.php | 12 +-- .../Options/ComboChart/ComboChartOptions.php | 44 ++------ GoogleCharts/Options/ComboChart/Series.php | 22 +--- GoogleCharts/Options/Crosshair.php | 17 +-- GoogleCharts/Options/CurveTypeTrait.php | 4 +- GoogleCharts/Options/DataOpacityTrait.php | 4 +- GoogleCharts/Options/Datum.php | 12 +-- .../Options/Diff/DiffBarChart/Diff.php | 8 +- .../Diff/DiffBarChart/DiffBarChartOptions.php | 8 +- .../Options/Diff/DiffBarChart/NewData.php | 4 +- .../Options/Diff/DiffColumnChart/Diff.php | 8 +- .../DiffColumnChartOptions.php | 8 +- .../Options/Diff/DiffColumnChart/NewData.php | 4 +- .../Options/Diff/DiffPieChart/Diff.php | 18 +--- .../Diff/DiffPieChart/DiffPieChartOptions.php | 5 +- .../Options/Diff/DiffPieChart/InnerCircle.php | 8 +- .../Options/Diff/DiffPieChart/OldData.php | 4 +- .../Options/Diff/DiffScatterChart/Diff.php | 13 +-- .../DiffScatterChartOptions.php | 8 +- GoogleCharts/Options/Domain.php | 12 +-- .../Options/EnableInteractivityTrait.php | 4 +- GoogleCharts/Options/Explorer.php | 24 ++--- GoogleCharts/Options/FillOpacityTrait.php | 4 +- GoogleCharts/Options/FillTrait.php | 4 +- GoogleCharts/Options/FocusTargetTrait.php | 4 +- GoogleCharts/Options/FontNameTrait.php | 4 +- GoogleCharts/Options/FontSizeTrait.php | 4 +- GoogleCharts/Options/ForceIFrameTrait.php | 4 +- GoogleCharts/Options/FormatTrait.php | 4 +- GoogleCharts/Options/FullTooltip.php | 4 +- GoogleCharts/Options/GanttChart/Arrow.php | 20 +--- GoogleCharts/Options/GanttChart/Gantt.php | 78 +++----------- .../Options/GanttChart/GanttChartOptions.php | 13 +-- .../Options/GaugeChart/GaugeChartOptions.php | 47 +++----- .../Options/GeoChart/GeoChartOptions.php | 65 +++-------- GoogleCharts/Options/GeoChart/Legend.php | 12 +-- GoogleCharts/Options/GeoChart/Tooltip.php | 5 +- GoogleCharts/Options/Gradient.php | 28 ++--- GoogleCharts/Options/Gridlines.php | 12 +-- GoogleCharts/Options/HAxis.php | 33 ++---- GoogleCharts/Options/Histogram/HAxis.php | 28 ++--- GoogleCharts/Options/Histogram/Histogram.php | 12 +-- .../Options/Histogram/HistogramOptions.php | 33 ++---- .../Options/InterpolateNullsTrait.php | 4 +- GoogleCharts/Options/ItalicTrait.php | 4 +- GoogleCharts/Options/Legend.php | 16 +-- .../Options/LineChart/LineChartOptions.php | 35 ++---- GoogleCharts/Options/LineChart/Series.php | 8 +- GoogleCharts/Options/LineDashStyleTrait.php | 2 +- GoogleCharts/Options/LineOptions.php | 8 +- GoogleCharts/Options/LineWidthTrait.php | 4 +- GoogleCharts/Options/MagnifyingGlass.php | 8 +- GoogleCharts/Options/Map/MapOptions.php | 34 ++---- GoogleCharts/Options/Material/Chart.php | 6 +- .../Options/Material/MaterialTrait.php | 2 +- GoogleCharts/Options/MaxTrait.php | 4 +- GoogleCharts/Options/MediumChartOptions.php | 14 +-- GoogleCharts/Options/MediumHAxis.php | 34 ++---- GoogleCharts/Options/MediumTooltip.php | 4 +- GoogleCharts/Options/MinTrait.php | 4 +- GoogleCharts/Options/MinorGridlines.php | 12 +-- GoogleCharts/Options/OpacityTrait.php | 4 +- .../Options/OrgChart/OrgChartOptions.php | 16 +-- GoogleCharts/Options/OrientationTrait.php | 4 +- .../Options/PieChart/PieChartOptions.php | 48 ++------- GoogleCharts/Options/PieChart/PieSlice.php | 12 +-- GoogleCharts/Options/PointShapeTrait.php | 4 +- GoogleCharts/Options/PointSizeTrait.php | 4 +- GoogleCharts/Options/PointsVisibleTrait.php | 4 +- .../Options/ReverseCategoriesTrait.php | 4 +- GoogleCharts/Options/SankeyDiagram/Link.php | 12 +-- GoogleCharts/Options/SankeyDiagram/Node.php | 24 +---- GoogleCharts/Options/SankeyDiagram/Sankey.php | 17 +-- .../SankeyDiagram/SankeyDiagramOptions.php | 13 +-- .../ScatterChart/ScatterChartOptions.php | 40 ++----- GoogleCharts/Options/ScatterChart/Series.php | 4 +- GoogleCharts/Options/SelectionModeTrait.php | 4 +- GoogleCharts/Options/Series.php | 4 +- GoogleCharts/Options/SeriesTrait.php | 2 +- GoogleCharts/Options/SizeAxis.php | 16 +-- GoogleCharts/Options/Stem.php | 4 +- .../Options/SteppedAreaChart/HAxis.php | 53 +++------ .../SteppedAreaChartOptions.php | 27 +---- GoogleCharts/Options/StrokeOpacity.php | 4 +- GoogleCharts/Options/StrokeTrait.php | 4 +- .../Options/TableChart/CssClassNames.php | 32 ++---- .../Options/TableChart/TableChartOptions.php | 60 +++-------- GoogleCharts/Options/ThemeTrait.php | 4 +- GoogleCharts/Options/Timeline/Timeline.php | 33 ++---- .../Options/Timeline/TimelineOptions.php | 21 +--- GoogleCharts/Options/TitlePositionTrait.php | 4 +- GoogleCharts/Options/TitleTrait.php | 4 +- GoogleCharts/Options/Tooltip.php | 4 +- .../TreeMapChart/TreeMapChartOptions.php | 101 +++++------------- GoogleCharts/Options/Trendlines.php | 20 +--- GoogleCharts/Options/TriggerTrait.php | 4 +- GoogleCharts/Options/Units.php | 38 ++----- GoogleCharts/Options/VAxesTrait.php | 2 +- GoogleCharts/Options/VAxis.php | 67 +++--------- GoogleCharts/Options/WidthTrait.php | 4 +- GoogleCharts/Options/WordTree/WordTree.php | 20 +--- .../Options/WordTree/WordTreeOptions.php | 12 +-- Output/AbstractChartOutput.php | 18 +--- Output/AbstractOptionsOutput.php | 6 +- Output/ChartOutputInterface.php | 38 ++----- Output/DataOutputInterface.php | 6 +- Output/DateOutputInterface.php | 4 +- Output/EventsOutputInterface.php | 6 +- Output/Javascript/ChartOutput.php | 24 ++--- Output/Javascript/DataOutput.php | 8 +- Output/Javascript/DateOutput.php | 2 +- Output/Javascript/EventsOutput.php | 5 +- Output/Javascript/OptionsOutput.php | 2 +- Output/OptionsOutputInterface.php | 16 +-- README.md | 1 + Resources/doc/contribute.md | 18 ++++ .../Charts/AnnotationChartTest.php | 3 +- Tests/GoogleCharts/Charts/ColumnChartTest.php | 3 +- Tests/GoogleCharts/Charts/GanttChartTest.php | 3 +- Tests/GoogleCharts/Charts/LineChartTest.php | 8 +- Tests/GoogleCharts/EventsTest.php | 18 ++-- Tests/GoogleCharts/ListenerTest.php | 11 +- .../AnnotationChartOptionsTest.php | 3 +- .../ColumnChart/ColumnChartOptionsTest.php | 3 +- .../GanttChart/GanttChartOptionsTest.php | 3 +- .../LineChart/LineChartOptionsTest.php | 3 +- Tests/Output/Javascript/ChartOutputTest.php | 61 +++++------ Tests/Output/Javascript/DataOutputTest.php | 12 ++- Tests/Output/Javascript/DateOutputTest.php | 3 +- Twig/GoogleChartsExtension.php | 26 +---- composer.json | 10 +- 210 files changed, 802 insertions(+), 2320 deletions(-) create mode 100644 Resources/doc/contribute.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af8f5df..8ce15bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,13 +10,13 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Install PHP dependencies run: composer install --prefer-dist --no-progress --no-suggest - name: Run PHP CS Fixer - run: vendor/bin/php-cs-fixer fix --diff --dry-run --verbose --stop-on-violation + run: ./vendor/bin/php-cs-fixer fix --diff --dry-run --verbose --stop-on-violation code_analyze: runs-on: [ubuntu-latest] @@ -25,37 +25,37 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Install PHP dependencies run: composer install --prefer-dist --no-progress --no-suggest - name: Run PHPStan - run: vendor/bin/phpstan analyse --level max + run: ./vendor/bin/phpstan analyse --level max tests: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + php-versions: ['7.1', '7.2', '7.3', '7.4'] runs-on: ${{ matrix.operating-system }} name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: - - name: Checkout code - uses: actions/checkout@v1 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: xml, dom, mbstring + coverage: xdebug - - name: Setup PHP - uses: shivammathur/setup-php@v1 - with: - php-version: ${{ matrix.php-versions }} - extension-csv: xml, dom, mbstring - coverage: none + - name: Checkout code + uses: actions/checkout@v2 - - name: Remove PHPStan (Not compatible with PHP < 7.1) and install PHP dependencies - run: composer remove phpstan/phpstan --dev + - name: Install PHP dependencies + run: composer install --prefer-dist --no-progress --no-suggest - - name: Run test suite - run: vendor/bin/phpunit + - name: Run test suite + run: ./vendor/bin/phpunit diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index ceca2fd..cb1ea62 100755 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -7,9 +7,6 @@ class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('cmen_google_charts'); diff --git a/GoogleCharts/Chart.php b/GoogleCharts/Chart.php index 1adfe83..251635e 100755 --- a/GoogleCharts/Chart.php +++ b/GoogleCharts/Chart.php @@ -37,10 +37,8 @@ public function __construct() /** * Returns chart's name. - * - * @return string */ - public function getName() + public function getName(): string { if (null === $this->elementID) { return ''; @@ -51,61 +49,51 @@ public function getName() /** * Returns data chart's name. - * - * @return string */ - public function getDataName() + public function getDataName(): string { return 'data'.ucfirst($this->getName()); } /** * Returns options chart's name. - * - * @return string */ - public function getOptionsName() + public function getOptionsName(): string { return 'options'.ucfirst($this->getName()); } /** * Returns the chart type. - * - * @return string */ - abstract public function getType(); + abstract public function getType(): string; /** * Returns library used by chart. - * - * @return string */ - public function getLibrary() + public function getLibrary(): string { return 'visualization'; } /** * Returns the chart package. - * - * @return string */ - abstract public function getPackage(); + abstract public function getPackage(): string; /** * Returns available event types. * * @return string[] */ - abstract public function getAvailableEventTypes(); + abstract public function getAvailableEventTypes(): array; /** * Returns the instance options. * * @return ChartOptionsInterface */ - abstract public function getOptions(); + abstract public function getOptions()/* : ChartOptionsInterface */; /** * Sets the instance Options. @@ -114,40 +102,29 @@ abstract public function getOptions(); * * @return $this */ - abstract public function setOptions($options); + abstract public function setOptions(/* ChartOptionsInterface */$options)/* : Chart */; /** - * @param string $elementID - * * @return $this */ - public function setElementID($elementID) + public function setElementID(string $elementID) { $this->elementID = $elementID; return $this; } - /** - * @return string|null - */ - public function getElementID() + public function getElementID(): ?string { return $this->elementID; } - /** - * @return Data - */ - public function getData() + public function getData(): Data { return $this->data; } - /** - * @return Events - */ - public function getEvents() + public function getEvents(): Events { return $this->events; } diff --git a/GoogleCharts/Charts/AnnotationChart.php b/GoogleCharts/Charts/AnnotationChart.php index 1e862fb..e860763 100644 --- a/GoogleCharts/Charts/AnnotationChart.php +++ b/GoogleCharts/Charts/AnnotationChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new AnnotationChartOptions(); } - public function getType() + public function getType(): string { return 'AnnotationChart'; } - public function getPackage() + public function getPackage(): string { return 'annotationchart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::RANGE_CHANGE, @@ -42,20 +42,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return AnnotationChartOptions - */ - public function getOptions() + public function getOptions(): AnnotationChartOptions { return $this->options; } /** * @param AnnotationChartOptions $options - * - * @return AnnotationChart */ - public function setOptions($options) + public function setOptions(/* AnnotationChartOptions */$options): AnnotationChart { $this->options = $options; diff --git a/GoogleCharts/Charts/AreaChart.php b/GoogleCharts/Charts/AreaChart.php index 6bbb121..3bb5ef2 100644 --- a/GoogleCharts/Charts/AreaChart.php +++ b/GoogleCharts/Charts/AreaChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new AreaChartOptions(); } - public function getType() + public function getType(): string { return 'AreaChart'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ANIMATION_FINISH, @@ -46,20 +46,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return AreaChartOptions - */ - public function getOptions() + public function getOptions(): AreaChartOptions { return $this->options; } /** * @param AreaChartOptions $options - * - * @return AreaChart */ - public function setOptions($options) + public function setOptions(/* AreaChartOptions */$options): AreaChart { $this->options = $options; diff --git a/GoogleCharts/Charts/BarChart.php b/GoogleCharts/Charts/BarChart.php index 3c92b8c..a2622a6 100644 --- a/GoogleCharts/Charts/BarChart.php +++ b/GoogleCharts/Charts/BarChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new BarChartOptions(); } - public function getType() + public function getType(): string { return 'BarChart'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ANIMATION_FINISH, @@ -46,10 +46,7 @@ public function getAvailableEventTypes() ]; } - /** - * @return BarChartOptions - */ - public function getOptions() + public function getOptions()/* : BarChartOptions */ { return $this->options; } @@ -59,7 +56,7 @@ public function getOptions() * * @return BarChart */ - public function setOptions($options) + public function setOptions(/* BarChartOptions */$options)/* : BarChart */ { $this->options = $options; diff --git a/GoogleCharts/Charts/BubbleChart.php b/GoogleCharts/Charts/BubbleChart.php index 10d1a86..4053fd4 100644 --- a/GoogleCharts/Charts/BubbleChart.php +++ b/GoogleCharts/Charts/BubbleChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new BubbleChartOptions(); } - public function getType() + public function getType(): string { return 'BubbleChart'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ANIMATION_FINISH, @@ -46,20 +46,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return BubbleChartOptions - */ - public function getOptions() + public function getOptions(): BubbleChartOptions { return $this->options; } /** * @param BubbleChartOptions $options - * - * @return BubbleChart */ - public function setOptions($options) + public function setOptions(/* BubbleChartOptions */$options): BubbleChart { $this->options = $options; diff --git a/GoogleCharts/Charts/CalendarChart.php b/GoogleCharts/Charts/CalendarChart.php index 1e617a2..9b05404 100644 --- a/GoogleCharts/Charts/CalendarChart.php +++ b/GoogleCharts/Charts/CalendarChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new CalendarChartOptions(); } - public function getType() + public function getType(): string { return 'Calendar'; } - public function getPackage() + public function getPackage(): string { return 'calendar'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ERROR, @@ -44,20 +44,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return CalendarChartOptions - */ - public function getOptions() + public function getOptions(): CalendarChartOptions { return $this->options; } /** * @param CalendarChartOptions $options - * - * @return CalendarChart */ - public function setOptions($options) + public function setOptions(/* CalendarChartOptions */$options): CalendarChart { $this->options = $options; diff --git a/GoogleCharts/Charts/CandlestickChart.php b/GoogleCharts/Charts/CandlestickChart.php index 13241e4..e92c312 100644 --- a/GoogleCharts/Charts/CandlestickChart.php +++ b/GoogleCharts/Charts/CandlestickChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new CandlestickChartOptions(); } - public function getType() + public function getType(): string { return 'CandlestickChart'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ANIMATION_FINISH, @@ -46,20 +46,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return CandlestickChartOptions - */ - public function getOptions() + public function getOptions(): CandlestickChartOptions { return $this->options; } /** * @param CandlestickChartOptions $options - * - * @return CandlestickChart */ - public function setOptions($options) + public function setOptions(/* CandlestickChartOptions */$options): CandlestickChart { $this->options = $options; diff --git a/GoogleCharts/Charts/ColumnChart.php b/GoogleCharts/Charts/ColumnChart.php index a72f744..ad42c43 100644 --- a/GoogleCharts/Charts/ColumnChart.php +++ b/GoogleCharts/Charts/ColumnChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new ColumnChartOptions(); } - public function getType() + public function getType(): string { return 'ColumnChart'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ANIMATION_FINISH, @@ -46,10 +46,7 @@ public function getAvailableEventTypes() ]; } - /** - * @return ColumnChartOptions - */ - public function getOptions() + public function getOptions()/* : ColumnChartOptions */ { return $this->options; } @@ -59,7 +56,7 @@ public function getOptions() * * @return ColumnChart */ - public function setOptions($options) + public function setOptions(/* ColumnChartOptions */$options)/* : ColumnChart */ { $this->options = $options; diff --git a/GoogleCharts/Charts/ComboChart.php b/GoogleCharts/Charts/ComboChart.php index 7ba3971..50e6400 100644 --- a/GoogleCharts/Charts/ComboChart.php +++ b/GoogleCharts/Charts/ComboChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new ComboChartOptions(); } - public function getType() + public function getType(): string { return 'ComboChart'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ANIMATION_FINISH, @@ -46,20 +46,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return ComboChartOptions - */ - public function getOptions() + public function getOptions(): ComboChartOptions { return $this->options; } /** * @param ComboChartOptions $options - * - * @return ComboChart */ - public function setOptions($options) + public function setOptions(/* ComboChartOptions */$options): ComboChart { $this->options = $options; diff --git a/GoogleCharts/Charts/Diff/DiffBarChart.php b/GoogleCharts/Charts/Diff/DiffBarChart.php index 7ced18d..7313afc 100644 --- a/GoogleCharts/Charts/Diff/DiffBarChart.php +++ b/GoogleCharts/Charts/Diff/DiffBarChart.php @@ -48,20 +48,15 @@ public function __construct($oldChart, $newChart) $this->newChart = $newChart; } - /** - * @return DiffBarChartOptions - */ - public function getOptions() + public function getOptions(): DiffBarChartOptions { return $this->options; } /** * @param DiffBarChartOptions $options - * - * @return DiffBarChart */ - public function setOptions($options) + public function setOptions(/* DiffBarChartOptions */$options): DiffBarChart { $this->options = $options; diff --git a/GoogleCharts/Charts/Diff/DiffChart.php b/GoogleCharts/Charts/Diff/DiffChart.php index 9659d59..84b8a35 100644 --- a/GoogleCharts/Charts/Diff/DiffChart.php +++ b/GoogleCharts/Charts/Diff/DiffChart.php @@ -9,10 +9,10 @@ interface DiffChart /** * @return Chart */ - public function getOldChart(); + public function getOldChart()/* : Chart */; /** * @return Chart */ - public function getNewChart(); + public function getNewChart()/* : Chart */; } diff --git a/GoogleCharts/Charts/Diff/DiffColumnChart.php b/GoogleCharts/Charts/Diff/DiffColumnChart.php index 6196b80..7f00c37 100644 --- a/GoogleCharts/Charts/Diff/DiffColumnChart.php +++ b/GoogleCharts/Charts/Diff/DiffColumnChart.php @@ -55,10 +55,8 @@ public function getOptions() /** * @param DiffColumnChartOptions $options - * - * @return DiffColumnChart */ - public function setOptions($options) + public function setOptions(/* DiffColumnChartOptions */$options): DiffColumnChart { $this->options = $options; diff --git a/GoogleCharts/Charts/Diff/DiffPieChart.php b/GoogleCharts/Charts/Diff/DiffPieChart.php index 3714fd6..f16ed9c 100644 --- a/GoogleCharts/Charts/Diff/DiffPieChart.php +++ b/GoogleCharts/Charts/Diff/DiffPieChart.php @@ -2,7 +2,6 @@ namespace CMEN\GoogleChartsBundle\GoogleCharts\Charts\Diff; -use CMEN\GoogleChartsBundle\Exception\GoogleChartsException; use CMEN\GoogleChartsBundle\GoogleCharts\Charts\PieChart; use CMEN\GoogleChartsBundle\GoogleCharts\Options\Diff\DiffPieChart\DiffPieChartOptions; @@ -26,18 +25,8 @@ class DiffPieChart extends PieChart implements DiffChart */ private $newChart; - /** - * @param PieChart|object $oldChart - * @param PieChart|object $newChart - * - * @throws GoogleChartsException - */ - public function __construct($oldChart, $newChart) + public function __construct(PieChart $oldChart, PieChart $newChart) { - if (!$oldChart instanceof PieChart || !$newChart instanceof PieChart) { - throw new GoogleChartsException('Instance of PieChart is expected'); - } - parent::__construct(); $this->options = new DiffPieChartOptions(); @@ -46,38 +35,27 @@ public function __construct($oldChart, $newChart) $this->newChart = $newChart; } - /** - * @return DiffPieChartOptions - */ - public function getOptions() + public function getOptions(): DiffPieChartOptions { return $this->options; } /** * @param DiffPieChartOptions $options - * - * @return DiffPieChart */ - public function setOptions($options) + public function setOptions(/* DiffPieChartOptions */$options): DiffPieChart { $this->options = $options; return $this; } - /** - * @return PieChart - */ - public function getOldChart() + public function getOldChart(): PieChart { return $this->oldChart; } - /** - * @return PieChart - */ - public function getNewChart() + public function getNewChart(): PieChart { return $this->newChart; } diff --git a/GoogleCharts/Charts/Diff/DiffScatterChart.php b/GoogleCharts/Charts/Diff/DiffScatterChart.php index dc81cf1..885786d 100644 --- a/GoogleCharts/Charts/Diff/DiffScatterChart.php +++ b/GoogleCharts/Charts/Diff/DiffScatterChart.php @@ -2,7 +2,6 @@ namespace CMEN\GoogleChartsBundle\GoogleCharts\Charts\Diff; -use CMEN\GoogleChartsBundle\Exception\GoogleChartsException; use CMEN\GoogleChartsBundle\GoogleCharts\Charts\ScatterChart; use CMEN\GoogleChartsBundle\GoogleCharts\Options\Diff\DiffScatterChart\DiffScatterChartOptions; @@ -26,18 +25,8 @@ class DiffScatterChart extends ScatterChart implements DiffChart */ private $newChart; - /** - * @param ScatterChart|object $oldChart - * @param ScatterChart|object $newChart - * - * @throws GoogleChartsException - */ - public function __construct($oldChart, $newChart) + public function __construct(ScatterChart $oldChart, ScatterChart $newChart) { - if (!$oldChart instanceof ScatterChart || !$newChart instanceof ScatterChart) { - throw new GoogleChartsException('Instance of PieChart is expected'); - } - parent::__construct(); $this->options = new DiffScatterChartOptions(); @@ -46,20 +35,15 @@ public function __construct($oldChart, $newChart) $this->newChart = $newChart; } - /** - * @return DiffScatterChartOptions - */ - public function getOptions() + public function getOptions(): DiffScatterChartOptions { return $this->options; } /** * @param DiffScatterChartOptions $options - * - * @return DiffScatterChart */ - public function setOptions($options) + public function setOptions(/* DiffScatterChartOptions */$options): DiffScatterChart { $this->options = $options; diff --git a/GoogleCharts/Charts/GanttChart.php b/GoogleCharts/Charts/GanttChart.php index 23eff92..0b28351 100644 --- a/GoogleCharts/Charts/GanttChart.php +++ b/GoogleCharts/Charts/GanttChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new GanttChartOptions(); } - public function getType() + public function getType(): string { return 'Gantt'; } - public function getPackage() + public function getPackage(): string { return 'gantt'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::CLICK, @@ -43,20 +43,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return GanttChartOptions - */ - public function getOptions() + public function getOptions(): GanttChartOptions { return $this->options; } /** * @param GanttChartOptions $options - * - * @return GanttChart */ - public function setOptions($options) + public function setOptions(/* GanttChartOptions */$options): GanttChart { $this->options = $options; diff --git a/GoogleCharts/Charts/GaugeChart.php b/GoogleCharts/Charts/GaugeChart.php index 2cc8654..be6163c 100644 --- a/GoogleCharts/Charts/GaugeChart.php +++ b/GoogleCharts/Charts/GaugeChart.php @@ -22,35 +22,30 @@ public function __construct() $this->options = new GaugeChartOptions(); } - public function getType() + public function getType(): string { return 'Gauge'; } - public function getPackage() + public function getPackage(): string { return 'gauge'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return []; } - /** - * @return GaugeChartOptions - */ - public function getOptions() + public function getOptions(): GaugeChartOptions { return $this->options; } /** * @param GaugeChartOptions $options - * - * @return GaugeChart */ - public function setOptions($options) + public function setOptions(/* GaugeChartOptions */$options): GaugeChart { $this->options = $options; diff --git a/GoogleCharts/Charts/GeoChart.php b/GoogleCharts/Charts/GeoChart.php index cb40132..6275795 100644 --- a/GoogleCharts/Charts/GeoChart.php +++ b/GoogleCharts/Charts/GeoChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new GeoChartOptions(); } - public function getType() + public function getType(): string { return 'GeoChart'; } - public function getPackage() + public function getPackage(): string { return 'geochart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ERROR, @@ -43,20 +43,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return GeoChartOptions - */ - public function getOptions() + public function getOptions(): GeoChartOptions { return $this->options; } /** * @param GeoChartOptions $options - * - * @return GeoChart */ - public function setOptions($options) + public function setOptions(/* GeoChartOptions */$options): GeoChart { $this->options = $options; diff --git a/GoogleCharts/Charts/Histogram.php b/GoogleCharts/Charts/Histogram.php index 012c125..a7ced1c 100644 --- a/GoogleCharts/Charts/Histogram.php +++ b/GoogleCharts/Charts/Histogram.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new HistogramOptions(); } - public function getType() + public function getType(): string { return 'Histogram'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ANIMATION_FINISH, @@ -46,20 +46,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return HistogramOptions - */ - public function getOptions() + public function getOptions(): HistogramOptions { return $this->options; } /** * @param HistogramOptions $options - * - * @return Histogram */ - public function setOptions($options) + public function setOptions(/* HistogramOptions */$options): Histogram { $this->options = $options; diff --git a/GoogleCharts/Charts/LineChart.php b/GoogleCharts/Charts/LineChart.php index e463a66..6220b02 100644 --- a/GoogleCharts/Charts/LineChart.php +++ b/GoogleCharts/Charts/LineChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new LineChartOptions(); } - public function getType() + public function getType(): string { return 'LineChart'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ANIMATION_FINISH, @@ -46,20 +46,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return LineChartOptions - */ - public function getOptions() + public function getOptions()/* : LineChartOptions */ { return $this->options; } /** * @param LineChartOptions $options - * - * @return LineChart */ - public function setOptions($options) + public function setOptions(/* LineChartOptions */$options): LineChart { $this->options = $options; diff --git a/GoogleCharts/Charts/Map.php b/GoogleCharts/Charts/Map.php index a93ffee..bd00232 100644 --- a/GoogleCharts/Charts/Map.php +++ b/GoogleCharts/Charts/Map.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new MapOptions(); } - public function getType() + public function getType(): string { return 'Map'; } - public function getPackage() + public function getPackage(): string { return 'map'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ERROR, @@ -41,20 +41,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return MapOptions - */ - public function getOptions() + public function getOptions(): MapOptions { return $this->options; } /** * @param MapOptions $options - * - * @return Map */ - public function setOptions($options) + public function setOptions(/* MapOptions */$options): Map { $this->options = $options; diff --git a/GoogleCharts/Charts/Material/BarChart.php b/GoogleCharts/Charts/Material/BarChart.php index 13fbb48..37409da 100644 --- a/GoogleCharts/Charts/Material/BarChart.php +++ b/GoogleCharts/Charts/Material/BarChart.php @@ -22,25 +22,22 @@ public function __construct() $this->options->setBars('horizontal'); } - public function getPackage() + public function getPackage(): string { return 'bar'; } - public function getLibrary() + public function getLibrary(): string { return 'charts'; } - public function getType() + public function getType(): string { return 'Bar'; } - /** - * @return BarChartOptions - */ - public function getOptions() + public function getOptions(): BarChartOptions { return $this->options; } diff --git a/GoogleCharts/Charts/Material/ColumnChart.php b/GoogleCharts/Charts/Material/ColumnChart.php index 4cb660a..e2a24bb 100644 --- a/GoogleCharts/Charts/Material/ColumnChart.php +++ b/GoogleCharts/Charts/Material/ColumnChart.php @@ -21,25 +21,22 @@ public function __construct() $this->options = new ColumnChartOptions(); } - public function getPackage() + public function getPackage(): string { return 'bar'; } - public function getLibrary() + public function getLibrary(): string { return 'charts'; } - public function getType() + public function getType(): string { return 'Bar'; } - /** - * @return ColumnChartOptions - */ - public function getOptions() + public function getOptions(): ColumnChartOptions { return $this->options; } diff --git a/GoogleCharts/Charts/Material/LineChart.php b/GoogleCharts/Charts/Material/LineChart.php index 2965319..e07fd43 100644 --- a/GoogleCharts/Charts/Material/LineChart.php +++ b/GoogleCharts/Charts/Material/LineChart.php @@ -21,25 +21,22 @@ public function __construct() $this->options = new LineChartOptions(); } - public function getPackage() + public function getPackage(): string { return 'line'; } - public function getLibrary() + public function getLibrary(): string { return 'charts'; } - public function getType() + public function getType(): string { return 'Line'; } - /** - * @return LineChartOptions - */ - public function getOptions() + public function getOptions(): LineChartOptions { return $this->options; } diff --git a/GoogleCharts/Charts/Material/ScatterChart.php b/GoogleCharts/Charts/Material/ScatterChart.php index 452ac82..9835ace 100644 --- a/GoogleCharts/Charts/Material/ScatterChart.php +++ b/GoogleCharts/Charts/Material/ScatterChart.php @@ -21,25 +21,22 @@ public function __construct() $this->options = new ScatterChartOptions(); } - public function getPackage() + public function getPackage(): string { return 'scatter'; } - public function getLibrary() + public function getLibrary(): string { return 'charts'; } - public function getType() + public function getType(): string { return 'Scatter'; } - /** - * @return ScatterChartOptions - */ - public function getOptions() + public function getOptions(): ScatterChartOptions { return $this->options; } diff --git a/GoogleCharts/Charts/OrgChart.php b/GoogleCharts/Charts/OrgChart.php index 2e46ad7..8dc04e8 100644 --- a/GoogleCharts/Charts/OrgChart.php +++ b/GoogleCharts/Charts/OrgChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new OrgChartOptions(); } - public function getType() + public function getType(): string { return 'OrgChart'; } - public function getPackage() + public function getPackage(): string { return 'orgchart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::COLLAPSE, @@ -44,20 +44,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return OrgChartOptions - */ - public function getOptions() + public function getOptions(): OrgChartOptions { return $this->options; } /** * @param OrgChartOptions $options - * - * @return OrgChart */ - public function setOptions($options) + public function setOptions(/* OrgChartOptions */$options): OrgChart { $this->options = $options; diff --git a/GoogleCharts/Charts/PieChart.php b/GoogleCharts/Charts/PieChart.php index 39b885a..c86534f 100644 --- a/GoogleCharts/Charts/PieChart.php +++ b/GoogleCharts/Charts/PieChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new PieChartOptions(); } - public function getType() + public function getType(): string { return 'PieChart'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::CLICK, @@ -48,7 +48,7 @@ public function getAvailableEventTypes() /** * @return PieChartOptions */ - public function getOptions() + public function getOptions()/* : PieChartOptions */ { return $this->options; } @@ -58,7 +58,7 @@ public function getOptions() * * @return PieChart */ - public function setOptions($options) + public function setOptions(/* PieChartOptions */$options)/* : PieChart */ { $this->options = $options; diff --git a/GoogleCharts/Charts/SankeyDiagram.php b/GoogleCharts/Charts/SankeyDiagram.php index d30e7af..53c0a49 100644 --- a/GoogleCharts/Charts/SankeyDiagram.php +++ b/GoogleCharts/Charts/SankeyDiagram.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new SankeyDiagramOptions(); } - public function getType() + public function getType(): string { return 'Sankey'; } - public function getPackage() + public function getPackage(): string { return 'sankey'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ERROR, @@ -44,20 +44,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return SankeyDiagramOptions - */ - public function getOptions() + public function getOptions(): SankeyDiagramOptions { return $this->options; } /** * @param SankeyDiagramOptions $options - * - * @return SankeyDiagram */ - public function setOptions($options) + public function setOptions(/* SankeyDiagramOptions */$options): SankeyDiagram { $this->options = $options; diff --git a/GoogleCharts/Charts/ScatterChart.php b/GoogleCharts/Charts/ScatterChart.php index 2633dfb..ea40837 100644 --- a/GoogleCharts/Charts/ScatterChart.php +++ b/GoogleCharts/Charts/ScatterChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new ScatterChartOptions(); } - public function getType() + public function getType(): string { return 'ScatterChart'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ANIMATION_FINISH, @@ -46,10 +46,7 @@ public function getAvailableEventTypes() ]; } - /** - * @return ScatterChartOptions - */ - public function getOptions() + public function getOptions()/*: ScatterChartOptions */ { return $this->options; } @@ -59,7 +56,7 @@ public function getOptions() * * @return ScatterChart */ - public function setOptions($options) + public function setOptions(/* ScatterChartOptions */$options)/* : ScatterChart */ { $this->options = $options; diff --git a/GoogleCharts/Charts/SteppedAreaChart.php b/GoogleCharts/Charts/SteppedAreaChart.php index c480ead..8d86f88 100644 --- a/GoogleCharts/Charts/SteppedAreaChart.php +++ b/GoogleCharts/Charts/SteppedAreaChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new SteppedAreaChartOptions(); } - public function getType() + public function getType(): string { return 'SteppedAreaChart'; } - public function getPackage() + public function getPackage(): string { return 'corechart'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ANIMATION_FINISH, @@ -46,20 +46,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return SteppedAreaChartOptions - */ - public function getOptions() + public function getOptions(): SteppedAreaChartOptions { return $this->options; } /** * @param SteppedAreaChartOptions $options - * - * @return SteppedAreaChart */ - public function setOptions($options) + public function setOptions(/* SteppedAreaChartOptions */$options): SteppedAreaChart { $this->options = $options; diff --git a/GoogleCharts/Charts/TableChart.php b/GoogleCharts/Charts/TableChart.php index 995cae0..3b3b3d4 100644 --- a/GoogleCharts/Charts/TableChart.php +++ b/GoogleCharts/Charts/TableChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new TableChartOptions(); } - public function getType() + public function getType(): string { return 'Table'; } - public function getPackage() + public function getPackage(): string { return 'table'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::PAGE, @@ -43,20 +43,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return TableChartOptions - */ - public function getOptions() + public function getOptions(): TableChartOptions { return $this->options; } /** * @param TableChartOptions $options - * - * @return TableChart */ - public function setOptions($options) + public function setOptions(/* TableChartOptions */$options): TableChart { $this->options = $options; diff --git a/GoogleCharts/Charts/Timeline.php b/GoogleCharts/Charts/Timeline.php index d87b2e1..9e7f423 100644 --- a/GoogleCharts/Charts/Timeline.php +++ b/GoogleCharts/Charts/Timeline.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new TimelineOptions(); } - public function getType() + public function getType(): string { return 'Timeline'; } - public function getPackage() + public function getPackage(): string { return 'timeline'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ERROR, @@ -44,20 +44,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return TimelineOptions - */ - public function getOptions() + public function getOptions(): TimelineOptions { return $this->options; } /** * @param TimelineOptions $options - * - * @return Timeline */ - public function setOptions($options) + public function setOptions(/* TimelineOptions */$options): Timeline { $this->options = $options; diff --git a/GoogleCharts/Charts/TreeMapChart.php b/GoogleCharts/Charts/TreeMapChart.php index 1d6fcd1..e8d3398 100644 --- a/GoogleCharts/Charts/TreeMapChart.php +++ b/GoogleCharts/Charts/TreeMapChart.php @@ -23,17 +23,17 @@ public function __construct() $this->options = new TreeMapChartOptions(); } - public function getType() + public function getType(): string { return 'TreeMap'; } - public function getPackage() + public function getPackage(): string { return 'treemap'; } - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::ON_MOUSE_OUT, @@ -44,20 +44,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return TreeMapChartOptions - */ - public function getOptions() + public function getOptions(): TreeMapChartOptions { return $this->options; } /** * @param TreeMapChartOptions $options - * - * @return TreeMapChart */ - public function setOptions($options) + public function setOptions(/* TreeMapChartOptions */$options): TreeMapChart { $this->options = $options; diff --git a/GoogleCharts/Charts/WordTree.php b/GoogleCharts/Charts/WordTree.php index d2d8e66..4ef6894 100644 --- a/GoogleCharts/Charts/WordTree.php +++ b/GoogleCharts/Charts/WordTree.php @@ -23,26 +23,17 @@ public function __construct() $this->options = new WordTreeOptions(); } - /** - * {@inheritdoc} - */ - public function getType() + public function getType(): string { return 'WordTree'; } - /** - * {@inheritdoc} - */ - public function getPackage() + public function getPackage(): string { return 'wordtree'; } - /** - * {@inheritdoc} - */ - public function getAvailableEventTypes() + public function getAvailableEventTypes(): array { return [ EventType::READY, @@ -50,20 +41,15 @@ public function getAvailableEventTypes() ]; } - /** - * @return WordTreeOptions - */ - public function getOptions() + public function getOptions(): WordTreeOptions { return $this->options; } /** * @param WordTreeOptions $options - * - * @return WordTree */ - public function setOptions($options) + public function setOptions(/* WordTreeOptions */$options): WordTree { $this->options = $options; diff --git a/GoogleCharts/Data.php b/GoogleCharts/Data.php index 18ec14e..a03d4fa 100755 --- a/GoogleCharts/Data.php +++ b/GoogleCharts/Data.php @@ -26,7 +26,7 @@ public function __construct() /** * @return array */ - public function getArrayToDataTable() + public function getArrayToDataTable(): array { return $this->arrayToDataTable; } @@ -45,16 +45,13 @@ public function getArrayToDataTable() * * @return void */ - public function setArrayToDataTable($arrayToDataTable, $firstRowIsData = false) + public function setArrayToDataTable(array $arrayToDataTable, bool $firstRowIsData = false) { $this->arrayToDataTable = $arrayToDataTable; $this->firstRowIsData = $firstRowIsData; } - /** - * @return bool - */ - public function isFirstRowIsData() + public function isFirstRowIsData(): bool { return $this->firstRowIsData; } diff --git a/GoogleCharts/EventType.php b/GoogleCharts/EventType.php index 344c725..beff08d 100644 --- a/GoogleCharts/EventType.php +++ b/GoogleCharts/EventType.php @@ -24,7 +24,7 @@ class EventType /** * @return string[] */ - public static function getAllEventTypes() + public static function getAllEventTypes(): array { return [ self::ANIMATION_FINISH, diff --git a/GoogleCharts/Events.php b/GoogleCharts/Events.php index bd53cf1..58cee66 100644 --- a/GoogleCharts/Events.php +++ b/GoogleCharts/Events.php @@ -25,15 +25,7 @@ public function __construct(Chart $chart) $this->chart = $chart; } - /** - * Adds a listener. - * - * @param string $type Type of event - * @param string $functionName Name of Javascript function - * - * @return void - */ - public function addListener($type, $functionName) + public function addListener(string $type, string $functionName): void { if (!in_array($type, $this->chart->getAvailableEventTypes())) { throw new GoogleChartsException("$type event is not available for this type of chart."); @@ -45,7 +37,7 @@ public function addListener($type, $functionName) /** * @return Listener[] */ - public function getListeners() + public function getListeners(): array { return $this->listeners; } diff --git a/GoogleCharts/Listener.php b/GoogleCharts/Listener.php index 83bec52..b90beb1 100644 --- a/GoogleCharts/Listener.php +++ b/GoogleCharts/Listener.php @@ -20,14 +20,9 @@ class Listener protected $functionName; /** - * Listener constructor. - * - * @param string $type - * @param string $functionName - * * @throws GoogleChartsException */ - public function __construct($type, $functionName) + public function __construct(string $type, string $functionName) { if (!in_array($type, EventType::getAllEventTypes())) { throw new GoogleChartsException("$type is not a valid type of event."); @@ -37,18 +32,12 @@ public function __construct($type, $functionName) $this->functionName = $functionName; } - /** - * @return string - */ - public function getType() + public function getType(): string { return $this->type; } - /** - * @return string - */ - public function getFunction() + public function getFunction(): string { return $this->functionName; } diff --git a/GoogleCharts/Options/AdvancedAnimation.php b/GoogleCharts/Options/AdvancedAnimation.php index 07c3a95..1de6819 100644 --- a/GoogleCharts/Options/AdvancedAnimation.php +++ b/GoogleCharts/Options/AdvancedAnimation.php @@ -16,11 +16,9 @@ class AdvancedAnimation extends Animation protected $startup; /** - * @param bool $startup - * * @return $this */ - public function setStartup($startup) + public function setStartup(bool $startup) { $this->startup = $startup; diff --git a/GoogleCharts/Options/AdvancedAnnotations.php b/GoogleCharts/Options/AdvancedAnnotations.php index e369fed..86cd967 100644 --- a/GoogleCharts/Options/AdvancedAnnotations.php +++ b/GoogleCharts/Options/AdvancedAnnotations.php @@ -15,11 +15,9 @@ class AdvancedAnnotations extends Annotations protected $alwaysOutside; /** - * @param bool $alwaysOutside - * * @return $this */ - public function setAlwaysOutside($alwaysOutside) + public function setAlwaysOutside(bool $alwaysOutside) { $this->alwaysOutside = $alwaysOutside; diff --git a/GoogleCharts/Options/AdvancedChartOptions.php b/GoogleCharts/Options/AdvancedChartOptions.php index b22a914..b5e8ab3 100644 --- a/GoogleCharts/Options/AdvancedChartOptions.php +++ b/GoogleCharts/Options/AdvancedChartOptions.php @@ -27,10 +27,7 @@ public function __construct() $this->vAxis = new VAxis(); } - /** - * @return VAxis - */ - public function getVAxis() + public function getVAxis(): VAxis { return $this->vAxis; } diff --git a/GoogleCharts/Options/AdvancedHAxis.php b/GoogleCharts/Options/AdvancedHAxis.php index 46f1ecb..45d2fb2 100644 --- a/GoogleCharts/Options/AdvancedHAxis.php +++ b/GoogleCharts/Options/AdvancedHAxis.php @@ -64,11 +64,9 @@ class AdvancedHAxis extends MediumHAxis protected $showTextEvery; /** - * @param int $showTextEvery - * * @return $this */ - public function setShowTextEvery($showTextEvery) + public function setShowTextEvery(int $showTextEvery) { $this->showTextEvery = $showTextEvery; @@ -76,11 +74,9 @@ public function setShowTextEvery($showTextEvery) } /** - * @param bool $allowContainerBoundaryTextCufoff - * * @return $this */ - public function setAllowContainerBoundaryTextCufoff($allowContainerBoundaryTextCufoff) + public function setAllowContainerBoundaryTextCufoff(bool $allowContainerBoundaryTextCufoff) { $this->allowContainerBoundaryTextCufoff = $allowContainerBoundaryTextCufoff; @@ -88,11 +84,9 @@ public function setAllowContainerBoundaryTextCufoff($allowContainerBoundaryTextC } /** - * @param bool $slantedText - * * @return $this */ - public function setSlantedText($slantedText) + public function setSlantedText(bool $slantedText) { $this->slantedText = $slantedText; @@ -100,11 +94,9 @@ public function setSlantedText($slantedText) } /** - * @param int $slantedTextAngle - * * @return $this */ - public function setSlantedTextAngle($slantedTextAngle) + public function setSlantedTextAngle(int $slantedTextAngle) { $this->slantedTextAngle = $slantedTextAngle; @@ -112,11 +104,9 @@ public function setSlantedTextAngle($slantedTextAngle) } /** - * @param int $maxAlternation - * * @return $this */ - public function setMaxAlternation($maxAlternation) + public function setMaxAlternation(int $maxAlternation) { $this->maxAlternation = $maxAlternation; @@ -124,11 +114,9 @@ public function setMaxAlternation($maxAlternation) } /** - * @param int $maxTextLines - * * @return $this */ - public function setMaxTextLines($maxTextLines) + public function setMaxTextLines(int $maxTextLines) { $this->maxTextLines = $maxTextLines; @@ -136,11 +124,9 @@ public function setMaxTextLines($maxTextLines) } /** - * @param int $minTextSpacing - * * @return $this */ - public function setMinTextSpacing($minTextSpacing) + public function setMinTextSpacing(int $minTextSpacing) { $this->minTextSpacing = $minTextSpacing; diff --git a/GoogleCharts/Options/AdvancedLegend.php b/GoogleCharts/Options/AdvancedLegend.php index f0e5501..9e28868 100644 --- a/GoogleCharts/Options/AdvancedLegend.php +++ b/GoogleCharts/Options/AdvancedLegend.php @@ -17,11 +17,9 @@ class AdvancedLegend extends Legend protected $maxLines; /** - * @param int $maxLines - * * @return $this */ - public function setMaxLines($maxLines) + public function setMaxLines(int $maxLines) { $this->maxLines = $maxLines; diff --git a/GoogleCharts/Options/AdvancedSeries.php b/GoogleCharts/Options/AdvancedSeries.php index 5c17664..edf325b 100644 --- a/GoogleCharts/Options/AdvancedSeries.php +++ b/GoogleCharts/Options/AdvancedSeries.php @@ -24,11 +24,9 @@ class AdvancedSeries extends Series protected $labelInLegend; /** - * @param int $targetAxisIndex - * * @return $this */ - public function setTargetAxisIndex($targetAxisIndex) + public function setTargetAxisIndex(int $targetAxisIndex) { $this->targetAxisIndex = $targetAxisIndex; @@ -36,11 +34,9 @@ public function setTargetAxisIndex($targetAxisIndex) } /** - * @param string $labelInLegend - * * @return $this */ - public function setLabelInLegend($labelInLegend) + public function setLabelInLegend(string $labelInLegend) { $this->labelInLegend = $labelInLegend; diff --git a/GoogleCharts/Options/AdvancedTextStyle.php b/GoogleCharts/Options/AdvancedTextStyle.php index 1947b4d..b1e3c0e 100644 --- a/GoogleCharts/Options/AdvancedTextStyle.php +++ b/GoogleCharts/Options/AdvancedTextStyle.php @@ -17,11 +17,9 @@ class AdvancedTextStyle extends MediumTextStyle use OpacityTrait; /** - * @param string $auraColor - * * @return $this */ - public function setAuraColor($auraColor) + public function setAuraColor(string $auraColor) { $this->auraColor = $auraColor; diff --git a/GoogleCharts/Options/AdvancedTooltip.php b/GoogleCharts/Options/AdvancedTooltip.php index c9d5456..de68fe5 100644 --- a/GoogleCharts/Options/AdvancedTooltip.php +++ b/GoogleCharts/Options/AdvancedTooltip.php @@ -17,11 +17,9 @@ class AdvancedTooltip extends MediumTooltip protected $ignoreBounds; /** - * @param bool $ignoreBounds - * * @return $this */ - public function setIgnoreBounds($ignoreBounds) + public function setIgnoreBounds(bool $ignoreBounds) { $this->ignoreBounds = $ignoreBounds; diff --git a/GoogleCharts/Options/AggregationTargetTrait.php b/GoogleCharts/Options/AggregationTargetTrait.php index f9d283c..7137ca2 100644 --- a/GoogleCharts/Options/AggregationTargetTrait.php +++ b/GoogleCharts/Options/AggregationTargetTrait.php @@ -34,11 +34,9 @@ trait AggregationTargetTrait protected $aggregationTarget; /** - * @param string $aggregationTarget - * * @return $this */ - public function setAggregationTarget($aggregationTarget) + public function setAggregationTarget(string $aggregationTarget) { $this->aggregationTarget = $aggregationTarget; diff --git a/GoogleCharts/Options/AllowHtmlTrait.php b/GoogleCharts/Options/AllowHtmlTrait.php index f9aef06..4a59ec7 100644 --- a/GoogleCharts/Options/AllowHtmlTrait.php +++ b/GoogleCharts/Options/AllowHtmlTrait.php @@ -17,11 +17,9 @@ trait AllowHtmlTrait protected $allowHtml; /** - * @param bool $allowHtml - * * @return $this */ - public function setAllowHtml($allowHtml) + public function setAllowHtml(bool $allowHtml) { $this->allowHtml = $allowHtml; diff --git a/GoogleCharts/Options/Animation.php b/GoogleCharts/Options/Animation.php index 7c07e7d..cb157ae 100644 --- a/GoogleCharts/Options/Animation.php +++ b/GoogleCharts/Options/Animation.php @@ -27,11 +27,9 @@ class Animation protected $easing; /** - * @param int $duration - * * @return $this */ - public function setDuration($duration) + public function setDuration(int $duration) { $this->duration = $duration; @@ -39,11 +37,9 @@ public function setDuration($duration) } /** - * @param string $easing - * * @return $this */ - public function setEasing($easing) + public function setEasing(string $easing) { $this->easing = $easing; diff --git a/GoogleCharts/Options/AnnotationChart/AnnotationChartOptions.php b/GoogleCharts/Options/AnnotationChart/AnnotationChartOptions.php index 91159f9..c356110 100644 --- a/GoogleCharts/Options/AnnotationChart/AnnotationChartOptions.php +++ b/GoogleCharts/Options/AnnotationChart/AnnotationChartOptions.php @@ -224,20 +224,15 @@ public function __construct() $this->table = new Table(); } - /** - * @return Table - */ - public function getTable() + public function getTable(): Table { return $this->table; } /** - * @param string $allValuesSuffix - * * @return $this */ - public function setAllValuesSuffix($allValuesSuffix) + public function setAllValuesSuffix(string $allValuesSuffix) { $this->allValuesSuffix = $allValuesSuffix; @@ -245,11 +240,9 @@ public function setAllValuesSuffix($allValuesSuffix) } /** - * @param int $annotationsWidth - * * @return $this */ - public function setAnnotationsWidth($annotationsWidth) + public function setAnnotationsWidth(int $annotationsWidth) { $this->annotationsWidth = $annotationsWidth; @@ -257,11 +250,9 @@ public function setAnnotationsWidth($annotationsWidth) } /** - * @param string $dateFormat - * * @return $this */ - public function setDateFormat($dateFormat) + public function setDateFormat(string $dateFormat) { $this->dateFormat = $dateFormat; @@ -269,11 +260,9 @@ public function setDateFormat($dateFormat) } /** - * @param bool $displayAnnotations - * * @return $this */ - public function setDisplayAnnotations($displayAnnotations) + public function setDisplayAnnotations(bool $displayAnnotations) { $this->displayAnnotations = $displayAnnotations; @@ -281,11 +270,9 @@ public function setDisplayAnnotations($displayAnnotations) } /** - * @param bool $displayAnnotationsFilter - * * @return $this */ - public function setDisplayAnnotationsFilter($displayAnnotationsFilter) + public function setDisplayAnnotationsFilter(bool $displayAnnotationsFilter) { $this->displayAnnotationsFilter = $displayAnnotationsFilter; @@ -293,11 +280,9 @@ public function setDisplayAnnotationsFilter($displayAnnotationsFilter) } /** - * @param bool $displayDateBarSeparator - * * @return $this */ - public function setDisplayDateBarSeparator($displayDateBarSeparator) + public function setDisplayDateBarSeparator(bool $displayDateBarSeparator) { $this->displayDateBarSeparator = $displayDateBarSeparator; @@ -305,11 +290,9 @@ public function setDisplayDateBarSeparator($displayDateBarSeparator) } /** - * @param bool $displayExactValues - * * @return $this */ - public function setDisplayExactValues($displayExactValues) + public function setDisplayExactValues(bool $displayExactValues) { $this->displayExactValues = $displayExactValues; @@ -317,11 +300,9 @@ public function setDisplayExactValues($displayExactValues) } /** - * @param bool $displayLegendDots - * * @return $this */ - public function setDisplayLegendDots($displayLegendDots) + public function setDisplayLegendDots(bool $displayLegendDots) { $this->displayLegendDots = $displayLegendDots; @@ -329,11 +310,9 @@ public function setDisplayLegendDots($displayLegendDots) } /** - * @param bool $displayLegendValues - * * @return $this */ - public function setDisplayLegendValues($displayLegendValues) + public function setDisplayLegendValues(bool $displayLegendValues) { $this->displayLegendValues = $displayLegendValues; @@ -341,11 +320,9 @@ public function setDisplayLegendValues($displayLegendValues) } /** - * @param bool $displayRangeSelector - * * @return $this */ - public function setDisplayRangeSelector($displayRangeSelector) + public function setDisplayRangeSelector(bool $displayRangeSelector) { $this->displayRangeSelector = $displayRangeSelector; @@ -353,11 +330,9 @@ public function setDisplayRangeSelector($displayRangeSelector) } /** - * @param bool $displayZoomButtons - * * @return $this */ - public function setDisplayZoomButtons($displayZoomButtons) + public function setDisplayZoomButtons(bool $displayZoomButtons) { $this->displayZoomButtons = $displayZoomButtons; @@ -365,11 +340,9 @@ public function setDisplayZoomButtons($displayZoomButtons) } /** - * @param int $fill - * * @return $this */ - public function setFill($fill) + public function setFill(int $fill) { $this->fill = $fill; @@ -377,11 +350,9 @@ public function setFill($fill) } /** - * @param string $legendPosition - * * @return $this */ - public function setLegendPosition($legendPosition) + public function setLegendPosition(string $legendPosition) { $this->legendPosition = $legendPosition; @@ -389,11 +360,9 @@ public function setLegendPosition($legendPosition) } /** - * @param string $numberFormats - * * @return $this */ - public function setNumberFormats($numberFormats) + public function setNumberFormats(string $numberFormats) { $this->numberFormats = $numberFormats; @@ -405,7 +374,7 @@ public function setNumberFormats($numberFormats) * * @return $this */ - public function setScaleColumns($scaleColumns) + public function setScaleColumns(array $scaleColumns) { $this->scaleColumns = $scaleColumns; @@ -413,11 +382,9 @@ public function setScaleColumns($scaleColumns) } /** - * @param string $scaleFormat - * * @return $this */ - public function setScaleFormat($scaleFormat) + public function setScaleFormat(string $scaleFormat) { $this->scaleFormat = $scaleFormat; @@ -425,11 +392,9 @@ public function setScaleFormat($scaleFormat) } /** - * @param string $scaleType - * * @return $this */ - public function setScaleType($scaleType) + public function setScaleType(string $scaleType) { $this->scaleType = $scaleType; @@ -437,11 +402,9 @@ public function setScaleType($scaleType) } /** - * @param DateTime $zoomStartTime - * * @return $this */ - public function setZoomStartTime($zoomStartTime) + public function setZoomStartTime(DateTime $zoomStartTime) { $this->zoomStartTime = $zoomStartTime; @@ -449,11 +412,9 @@ public function setZoomStartTime($zoomStartTime) } /** - * @param int $thickness - * * @return $this */ - public function setThickness($thickness) + public function setThickness(int $thickness) { $this->thickness = $thickness; @@ -461,11 +422,9 @@ public function setThickness($thickness) } /** - * @param DateTime $zoomEndTime - * * @return $this */ - public function setZoomEndTime($zoomEndTime) + public function setZoomEndTime(DateTime $zoomEndTime) { $this->zoomEndTime = $zoomEndTime; diff --git a/GoogleCharts/Options/AnnotationChart/Table.php b/GoogleCharts/Options/AnnotationChart/Table.php index 7d60c04..80de885 100644 --- a/GoogleCharts/Options/AnnotationChart/Table.php +++ b/GoogleCharts/Options/AnnotationChart/Table.php @@ -23,11 +23,9 @@ class Table protected $sortColumn; /** - * @param bool $sortAscending - * * @return $this */ - public function setSortAscending($sortAscending) + public function setSortAscending(bool $sortAscending) { $this->sortAscending = $sortAscending; @@ -35,11 +33,9 @@ public function setSortAscending($sortAscending) } /** - * @param int $sortColumn - * * @return $this */ - public function setSortColumn($sortColumn) + public function setSortColumn(int $sortColumn) { $this->sortColumn = $sortColumn; diff --git a/GoogleCharts/Options/Annotations.php b/GoogleCharts/Options/Annotations.php index b38db5d..ccb5a16 100644 --- a/GoogleCharts/Options/Annotations.php +++ b/GoogleCharts/Options/Annotations.php @@ -49,9 +49,6 @@ class Annotations */ protected $textStyle; - /** - * Annotations constructor. - */ public function __construct() { $this->boxStyle = new BoxStyle(); @@ -61,52 +58,35 @@ public function __construct() $this->textStyle = new AdvancedTextStyle(); } - /** - * @return BoxStyle - */ - public function getBoxStyle() + public function getBoxStyle(): BoxStyle { return $this->boxStyle; } - /** - * @return Datum - */ - public function getDatum() + public function getDatum(): Datum { return $this->datum; } - /** - * @return Domain - */ - public function getDomain() + public function getDomain(): Domain { return $this->domain; } - /** - * @return Stem - */ - public function getStem() + public function getStem(): Stem { return $this->stem; } - /** - * @return AdvancedTextStyle - */ - public function getTextStyle() + public function getTextStyle(): AdvancedTextStyle { return $this->textStyle; } /** - * @param bool $highContrast - * * @return $this */ - public function setHighContrast($highContrast) + public function setHighContrast(bool $highContrast) { $this->highContrast = $highContrast; @@ -114,11 +94,9 @@ public function setHighContrast($highContrast) } /** - * @param string $style - * * @return $this */ - public function setStyle($style) + public function setStyle(string $style) { $this->style = $style; diff --git a/GoogleCharts/Options/AreaChart/AreaChartOptions.php b/GoogleCharts/Options/AreaChart/AreaChartOptions.php index 6a37f40..e839be9 100644 --- a/GoogleCharts/Options/AreaChart/AreaChartOptions.php +++ b/GoogleCharts/Options/AreaChart/AreaChartOptions.php @@ -72,9 +72,6 @@ class AreaChartOptions extends LineOptions use VAxesTrait; - /** - * AreaChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -87,50 +84,32 @@ public function __construct() $this->legend = new AdvancedLegend(); } - /** - * @return AdvancedAnimation - */ - public function getAnimation() + public function getAnimation(): AdvancedAnimation { return $this->animation; } - /** - * @return Annotations - */ - public function getAnnotations() + public function getAnnotations(): Annotations { return $this->annotations; } - /** - * @return Crosshair - */ - public function getCrosshair() + public function getCrosshair(): Crosshair { return $this->crosshair; } - /** - * @return Explorer - */ - public function getExplorer() + public function getExplorer(): Explorer { return $this->explorer; } - /** - * @return AdvancedHAxis - */ - public function getHAxis() + public function getHAxis(): AdvancedHAxis { return $this->hAxis; } - /** - * @return AdvancedLegend - */ - public function getLegend() + public function getLegend(): AdvancedLegend { return $this->legend; } diff --git a/GoogleCharts/Options/AreaChart/Series.php b/GoogleCharts/Options/AreaChart/Series.php index 7eb089f..c9c4b0e 100644 --- a/GoogleCharts/Options/AreaChart/Series.php +++ b/GoogleCharts/Options/AreaChart/Series.php @@ -18,18 +18,12 @@ class Series extends LineSeries use AreaOpacityTrait; - /** - * Series constructor. - */ public function __construct() { $this->annotations = new Annotations(); } - /** - * @return Annotations - */ - public function getAnnotations() + public function getAnnotations(): Annotations { return $this->annotations; } diff --git a/GoogleCharts/Options/AreaOpacityTrait.php b/GoogleCharts/Options/AreaOpacityTrait.php index a086f8f..4c6cea8 100644 --- a/GoogleCharts/Options/AreaOpacityTrait.php +++ b/GoogleCharts/Options/AreaOpacityTrait.php @@ -18,11 +18,9 @@ trait AreaOpacityTrait protected $areaOpacity; /** - * @param float $areaOpacity - * * @return $this */ - public function setAreaOpacity($areaOpacity) + public function setAreaOpacity(float $areaOpacity) { $this->areaOpacity = $areaOpacity; diff --git a/GoogleCharts/Options/AxisTitlesPositionTrait.php b/GoogleCharts/Options/AxisTitlesPositionTrait.php index 67d4dca..f8e06d0 100644 --- a/GoogleCharts/Options/AxisTitlesPositionTrait.php +++ b/GoogleCharts/Options/AxisTitlesPositionTrait.php @@ -20,11 +20,9 @@ trait AxisTitlesPositionTrait protected $axisTitlesPosition; /** - * @param string $axisTitlesPosition - * * @return $this */ - public function setAxisTitlesPosition($axisTitlesPosition) + public function setAxisTitlesPosition(string $axisTitlesPosition) { $this->axisTitlesPosition = $axisTitlesPosition; diff --git a/GoogleCharts/Options/BarChart/BarChartOptions.php b/GoogleCharts/Options/BarChart/BarChartOptions.php index 1a8cd78..90b91e5 100644 --- a/GoogleCharts/Options/BarChart/BarChartOptions.php +++ b/GoogleCharts/Options/BarChart/BarChartOptions.php @@ -88,9 +88,6 @@ class BarChartOptions extends AdvancedChartOptions */ protected $trendlines; - /** - * BarChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -104,58 +101,37 @@ public function __construct() $this->tooltip = new AdvancedTooltip(); } - /** - * @return AdvancedAnimation - */ - public function getAnimation() + public function getAnimation(): AdvancedAnimation { return $this->animation; } - /** - * @return AdvancedAnnotations - */ - public function getAnnotations() + public function getAnnotations(): AdvancedAnnotations { return $this->annotations; } - /** - * @return Bar - */ - public function getBar() + public function getBar(): Bar { return $this->bar; } - /** - * @return Explorer - */ - public function getExplorer() + public function getExplorer(): Explorer { return $this->explorer; } - /** - * @return MediumHAxis - */ - public function getHAxis() + public function getHAxis(): MediumHAxis { return $this->hAxis; } - /** - * @return AdvancedLegend - */ - public function getLegend() + public function getLegend(): AdvancedLegend { return $this->legend; } - /** - * @return AdvancedTooltip - */ - public function getTooltip() + public function getTooltip(): AdvancedTooltip { return $this->tooltip; } @@ -165,7 +141,7 @@ public function getTooltip() * * @return $this */ - public function setHAxes($hAxes) + public function setHAxes(array $hAxes) { $this->hAxes = $hAxes; @@ -177,7 +153,7 @@ public function setHAxes($hAxes) * * @return $this */ - public function setTrendlines($trendlines) + public function setTrendlines(array $trendlines) { $this->trendlines = $trendlines; diff --git a/GoogleCharts/Options/BarChart/Series.php b/GoogleCharts/Options/BarChart/Series.php index c47ecde..2fbd75a 100644 --- a/GoogleCharts/Options/BarChart/Series.php +++ b/GoogleCharts/Options/BarChart/Series.php @@ -20,10 +20,7 @@ public function __construct() $this->annotations = new AdvancedAnnotations(); } - /** - * @return AdvancedAnnotations - */ - public function getAnnotations() + public function getAnnotations(): AdvancedAnnotations { return $this->annotations; } diff --git a/GoogleCharts/Options/BarsTrait.php b/GoogleCharts/Options/BarsTrait.php index 1d77677..b8ca777 100644 --- a/GoogleCharts/Options/BarsTrait.php +++ b/GoogleCharts/Options/BarsTrait.php @@ -17,11 +17,9 @@ trait BarsTrait protected $bars; /** - * @param string $bars - * * @return $this */ - public function setBars($bars) + public function setBars(string $bars) { $this->bars = $bars; diff --git a/GoogleCharts/Options/BasicTooltip.php b/GoogleCharts/Options/BasicTooltip.php index 689d40d..17d5db5 100644 --- a/GoogleCharts/Options/BasicTooltip.php +++ b/GoogleCharts/Options/BasicTooltip.php @@ -14,18 +14,12 @@ class BasicTooltip extends Tooltip use TriggerTrait; - /** - * BasicTooltip constructor. - */ public function __construct() { $this->textStyle = new MediumTextStyle(); } - /** - * @return MediumTextStyle - */ - public function getTextStyle() + public function getTextStyle(): MediumTextStyle { return $this->textStyle; } diff --git a/GoogleCharts/Options/BoldTrait.php b/GoogleCharts/Options/BoldTrait.php index 6c1139a..527d9f0 100644 --- a/GoogleCharts/Options/BoldTrait.php +++ b/GoogleCharts/Options/BoldTrait.php @@ -13,11 +13,9 @@ trait BoldTrait protected $bold; /** - * @param bool $bold - * * @return $this */ - public function setBold($bold) + public function setBold(bool $bold) { $this->bold = $bold; diff --git a/GoogleCharts/Options/BoxStyle.php b/GoogleCharts/Options/BoxStyle.php index ac1bb4b..594cf25 100644 --- a/GoogleCharts/Options/BoxStyle.php +++ b/GoogleCharts/Options/BoxStyle.php @@ -30,28 +30,20 @@ class BoxStyle */ protected $gradient; - /** - * BoxStyle constructor. - */ public function __construct() { $this->gradient = new Gradient(); } - /** - * @return Gradient - */ - public function getGradient() + public function getGradient(): Gradient { return $this->gradient; } /** - * @param int $rx - * * @return $this */ - public function setRx($rx) + public function setRx(int $rx) { $this->rx = $rx; @@ -59,11 +51,9 @@ public function setRx($rx) } /** - * @param int $ry - * * @return $this */ - public function setRy($ry) + public function setRy(int $ry) { $this->ry = $ry; diff --git a/GoogleCharts/Options/BubbleChart/Bubble.php b/GoogleCharts/Options/BubbleChart/Bubble.php index 8911ead..bb807b3 100644 --- a/GoogleCharts/Options/BubbleChart/Bubble.php +++ b/GoogleCharts/Options/BubbleChart/Bubble.php @@ -20,18 +20,12 @@ class Bubble */ protected $textStyle; - /** - * Bubble constructor. - */ public function __construct() { $this->textStyle = new AdvancedTextStyle(); } - /** - * @return AdvancedTextStyle - */ - public function getTextStyle() + public function getTextStyle(): AdvancedTextStyle { return $this->textStyle; } diff --git a/GoogleCharts/Options/BubbleChart/BubbleChartOptions.php b/GoogleCharts/Options/BubbleChart/BubbleChartOptions.php index 64dc9f9..33dfe8e 100644 --- a/GoogleCharts/Options/BubbleChart/BubbleChartOptions.php +++ b/GoogleCharts/Options/BubbleChart/BubbleChartOptions.php @@ -10,7 +10,6 @@ use CMEN\GoogleChartsBundle\GoogleCharts\Options\MediumHAxis; use CMEN\GoogleChartsBundle\GoogleCharts\Options\SelectionModeTrait; use CMEN\GoogleChartsBundle\GoogleCharts\Options\SizeAxis; -use CMEN\GoogleChartsBundle\GoogleCharts\Options\VAxis; /** * @author Christophe Meneses @@ -67,14 +66,6 @@ class BubbleChartOptions extends AdvancedChartOptions */ protected $tooltip; - /** - * @var VAxis - */ - protected $vAxis; - - /** - * BubbleChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -87,87 +78,52 @@ public function __construct() $this->legend = new AdvancedLegend(); $this->sizeAxis = new SizeAxis(); $this->tooltip = new BasicTooltip(); - $this->vAxis = new VAxis(); } - /** - * @return AdvancedAnimation - */ - public function getAnimation() + public function getAnimation(): AdvancedAnimation { return $this->animation; } - /** - * @return Bubble - */ - public function getBubble() + public function getBubble(): Bubble { return $this->bubble; } - /** - * @return ColorAxis - */ - public function getColorAxis() + public function getColorAxis(): ColorAxis { return $this->colorAxis; } - /** - * @return Explorer - */ - public function getExplorer() + public function getExplorer(): Explorer { return $this->explorer; } - /** - * @return MediumHAxis - */ - public function getHAxis() + public function getHAxis(): MediumHAxis { return $this->hAxis; } - /** - * @return AdvancedLegend - */ - public function getLegend() + public function getLegend(): AdvancedLegend { return $this->legend; } - /** - * @return SizeAxis - */ - public function getSizeAxis() + public function getSizeAxis(): SizeAxis { return $this->sizeAxis; } - /** - * @return BasicTooltip - */ - public function getTooltip() + public function getTooltip(): BasicTooltip { return $this->tooltip; } /** - * @return VAxis - */ - public function getVAxis() - { - return $this->vAxis; - } - - /** - * @param bool $sortBubblesBySize - * * @return $this */ - public function setSortBubblesBySize($sortBubblesBySize) + public function setSortBubblesBySize(bool $sortBubblesBySize) { $this->sortBubblesBySize = $sortBubblesBySize; diff --git a/GoogleCharts/Options/BubbleChart/ColorAxis.php b/GoogleCharts/Options/BubbleChart/ColorAxis.php index 52c02bc..8f530dc 100644 --- a/GoogleCharts/Options/BubbleChart/ColorAxis.php +++ b/GoogleCharts/Options/BubbleChart/ColorAxis.php @@ -17,10 +17,7 @@ public function __construct() $this->legend = new Legend(); } - /** - * @return Legend - */ - public function getLegend() + public function getLegend(): Legend { return $this->legend; } diff --git a/GoogleCharts/Options/BubbleChart/Legend.php b/GoogleCharts/Options/BubbleChart/Legend.php index 179ccec..8c78b34 100644 --- a/GoogleCharts/Options/BubbleChart/Legend.php +++ b/GoogleCharts/Options/BubbleChart/Legend.php @@ -25,20 +25,15 @@ class Legend */ protected $textStyle; - /** - * @return TextStyle - */ - public function getTextStyle() + public function getTextStyle(): TextStyle { return $this->textStyle; } /** - * @param string $position - * * @return $this */ - public function setPosition($position) + public function setPosition(string $position) { $this->position = $position; diff --git a/GoogleCharts/Options/CalendarChart/Calendar.php b/GoogleCharts/Options/CalendarChart/Calendar.php index b1b87e2..b4b5b6f 100644 --- a/GoogleCharts/Options/CalendarChart/Calendar.php +++ b/GoogleCharts/Options/CalendarChart/Calendar.php @@ -150,11 +150,9 @@ public function getYearLabel() } /** - * @param int $cellSize - * * @return $this */ - public function setCellSize($cellSize) + public function setCellSize(int $cellSize) { $this->cellSize = $cellSize; @@ -162,11 +160,9 @@ public function setCellSize($cellSize) } /** - * @param int $dayOfWeekRightSpace - * * @return $this */ - public function setDayOfWeekRightSpace($dayOfWeekRightSpace) + public function setDayOfWeekRightSpace(int $dayOfWeekRightSpace) { $this->dayOfWeekRightSpace = $dayOfWeekRightSpace; @@ -174,11 +170,9 @@ public function setDayOfWeekRightSpace($dayOfWeekRightSpace) } /** - * @param string $daysOfWeek - * * @return $this */ - public function setDaysOfWeek($daysOfWeek) + public function setDaysOfWeek(string $daysOfWeek) { $this->daysOfWeek = $daysOfWeek; @@ -186,11 +180,9 @@ public function setDaysOfWeek($daysOfWeek) } /** - * @param int $underMonthSpace - * * @return $this */ - public function setUnderMonthSpace($underMonthSpace) + public function setUnderMonthSpace(int $underMonthSpace) { $this->underMonthSpace = $underMonthSpace; @@ -198,11 +190,9 @@ public function setUnderMonthSpace($underMonthSpace) } /** - * @param int $underYearSpace - * * @return $this */ - public function setUnderYearSpace($underYearSpace) + public function setUnderYearSpace(int $underYearSpace) { $this->underYearSpace = $underYearSpace; diff --git a/GoogleCharts/Options/CalendarChart/CalendarChartOptions.php b/GoogleCharts/Options/CalendarChart/CalendarChartOptions.php index ae871b6..161dec2 100644 --- a/GoogleCharts/Options/CalendarChart/CalendarChartOptions.php +++ b/GoogleCharts/Options/CalendarChart/CalendarChartOptions.php @@ -28,9 +28,6 @@ class CalendarChartOptions extends ChartOptions */ protected $noDataPattern; - /** - * CalendarChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -40,26 +37,17 @@ public function __construct() $this->noDataPattern = new NoDataPattern(); } - /** - * @return Calendar - */ - public function getCalendar() + public function getCalendar(): Calendar { return $this->calendar; } - /** - * @return ColorAxis - */ - public function getColorAxis() + public function getColorAxis(): ColorAxis { return $this->colorAxis; } - /** - * @return NoDataPattern - */ - public function getNoDataPattern() + public function getNoDataPattern(): NoDataPattern { return $this->noDataPattern; } diff --git a/GoogleCharts/Options/CalendarChart/NoDataPattern.php b/GoogleCharts/Options/CalendarChart/NoDataPattern.php index 8ad9f97..abba74d 100644 --- a/GoogleCharts/Options/CalendarChart/NoDataPattern.php +++ b/GoogleCharts/Options/CalendarChart/NoDataPattern.php @@ -20,11 +20,9 @@ class NoDataPattern use ColorTrait; /** - * @param string $backgroundColor - * * @return $this */ - public function setBackgroundColor($backgroundColor) + public function setBackgroundColor(string $backgroundColor) { $this->backgroundColor = $backgroundColor; diff --git a/GoogleCharts/Options/Candlestick.php b/GoogleCharts/Options/Candlestick.php index f7d7b77..735d2a7 100644 --- a/GoogleCharts/Options/Candlestick.php +++ b/GoogleCharts/Options/Candlestick.php @@ -24,37 +24,26 @@ class Candlestick */ protected $risingColor; - /** - * Candlestick constructor. - */ public function __construct() { $this->fallingColor = new FallingColor(); $this->risingColor = new RisingColor(); } - /** - * @return FallingColor - */ - public function getFallingColor() + public function getFallingColor(): FallingColor { return $this->fallingColor; } - /** - * @return RisingColor - */ - public function getRisingColor() + public function getRisingColor(): RisingColor { return $this->risingColor; } /** - * @param bool $hollowIsRising - * * @return $this */ - public function setHollowIsRising($hollowIsRising) + public function setHollowIsRising(bool $hollowIsRising) { $this->hollowIsRising = $hollowIsRising; diff --git a/GoogleCharts/Options/CandlestickChart/CandlestickChartOptions.php b/GoogleCharts/Options/CandlestickChart/CandlestickChartOptions.php index 2ebbd2d..a29e983 100644 --- a/GoogleCharts/Options/CandlestickChart/CandlestickChartOptions.php +++ b/GoogleCharts/Options/CandlestickChart/CandlestickChartOptions.php @@ -63,9 +63,6 @@ class CandlestickChartOptions extends AdvancedChartOptions use VAxesTrait; - /** - * CandlestickChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -78,50 +75,32 @@ public function __construct() $this->tooltip = new AdvancedTooltip(); } - /** - * @return AdvancedAnimation - */ - public function getAnimation() + public function getAnimation(): AdvancedAnimation { return $this->animation; } - /** - * @return Bar - */ - public function getBar() + public function getBar(): Bar { return $this->bar; } - /** - * @return Candlestick - */ - public function getCandlestick() + public function getCandlestick(): Candlestick { return $this->candlestick; } - /** - * @return AdvancedHAxis - */ - public function getHAxis() + public function getHAxis(): AdvancedHAxis { return $this->hAxis; } - /** - * @return AdvancedLegend - */ - public function getLegend() + public function getLegend(): AdvancedLegend { return $this->legend; } - /** - * @return AdvancedTooltip - */ - public function getTooltip() + public function getTooltip(): AdvancedTooltip { return $this->tooltip; } diff --git a/GoogleCharts/Options/CandlestickChart/Series.php b/GoogleCharts/Options/CandlestickChart/Series.php index 0e4853a..2c8165c 100644 --- a/GoogleCharts/Options/CandlestickChart/Series.php +++ b/GoogleCharts/Options/CandlestickChart/Series.php @@ -21,27 +21,18 @@ class Series extends AdvancedSeries */ protected $risingColor; - /** - * Series constructor. - */ public function __construct() { $this->fallingColor = new FallingColor(); $this->risingColor = new RisingColor(); } - /** - * @return RisingColor - */ - public function getRisingColor() + public function getRisingColor(): RisingColor { return $this->risingColor; } - /** - * @return FallingColor - */ - public function getFallingColor() + public function getFallingColor(): FallingColor { return $this->fallingColor; } diff --git a/GoogleCharts/Options/ChartArea.php b/GoogleCharts/Options/ChartArea.php index 2a69771..8aa9965 100644 --- a/GoogleCharts/Options/ChartArea.php +++ b/GoogleCharts/Options/ChartArea.php @@ -112,11 +112,9 @@ public function setWidth($width) } /** - * @param string $backgroundColor - * * @return $this */ - public function setBackgroundColor($backgroundColor) + public function setBackgroundColor(string $backgroundColor) { $this->backgroundColor = $backgroundColor; diff --git a/GoogleCharts/Options/ChartOptions.php b/GoogleCharts/Options/ChartOptions.php index cee4033..fe2ab34 100644 --- a/GoogleCharts/Options/ChartOptions.php +++ b/GoogleCharts/Options/ChartOptions.php @@ -13,9 +13,6 @@ class ChartOptions implements ChartOptionsInterface use WidthTrait; - /** - * ChartOptions constructor. - */ public function __construct() { } diff --git a/GoogleCharts/Options/ColorAxis.php b/GoogleCharts/Options/ColorAxis.php index db6bf05..6a2ae85 100644 --- a/GoogleCharts/Options/ColorAxis.php +++ b/GoogleCharts/Options/ColorAxis.php @@ -36,11 +36,9 @@ class ColorAxis use ColorsTrait; /** - * @param int $minValue - * * @return $this */ - public function setMinValue($minValue) + public function setMinValue(int $minValue) { $this->minValue = $minValue; @@ -48,11 +46,9 @@ public function setMinValue($minValue) } /** - * @param int $maxValue - * * @return $this */ - public function setMaxValue($maxValue) + public function setMaxValue(int $maxValue) { $this->maxValue = $maxValue; @@ -64,7 +60,7 @@ public function setMaxValue($maxValue) * * @return $this */ - public function setValues($values) + public function setValues(array $values) { $this->values = $values; diff --git a/GoogleCharts/Options/ColorTrait.php b/GoogleCharts/Options/ColorTrait.php index 2df0663..0d8f479 100644 --- a/GoogleCharts/Options/ColorTrait.php +++ b/GoogleCharts/Options/ColorTrait.php @@ -15,11 +15,9 @@ trait ColorTrait protected $color; /** - * @param string $color - * * @return $this */ - public function setColor($color) + public function setColor(string $color) { $this->color = $color; diff --git a/GoogleCharts/Options/ColorsTrait.php b/GoogleCharts/Options/ColorsTrait.php index a536aef..e4ea988 100644 --- a/GoogleCharts/Options/ColorsTrait.php +++ b/GoogleCharts/Options/ColorsTrait.php @@ -20,7 +20,7 @@ trait ColorsTrait * * @return $this */ - public function setColors($colors) + public function setColors(array $colors) { $this->colors = $colors; diff --git a/GoogleCharts/Options/ColumnChart/ColumnChartOptions.php b/GoogleCharts/Options/ColumnChart/ColumnChartOptions.php index dbe5009..6423d53 100644 --- a/GoogleCharts/Options/ColumnChart/ColumnChartOptions.php +++ b/GoogleCharts/Options/ColumnChart/ColumnChartOptions.php @@ -78,9 +78,6 @@ class ColumnChartOptions extends AdvancedChartOptions use VAxesTrait; - /** - * ColumnChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -94,58 +91,37 @@ public function __construct() $this->tooltip = new AdvancedTooltip(); } - /** - * @return AdvancedAnimation - */ - public function getAnimation() + public function getAnimation(): AdvancedAnimation { return $this->animation; } - /** - * @return AdvancedAnnotations - */ - public function getAnnotations() + public function getAnnotations(): AdvancedAnnotations { return $this->annotations; } - /** - * @return Bar - */ - public function getBar() + public function getBar(): Bar { return $this->bar; } - /** - * @return Explorer - */ - public function getExplorer() + public function getExplorer(): Explorer { return $this->explorer; } - /** - * @return AdvancedHAxis - */ - public function getHAxis() + public function getHAxis(): AdvancedHAxis { return $this->hAxis; } - /** - * @return Legend - */ - public function getLegend() + public function getLegend(): Legend { return $this->legend; } - /** - * @return AdvancedTooltip - */ - public function getTooltip() + public function getTooltip(): AdvancedTooltip { return $this->tooltip; } @@ -155,7 +131,7 @@ public function getTooltip() * * @return $this */ - public function setTrendlines($trendlines) + public function setTrendlines(array $trendlines) { $this->trendlines = $trendlines; diff --git a/GoogleCharts/Options/ColumnChart/Series.php b/GoogleCharts/Options/ColumnChart/Series.php index 1d2b55e..1a3b670 100644 --- a/GoogleCharts/Options/ColumnChart/Series.php +++ b/GoogleCharts/Options/ColumnChart/Series.php @@ -23,28 +23,20 @@ class Series extends \CMEN\GoogleChartsBundle\GoogleCharts\Options\Series */ protected $targetAxisIndex; - /** - * Series constructor. - */ public function __construct() { $this->annotations = new AdvancedAnnotations(); } - /** - * @return AdvancedAnnotations - */ - public function getAnnotations() + public function getAnnotations(): AdvancedAnnotations { return $this->annotations; } /** - * @param int $targetAxisIndex - * * @return $this */ - public function setTargetAxisIndex($targetAxisIndex) + public function setTargetAxisIndex(int $targetAxisIndex) { $this->targetAxisIndex = $targetAxisIndex; diff --git a/GoogleCharts/Options/ComboChart/ComboChartOptions.php b/GoogleCharts/Options/ComboChart/ComboChartOptions.php index 5d3097c..c3d4e50 100644 --- a/GoogleCharts/Options/ComboChart/ComboChartOptions.php +++ b/GoogleCharts/Options/ComboChart/ComboChartOptions.php @@ -98,9 +98,6 @@ class ComboChartOptions extends LineOptions use VAxesTrait; - /** - * ComboChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -114,58 +111,37 @@ public function __construct() $this->legend = new AdvancedLegend(); } - /** - * @return AdvancedAnimation - */ - public function getAnimation() + public function getAnimation(): AdvancedAnimation { return $this->animation; } - /** - * @return Annotations - */ - public function getAnnotations() + public function getAnnotations(): Annotations { return $this->annotations; } - /** - * @return Bar - */ - public function getBar() + public function getBar(): Bar { return $this->bar; } - /** - * @return Candlestick - */ - public function getCandlestick() + public function getCandlestick(): Candlestick { return $this->candlestick; } - /** - * @return Crosshair - */ - public function getCrosshair() + public function getCrosshair(): Crosshair { return $this->crosshair; } - /** - * @return AdvancedHAxis - */ - public function getHAxis() + public function getHAxis(): AdvancedHAxis { return $this->hAxis; } - /** - * @return AdvancedLegend - */ - public function getLegend() + public function getLegend(): AdvancedLegend { return $this->legend; } @@ -175,7 +151,7 @@ public function getLegend() * * @return $this */ - public function setTrendlines($trendlines) + public function setTrendlines(array $trendlines) { $this->trendlines = $trendlines; @@ -183,11 +159,9 @@ public function setTrendlines($trendlines) } /** - * @param string $seriesType - * * @return $this */ - public function setSeriesType($seriesType) + public function setSeriesType(string $seriesType) { $this->seriesType = $seriesType; diff --git a/GoogleCharts/Options/ComboChart/Series.php b/GoogleCharts/Options/ComboChart/Series.php index 1866d84..978bc3e 100644 --- a/GoogleCharts/Options/ComboChart/Series.php +++ b/GoogleCharts/Options/ComboChart/Series.php @@ -42,9 +42,6 @@ class Series extends LineSeries */ protected $type; - /** - * Series constructor. - */ public function __construct() { $this->annotations = new Annotations(); @@ -52,36 +49,25 @@ public function __construct() $this->risingColor = new RisingColor(); } - /** - * @return Annotations - */ - public function getAnnotations() + public function getAnnotations(): Annotations { return $this->annotations; } - /** - * @return FallingColor - */ - public function getFallingColor() + public function getFallingColor(): FallingColor { return $this->fallingColor; } - /** - * @return RisingColor - */ - public function getRisingColor() + public function getRisingColor(): RisingColor { return $this->risingColor; } /** - * @param string $type - * * @return $this */ - public function setType($type) + public function setType(string $type) { $this->type = $type; diff --git a/GoogleCharts/Options/Crosshair.php b/GoogleCharts/Options/Crosshair.php index 8b9748a..4977a05 100644 --- a/GoogleCharts/Options/Crosshair.php +++ b/GoogleCharts/Options/Crosshair.php @@ -33,37 +33,26 @@ class Crosshair */ protected $trigger; - /** - * Crosshair constructor. - */ public function __construct() { $this->focused = new Focused(); $this->selected = new Selected(); } - /** - * @return Focused - */ - public function getFocused() + public function getFocused(): Focused { return $this->focused; } - /** - * @return Selected - */ - public function getSelected() + public function getSelected(): Selected { return $this->selected; } /** - * @param string $trigger - * * @return $this */ - public function setTrigger($trigger) + public function setTrigger(string $trigger) { $this->trigger = $trigger; diff --git a/GoogleCharts/Options/CurveTypeTrait.php b/GoogleCharts/Options/CurveTypeTrait.php index d6b7410..7b84daa 100644 --- a/GoogleCharts/Options/CurveTypeTrait.php +++ b/GoogleCharts/Options/CurveTypeTrait.php @@ -19,11 +19,9 @@ trait CurveTypeTrait protected $curveType; /** - * @param string $curveType - * * @return $this */ - public function setCurveType($curveType) + public function setCurveType(string $curveType) { $this->curveType = $curveType; diff --git a/GoogleCharts/Options/DataOpacityTrait.php b/GoogleCharts/Options/DataOpacityTrait.php index b558b90..7d57a81 100644 --- a/GoogleCharts/Options/DataOpacityTrait.php +++ b/GoogleCharts/Options/DataOpacityTrait.php @@ -22,11 +22,9 @@ trait DataOpacityTrait protected $dataOpacity; /** - * @param float $dataOpacity - * * @return $this */ - public function setDataOpacity($dataOpacity) + public function setDataOpacity(float $dataOpacity) { $this->dataOpacity = $dataOpacity; diff --git a/GoogleCharts/Options/Datum.php b/GoogleCharts/Options/Datum.php index 067bcf1..9a76836 100644 --- a/GoogleCharts/Options/Datum.php +++ b/GoogleCharts/Options/Datum.php @@ -22,28 +22,20 @@ class Datum */ protected $style; - /** - * Datum constructor. - */ public function __construct() { $this->stem = new Stem(); } - /** - * @return Stem - */ - public function getStem() + public function getStem(): Stem { return $this->stem; } /** - * @param string $style - * * @return $this */ - public function setStyle($style) + public function setStyle(string $style) { $this->style = $style; diff --git a/GoogleCharts/Options/Diff/DiffBarChart/Diff.php b/GoogleCharts/Options/Diff/DiffBarChart/Diff.php index bd36d36..45e3acf 100644 --- a/GoogleCharts/Options/Diff/DiffBarChart/Diff.php +++ b/GoogleCharts/Options/Diff/DiffBarChart/Diff.php @@ -12,18 +12,12 @@ class Diff */ protected $newData; - /** - * Diff constructor. - */ public function __construct() { $this->newData = new NewData(); } - /** - * @return NewData - */ - public function getNewData() + public function getNewData(): NewData { return $this->newData; } diff --git a/GoogleCharts/Options/Diff/DiffBarChart/DiffBarChartOptions.php b/GoogleCharts/Options/Diff/DiffBarChart/DiffBarChartOptions.php index 941e655..457a856 100644 --- a/GoogleCharts/Options/Diff/DiffBarChart/DiffBarChartOptions.php +++ b/GoogleCharts/Options/Diff/DiffBarChart/DiffBarChartOptions.php @@ -14,9 +14,6 @@ class DiffBarChartOptions extends BarChartOptions */ protected $diff; - /** - * DiffBarChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -24,10 +21,7 @@ public function __construct() $this->diff = new Diff(); } - /** - * @return Diff - */ - public function getDiff() + public function getDiff(): Diff { return $this->diff; } diff --git a/GoogleCharts/Options/Diff/DiffBarChart/NewData.php b/GoogleCharts/Options/Diff/DiffBarChart/NewData.php index eee69a3..fcc7eb1 100644 --- a/GoogleCharts/Options/Diff/DiffBarChart/NewData.php +++ b/GoogleCharts/Options/Diff/DiffBarChart/NewData.php @@ -15,11 +15,9 @@ class NewData protected $widthFactor; /** - * @param float $widthFactor - * * @return $this */ - public function setWidthFactor($widthFactor) + public function setWidthFactor(float $widthFactor) { $this->widthFactor = $widthFactor; diff --git a/GoogleCharts/Options/Diff/DiffColumnChart/Diff.php b/GoogleCharts/Options/Diff/DiffColumnChart/Diff.php index 28389fe..417fa2c 100644 --- a/GoogleCharts/Options/Diff/DiffColumnChart/Diff.php +++ b/GoogleCharts/Options/Diff/DiffColumnChart/Diff.php @@ -12,18 +12,12 @@ class Diff */ protected $newData; - /** - * Diff constructor. - */ public function __construct() { $this->newData = new NewData(); } - /** - * @return NewData - */ - public function getNewData() + public function getNewData(): NewData { return $this->newData; } diff --git a/GoogleCharts/Options/Diff/DiffColumnChart/DiffColumnChartOptions.php b/GoogleCharts/Options/Diff/DiffColumnChart/DiffColumnChartOptions.php index 9c8c722..47e0f30 100644 --- a/GoogleCharts/Options/Diff/DiffColumnChart/DiffColumnChartOptions.php +++ b/GoogleCharts/Options/Diff/DiffColumnChart/DiffColumnChartOptions.php @@ -14,9 +14,6 @@ class DiffColumnChartOptions extends ColumnChartOptions */ protected $diff; - /** - * DiffColumnChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -24,10 +21,7 @@ public function __construct() $this->diff = new Diff(); } - /** - * @return Diff - */ - public function getDiff() + public function getDiff(): Diff { return $this->diff; } diff --git a/GoogleCharts/Options/Diff/DiffColumnChart/NewData.php b/GoogleCharts/Options/Diff/DiffColumnChart/NewData.php index 58e1a2c..c731cd3 100644 --- a/GoogleCharts/Options/Diff/DiffColumnChart/NewData.php +++ b/GoogleCharts/Options/Diff/DiffColumnChart/NewData.php @@ -15,11 +15,9 @@ class NewData protected $widthFactor; /** - * @param float $widthFactor - * * @return $this */ - public function setWidthFactor($widthFactor) + public function setWidthFactor(float $widthFactor) { $this->widthFactor = $widthFactor; diff --git a/GoogleCharts/Options/Diff/DiffPieChart/Diff.php b/GoogleCharts/Options/Diff/DiffPieChart/Diff.php index e714570..98bf3d7 100644 --- a/GoogleCharts/Options/Diff/DiffPieChart/Diff.php +++ b/GoogleCharts/Options/Diff/DiffPieChart/Diff.php @@ -22,9 +22,6 @@ class Diff */ protected $oldData; - /** - * Diff constructor. - */ public function __construct() { $this->innerCircle = new InnerCircle(); @@ -32,26 +29,17 @@ public function __construct() $this->oldData = new OldData(); } - /** - * @return NewData - */ - public function getNewData() + public function getNewData(): NewData { return $this->newData; } - /** - * @return InnerCircle - */ - public function getInnerCircle() + public function getInnerCircle(): InnerCircle { return $this->innerCircle; } - /** - * @return OldData - */ - public function getOldData() + public function getOldData(): OldData { return $this->oldData; } diff --git a/GoogleCharts/Options/Diff/DiffPieChart/DiffPieChartOptions.php b/GoogleCharts/Options/Diff/DiffPieChart/DiffPieChartOptions.php index 392bec5..5fe808a 100644 --- a/GoogleCharts/Options/Diff/DiffPieChart/DiffPieChartOptions.php +++ b/GoogleCharts/Options/Diff/DiffPieChart/DiffPieChartOptions.php @@ -18,10 +18,7 @@ public function __construct() $this->diff = new Diff(); } - /** - * @return Diff - */ - public function getDiff() + public function getDiff(): Diff { return $this->diff; } diff --git a/GoogleCharts/Options/Diff/DiffPieChart/InnerCircle.php b/GoogleCharts/Options/Diff/DiffPieChart/InnerCircle.php index 84bc2f3..b593e40 100644 --- a/GoogleCharts/Options/Diff/DiffPieChart/InnerCircle.php +++ b/GoogleCharts/Options/Diff/DiffPieChart/InnerCircle.php @@ -22,11 +22,9 @@ class InnerCircle protected $borderFactor; /** - * @param float $radiusFactor - * * @return $this */ - public function setRadiusFactor($radiusFactor) + public function setRadiusFactor(float $radiusFactor) { $this->radiusFactor = $radiusFactor; @@ -34,11 +32,9 @@ public function setRadiusFactor($radiusFactor) } /** - * @param float $borderFactor - * * @return $this */ - public function setBorderFactor($borderFactor) + public function setBorderFactor(float $borderFactor) { $this->borderFactor = $borderFactor; diff --git a/GoogleCharts/Options/Diff/DiffPieChart/OldData.php b/GoogleCharts/Options/Diff/DiffPieChart/OldData.php index 5d95021..a37998d 100644 --- a/GoogleCharts/Options/Diff/DiffPieChart/OldData.php +++ b/GoogleCharts/Options/Diff/DiffPieChart/OldData.php @@ -19,11 +19,9 @@ class OldData protected $inCenter; /** - * @param bool $inCenter - * * @return $this */ - public function setInCenter($inCenter) + public function setInCenter(bool $inCenter) { $this->inCenter = $inCenter; diff --git a/GoogleCharts/Options/Diff/DiffScatterChart/Diff.php b/GoogleCharts/Options/Diff/DiffScatterChart/Diff.php index 619da4d..bf46ba5 100644 --- a/GoogleCharts/Options/Diff/DiffScatterChart/Diff.php +++ b/GoogleCharts/Options/Diff/DiffScatterChart/Diff.php @@ -17,27 +17,18 @@ class Diff */ protected $oldData; - /** - * Diff constructor. - */ public function __construct() { $this->newData = new NewData(); $this->oldData = new OldData(); } - /** - * @return NewData - */ - public function getNewData() + public function getNewData(): NewData { return $this->newData; } - /** - * @return OldData - */ - public function getOldData() + public function getOldData(): OldData { return $this->oldData; } diff --git a/GoogleCharts/Options/Diff/DiffScatterChart/DiffScatterChartOptions.php b/GoogleCharts/Options/Diff/DiffScatterChart/DiffScatterChartOptions.php index 4c79c97..63f85ff 100644 --- a/GoogleCharts/Options/Diff/DiffScatterChart/DiffScatterChartOptions.php +++ b/GoogleCharts/Options/Diff/DiffScatterChart/DiffScatterChartOptions.php @@ -11,9 +11,6 @@ class DiffScatterChartOptions extends ScatterChartOptions */ protected $diff; - /** - * DiffScatterChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -21,10 +18,7 @@ public function __construct() $this->diff = new Diff(); } - /** - * @return Diff - */ - public function getDiff() + public function getDiff(): Diff { return $this->diff; } diff --git a/GoogleCharts/Options/Domain.php b/GoogleCharts/Options/Domain.php index 69c57a2..49d5b8d 100644 --- a/GoogleCharts/Options/Domain.php +++ b/GoogleCharts/Options/Domain.php @@ -22,28 +22,20 @@ class Domain */ protected $style; - /** - * Domain constructor. - */ public function __construct() { $this->stem = new Stem(); } - /** - * @return Stem - */ - public function getStem() + public function getStem(): Stem { return $this->stem; } /** - * @param string $style - * * @return $this */ - public function setStyle($style) + public function setStyle(string $style) { $this->style = $style; diff --git a/GoogleCharts/Options/EnableInteractivityTrait.php b/GoogleCharts/Options/EnableInteractivityTrait.php index 521d04c..fced48b 100644 --- a/GoogleCharts/Options/EnableInteractivityTrait.php +++ b/GoogleCharts/Options/EnableInteractivityTrait.php @@ -19,11 +19,9 @@ trait EnableInteractivityTrait protected $enableInteractivity; /** - * @param bool $enableInteractivity - * * @return $this */ - public function setEnableInteractivity($enableInteractivity) + public function setEnableInteractivity(bool $enableInteractivity) { $this->enableInteractivity = $enableInteractivity; diff --git a/GoogleCharts/Options/Explorer.php b/GoogleCharts/Options/Explorer.php index f637c39..9bf5ed3 100644 --- a/GoogleCharts/Options/Explorer.php +++ b/GoogleCharts/Options/Explorer.php @@ -73,7 +73,7 @@ class Explorer * * @return $this */ - public function setActions($actions) + public function setActions(array $actions) { $this->actions = $actions; @@ -81,11 +81,9 @@ public function setActions($actions) } /** - * @param string $axis - * * @return $this */ - public function setAxis($axis) + public function setAxis(string $axis) { $this->axis = $axis; @@ -93,11 +91,9 @@ public function setAxis($axis) } /** - * @param bool $keepInBounds - * * @return $this */ - public function setKeepInBounds($keepInBounds) + public function setKeepInBounds(bool $keepInBounds) { $this->keepInBounds = $keepInBounds; @@ -105,11 +101,9 @@ public function setKeepInBounds($keepInBounds) } /** - * @param float $maxZoomIn - * * @return $this */ - public function setMaxZoomIn($maxZoomIn) + public function setMaxZoomIn(float $maxZoomIn) { $this->maxZoomIn = $maxZoomIn; @@ -117,11 +111,9 @@ public function setMaxZoomIn($maxZoomIn) } /** - * @param float $maxZoomOut - * * @return $this */ - public function setMaxZoomOut($maxZoomOut) + public function setMaxZoomOut(float $maxZoomOut) { $this->maxZoomOut = $maxZoomOut; @@ -129,11 +121,9 @@ public function setMaxZoomOut($maxZoomOut) } /** - * @param float $zoomDelta - * - * @return Explorer + * @return $this */ - public function setZoomDelta($zoomDelta) + public function setZoomDelta(float $zoomDelta) { $this->zoomDelta = $zoomDelta; diff --git a/GoogleCharts/Options/FillOpacityTrait.php b/GoogleCharts/Options/FillOpacityTrait.php index c31e3a6..925efea 100644 --- a/GoogleCharts/Options/FillOpacityTrait.php +++ b/GoogleCharts/Options/FillOpacityTrait.php @@ -15,11 +15,9 @@ trait FillOpacityTrait protected $fillOpacity; /** - * @param float $fillOpacity - * * @return $this */ - public function setFillOpacity($fillOpacity) + public function setFillOpacity(float $fillOpacity) { $this->fillOpacity = $fillOpacity; diff --git a/GoogleCharts/Options/FillTrait.php b/GoogleCharts/Options/FillTrait.php index da9a515..2d3a151 100644 --- a/GoogleCharts/Options/FillTrait.php +++ b/GoogleCharts/Options/FillTrait.php @@ -15,11 +15,9 @@ trait FillTrait protected $fill; /** - * @param string $fill - * * @return $this */ - public function setFill($fill) + public function setFill(string $fill) { $this->fill = $fill; diff --git a/GoogleCharts/Options/FocusTargetTrait.php b/GoogleCharts/Options/FocusTargetTrait.php index 6429ca6..b7d8cc6 100644 --- a/GoogleCharts/Options/FocusTargetTrait.php +++ b/GoogleCharts/Options/FocusTargetTrait.php @@ -23,11 +23,9 @@ trait FocusTargetTrait protected $focusTarget; /** - * @param string $focusTarget - * * @return $this */ - public function setFocusTarget($focusTarget) + public function setFocusTarget(string $focusTarget) { $this->focusTarget = $focusTarget; diff --git a/GoogleCharts/Options/FontNameTrait.php b/GoogleCharts/Options/FontNameTrait.php index e097f11..1a77437 100644 --- a/GoogleCharts/Options/FontNameTrait.php +++ b/GoogleCharts/Options/FontNameTrait.php @@ -18,11 +18,9 @@ trait FontNameTrait protected $fontName; /** - * @param string $fontName - * * @return $this */ - public function setFontName($fontName) + public function setFontName(string $fontName) { $this->fontName = $fontName; diff --git a/GoogleCharts/Options/FontSizeTrait.php b/GoogleCharts/Options/FontSizeTrait.php index 26bcc1e..3ca8086 100644 --- a/GoogleCharts/Options/FontSizeTrait.php +++ b/GoogleCharts/Options/FontSizeTrait.php @@ -18,11 +18,9 @@ trait FontSizeTrait protected $fontSize; /** - * @param int $fontSize - * * @return $this */ - public function setFontSize($fontSize) + public function setFontSize(int $fontSize) { $this->fontSize = $fontSize; diff --git a/GoogleCharts/Options/ForceIFrameTrait.php b/GoogleCharts/Options/ForceIFrameTrait.php index a4c815e..c95c1ad 100644 --- a/GoogleCharts/Options/ForceIFrameTrait.php +++ b/GoogleCharts/Options/ForceIFrameTrait.php @@ -18,11 +18,9 @@ trait ForceIFrameTrait protected $forceIFrame; /** - * @param bool $forceIFrame - * * @return $this */ - public function setForceIFrame($forceIFrame) + public function setForceIFrame(bool $forceIFrame) { $this->forceIFrame = $forceIFrame; diff --git a/GoogleCharts/Options/FormatTrait.php b/GoogleCharts/Options/FormatTrait.php index c704b90..4483d43 100644 --- a/GoogleCharts/Options/FormatTrait.php +++ b/GoogleCharts/Options/FormatTrait.php @@ -13,11 +13,9 @@ trait FormatTrait protected $format; /** - * @param string $format - * * @return $this */ - public function setFormat($format) + public function setFormat(string $format) { $this->format = $format; diff --git a/GoogleCharts/Options/FullTooltip.php b/GoogleCharts/Options/FullTooltip.php index 69362fa..a817667 100644 --- a/GoogleCharts/Options/FullTooltip.php +++ b/GoogleCharts/Options/FullTooltip.php @@ -18,11 +18,9 @@ class FullTooltip extends AdvancedTooltip protected $text; /** - * @param string $text - * * @return $this */ - public function setText($text) + public function setText(string $text) { $this->text = $text; diff --git a/GoogleCharts/Options/GanttChart/Arrow.php b/GoogleCharts/Options/GanttChart/Arrow.php index d59efe4..e839b3e 100644 --- a/GoogleCharts/Options/GanttChart/Arrow.php +++ b/GoogleCharts/Options/GanttChart/Arrow.php @@ -47,11 +47,9 @@ class Arrow protected $width; /** - * @param int $angle - * * @return $this */ - public function setAngle($angle) + public function setAngle(int $angle) { $this->angle = $angle; @@ -59,11 +57,9 @@ public function setAngle($angle) } /** - * @param int $length - * * @return $this */ - public function setLength($length) + public function setLength(int $length) { $this->length = $length; @@ -71,11 +67,9 @@ public function setLength($length) } /** - * @param int $radius - * * @return $this */ - public function setRadius($radius) + public function setRadius(int $radius) { $this->radius = $radius; @@ -83,11 +77,9 @@ public function setRadius($radius) } /** - * @param int $spaceAfter - * * @return $this */ - public function setSpaceAfter($spaceAfter) + public function setSpaceAfter(int $spaceAfter) { $this->spaceAfter = $spaceAfter; @@ -95,11 +87,9 @@ public function setSpaceAfter($spaceAfter) } /** - * @param float $width - * * @return $this */ - public function setWidth($width) + public function setWidth(float $width) { $this->width = $width; diff --git a/GoogleCharts/Options/GanttChart/Gantt.php b/GoogleCharts/Options/GanttChart/Gantt.php index 39a593d..ce7280a 100644 --- a/GoogleCharts/Options/GanttChart/Gantt.php +++ b/GoogleCharts/Options/GanttChart/Gantt.php @@ -113,9 +113,6 @@ class Gantt */ protected $trackHeight; - /** - * Gantt constructor. - */ public function __construct() { $this->arrow = new Arrow(); @@ -127,68 +124,45 @@ public function __construct() $this->percentStyle = new PercentStyle(); } - /** - * @return Arrow - */ - public function getArrow() + public function getArrow(): Arrow { return $this->arrow; } - /** - * @return CriticalPathStyle - */ - public function getCriticalPathStyle() + public function getCriticalPathStyle(): CriticalPathStyle { return $this->criticalPathStyle; } - /** - * @return InnerGridHorizLine - */ - public function getInnerGridHorizLine() + public function getInnerGridHorizLine(): InnerGridHorizLine { return $this->innerGridHorizLine; } - /** - * @return InnerGridTrack - */ - public function getInnerGridTrack() + public function getInnerGridTrack(): InnerGridTrack { return $this->innerGridTrack; } - /** - * @return InnerGridDarkTrack - */ - public function getInnerGridDarkTrack() + public function getInnerGridDarkTrack(): InnerGridDarkTrack { return $this->innerGridDarkTrack; } - /** - * @return LabelStyle - */ - public function getLabelStyle() + public function getLabelStyle(): LabelStyle { return $this->labelStyle; } - /** - * @return PercentStyle - */ - public function getPercentStyle() + public function getPercentStyle(): PercentStyle { return $this->percentStyle; } /** - * @param int $barCornerRadius - * * @return $this */ - public function setBarCornerRadius($barCornerRadius) + public function setBarCornerRadius(int $barCornerRadius) { $this->barCornerRadius = $barCornerRadius; @@ -196,11 +170,9 @@ public function setBarCornerRadius($barCornerRadius) } /** - * @param int $barHeight - * * @return $this */ - public function setBarHeight($barHeight) + public function setBarHeight(int $barHeight) { $this->barHeight = $barHeight; @@ -208,11 +180,9 @@ public function setBarHeight($barHeight) } /** - * @param bool $criticalPathEnabled - * * @return $this */ - public function setCriticalPathEnabled($criticalPathEnabled) + public function setCriticalPathEnabled(bool $criticalPathEnabled) { $this->criticalPathEnabled = $criticalPathEnabled; @@ -220,11 +190,9 @@ public function setCriticalPathEnabled($criticalPathEnabled) } /** - * @param int $defaultStartDate - * * @return $this */ - public function setDefaultStartDate($defaultStartDate) + public function setDefaultStartDate(int $defaultStartDate) { $this->defaultStartDate = $defaultStartDate; @@ -232,11 +200,9 @@ public function setDefaultStartDate($defaultStartDate) } /** - * @param int $labelMaxWidth - * * @return $this */ - public function setLabelMaxWidth($labelMaxWidth) + public function setLabelMaxWidth(int $labelMaxWidth) { $this->labelMaxWidth = $labelMaxWidth; @@ -244,11 +210,9 @@ public function setLabelMaxWidth($labelMaxWidth) } /** - * @param bool $percentEnabled - * * @return $this */ - public function setPercentEnabled($percentEnabled) + public function setPercentEnabled(bool $percentEnabled) { $this->percentEnabled = $percentEnabled; @@ -256,11 +220,9 @@ public function setPercentEnabled($percentEnabled) } /** - * @param bool $shadowEnabled - * * @return $this */ - public function setShadowEnabled($shadowEnabled) + public function setShadowEnabled(bool $shadowEnabled) { $this->shadowEnabled = $shadowEnabled; @@ -268,11 +230,9 @@ public function setShadowEnabled($shadowEnabled) } /** - * @param string $shadowColor - * * @return $this */ - public function setShadowColor($shadowColor) + public function setShadowColor(string $shadowColor) { $this->shadowColor = $shadowColor; @@ -280,11 +240,9 @@ public function setShadowColor($shadowColor) } /** - * @param int $shadowOffset - * * @return $this */ - public function setShadowOffset($shadowOffset) + public function setShadowOffset(int $shadowOffset) { $this->shadowOffset = $shadowOffset; @@ -292,11 +250,9 @@ public function setShadowOffset($shadowOffset) } /** - * @param int $trackHeight - * * @return $this */ - public function setTrackHeight($trackHeight) + public function setTrackHeight(int $trackHeight) { $this->trackHeight = $trackHeight; diff --git a/GoogleCharts/Options/GanttChart/GanttChartOptions.php b/GoogleCharts/Options/GanttChart/GanttChartOptions.php index a195de4..e84d3a5 100644 --- a/GoogleCharts/Options/GanttChart/GanttChartOptions.php +++ b/GoogleCharts/Options/GanttChart/GanttChartOptions.php @@ -25,27 +25,18 @@ class GanttChartOptions implements ChartOptionsInterface use WidthTrait; - /** - * GanttChartOptions constructor. - */ public function __construct() { $this->backgroundColor = new BackgroundColor(); $this->gantt = new Gantt(); } - /** - * @return BackgroundColor - */ - public function getBackgroundColor() + public function getBackgroundColor(): BackgroundColor { return $this->backgroundColor; } - /** - * @return Gantt - */ - public function getGantt() + public function getGantt(): Gantt { return $this->gantt; } diff --git a/GoogleCharts/Options/GaugeChart/GaugeChartOptions.php b/GoogleCharts/Options/GaugeChart/GaugeChartOptions.php index d946077..e195a7e 100644 --- a/GoogleCharts/Options/GaugeChart/GaugeChartOptions.php +++ b/GoogleCharts/Options/GaugeChart/GaugeChartOptions.php @@ -106,20 +106,15 @@ public function __construct() $this->animation = new Animation(); } - /** - * @return Animation - */ - public function getAnimation() + public function getAnimation(): Animation { return $this->animation; } /** - * @param string $greenColor - * * @return $this */ - public function setGreenColor($greenColor) + public function setGreenColor(string $greenColor) { $this->greenColor = $greenColor; @@ -127,11 +122,9 @@ public function setGreenColor($greenColor) } /** - * @param int $greenFrom - * * @return $this */ - public function setGreenFrom($greenFrom) + public function setGreenFrom(int $greenFrom) { $this->greenFrom = $greenFrom; @@ -139,11 +132,9 @@ public function setGreenFrom($greenFrom) } /** - * @param int $greenTo - * * @return $this */ - public function setGreenTo($greenTo) + public function setGreenTo(int $greenTo) { $this->greenTo = $greenTo; @@ -155,7 +146,7 @@ public function setGreenTo($greenTo) * * @return $this */ - public function setMajorTicks($majorTicks) + public function setMajorTicks(array $majorTicks) { $this->majorTicks = $majorTicks; @@ -163,11 +154,9 @@ public function setMajorTicks($majorTicks) } /** - * @param int $minorTicks - * * @return $this */ - public function setMinorTicks($minorTicks) + public function setMinorTicks(int $minorTicks) { $this->minorTicks = $minorTicks; @@ -175,11 +164,9 @@ public function setMinorTicks($minorTicks) } /** - * @param string $redColor - * * @return $this */ - public function setRedColor($redColor) + public function setRedColor(string $redColor) { $this->redColor = $redColor; @@ -187,11 +174,9 @@ public function setRedColor($redColor) } /** - * @param int $redFrom - * * @return $this */ - public function setRedFrom($redFrom) + public function setRedFrom(int $redFrom) { $this->redFrom = $redFrom; @@ -199,11 +184,9 @@ public function setRedFrom($redFrom) } /** - * @param int $redTo - * * @return $this */ - public function setRedTo($redTo) + public function setRedTo(int $redTo) { $this->redTo = $redTo; @@ -211,11 +194,9 @@ public function setRedTo($redTo) } /** - * @param string $yellowColor - * * @return $this */ - public function setYellowColor($yellowColor) + public function setYellowColor(string $yellowColor) { $this->yellowColor = $yellowColor; @@ -223,11 +204,9 @@ public function setYellowColor($yellowColor) } /** - * @param int $yellowFrom - * * @return $this */ - public function setYellowFrom($yellowFrom) + public function setYellowFrom(int $yellowFrom) { $this->yellowFrom = $yellowFrom; @@ -235,11 +214,9 @@ public function setYellowFrom($yellowFrom) } /** - * @param int $yellowTo - * * @return $this */ - public function setYellowTo($yellowTo) + public function setYellowTo(int $yellowTo) { $this->yellowTo = $yellowTo; diff --git a/GoogleCharts/Options/GeoChart/GeoChartOptions.php b/GoogleCharts/Options/GeoChart/GeoChartOptions.php index 27d70b0..9e2e2a3 100644 --- a/GoogleCharts/Options/GeoChart/GeoChartOptions.php +++ b/GoogleCharts/Options/GeoChart/GeoChartOptions.php @@ -152,52 +152,35 @@ public function getBackgroundColor() return $this->backgroundColor; } - /** - * @return ColorAxis - */ - public function getColorAxis() + public function getColorAxis(): ColorAxis { return $this->colorAxis; } - /** - * @return Legend - */ - public function getLegend() + public function getLegend(): Legend { return $this->legend; } - /** - * @return MagnifyingGlass - */ - public function getMagnifyingGlass() + public function getMagnifyingGlass(): MagnifyingGlass { return $this->magnifyingGlass; } - /** - * @return SizeAxis - */ - public function getSizeAxis() + public function getSizeAxis(): SizeAxis { return $this->sizeAxis; } - /** - * @return Tooltip - */ - public function getTooltip() + public function getTooltip(): Tooltip { return $this->tooltip; } /** - * @param string $backgroundColor - * * @return $this */ - public function setBackgroundColor($backgroundColor) + public function setBackgroundColor(string $backgroundColor) { $this->backgroundColor = $backgroundColor; @@ -205,11 +188,9 @@ public function setBackgroundColor($backgroundColor) } /** - * @param string $datalessRegionColor - * * @return $this */ - public function setDatalessRegionColor($datalessRegionColor) + public function setDatalessRegionColor(string $datalessRegionColor) { $this->datalessRegionColor = $datalessRegionColor; @@ -217,11 +198,9 @@ public function setDatalessRegionColor($datalessRegionColor) } /** - * @param string $displayMode - * * @return $this */ - public function setDisplayMode($displayMode) + public function setDisplayMode(string $displayMode) { $this->displayMode = $displayMode; @@ -229,11 +208,9 @@ public function setDisplayMode($displayMode) } /** - * @param string $defaultColor - * * @return $this */ - public function setDefaultColor($defaultColor) + public function setDefaultColor(string $defaultColor) { $this->defaultColor = $defaultColor; @@ -241,11 +218,9 @@ public function setDefaultColor($defaultColor) } /** - * @param string $domain - * * @return $this */ - public function setDomain($domain) + public function setDomain(string $domain) { $this->domain = $domain; @@ -253,11 +228,9 @@ public function setDomain($domain) } /** - * @param bool $keepAspectRatio - * * @return $this */ - public function setKeepAspectRatio($keepAspectRatio) + public function setKeepAspectRatio(bool $keepAspectRatio) { $this->keepAspectRatio = $keepAspectRatio; @@ -265,11 +238,9 @@ public function setKeepAspectRatio($keepAspectRatio) } /** - * @param bool $enableRegionInteractivity - * * @return $this */ - public function setEnableRegionInteractivity($enableRegionInteractivity) + public function setEnableRegionInteractivity(bool $enableRegionInteractivity) { $this->enableRegionInteractivity = $enableRegionInteractivity; @@ -277,11 +248,9 @@ public function setEnableRegionInteractivity($enableRegionInteractivity) } /** - * @param string $region - * * @return $this */ - public function setRegion($region) + public function setRegion(string $region) { $this->region = $region; @@ -289,11 +258,9 @@ public function setRegion($region) } /** - * @param float $markerOpacity - * * @return $this */ - public function setMarkerOpacity($markerOpacity) + public function setMarkerOpacity(float $markerOpacity) { $this->markerOpacity = $markerOpacity; @@ -301,11 +268,9 @@ public function setMarkerOpacity($markerOpacity) } /** - * @param string $resolution - * * @return $this */ - public function setResolution($resolution) + public function setResolution(string $resolution) { $this->resolution = $resolution; diff --git a/GoogleCharts/Options/GeoChart/Legend.php b/GoogleCharts/Options/GeoChart/Legend.php index f6d9fa7..e4dcb78 100644 --- a/GoogleCharts/Options/GeoChart/Legend.php +++ b/GoogleCharts/Options/GeoChart/Legend.php @@ -22,28 +22,20 @@ class Legend */ protected $textStyle; - /** - * Legend constructor. - */ public function __construct() { $this->textStyle = new MediumTextStyle(); } - /** - * @return MediumTextStyle - */ - public function getTextStyle() + public function getTextStyle(): MediumTextStyle { return $this->textStyle; } /** - * @param string $numberFormat - * * @return $this */ - public function setNumberFormat($numberFormat) + public function setNumberFormat(string $numberFormat) { $this->numberFormat = $numberFormat; diff --git a/GoogleCharts/Options/GeoChart/Tooltip.php b/GoogleCharts/Options/GeoChart/Tooltip.php index f595e98..b46e5a0 100644 --- a/GoogleCharts/Options/GeoChart/Tooltip.php +++ b/GoogleCharts/Options/GeoChart/Tooltip.php @@ -22,10 +22,7 @@ public function __construct() $this->textStyle = new MediumTextStyle(); } - /** - * @return MediumTextStyle - */ - public function getTextStyle() + public function getTextStyle(): MediumTextStyle { return $this->textStyle; } diff --git a/GoogleCharts/Options/Gradient.php b/GoogleCharts/Options/Gradient.php index 0b04fd9..da4c308 100644 --- a/GoogleCharts/Options/Gradient.php +++ b/GoogleCharts/Options/Gradient.php @@ -57,11 +57,9 @@ class Gradient protected $useObjectBoundingBoxUnits; /** - * @param string $color1 - * * @return $this */ - public function setColor1($color1) + public function setColor1(string $color1) { $this->color1 = $color1; @@ -69,11 +67,9 @@ public function setColor1($color1) } /** - * @param string $color2 - * * @return $this */ - public function setColor2($color2) + public function setColor2(string $color2) { $this->color2 = $color2; @@ -81,11 +77,9 @@ public function setColor2($color2) } /** - * @param string $x1 - * * @return $this */ - public function setX1($x1) + public function setX1(string $x1) { $this->x1 = $x1; @@ -93,11 +87,9 @@ public function setX1($x1) } /** - * @param string $y1 - * * @return $this */ - public function setY1($y1) + public function setY1(string $y1) { $this->y1 = $y1; @@ -105,11 +97,9 @@ public function setY1($y1) } /** - * @param string $x2 - * * @return $this */ - public function setX2($x2) + public function setX2(string $x2) { $this->x2 = $x2; @@ -117,11 +107,9 @@ public function setX2($x2) } /** - * @param string $y2 - * * @return $this */ - public function setY2($y2) + public function setY2(string $y2) { $this->y2 = $y2; @@ -129,11 +117,9 @@ public function setY2($y2) } /** - * @param bool $useObjectBoundingBoxUnits - * * @return $this */ - public function setUseObjectBoundingBoxUnits($useObjectBoundingBoxUnits) + public function setUseObjectBoundingBoxUnits(bool $useObjectBoundingBoxUnits) { $this->useObjectBoundingBoxUnits = $useObjectBoundingBoxUnits; diff --git a/GoogleCharts/Options/Gridlines.php b/GoogleCharts/Options/Gridlines.php index 107dc12..1b5d602 100644 --- a/GoogleCharts/Options/Gridlines.php +++ b/GoogleCharts/Options/Gridlines.php @@ -22,28 +22,20 @@ class Gridlines */ protected $units; - /** - * Gridlines constructor. - */ public function __construct() { $this->units = new Units(); } - /** - * @return Units - */ - public function getUnits() + public function getUnits(): Units { return $this->units; } /** - * @param int $count - * * @return $this */ - public function setCount($count) + public function setCount(int $count) { $this->count = $count; diff --git a/GoogleCharts/Options/HAxis.php b/GoogleCharts/Options/HAxis.php index 6b078c1..f4cbea4 100644 --- a/GoogleCharts/Options/HAxis.php +++ b/GoogleCharts/Options/HAxis.php @@ -66,52 +66,35 @@ public function __construct() $this->viewWindow = new ViewWindow(); } - /** - * @return Gridlines - */ - public function getGridlines() + public function getGridlines(): Gridlines { return $this->gridlines; } - /** - * @return MinorGridlines - */ - public function getMinorGridlines() + public function getMinorGridlines(): MinorGridlines { return $this->minorGridlines; } - /** - * @return MediumTextStyle - */ - public function getTextStyle() + public function getTextStyle(): MediumTextStyle { return $this->textStyle; } - /** - * @return TitleTextStyle - */ - public function getTitleTextStyle() + public function getTitleTextStyle(): TitleTextStyle { return $this->titleTextStyle; } - /** - * @return ViewWindow - */ - public function getViewWindow() + public function getViewWindow(): ViewWindow { return $this->viewWindow; } /** - * @param string $textPosition - * * @return $this */ - public function setTextPosition($textPosition) + public function setTextPosition(string $textPosition) { $this->textPosition = $textPosition; @@ -119,11 +102,9 @@ public function setTextPosition($textPosition) } /** - * @param string $viewWindowMode - * * @return $this */ - public function setViewWindowMode($viewWindowMode) + public function setViewWindowMode(string $viewWindowMode) { $this->viewWindowMode = $viewWindowMode; diff --git a/GoogleCharts/Options/Histogram/HAxis.php b/GoogleCharts/Options/Histogram/HAxis.php index bd56325..862543a 100644 --- a/GoogleCharts/Options/Histogram/HAxis.php +++ b/GoogleCharts/Options/Histogram/HAxis.php @@ -67,11 +67,9 @@ class HAxis extends \CMEN\GoogleChartsBundle\GoogleCharts\Options\HAxis protected $showTextEvery; /** - * @param int $showTextEvery - * * @return $this */ - public function setShowTextEvery($showTextEvery) + public function setShowTextEvery(int $showTextEvery) { $this->showTextEvery = $showTextEvery; @@ -79,11 +77,9 @@ public function setShowTextEvery($showTextEvery) } /** - * @param bool $allowContainerBoundaryTextCufoff - * * @return $this */ - public function setAllowContainerBoundaryTextCufoff($allowContainerBoundaryTextCufoff) + public function setAllowContainerBoundaryTextCufoff(bool $allowContainerBoundaryTextCufoff) { $this->allowContainerBoundaryTextCufoff = $allowContainerBoundaryTextCufoff; @@ -91,11 +87,9 @@ public function setAllowContainerBoundaryTextCufoff($allowContainerBoundaryTextC } /** - * @param bool $slantedText - * * @return $this */ - public function setSlantedText($slantedText) + public function setSlantedText(bool $slantedText) { $this->slantedText = $slantedText; @@ -103,11 +97,9 @@ public function setSlantedText($slantedText) } /** - * @param int $slantedTextAngle - * * @return $this */ - public function setSlantedTextAngle($slantedTextAngle) + public function setSlantedTextAngle(int $slantedTextAngle) { $this->slantedTextAngle = $slantedTextAngle; @@ -115,11 +107,9 @@ public function setSlantedTextAngle($slantedTextAngle) } /** - * @param int $maxAlternation - * * @return $this */ - public function setMaxAlternation($maxAlternation) + public function setMaxAlternation(int $maxAlternation) { $this->maxAlternation = $maxAlternation; @@ -127,11 +117,9 @@ public function setMaxAlternation($maxAlternation) } /** - * @param int $maxTextLines - * * @return $this */ - public function setMaxTextLines($maxTextLines) + public function setMaxTextLines(int $maxTextLines) { $this->maxTextLines = $maxTextLines; @@ -139,11 +127,9 @@ public function setMaxTextLines($maxTextLines) } /** - * @param int $minTextSpacing - * * @return $this */ - public function setMinTextSpacing($minTextSpacing) + public function setMinTextSpacing(int $minTextSpacing) { $this->minTextSpacing = $minTextSpacing; diff --git a/GoogleCharts/Options/Histogram/Histogram.php b/GoogleCharts/Options/Histogram/Histogram.php index 52b66bc..11e1bbc 100644 --- a/GoogleCharts/Options/Histogram/Histogram.php +++ b/GoogleCharts/Options/Histogram/Histogram.php @@ -29,11 +29,9 @@ class Histogram protected $lastBucketPercentile; /** - * @param int $bucketSize - * * @return $this */ - public function setBucketSize($bucketSize) + public function setBucketSize(int $bucketSize) { $this->bucketSize = $bucketSize; @@ -41,11 +39,9 @@ public function setBucketSize($bucketSize) } /** - * @param bool $hideBucketItems - * * @return $this */ - public function setHideBucketItems($hideBucketItems) + public function setHideBucketItems(bool $hideBucketItems) { $this->hideBucketItems = $hideBucketItems; @@ -53,11 +49,9 @@ public function setHideBucketItems($hideBucketItems) } /** - * @param int $lastBucketPercentile - * * @return $this */ - public function setLastBucketPercentile($lastBucketPercentile) + public function setLastBucketPercentile(int $lastBucketPercentile) { $this->lastBucketPercentile = $lastBucketPercentile; diff --git a/GoogleCharts/Options/Histogram/HistogramOptions.php b/GoogleCharts/Options/Histogram/HistogramOptions.php index 2d9ad3f..aef8f1d 100644 --- a/GoogleCharts/Options/Histogram/HistogramOptions.php +++ b/GoogleCharts/Options/Histogram/HistogramOptions.php @@ -64,9 +64,6 @@ class HistogramOptions extends AdvancedChartOptions use VAxesTrait; - /** - * HistogramOptions constructor. - */ public function __construct() { parent::__construct(); @@ -79,50 +76,32 @@ public function __construct() $this->tooltip = new MediumTooltip(); } - /** - * @return AdvancedAnimation - */ - public function getAnimation() + public function getAnimation(): AdvancedAnimation { return $this->animation; } - /** - * @return Bar - */ - public function getBar() + public function getBar(): Bar { return $this->bar; } - /** - * @return Histogram - */ - public function getHistogram() + public function getHistogram(): Histogram { return $this->histogram; } - /** - * @return HAxis - */ - public function getHAxis() + public function getHAxis(): HAxis { return $this->hAxis; } - /** - * @return AdvancedLegend - */ - public function getLegend() + public function getLegend(): AdvancedLegend { return $this->legend; } - /** - * @return MediumTooltip - */ - public function getTooltip() + public function getTooltip(): MediumTooltip { return $this->tooltip; } diff --git a/GoogleCharts/Options/InterpolateNullsTrait.php b/GoogleCharts/Options/InterpolateNullsTrait.php index 8a353f7..7053849 100644 --- a/GoogleCharts/Options/InterpolateNullsTrait.php +++ b/GoogleCharts/Options/InterpolateNullsTrait.php @@ -19,11 +19,9 @@ trait InterpolateNullsTrait protected $interpolateNulls; /** - * @param bool $interpolateNulls - * * @return $this */ - public function setInterpolateNulls($interpolateNulls) + public function setInterpolateNulls(bool $interpolateNulls) { $this->interpolateNulls = $interpolateNulls; diff --git a/GoogleCharts/Options/ItalicTrait.php b/GoogleCharts/Options/ItalicTrait.php index 05a470d..8b9398d 100644 --- a/GoogleCharts/Options/ItalicTrait.php +++ b/GoogleCharts/Options/ItalicTrait.php @@ -13,11 +13,9 @@ trait ItalicTrait protected $italic; /** - * @param bool $italic - * * @return $this */ - public function setItalic($italic) + public function setItalic(bool $italic) { $this->italic = $italic; diff --git a/GoogleCharts/Options/Legend.php b/GoogleCharts/Options/Legend.php index 03ebc0d..5ee7871 100644 --- a/GoogleCharts/Options/Legend.php +++ b/GoogleCharts/Options/Legend.php @@ -41,28 +41,20 @@ class Legend */ protected $textStyle; - /** - * Legend constructor. - */ public function __construct() { $this->textStyle = new MediumTextStyle(); } - /** - * @return MediumTextStyle - */ - public function getTextStyle() + public function getTextStyle(): MediumTextStyle { return $this->textStyle; } /** - * @param string $alignment - * * @return $this */ - public function setAlignment($alignment) + public function setAlignment(string $alignment) { $this->alignment = $alignment; @@ -70,11 +62,9 @@ public function setAlignment($alignment) } /** - * @param string $position - * * @return $this */ - public function setPosition($position) + public function setPosition(string $position) { $this->position = $position; diff --git a/GoogleCharts/Options/LineChart/LineChartOptions.php b/GoogleCharts/Options/LineChart/LineChartOptions.php index c74f138..af03ab7 100644 --- a/GoogleCharts/Options/LineChart/LineChartOptions.php +++ b/GoogleCharts/Options/LineChart/LineChartOptions.php @@ -78,9 +78,6 @@ class LineChartOptions extends LineOptions use VAxesTrait; - /** - * LineChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -93,50 +90,32 @@ public function __construct() $this->legend = new AdvancedLegend(); } - /** - * @return AdvancedAnimation - */ - public function getAnimation() + public function getAnimation(): AdvancedAnimation { return $this->animation; } - /** - * @return Annotations - */ - public function getAnnotations() + public function getAnnotations(): Annotations { return $this->annotations; } - /** - * @return Crosshair - */ - public function getCrosshair() + public function getCrosshair(): Crosshair { return $this->crosshair; } - /** - * @return Explorer - */ - public function getExplorer() + public function getExplorer(): Explorer { return $this->explorer; } - /** - * @return AdvancedHAxis - */ - public function getHAxis() + public function getHAxis(): AdvancedHAxis { return $this->hAxis; } - /** - * @return AdvancedLegend - */ - public function getLegend() + public function getLegend(): AdvancedLegend { return $this->legend; } @@ -146,7 +125,7 @@ public function getLegend() * * @return $this */ - public function setTrendlines($trendlines) + public function setTrendlines(array $trendlines) { $this->trendlines = $trendlines; diff --git a/GoogleCharts/Options/LineChart/Series.php b/GoogleCharts/Options/LineChart/Series.php index f739f83..5cf8d27 100644 --- a/GoogleCharts/Options/LineChart/Series.php +++ b/GoogleCharts/Options/LineChart/Series.php @@ -18,18 +18,12 @@ class Series extends LineSeries use CurveTypeTrait; - /** - * Series constructor. - */ public function __construct() { $this->annotations = new Annotations(); } - /** - * @return Annotations - */ - public function getAnnotations() + public function getAnnotations(): Annotations { return $this->annotations; } diff --git a/GoogleCharts/Options/LineDashStyleTrait.php b/GoogleCharts/Options/LineDashStyleTrait.php index ac4affa..b2544fd 100644 --- a/GoogleCharts/Options/LineDashStyleTrait.php +++ b/GoogleCharts/Options/LineDashStyleTrait.php @@ -23,7 +23,7 @@ trait LineDashStyleTrait * * @return $this */ - public function setLineDashStyle($lineDashStyle) + public function setLineDashStyle(array $lineDashStyle) { $this->lineDashStyle = $lineDashStyle; diff --git a/GoogleCharts/Options/LineOptions.php b/GoogleCharts/Options/LineOptions.php index 0d9df9b..5914e2b 100644 --- a/GoogleCharts/Options/LineOptions.php +++ b/GoogleCharts/Options/LineOptions.php @@ -20,9 +20,6 @@ class LineOptions extends AdvancedChartOptions */ protected $tooltip; - /** - * LineOptions constructor. - */ public function __construct() { parent::__construct(); @@ -30,10 +27,7 @@ public function __construct() $this->tooltip = new AdvancedTooltip(); } - /** - * @return AdvancedTooltip - */ - public function getTooltip() + public function getTooltip(): AdvancedTooltip { return $this->tooltip; } diff --git a/GoogleCharts/Options/LineWidthTrait.php b/GoogleCharts/Options/LineWidthTrait.php index 7b771e5..0040cd6 100644 --- a/GoogleCharts/Options/LineWidthTrait.php +++ b/GoogleCharts/Options/LineWidthTrait.php @@ -18,11 +18,9 @@ trait LineWidthTrait protected $lineWidth; /** - * @param int $lineWidth - * * @return $this */ - public function setLineWidth($lineWidth) + public function setLineWidth(int $lineWidth) { $this->lineWidth = $lineWidth; diff --git a/GoogleCharts/Options/MagnifyingGlass.php b/GoogleCharts/Options/MagnifyingGlass.php index b7e8655..2564690 100644 --- a/GoogleCharts/Options/MagnifyingGlass.php +++ b/GoogleCharts/Options/MagnifyingGlass.php @@ -25,11 +25,9 @@ class MagnifyingGlass protected $zoomFactor; /** - * @param bool $enable - * * @return $this */ - public function setEnable($enable) + public function setEnable(bool $enable) { $this->enable = $enable; @@ -37,11 +35,9 @@ public function setEnable($enable) } /** - * @param float $zoomFactor - * * @return $this */ - public function setZoomFactor($zoomFactor) + public function setZoomFactor(float $zoomFactor) { $this->zoomFactor = $zoomFactor; diff --git a/GoogleCharts/Options/Map/MapOptions.php b/GoogleCharts/Options/Map/MapOptions.php index 400d92d..60f21b4 100644 --- a/GoogleCharts/Options/Map/MapOptions.php +++ b/GoogleCharts/Options/Map/MapOptions.php @@ -96,11 +96,9 @@ class MapOptions implements ChartOptionsInterface protected $zoomLevel; /** - * @param bool $enableScrollWheel - * * @return $this */ - public function setEnableScrollWheel($enableScrollWheel) + public function setEnableScrollWheel(bool $enableScrollWheel) { $this->enableScrollWheel = $enableScrollWheel; @@ -112,7 +110,7 @@ public function setEnableScrollWheel($enableScrollWheel) * * @return $this */ - public function setIcons($icons) + public function setIcons(array $icons) { $this->icons = $icons; @@ -120,11 +118,9 @@ public function setIcons($icons) } /** - * @param bool $lineColor - * * @return $this */ - public function setLineColor($lineColor) + public function setLineColor(bool $lineColor) { $this->lineColor = $lineColor; @@ -136,7 +132,7 @@ public function setLineColor($lineColor) * * @return $this */ - public function setMaps($maps) + public function setMaps(array $maps) { $this->maps = $maps; @@ -144,11 +140,9 @@ public function setMaps($maps) } /** - * @param string $mapType - * * @return $this */ - public function setMapType($mapType) + public function setMapType(string $mapType) { $this->mapType = $mapType; @@ -160,7 +154,7 @@ public function setMapType($mapType) * * @return $this */ - public function setMapTypeIds($mapTypeIds) + public function setMapTypeIds(array $mapTypeIds) { $this->mapTypeIds = $mapTypeIds; @@ -168,11 +162,9 @@ public function setMapTypeIds($mapTypeIds) } /** - * @param bool $showLine - * * @return $this */ - public function setShowLine($showLine) + public function setShowLine(bool $showLine) { $this->showLine = $showLine; @@ -180,11 +172,9 @@ public function setShowLine($showLine) } /** - * @param bool $showTip - * * @return $this */ - public function setShowTip($showTip) + public function setShowTip(bool $showTip) { $this->showTip = $showTip; @@ -192,11 +182,9 @@ public function setShowTip($showTip) } /** - * @param bool $useMapTypeControl - * * @return $this */ - public function setUseMapTypeControl($useMapTypeControl) + public function setUseMapTypeControl(bool $useMapTypeControl) { $this->useMapTypeControl = $useMapTypeControl; @@ -204,11 +192,9 @@ public function setUseMapTypeControl($useMapTypeControl) } /** - * @param int $zoomLevel - * * @return $this */ - public function setZoomLevel($zoomLevel) + public function setZoomLevel(int $zoomLevel) { $this->zoomLevel = $zoomLevel; diff --git a/GoogleCharts/Options/Material/Chart.php b/GoogleCharts/Options/Material/Chart.php index 864398b..d2fc0f5 100644 --- a/GoogleCharts/Options/Material/Chart.php +++ b/GoogleCharts/Options/Material/Chart.php @@ -5,8 +5,6 @@ use CMEN\GoogleChartsBundle\GoogleCharts\Options\TitleTrait; /** - * Class Chart. - * * @author Christophe Meneses */ class Chart @@ -21,11 +19,9 @@ class Chart use TitleTrait; /** - * @param string $subtitle - * * @return Chart */ - public function setSubtitle($subtitle) + public function setSubtitle(string $subtitle) { $this->subtitle = $subtitle; diff --git a/GoogleCharts/Options/Material/MaterialTrait.php b/GoogleCharts/Options/Material/MaterialTrait.php index 080bf3b..90ba3cc 100644 --- a/GoogleCharts/Options/Material/MaterialTrait.php +++ b/GoogleCharts/Options/Material/MaterialTrait.php @@ -30,7 +30,7 @@ public function getChart() * * @return $this */ - public function setAxes($axes) + public function setAxes(array $axes) { $this->axes = $axes; diff --git a/GoogleCharts/Options/MaxTrait.php b/GoogleCharts/Options/MaxTrait.php index 6067503..62404c1 100644 --- a/GoogleCharts/Options/MaxTrait.php +++ b/GoogleCharts/Options/MaxTrait.php @@ -15,11 +15,9 @@ trait MaxTrait protected $max; /** - * @param int $max - * * @return $this */ - public function setMax($max) + public function setMax(int $max) { $this->max = $max; diff --git a/GoogleCharts/Options/MediumChartOptions.php b/GoogleCharts/Options/MediumChartOptions.php index 7d34d24..cf13566 100644 --- a/GoogleCharts/Options/MediumChartOptions.php +++ b/GoogleCharts/Options/MediumChartOptions.php @@ -53,28 +53,20 @@ public function getBackgroundColor() return $this->backgroundColor; } - /** - * @return ChartArea - */ - public function getChartArea() + public function getChartArea(): ChartArea { return $this->chartArea; } - /** - * @return TitleTextStyle - */ - public function getTitleTextStyle() + public function getTitleTextStyle(): TitleTextStyle { return $this->titleTextStyle; } /** - * @param string $backgroundColor - * * @return $this */ - public function setBackgroundColor($backgroundColor) + public function setBackgroundColor(string $backgroundColor) { $this->backgroundColor = $backgroundColor; diff --git a/GoogleCharts/Options/MediumHAxis.php b/GoogleCharts/Options/MediumHAxis.php index 8ec8e98..4e75430 100644 --- a/GoogleCharts/Options/MediumHAxis.php +++ b/GoogleCharts/Options/MediumHAxis.php @@ -111,11 +111,9 @@ class MediumHAxis extends HAxis protected $ticks; /** - * @param int $baseline - * * @return $this */ - public function setBaseline($baseline) + public function setBaseline(int $baseline) { $this->baseline = $baseline; @@ -123,11 +121,9 @@ public function setBaseline($baseline) } /** - * @param string $baselineColor - * * @return $this */ - public function setBaselineColor($baselineColor) + public function setBaselineColor(string $baselineColor) { $this->baselineColor = $baselineColor; @@ -135,11 +131,9 @@ public function setBaselineColor($baselineColor) } /** - * @param int $direction - * * @return $this */ - public function setDirection($direction) + public function setDirection(int $direction) { $this->direction = $direction; @@ -147,11 +141,9 @@ public function setDirection($direction) } /** - * @param string $format - * * @return $this */ - public function setFormat($format) + public function setFormat(string $format) { $this->format = $format; @@ -159,11 +151,9 @@ public function setFormat($format) } /** - * @param bool $logScale - * * @return $this */ - public function setLogScale($logScale) + public function setLogScale(bool $logScale) { $this->logScale = $logScale; @@ -171,11 +161,9 @@ public function setLogScale($logScale) } /** - * @param string $scaleType - * * @return $this */ - public function setScaleType($scaleType) + public function setScaleType(string $scaleType) { $this->scaleType = $scaleType; @@ -187,7 +175,7 @@ public function setScaleType($scaleType) * * @return $this */ - public function setTicks($ticks) + public function setTicks(array $ticks) { $this->ticks = $ticks; @@ -195,11 +183,9 @@ public function setTicks($ticks) } /** - * @param int $maxValue - * * @return $this */ - public function setMaxValue($maxValue) + public function setMaxValue(int $maxValue) { $this->maxValue = $maxValue; @@ -207,11 +193,9 @@ public function setMaxValue($maxValue) } /** - * @param int $minValue - * * @return $this */ - public function setMinValue($minValue) + public function setMinValue(int $minValue) { $this->minValue = $minValue; diff --git a/GoogleCharts/Options/MediumTooltip.php b/GoogleCharts/Options/MediumTooltip.php index 9751d4b..3eb458d 100644 --- a/GoogleCharts/Options/MediumTooltip.php +++ b/GoogleCharts/Options/MediumTooltip.php @@ -16,11 +16,9 @@ class MediumTooltip extends BasicTooltip protected $showColorCode; /** - * @param bool $showColorCode - * * @return $this */ - public function setShowColorCode($showColorCode) + public function setShowColorCode(bool $showColorCode) { $this->showColorCode = $showColorCode; diff --git a/GoogleCharts/Options/MinTrait.php b/GoogleCharts/Options/MinTrait.php index 5000881..34e7ed3 100644 --- a/GoogleCharts/Options/MinTrait.php +++ b/GoogleCharts/Options/MinTrait.php @@ -15,11 +15,9 @@ trait MinTrait protected $min; /** - * @param int $min - * * @return $this */ - public function setMin($min) + public function setMin(int $min) { $this->min = $min; diff --git a/GoogleCharts/Options/MinorGridlines.php b/GoogleCharts/Options/MinorGridlines.php index 8322acb..c6dc808 100644 --- a/GoogleCharts/Options/MinorGridlines.php +++ b/GoogleCharts/Options/MinorGridlines.php @@ -21,28 +21,20 @@ class MinorGridlines */ protected $units; - /** - * MinorGridlines constructor. - */ public function __construct() { $this->units = new Units(); } - /** - * @return Units - */ - public function getUnits() + public function getUnits(): Units { return $this->units; } /** - * @param int $count - * * @return $this */ - public function setCount($count) + public function setCount(int $count) { $this->count = $count; diff --git a/GoogleCharts/Options/OpacityTrait.php b/GoogleCharts/Options/OpacityTrait.php index 8b04b7b..2dc8071 100644 --- a/GoogleCharts/Options/OpacityTrait.php +++ b/GoogleCharts/Options/OpacityTrait.php @@ -15,11 +15,9 @@ trait OpacityTrait protected $opacity; /** - * @param float $opacity - * * @return $this */ - public function setOpacity($opacity) + public function setOpacity(float $opacity) { $this->opacity = $opacity; diff --git a/GoogleCharts/Options/OrgChart/OrgChartOptions.php b/GoogleCharts/Options/OrgChart/OrgChartOptions.php index 8b58eaf..8f4a291 100644 --- a/GoogleCharts/Options/OrgChart/OrgChartOptions.php +++ b/GoogleCharts/Options/OrgChart/OrgChartOptions.php @@ -43,11 +43,9 @@ class OrgChartOptions implements ChartOptionsInterface protected $size; /** - * @param bool $allowCollapse - * * @return $this */ - public function setAllowCollapse($allowCollapse) + public function setAllowCollapse(bool $allowCollapse) { $this->allowCollapse = $allowCollapse; @@ -55,11 +53,9 @@ public function setAllowCollapse($allowCollapse) } /** - * @param string $nodeClass - * * @return $this */ - public function setNodeClass($nodeClass) + public function setNodeClass(string $nodeClass) { $this->nodeClass = $nodeClass; @@ -67,11 +63,9 @@ public function setNodeClass($nodeClass) } /** - * @param string $selectedNodeClass - * * @return $this */ - public function setSelectedNodeClass($selectedNodeClass) + public function setSelectedNodeClass(string $selectedNodeClass) { $this->selectedNodeClass = $selectedNodeClass; @@ -79,11 +73,9 @@ public function setSelectedNodeClass($selectedNodeClass) } /** - * @param string $size - * * @return $this */ - public function setSize($size) + public function setSize(string $size) { $this->size = $size; diff --git a/GoogleCharts/Options/OrientationTrait.php b/GoogleCharts/Options/OrientationTrait.php index aa50069..5b0e9af 100644 --- a/GoogleCharts/Options/OrientationTrait.php +++ b/GoogleCharts/Options/OrientationTrait.php @@ -21,11 +21,9 @@ trait OrientationTrait protected $orientation; /** - * @param string $orientation - * * @return $this */ - public function setOrientation($orientation) + public function setOrientation(string $orientation) { $this->orientation = $orientation; diff --git a/GoogleCharts/Options/PieChart/PieChartOptions.php b/GoogleCharts/Options/PieChart/PieChartOptions.php index d239719..4a41fc0 100644 --- a/GoogleCharts/Options/PieChart/PieChartOptions.php +++ b/GoogleCharts/Options/PieChart/PieChartOptions.php @@ -105,9 +105,6 @@ class PieChartOptions extends MediumChartOptions */ protected $tooltip; - /** - * PieChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -117,36 +114,25 @@ public function __construct() $this->tooltip = new FullTooltip(); } - /** - * @return PieSliceTextStyle - */ - public function getPieSliceTextStyle() + public function getPieSliceTextStyle(): PieSliceTextStyle { return $this->pieSliceTextStyle; } - /** - * @return FullTooltip - */ - public function getTooltip() + public function getTooltip(): FullTooltip { return $this->tooltip; } - /** - * @return AdvancedLegend - */ - public function getLegend() + public function getLegend(): AdvancedLegend { return $this->legend; } /** - * @param bool $is3D - * * @return $this */ - public function setIs3D($is3D) + public function setIs3D(bool $is3D) { $this->is3D = $is3D; @@ -154,11 +140,9 @@ public function setIs3D($is3D) } /** - * @param float $pieHole - * * @return $this */ - public function setPieHole($pieHole) + public function setPieHole(float $pieHole) { $this->pieHole = $pieHole; @@ -166,11 +150,9 @@ public function setPieHole($pieHole) } /** - * @param int $pieStartAngle - * * @return $this */ - public function setPieStartAngle($pieStartAngle) + public function setPieStartAngle(int $pieStartAngle) { $this->pieStartAngle = $pieStartAngle; @@ -178,11 +160,9 @@ public function setPieStartAngle($pieStartAngle) } /** - * @param string $pieSliceText - * * @return $this */ - public function setPieSliceText($pieSliceText) + public function setPieSliceText(string $pieSliceText) { $this->pieSliceText = $pieSliceText; @@ -194,7 +174,7 @@ public function setPieSliceText($pieSliceText) * * @return $this */ - public function setSlices($slices) + public function setSlices(array $slices) { $this->slices = $slices; @@ -202,11 +182,9 @@ public function setSlices($slices) } /** - * @param float $sliceVisibilityThreshold - * * @return $this */ - public function setSliceVisibilityThreshold($sliceVisibilityThreshold) + public function setSliceVisibilityThreshold(float $sliceVisibilityThreshold) { $this->sliceVisibilityThreshold = $sliceVisibilityThreshold; @@ -214,11 +192,9 @@ public function setSliceVisibilityThreshold($sliceVisibilityThreshold) } /** - * @param string $pieResidueSliceColor - * * @return $this */ - public function setPieResidueSliceColor($pieResidueSliceColor) + public function setPieResidueSliceColor(string $pieResidueSliceColor) { $this->pieResidueSliceColor = $pieResidueSliceColor; @@ -226,11 +202,9 @@ public function setPieResidueSliceColor($pieResidueSliceColor) } /** - * @param string $pieResidueSliceLabel - * * @return $this */ - public function setPieResidueSliceLabel($pieResidueSliceLabel) + public function setPieResidueSliceLabel(string $pieResidueSliceLabel) { $this->pieResidueSliceLabel = $pieResidueSliceLabel; diff --git a/GoogleCharts/Options/PieChart/PieSlice.php b/GoogleCharts/Options/PieChart/PieSlice.php index d43e560..1c7273d 100644 --- a/GoogleCharts/Options/PieChart/PieSlice.php +++ b/GoogleCharts/Options/PieChart/PieSlice.php @@ -25,28 +25,20 @@ class PieSlice */ protected $textStyle; - /** - * PieSlice constructor. - */ public function __construct() { $this->textStyle = new PieSliceTextStyle(); } - /** - * @return PieSliceTextStyle - */ - public function getTextStyle() + public function getTextStyle(): PieSliceTextStyle { return $this->textStyle; } /** - * @param float $offset - * * @return $this */ - public function setOffset($offset) + public function setOffset(float $offset) { $this->offset = $offset; diff --git a/GoogleCharts/Options/PointShapeTrait.php b/GoogleCharts/Options/PointShapeTrait.php index ca995ec..359b5f9 100644 --- a/GoogleCharts/Options/PointShapeTrait.php +++ b/GoogleCharts/Options/PointShapeTrait.php @@ -17,11 +17,9 @@ trait PointShapeTrait protected $pointShape; /** - * @param string $pointShape - * * @return $this */ - public function setPointShape($pointShape) + public function setPointShape(string $pointShape) { $this->pointShape = $pointShape; diff --git a/GoogleCharts/Options/PointSizeTrait.php b/GoogleCharts/Options/PointSizeTrait.php index 2dd44ea..0c27961 100644 --- a/GoogleCharts/Options/PointSizeTrait.php +++ b/GoogleCharts/Options/PointSizeTrait.php @@ -19,11 +19,9 @@ trait PointSizeTrait protected $pointSize; /** - * @param int $pointSize - * * @return $this */ - public function setPointSize($pointSize) + public function setPointSize(int $pointSize) { $this->pointSize = $pointSize; diff --git a/GoogleCharts/Options/PointsVisibleTrait.php b/GoogleCharts/Options/PointsVisibleTrait.php index 20f1406..8f89376 100644 --- a/GoogleCharts/Options/PointsVisibleTrait.php +++ b/GoogleCharts/Options/PointsVisibleTrait.php @@ -21,11 +21,9 @@ trait PointsVisibleTrait protected $pointsVisible; /** - * @param bool $pointsVisible - * * @return $this */ - public function setPointsVisible($pointsVisible) + public function setPointsVisible(bool $pointsVisible) { $this->pointsVisible = $pointsVisible; diff --git a/GoogleCharts/Options/ReverseCategoriesTrait.php b/GoogleCharts/Options/ReverseCategoriesTrait.php index 99a0b3b..bcc99be 100644 --- a/GoogleCharts/Options/ReverseCategoriesTrait.php +++ b/GoogleCharts/Options/ReverseCategoriesTrait.php @@ -18,11 +18,9 @@ trait ReverseCategoriesTrait protected $reverseCategories; /** - * @param bool $reverseCategories - * * @return $this */ - public function setReverseCategories($reverseCategories) + public function setReverseCategories(bool $reverseCategories) { $this->reverseCategories = $reverseCategories; diff --git a/GoogleCharts/Options/SankeyDiagram/Link.php b/GoogleCharts/Options/SankeyDiagram/Link.php index be295bf..32f3fe2 100644 --- a/GoogleCharts/Options/SankeyDiagram/Link.php +++ b/GoogleCharts/Options/SankeyDiagram/Link.php @@ -31,28 +31,20 @@ class Link */ protected $colorMode; - /** - * Link constructor. - */ public function __construct() { $this->color = new Color(); } - /** - * @return Color - */ - public function getColor() + public function getColor(): Color { return $this->color; } /** - * @param string $colorMode - * * @return $this */ - public function setColorMode($colorMode) + public function setColorMode(string $colorMode) { $this->colorMode = $colorMode; diff --git a/GoogleCharts/Options/SankeyDiagram/Node.php b/GoogleCharts/Options/SankeyDiagram/Node.php index afb6524..f60899e 100644 --- a/GoogleCharts/Options/SankeyDiagram/Node.php +++ b/GoogleCharts/Options/SankeyDiagram/Node.php @@ -48,28 +48,20 @@ class Node */ protected $colorMode; - /** - * Node constructor. - */ public function __construct() { $this->label = new Label(); } - /** - * @return Label - */ - public function getLabel() + public function getLabel(): Label { return $this->label; } /** - * @param bool $interactivity - * * @return $this */ - public function setInteractivity($interactivity) + public function setInteractivity(bool $interactivity) { $this->interactivity = $interactivity; @@ -77,11 +69,9 @@ public function setInteractivity($interactivity) } /** - * @param int $labelPadding - * * @return $this */ - public function setLabelPadding($labelPadding) + public function setLabelPadding(int $labelPadding) { $this->labelPadding = $labelPadding; @@ -89,11 +79,9 @@ public function setLabelPadding($labelPadding) } /** - * @param int $nodePadding - * * @return $this */ - public function setNodePadding($nodePadding) + public function setNodePadding(int $nodePadding) { $this->nodePadding = $nodePadding; @@ -101,11 +89,9 @@ public function setNodePadding($nodePadding) } /** - * @param string $colorMode - * * @return $this */ - public function setColorMode($colorMode) + public function setColorMode(string $colorMode) { $this->colorMode = $colorMode; diff --git a/GoogleCharts/Options/SankeyDiagram/Sankey.php b/GoogleCharts/Options/SankeyDiagram/Sankey.php index 0a694da..88ea0b4 100644 --- a/GoogleCharts/Options/SankeyDiagram/Sankey.php +++ b/GoogleCharts/Options/SankeyDiagram/Sankey.php @@ -27,37 +27,26 @@ class Sankey */ protected $node; - /** - * Sankey constructor. - */ public function __construct() { $this->link = new Link(); $this->node = new Node(); } - /** - * @return Link - */ - public function getLink() + public function getLink(): Link { return $this->link; } - /** - * @return Node - */ - public function getNode() + public function getNode(): Node { return $this->node; } /** - * @param int $iterations - * * @return $this */ - public function setIterations($iterations) + public function setIterations(int $iterations) { $this->iterations = $iterations; diff --git a/GoogleCharts/Options/SankeyDiagram/SankeyDiagramOptions.php b/GoogleCharts/Options/SankeyDiagram/SankeyDiagramOptions.php index bab3dee..f4aca3e 100644 --- a/GoogleCharts/Options/SankeyDiagram/SankeyDiagramOptions.php +++ b/GoogleCharts/Options/SankeyDiagram/SankeyDiagramOptions.php @@ -20,9 +20,6 @@ class SankeyDiagramOptions extends ChartOptions */ protected $tooltip; - /** - * SankeyDiagramOptions constructor. - */ public function __construct() { parent::__construct(); @@ -31,18 +28,12 @@ public function __construct() $this->tooltip = new MediumTooltip(); } - /** - * @return Sankey - */ - public function getSankey() + public function getSankey(): Sankey { return $this->sankey; } - /** - * @return MediumTooltip - */ - public function getTooltip() + public function getTooltip(): MediumTooltip { return $this->tooltip; } diff --git a/GoogleCharts/Options/ScatterChart/ScatterChartOptions.php b/GoogleCharts/Options/ScatterChart/ScatterChartOptions.php index 367fda1..a651137 100644 --- a/GoogleCharts/Options/ScatterChart/ScatterChartOptions.php +++ b/GoogleCharts/Options/ScatterChart/ScatterChartOptions.php @@ -81,9 +81,6 @@ class ScatterChartOptions extends AdvancedChartOptions */ protected $trendlines; - /** - * ScatterChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -97,58 +94,37 @@ public function __construct() $this->tooltip = new AdvancedTooltip(); } - /** - * @return AdvancedAnimation - */ - public function getAnimation() + public function getAnimation(): AdvancedAnimation { return $this->animation; } - /** - * @return Annotations - */ - public function getAnnotations() + public function getAnnotations(): Annotations { return $this->annotations; } - /** - * @return Crosshair - */ - public function getCrosshair() + public function getCrosshair(): Crosshair { return $this->crosshair; } - /** - * @return Explorer - */ - public function getExplorer() + public function getExplorer(): Explorer { return $this->explorer; } - /** - * @return MediumHAxis - */ - public function getHAxis() + public function getHAxis(): MediumHAxis { return $this->hAxis; } - /** - * @return AdvancedLegend - */ - public function getLegend() + public function getLegend(): AdvancedLegend { return $this->legend; } - /** - * @return AdvancedTooltip - */ - public function getTooltip() + public function getTooltip(): AdvancedTooltip { return $this->tooltip; } @@ -158,7 +134,7 @@ public function getTooltip() * * @return $this */ - public function setTrendlines($trendlines) + public function setTrendlines(array $trendlines) { $this->trendlines = $trendlines; diff --git a/GoogleCharts/Options/ScatterChart/Series.php b/GoogleCharts/Options/ScatterChart/Series.php index 54494b6..6033a68 100644 --- a/GoogleCharts/Options/ScatterChart/Series.php +++ b/GoogleCharts/Options/ScatterChart/Series.php @@ -22,11 +22,9 @@ class Series extends \CMEN\GoogleChartsBundle\GoogleCharts\Options\Series use PointTrait; /** - * @param string $labelInLegend - * * @return $this */ - public function setLabelInLegend($labelInLegend) + public function setLabelInLegend(string $labelInLegend) { $this->labelInLegend = $labelInLegend; diff --git a/GoogleCharts/Options/SelectionModeTrait.php b/GoogleCharts/Options/SelectionModeTrait.php index 3dfff77..e24d965 100644 --- a/GoogleCharts/Options/SelectionModeTrait.php +++ b/GoogleCharts/Options/SelectionModeTrait.php @@ -17,11 +17,9 @@ trait SelectionModeTrait protected $selectionMode; /** - * @param string $selectionMode - * * @return $this */ - public function setSelectionMode($selectionMode) + public function setSelectionMode(string $selectionMode) { $this->selectionMode = $selectionMode; diff --git a/GoogleCharts/Options/Series.php b/GoogleCharts/Options/Series.php index d07e915..d2bc0c8 100644 --- a/GoogleCharts/Options/Series.php +++ b/GoogleCharts/Options/Series.php @@ -18,11 +18,9 @@ class Series protected $visibleInLegend; /** - * @param bool $visibleInLegend - * * @return $this */ - public function setVisibleInLegend($visibleInLegend) + public function setVisibleInLegend(bool $visibleInLegend) { $this->visibleInLegend = $visibleInLegend; diff --git a/GoogleCharts/Options/SeriesTrait.php b/GoogleCharts/Options/SeriesTrait.php index 048ac2a..a0eeb91 100644 --- a/GoogleCharts/Options/SeriesTrait.php +++ b/GoogleCharts/Options/SeriesTrait.php @@ -28,7 +28,7 @@ trait SeriesTrait * * @return $this */ - public function setSeries($series) + public function setSeries(array $series) { $this->series = $series; diff --git a/GoogleCharts/Options/SizeAxis.php b/GoogleCharts/Options/SizeAxis.php index e071220..bd06da8 100644 --- a/GoogleCharts/Options/SizeAxis.php +++ b/GoogleCharts/Options/SizeAxis.php @@ -38,11 +38,9 @@ class SizeAxis protected $minValue; /** - * @param int $maxSize - * * @return $this */ - public function setMaxSize($maxSize) + public function setMaxSize(int $maxSize) { $this->maxSize = $maxSize; @@ -50,11 +48,9 @@ public function setMaxSize($maxSize) } /** - * @param int $maxValue - * * @return $this */ - public function setMaxValue($maxValue) + public function setMaxValue(int $maxValue) { $this->maxValue = $maxValue; @@ -62,11 +58,9 @@ public function setMaxValue($maxValue) } /** - * @param int $minSize - * * @return $this */ - public function setMinSize($minSize) + public function setMinSize(int $minSize) { $this->minSize = $minSize; @@ -74,11 +68,9 @@ public function setMinSize($minSize) } /** - * @param int $minValue - * * @return $this */ - public function setMinValue($minValue) + public function setMinValue(int $minValue) { $this->minValue = $minValue; diff --git a/GoogleCharts/Options/Stem.php b/GoogleCharts/Options/Stem.php index 32d4047..468cbb3 100644 --- a/GoogleCharts/Options/Stem.php +++ b/GoogleCharts/Options/Stem.php @@ -15,11 +15,9 @@ class Stem protected $length; /** - * @param int $length - * * @return $this */ - public function setLength($length) + public function setLength(int $length) { $this->length = $length; diff --git a/GoogleCharts/Options/SteppedAreaChart/HAxis.php b/GoogleCharts/Options/SteppedAreaChart/HAxis.php index 93791ce..ab7ac5e 100644 --- a/GoogleCharts/Options/SteppedAreaChart/HAxis.php +++ b/GoogleCharts/Options/SteppedAreaChart/HAxis.php @@ -124,26 +124,17 @@ public function __construct() $this->viewWindow = new ViewWindow(); } - /** - * @return TextStyle - */ - public function getTextStyle() + public function getTextStyle(): TextStyle { return $this->textStyle; } - /** - * @return TitleTextStyle - */ - public function getTitleTextStyle() + public function getTitleTextStyle(): TitleTextStyle { return $this->titleTextStyle; } - /** - * @return ViewWindow - */ - public function getViewWindow() + public function getViewWindow(): ViewWindow { return $this->viewWindow; } @@ -153,7 +144,7 @@ public function getViewWindow() * * @return $this */ - public function setTicks($ticks) + public function setTicks(array $ticks) { $this->ticks = $ticks; @@ -161,11 +152,9 @@ public function setTicks($ticks) } /** - * @param int $direction - * * @return $this */ - public function setDirection($direction) + public function setDirection(int $direction) { $this->direction = $direction; @@ -173,11 +162,9 @@ public function setDirection($direction) } /** - * @param int $showTextEvery - * * @return $this */ - public function setShowTextEvery($showTextEvery) + public function setShowTextEvery(int $showTextEvery) { $this->showTextEvery = $showTextEvery; @@ -185,11 +172,9 @@ public function setShowTextEvery($showTextEvery) } /** - * @param bool $allowContainerBoundaryTextCufoff - * * @return $this */ - public function setAllowContainerBoundaryTextCufoff($allowContainerBoundaryTextCufoff) + public function setAllowContainerBoundaryTextCufoff(bool $allowContainerBoundaryTextCufoff) { $this->allowContainerBoundaryTextCufoff = $allowContainerBoundaryTextCufoff; @@ -197,11 +182,9 @@ public function setAllowContainerBoundaryTextCufoff($allowContainerBoundaryTextC } /** - * @param bool $slantedText - * * @return $this */ - public function setSlantedText($slantedText) + public function setSlantedText(bool $slantedText) { $this->slantedText = $slantedText; @@ -209,11 +192,9 @@ public function setSlantedText($slantedText) } /** - * @param int $slantedTextAngle - * * @return $this */ - public function setSlantedTextAngle($slantedTextAngle) + public function setSlantedTextAngle(int $slantedTextAngle) { $this->slantedTextAngle = $slantedTextAngle; @@ -221,11 +202,9 @@ public function setSlantedTextAngle($slantedTextAngle) } /** - * @param int $maxAlternation - * * @return $this */ - public function setMaxAlternation($maxAlternation) + public function setMaxAlternation(int $maxAlternation) { $this->maxAlternation = $maxAlternation; @@ -233,11 +212,9 @@ public function setMaxAlternation($maxAlternation) } /** - * @param int $maxTextLines - * * @return $this */ - public function setMaxTextLines($maxTextLines) + public function setMaxTextLines(int $maxTextLines) { $this->maxTextLines = $maxTextLines; @@ -245,11 +222,9 @@ public function setMaxTextLines($maxTextLines) } /** - * @param int $minTextSpacing - * * @return $this */ - public function setMinTextSpacing($minTextSpacing) + public function setMinTextSpacing(int $minTextSpacing) { $this->minTextSpacing = $minTextSpacing; @@ -257,11 +232,9 @@ public function setMinTextSpacing($minTextSpacing) } /** - * @param string $textPosition - * * @return $this */ - public function setTextPosition($textPosition) + public function setTextPosition(string $textPosition) { $this->textPosition = $textPosition; diff --git a/GoogleCharts/Options/SteppedAreaChart/SteppedAreaChartOptions.php b/GoogleCharts/Options/SteppedAreaChart/SteppedAreaChartOptions.php index e9eeb1a..0c33703 100644 --- a/GoogleCharts/Options/SteppedAreaChart/SteppedAreaChartOptions.php +++ b/GoogleCharts/Options/SteppedAreaChart/SteppedAreaChartOptions.php @@ -61,9 +61,6 @@ class SteppedAreaChartOptions extends AdvancedChartOptions use VAxesTrait; - /** - * SteppedAreaChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -74,44 +71,30 @@ public function __construct() $this->tooltip = new AdvancedTooltip(); } - /** - * @return AdvancedAnimation - */ - public function getAnimation() + public function getAnimation(): AdvancedAnimation { return $this->animation; } - /** - * @return HAxis - */ - public function getHAxis() + public function getHAxis(): HAxis { return $this->hAxis; } - /** - * @return AdvancedLegend - */ - public function getLegend() + public function getLegend(): AdvancedLegend { return $this->legend; } - /** - * @return AdvancedTooltip - */ - public function getTooltip() + public function getTooltip(): AdvancedTooltip { return $this->tooltip; } /** - * @param bool $connectSteps - * * @return $this */ - public function setConnectSteps($connectSteps) + public function setConnectSteps(bool $connectSteps) { $this->connectSteps = $connectSteps; diff --git a/GoogleCharts/Options/StrokeOpacity.php b/GoogleCharts/Options/StrokeOpacity.php index 91a093f..3b6920a 100644 --- a/GoogleCharts/Options/StrokeOpacity.php +++ b/GoogleCharts/Options/StrokeOpacity.php @@ -15,11 +15,9 @@ trait StrokeOpacity protected $strokeOpacity; /** - * @param float $strokeOpacity - * * @return $this */ - public function setStrokeOpacity($strokeOpacity) + public function setStrokeOpacity(float $strokeOpacity) { $this->strokeOpacity = $strokeOpacity; diff --git a/GoogleCharts/Options/StrokeTrait.php b/GoogleCharts/Options/StrokeTrait.php index a37eae3..5592ec6 100644 --- a/GoogleCharts/Options/StrokeTrait.php +++ b/GoogleCharts/Options/StrokeTrait.php @@ -17,11 +17,9 @@ trait StrokeTrait protected $stroke; /** - * @param string $stroke - * * @return $this */ - public function setStroke($stroke) + public function setStroke(string $stroke) { $this->stroke = $stroke; diff --git a/GoogleCharts/Options/TableChart/CssClassNames.php b/GoogleCharts/Options/TableChart/CssClassNames.php index 7db60bd..3c63537 100644 --- a/GoogleCharts/Options/TableChart/CssClassNames.php +++ b/GoogleCharts/Options/TableChart/CssClassNames.php @@ -65,11 +65,9 @@ class CssClassNames protected $rowNumberCell; /** - * @param string $headerRow - * * @return $this */ - public function setHeaderRow($headerRow) + public function setHeaderRow(string $headerRow) { $this->headerRow = $headerRow; @@ -77,11 +75,9 @@ public function setHeaderRow($headerRow) } /** - * @param string $tableRow - * * @return $this */ - public function setTableRow($tableRow) + public function setTableRow(string $tableRow) { $this->tableRow = $tableRow; @@ -89,11 +85,9 @@ public function setTableRow($tableRow) } /** - * @param string $oddTableRow - * * @return $this */ - public function setOddTableRow($oddTableRow) + public function setOddTableRow(string $oddTableRow) { $this->oddTableRow = $oddTableRow; @@ -101,11 +95,9 @@ public function setOddTableRow($oddTableRow) } /** - * @param string $selectedTableRow - * * @return $this */ - public function setSelectedTableRow($selectedTableRow) + public function setSelectedTableRow(string $selectedTableRow) { $this->selectedTableRow = $selectedTableRow; @@ -113,11 +105,9 @@ public function setSelectedTableRow($selectedTableRow) } /** - * @param string $hoverTableRow - * * @return $this */ - public function setHoverTableRow($hoverTableRow) + public function setHoverTableRow(string $hoverTableRow) { $this->hoverTableRow = $hoverTableRow; @@ -125,11 +115,9 @@ public function setHoverTableRow($hoverTableRow) } /** - * @param string $headerCell - * * @return $this */ - public function setHeaderCell($headerCell) + public function setHeaderCell(string $headerCell) { $this->headerCell = $headerCell; @@ -137,11 +125,9 @@ public function setHeaderCell($headerCell) } /** - * @param string $tableCell - * * @return $this */ - public function setTableCell($tableCell) + public function setTableCell(string $tableCell) { $this->tableCell = $tableCell; @@ -149,11 +135,9 @@ public function setTableCell($tableCell) } /** - * @param string $rowNumberCell - * * @return $this */ - public function setRowNumberCell($rowNumberCell) + public function setRowNumberCell(string $rowNumberCell) { $this->rowNumberCell = $rowNumberCell; diff --git a/GoogleCharts/Options/TableChart/TableChartOptions.php b/GoogleCharts/Options/TableChart/TableChartOptions.php index e3adfde..c5edc91 100644 --- a/GoogleCharts/Options/TableChart/TableChartOptions.php +++ b/GoogleCharts/Options/TableChart/TableChartOptions.php @@ -152,28 +152,20 @@ class TableChartOptions implements ChartOptionsInterface */ protected $width; - /** - * TableChartOptions constructor. - */ public function __construct() { $this->cssClassNames = new CssClassNames(); } - /** - * @return CssClassNames - */ - public function getCssClassNames() + public function getCssClassNames(): CssClassNames { return $this->cssClassNames; } /** - * @param bool $alternatingRowStyle - * * @return $this */ - public function setAlternatingRowStyle($alternatingRowStyle) + public function setAlternatingRowStyle(bool $alternatingRowStyle) { $this->alternatingRowStyle = $alternatingRowStyle; @@ -181,11 +173,9 @@ public function setAlternatingRowStyle($alternatingRowStyle) } /** - * @param int $firstRowNumber - * * @return $this */ - public function setFirstRowNumber($firstRowNumber) + public function setFirstRowNumber(int $firstRowNumber) { $this->firstRowNumber = $firstRowNumber; @@ -193,11 +183,9 @@ public function setFirstRowNumber($firstRowNumber) } /** - * @param int $frozenColumns - * * @return $this */ - public function setFrozenColumns($frozenColumns) + public function setFrozenColumns(int $frozenColumns) { $this->frozenColumns = $frozenColumns; @@ -205,11 +193,9 @@ public function setFrozenColumns($frozenColumns) } /** - * @param string $page - * * @return $this */ - public function setPage($page) + public function setPage(string $page) { $this->page = $page; @@ -217,11 +203,9 @@ public function setPage($page) } /** - * @param int $pageSize - * * @return $this */ - public function setPageSize($pageSize) + public function setPageSize(int $pageSize) { $this->pageSize = $pageSize; @@ -241,11 +225,9 @@ public function setPagingButtons($pagingButtons) } /** - * @param bool $rtlTable - * * @return $this */ - public function setRtlTable($rtlTable) + public function setRtlTable(bool $rtlTable) { $this->rtlTable = $rtlTable; @@ -253,11 +235,9 @@ public function setRtlTable($rtlTable) } /** - * @param int $scrollLeftStartPosition - * * @return $this */ - public function setScrollLeftStartPosition($scrollLeftStartPosition) + public function setScrollLeftStartPosition(int $scrollLeftStartPosition) { $this->scrollLeftStartPosition = $scrollLeftStartPosition; @@ -265,11 +245,9 @@ public function setScrollLeftStartPosition($scrollLeftStartPosition) } /** - * @param bool $showRowNumber - * * @return $this */ - public function setShowRowNumber($showRowNumber) + public function setShowRowNumber(bool $showRowNumber) { $this->showRowNumber = $showRowNumber; @@ -277,11 +255,9 @@ public function setShowRowNumber($showRowNumber) } /** - * @param string $sort - * * @return $this */ - public function setSort($sort) + public function setSort(string $sort) { $this->sort = $sort; @@ -289,11 +265,9 @@ public function setSort($sort) } /** - * @param bool $sortAscending - * * @return $this */ - public function setSortAscending($sortAscending) + public function setSortAscending(bool $sortAscending) { $this->sortAscending = $sortAscending; @@ -301,11 +275,9 @@ public function setSortAscending($sortAscending) } /** - * @param int $sortColumn - * * @return $this */ - public function setSortColumn($sortColumn) + public function setSortColumn(int $sortColumn) { $this->sortColumn = $sortColumn; @@ -313,11 +285,9 @@ public function setSortColumn($sortColumn) } /** - * @param int $startPage - * * @return $this */ - public function setStartPage($startPage) + public function setStartPage(int $startPage) { $this->startPage = $startPage; @@ -325,11 +295,9 @@ public function setStartPage($startPage) } /** - * @param string $width - * * @return $this */ - public function setWidth($width) + public function setWidth(string $width) { $this->width = $width; diff --git a/GoogleCharts/Options/ThemeTrait.php b/GoogleCharts/Options/ThemeTrait.php index ddd3e9c..dd8d5ef 100644 --- a/GoogleCharts/Options/ThemeTrait.php +++ b/GoogleCharts/Options/ThemeTrait.php @@ -24,11 +24,9 @@ trait ThemeTrait protected $theme; /** - * @param string $theme - * * @return $this */ - public function setTheme($theme) + public function setTheme(string $theme) { $this->theme = $theme; diff --git a/GoogleCharts/Options/Timeline/Timeline.php b/GoogleCharts/Options/Timeline/Timeline.php index bbe24b4..984801d 100644 --- a/GoogleCharts/Options/Timeline/Timeline.php +++ b/GoogleCharts/Options/Timeline/Timeline.php @@ -53,37 +53,26 @@ class Timeline */ protected $singleColor; - /** - * Timeline constructor. - */ public function __construct() { $this->barLabelStyle = new BarLabelStyle(); $this->rowLabelStyle = new RowLabelStyle(); } - /** - * @return BarLabelStyle - */ - public function getBarLabelStyle() + public function getBarLabelStyle(): BarLabelStyle { return $this->barLabelStyle; } - /** - * @return RowLabelStyle - */ - public function getRowLabelStyle() + public function getRowLabelStyle(): RowLabelStyle { return $this->rowLabelStyle; } /** - * @param bool $colorByRowLabel - * * @return $this */ - public function setColorByRowLabel($colorByRowLabel) + public function setColorByRowLabel(bool $colorByRowLabel) { $this->colorByRowLabel = $colorByRowLabel; @@ -91,11 +80,9 @@ public function setColorByRowLabel($colorByRowLabel) } /** - * @param bool $showBarLabels - * * @return $this */ - public function setShowBarLabels($showBarLabels) + public function setShowBarLabels(bool $showBarLabels) { $this->showBarLabels = $showBarLabels; @@ -103,11 +90,9 @@ public function setShowBarLabels($showBarLabels) } /** - * @param bool $showRowLabels - * * @return $this */ - public function setShowRowLabels($showRowLabels) + public function setShowRowLabels(bool $showRowLabels) { $this->showRowLabels = $showRowLabels; @@ -115,11 +100,9 @@ public function setShowRowLabels($showRowLabels) } /** - * @param string $singleColor - * * @return $this */ - public function setSingleColor($singleColor) + public function setSingleColor(string $singleColor) { $this->singleColor = $singleColor; @@ -127,11 +110,9 @@ public function setSingleColor($singleColor) } /** - * @param bool $groupByRowLabel - * * @return $this */ - public function setGroupByRowLabel($groupByRowLabel) + public function setGroupByRowLabel(bool $groupByRowLabel) { $this->groupByRowLabel = $groupByRowLabel; diff --git a/GoogleCharts/Options/Timeline/TimelineOptions.php b/GoogleCharts/Options/Timeline/TimelineOptions.php index 9405122..280930e 100644 --- a/GoogleCharts/Options/Timeline/TimelineOptions.php +++ b/GoogleCharts/Options/Timeline/TimelineOptions.php @@ -39,9 +39,6 @@ class TimelineOptions extends BasicChartOptions */ protected $tooltip; - /** - * TimelineOptions constructor. - */ public function __construct() { parent::__construct(); @@ -50,28 +47,20 @@ public function __construct() $this->tooltip = new BasicTooltip(); } - /** - * @return Timeline - */ - public function getTimeline() + public function getTimeline(): Timeline { return $this->timeline; } - /** - * @return BasicTooltip - */ - public function getTooltip() + public function getTooltip(): BasicTooltip { return $this->tooltip; } /** - * @param bool $avoidOverlappingGridLines - * * @return $this */ - public function setAvoidOverlappingGridLines($avoidOverlappingGridLines) + public function setAvoidOverlappingGridLines(bool $avoidOverlappingGridLines) { $this->avoidOverlappingGridLines = $avoidOverlappingGridLines; @@ -79,11 +68,9 @@ public function setAvoidOverlappingGridLines($avoidOverlappingGridLines) } /** - * @param string $backgroundColor - * * @return $this */ - public function setBackgroundColor($backgroundColor) + public function setBackgroundColor(string $backgroundColor) { $this->backgroundColor = $backgroundColor; diff --git a/GoogleCharts/Options/TitlePositionTrait.php b/GoogleCharts/Options/TitlePositionTrait.php index 16536d8..e4932fc 100644 --- a/GoogleCharts/Options/TitlePositionTrait.php +++ b/GoogleCharts/Options/TitlePositionTrait.php @@ -20,11 +20,9 @@ trait TitlePositionTrait protected $titlePosition; /** - * @param string $titlePosition - * * @return $this */ - public function setTitlePosition($titlePosition) + public function setTitlePosition(string $titlePosition) { $this->titlePosition = $titlePosition; diff --git a/GoogleCharts/Options/TitleTrait.php b/GoogleCharts/Options/TitleTrait.php index a782233..3143bdc 100644 --- a/GoogleCharts/Options/TitleTrait.php +++ b/GoogleCharts/Options/TitleTrait.php @@ -17,11 +17,9 @@ trait TitleTrait protected $title; /** - * @param string $title - * * @return $this */ - public function setTitle($title) + public function setTitle(string $title) { $this->title = $title; diff --git a/GoogleCharts/Options/Tooltip.php b/GoogleCharts/Options/Tooltip.php index dd06814..336cd63 100644 --- a/GoogleCharts/Options/Tooltip.php +++ b/GoogleCharts/Options/Tooltip.php @@ -18,11 +18,9 @@ class Tooltip protected $isHtml; /** - * @param bool $isHtml - * * @return $this */ - public function setIsHtml($isHtml) + public function setIsHtml(bool $isHtml) { $this->isHtml = $isHtml; diff --git a/GoogleCharts/Options/TreeMapChart/TreeMapChartOptions.php b/GoogleCharts/Options/TreeMapChart/TreeMapChartOptions.php index 450ba0f..514bba4 100644 --- a/GoogleCharts/Options/TreeMapChart/TreeMapChartOptions.php +++ b/GoogleCharts/Options/TreeMapChart/TreeMapChartOptions.php @@ -196,9 +196,6 @@ class TreeMapChartOptions extends ChartOptions */ protected $useWeightedAverageForAggregation; - /** - * TreeMapChartOptions constructor. - */ public function __construct() { parent::__construct(); @@ -207,28 +204,20 @@ public function __construct() $this->titleTextStyle = new TitleTextStyle(); } - /** - * @return MediumTextStyle - */ - public function getTextStyle() + public function getTextStyle(): MediumTextStyle { return $this->textStyle; } - /** - * @return TitleTextStyle - */ - public function getTitleTextStyle() + public function getTitleTextStyle(): TitleTextStyle { return $this->titleTextStyle; } /** - * @param bool $useWeightedAverageForAggregation - * * @return $this */ - public function setUseWeightedAverageForAggregation($useWeightedAverageForAggregation) + public function setUseWeightedAverageForAggregation(bool $useWeightedAverageForAggregation) { $this->useWeightedAverageForAggregation = $useWeightedAverageForAggregation; @@ -236,11 +225,9 @@ public function setUseWeightedAverageForAggregation($useWeightedAverageForAggreg } /** - * @param string $fontColor - * * @return $this */ - public function setFontColor($fontColor) + public function setFontColor(string $fontColor) { $this->fontColor = $fontColor; @@ -248,11 +235,9 @@ public function setFontColor($fontColor) } /** - * @param string $fontFamily - * * @return $this */ - public function setFontFamily($fontFamily) + public function setFontFamily(string $fontFamily) { $this->fontFamily = $fontFamily; @@ -260,11 +245,9 @@ public function setFontFamily($fontFamily) } /** - * @param string $headerColor - * * @return $this */ - public function setHeaderColor($headerColor) + public function setHeaderColor(string $headerColor) { $this->headerColor = $headerColor; @@ -272,11 +255,9 @@ public function setHeaderColor($headerColor) } /** - * @param int $headerHeight - * * @return $this */ - public function setHeaderHeight($headerHeight) + public function setHeaderHeight(int $headerHeight) { $this->headerHeight = $headerHeight; @@ -284,11 +265,9 @@ public function setHeaderHeight($headerHeight) } /** - * @param string $headerHighlightColor - * * @return $this */ - public function setHeaderHighlightColor($headerHighlightColor) + public function setHeaderHighlightColor(string $headerHighlightColor) { $this->headerHighlightColor = $headerHighlightColor; @@ -296,11 +275,9 @@ public function setHeaderHighlightColor($headerHighlightColor) } /** - * @param bool $highlightOnMouseOver - * * @return $this */ - public function setHighlightOnMouseOver($highlightOnMouseOver) + public function setHighlightOnMouseOver(bool $highlightOnMouseOver) { $this->highlightOnMouseOver = $highlightOnMouseOver; @@ -308,11 +285,9 @@ public function setHighlightOnMouseOver($highlightOnMouseOver) } /** - * @param float $hintOpacity - * * @return $this */ - public function setHintOpacity($hintOpacity) + public function setHintOpacity(float $hintOpacity) { $this->hintOpacity = $hintOpacity; @@ -320,11 +295,9 @@ public function setHintOpacity($hintOpacity) } /** - * @param string $maxColor - * * @return $this */ - public function setMaxColor($maxColor) + public function setMaxColor(string $maxColor) { $this->maxColor = $maxColor; @@ -332,11 +305,9 @@ public function setMaxColor($maxColor) } /** - * @param int $maxDepth - * * @return $this */ - public function setMaxDepth($maxDepth) + public function setMaxDepth(int $maxDepth) { $this->maxDepth = $maxDepth; @@ -344,11 +315,9 @@ public function setMaxDepth($maxDepth) } /** - * @param string $maxHighlightColor - * * @return $this */ - public function setMaxHighlightColor($maxHighlightColor) + public function setMaxHighlightColor(string $maxHighlightColor) { $this->maxHighlightColor = $maxHighlightColor; @@ -356,11 +325,9 @@ public function setMaxHighlightColor($maxHighlightColor) } /** - * @param int $maxPostDepth - * * @return $this */ - public function setMaxPostDepth($maxPostDepth) + public function setMaxPostDepth(int $maxPostDepth) { $this->maxPostDepth = $maxPostDepth; @@ -368,11 +335,9 @@ public function setMaxPostDepth($maxPostDepth) } /** - * @param int $maxColorValue - * * @return $this */ - public function setMaxColorValue($maxColorValue) + public function setMaxColorValue(int $maxColorValue) { $this->maxColorValue = $maxColorValue; @@ -380,11 +345,9 @@ public function setMaxColorValue($maxColorValue) } /** - * @param string $midColor - * * @return $this */ - public function setMidColor($midColor) + public function setMidColor(string $midColor) { $this->midColor = $midColor; @@ -392,11 +355,9 @@ public function setMidColor($midColor) } /** - * @param string $midHighlightColor - * * @return $this */ - public function setMidHighlightColor($midHighlightColor) + public function setMidHighlightColor(string $midHighlightColor) { $this->midHighlightColor = $midHighlightColor; @@ -404,11 +365,9 @@ public function setMidHighlightColor($midHighlightColor) } /** - * @param string $minColor - * * @return $this */ - public function setMinColor($minColor) + public function setMinColor(string $minColor) { $this->minColor = $minColor; @@ -416,11 +375,9 @@ public function setMinColor($minColor) } /** - * @param string $minHighlightColor - * * @return $this */ - public function setMinHighlightColor($minHighlightColor) + public function setMinHighlightColor(string $minHighlightColor) { $this->minHighlightColor = $minHighlightColor; @@ -428,11 +385,9 @@ public function setMinHighlightColor($minHighlightColor) } /** - * @param int $minColorValue - * * @return $this */ - public function setMinColorValue($minColorValue) + public function setMinColorValue(int $minColorValue) { $this->minColorValue = $minColorValue; @@ -440,11 +395,9 @@ public function setMinColorValue($minColorValue) } /** - * @param string $noColor - * * @return $this */ - public function setNoColor($noColor) + public function setNoColor(string $noColor) { $this->noColor = $noColor; @@ -452,11 +405,9 @@ public function setNoColor($noColor) } /** - * @param string $noHighlightColor - * * @return $this */ - public function setNoHighlightColor($noHighlightColor) + public function setNoHighlightColor(string $noHighlightColor) { $this->noHighlightColor = $noHighlightColor; @@ -464,11 +415,9 @@ public function setNoHighlightColor($noHighlightColor) } /** - * @param bool $showScale - * * @return $this */ - public function setShowScale($showScale) + public function setShowScale(bool $showScale) { $this->showScale = $showScale; @@ -476,11 +425,9 @@ public function setShowScale($showScale) } /** - * @param bool $showTooltips - * * @return $this */ - public function setShowTooltips($showTooltips) + public function setShowTooltips(bool $showTooltips) { $this->showTooltips = $showTooltips; diff --git a/GoogleCharts/Options/Trendlines.php b/GoogleCharts/Options/Trendlines.php index 755072e..af2d6bd 100644 --- a/GoogleCharts/Options/Trendlines.php +++ b/GoogleCharts/Options/Trendlines.php @@ -54,11 +54,9 @@ class Trendlines protected $visibleInLegend; /** - * @param bool $visibleInLegend - * * @return $this */ - public function setVisibleInLegend($visibleInLegend) + public function setVisibleInLegend(bool $visibleInLegend) { $this->visibleInLegend = $visibleInLegend; @@ -66,11 +64,9 @@ public function setVisibleInLegend($visibleInLegend) } /** - * @param int $degree - * * @return $this */ - public function setDegree($degree) + public function setDegree(int $degree) { $this->degree = $degree; @@ -78,11 +74,9 @@ public function setDegree($degree) } /** - * @param string $labelInLegend - * * @return $this */ - public function setLabelInLegend($labelInLegend) + public function setLabelInLegend(string $labelInLegend) { $this->labelInLegend = $labelInLegend; @@ -90,11 +84,9 @@ public function setLabelInLegend($labelInLegend) } /** - * @param bool $showR2 - * * @return $this */ - public function setShowR2($showR2) + public function setShowR2(bool $showR2) { $this->showR2 = $showR2; @@ -102,11 +94,9 @@ public function setShowR2($showR2) } /** - * @param string $type - * * @return $this */ - public function setType($type) + public function setType(string $type) { $this->type = $type; diff --git a/GoogleCharts/Options/TriggerTrait.php b/GoogleCharts/Options/TriggerTrait.php index 82de72f..5bdf8e8 100644 --- a/GoogleCharts/Options/TriggerTrait.php +++ b/GoogleCharts/Options/TriggerTrait.php @@ -20,11 +20,9 @@ trait TriggerTrait protected $trigger; /** - * @param string $trigger - * * @return $this */ - public function setTrigger($trigger) + public function setTrigger(string $trigger) { $this->trigger = $trigger; diff --git a/GoogleCharts/Options/Units.php b/GoogleCharts/Options/Units.php index 7e0411a..22f8ad1 100644 --- a/GoogleCharts/Options/Units.php +++ b/GoogleCharts/Options/Units.php @@ -42,9 +42,6 @@ class Units */ protected $milliseconds; - /** - * Units constructor. - */ public function __construct() { $this->years = new Years(); @@ -56,58 +53,37 @@ public function __construct() $this->milliseconds = new Milliseconds(); } - /** - * @return Years - */ - public function getYears() + public function getYears(): Years { return $this->years; } - /** - * @return Months - */ - public function getMonths() + public function getMonths(): Months { return $this->months; } - /** - * @return Days - */ - public function getDays() + public function getDays(): Days { return $this->days; } - /** - * @return Hours - */ - public function getHours() + public function getHours(): Hours { return $this->hours; } - /** - * @return Minutes - */ - public function getMinutes() + public function getMinutes(): Minutes { return $this->minutes; } - /** - * @return Seconds - */ - public function getSeconds() + public function getSeconds(): Seconds { return $this->seconds; } - /** - * @return Milliseconds - */ - public function getMilliseconds() + public function getMilliseconds(): Milliseconds { return $this->milliseconds; } diff --git a/GoogleCharts/Options/VAxesTrait.php b/GoogleCharts/Options/VAxesTrait.php index 9178a99..f8d605f 100644 --- a/GoogleCharts/Options/VAxesTrait.php +++ b/GoogleCharts/Options/VAxesTrait.php @@ -23,7 +23,7 @@ trait VAxesTrait * * @return $this */ - public function setVAxes($vAxes) + public function setVAxes(array $vAxes) { $this->vAxes = $vAxes; diff --git a/GoogleCharts/Options/VAxis.php b/GoogleCharts/Options/VAxis.php index 6f2c885..3debb8f 100644 --- a/GoogleCharts/Options/VAxis.php +++ b/GoogleCharts/Options/VAxis.php @@ -163,52 +163,35 @@ public function __construct() $this->textStyle = new MediumTextStyle(); } - /** - * @return Gridlines - */ - public function getGridlines() + public function getGridlines(): Gridlines { return $this->gridlines; } - /** - * @return MinorGridlines - */ - public function getMinorGridlines() + public function getMinorGridlines(): MinorGridlines { return $this->minorGridlines; } - /** - * @return TitleTextStyle - */ - public function getTitleTextStyle() + public function getTitleTextStyle(): TitleTextStyle { return $this->titleTextStyle; } - /** - * @return ViewWindow - */ - public function getViewWindow() + public function getViewWindow(): ViewWindow { return $this->viewWindow; } - /** - * @return MediumTextStyle - */ - public function getTextStyle() + public function getTextStyle(): MediumTextStyle { return $this->textStyle; } /** - * @param int $baseline - * * @return $this */ - public function setBaseline($baseline) + public function setBaseline(int $baseline) { $this->baseline = $baseline; @@ -216,11 +199,9 @@ public function setBaseline($baseline) } /** - * @param string $baselineColor - * * @return $this */ - public function setBaselineColor($baselineColor) + public function setBaselineColor(string $baselineColor) { $this->baselineColor = $baselineColor; @@ -228,11 +209,9 @@ public function setBaselineColor($baselineColor) } /** - * @param int $direction - * * @return $this */ - public function setDirection($direction) + public function setDirection(int $direction) { $this->direction = $direction; @@ -240,11 +219,9 @@ public function setDirection($direction) } /** - * @param string $format - * * @return $this */ - public function setFormat($format) + public function setFormat(string $format) { $this->format = $format; @@ -252,11 +229,9 @@ public function setFormat($format) } /** - * @param bool $logScale - * * @return $this */ - public function setLogScale($logScale) + public function setLogScale(bool $logScale) { $this->logScale = $logScale; @@ -264,11 +239,9 @@ public function setLogScale($logScale) } /** - * @param string $scaleType - * * @return $this */ - public function setScaleType($scaleType) + public function setScaleType(string $scaleType) { $this->scaleType = $scaleType; @@ -276,11 +249,9 @@ public function setScaleType($scaleType) } /** - * @param string $textPosition - * * @return $this */ - public function setTextPosition($textPosition) + public function setTextPosition(string $textPosition) { $this->textPosition = $textPosition; @@ -292,7 +263,7 @@ public function setTextPosition($textPosition) * * @return $this */ - public function setTicks($ticks) + public function setTicks(array $ticks) { $this->ticks = $ticks; @@ -300,11 +271,9 @@ public function setTicks($ticks) } /** - * @param int $maxValue - * * @return $this */ - public function setMaxValue($maxValue) + public function setMaxValue(int $maxValue) { $this->maxValue = $maxValue; @@ -312,11 +281,9 @@ public function setMaxValue($maxValue) } /** - * @param int $minValue - * * @return $this */ - public function setMinValue($minValue) + public function setMinValue(int $minValue) { $this->minValue = $minValue; @@ -324,11 +291,9 @@ public function setMinValue($minValue) } /** - * @param string $viewWindowMode - * * @return $this */ - public function setViewWindowMode($viewWindowMode) + public function setViewWindowMode(string $viewWindowMode) { $this->viewWindowMode = $viewWindowMode; diff --git a/GoogleCharts/Options/WidthTrait.php b/GoogleCharts/Options/WidthTrait.php index 591ede6..2e3cec3 100644 --- a/GoogleCharts/Options/WidthTrait.php +++ b/GoogleCharts/Options/WidthTrait.php @@ -17,11 +17,9 @@ trait WidthTrait protected $width; /** - * @param int $width - * * @return $this */ - public function setWidth($width) + public function setWidth(int $width) { $this->width = $width; diff --git a/GoogleCharts/Options/WordTree/WordTree.php b/GoogleCharts/Options/WordTree/WordTree.php index 0faa65b..876093d 100644 --- a/GoogleCharts/Options/WordTree/WordTree.php +++ b/GoogleCharts/Options/WordTree/WordTree.php @@ -46,11 +46,9 @@ class WordTree protected $wordRegex; /** - * @param string $format - * * @return $this */ - public function setFormat($format) + public function setFormat(string $format) { $this->format = $format; @@ -58,11 +56,9 @@ public function setFormat($format) } /** - * @param string $sentenceRegex - * * @return $this */ - public function setSentenceRegex($sentenceRegex) + public function setSentenceRegex(string $sentenceRegex) { $this->sentenceRegex = $sentenceRegex; @@ -70,11 +66,9 @@ public function setSentenceRegex($sentenceRegex) } /** - * @param string $type - * * @return $this */ - public function setType($type) + public function setType(string $type) { $this->type = $type; @@ -82,11 +76,9 @@ public function setType($type) } /** - * @param string $word - * * @return $this */ - public function setWord($word) + public function setWord(string $word) { $this->word = $word; @@ -94,11 +86,9 @@ public function setWord($word) } /** - * @param string $wordRegex - * * @return $this */ - public function setWordRegex($wordRegex) + public function setWordRegex(string $wordRegex) { $this->wordRegex = $wordRegex; diff --git a/GoogleCharts/Options/WordTree/WordTreeOptions.php b/GoogleCharts/Options/WordTree/WordTreeOptions.php index 1e06e44..3aa5d57 100644 --- a/GoogleCharts/Options/WordTree/WordTreeOptions.php +++ b/GoogleCharts/Options/WordTree/WordTreeOptions.php @@ -27,9 +27,6 @@ class WordTreeOptions extends ChartOptions */ protected $wordtree; - /** - * WordTreeOptions constructor. - */ public function __construct() { parent::__construct(); @@ -37,20 +34,15 @@ public function __construct() $this->wordtree = new WordTree(); } - /** - * @return WordTree - */ - public function getWordtree() + public function getWordtree(): WordTree { return $this->wordtree; } /** - * @param int $maxFontSize - * * @return $this */ - public function setMaxFontSize($maxFontSize) + public function setMaxFontSize(int $maxFontSize) { $this->maxFontSize = $maxFontSize; diff --git a/Output/AbstractChartOutput.php b/Output/AbstractChartOutput.php index 717cf32..71b384f 100644 --- a/Output/AbstractChartOutput.php +++ b/Output/AbstractChartOutput.php @@ -24,22 +24,16 @@ abstract class AbstractChartOutput implements ChartOutputInterface */ protected $language; - /** - * @param string $version - * @param string $language - */ - public function __construct($version, $language) + public function __construct(string $version, string $language) { $this->version = $version; $this->language = $language; } /** - * @param string $language - * * @return $this */ - public function setLanguage($language) + public function setLanguage(string $language): ChartOutputInterface { $this->language = $language; @@ -52,11 +46,9 @@ public function setLanguage($language) * @param Chart[] $charts * @param string[] $elementsID * - * @return void - * * @throws GoogleChartsException */ - protected function checkElementsId(array $charts, array $elementsID) + protected function checkElementsId(array $charts, array $elementsID): void { if (count($charts) != count($elementsID)) { throw new GoogleChartsException('Array charts and array HTML elements ID do not have the same number of element.'); @@ -74,11 +66,9 @@ protected function checkElementsId(array $charts, array $elementsID) * * @param Chart[] $charts * - * @return void - * * @throws GoogleChartsException */ - protected function checkChartsTypes(array $charts) + protected function checkChartsTypes(array $charts): void { foreach ($charts as $chart) { if (!$chart instanceof Chart) { diff --git a/Output/AbstractOptionsOutput.php b/Output/AbstractOptionsOutput.php index 25d7894..8e20192 100644 --- a/Output/AbstractOptionsOutput.php +++ b/Output/AbstractOptionsOutput.php @@ -7,7 +7,7 @@ */ abstract class AbstractOptionsOutput implements OptionsOutputInterface { - public function removeRecursivelyNullValue(&$options) + public function removeRecursivelyNullValue(&$options): void { $options = array_filter((array) $options, function ($val) { return !is_null($val); @@ -20,7 +20,7 @@ public function removeRecursivelyNullValue(&$options) } } - public function removeRecursivelyEmptyArray(&$options) + public function removeRecursivelyEmptyArray(array &$options): void { foreach ($options as $key => $value) { if (is_array($value)) { @@ -33,7 +33,7 @@ public function removeRecursivelyEmptyArray(&$options) } } - public function renameRecursivelyKeys($options) + public function renameRecursivelyKeys(array $options): array { $newOptions = []; diff --git a/Output/ChartOutputInterface.php b/Output/ChartOutputInterface.php index bcbf169..b15682f 100644 --- a/Output/ChartOutputInterface.php +++ b/Output/ChartOutputInterface.php @@ -13,18 +13,14 @@ interface ChartOutputInterface /** * Returns a string to draw the beginning of the chart (Declaration, data and options). * - * @return string - * * @throws GoogleChartsException */ - public function startChart(Chart $chart); + public function startChart(Chart $chart): string; /** * Returns a string to draw the end of the chart (Events and drawing). - * - * @return string */ - public function endChart(Chart $chart); + public function endChart(Chart $chart): string; /** * Returns a string to draw the beginning of one or more charts. @@ -32,22 +28,18 @@ public function endChart(Chart $chart); * @param Chart|Chart[] $charts Chart instance or array of Chart instance * @param string|string[]|null $elementsID HTML element ID or array of HTML elements IDs. Can be null * - * @return string - * * @throws GoogleChartsException */ - public function startCharts($charts, $elementsID = null); + public function startCharts($charts, $elementsID = null): string; /** * Returns a string to draw the end of one or more charts. * * @param Chart|Chart[] $charts Chart instance or array of Chart instance * - * @return string - * * @throws GoogleChartsException */ - public function endCharts($charts); + public function endCharts($charts): string; /** * Returns a string to draw one or more complete charts. @@ -55,43 +47,31 @@ public function endCharts($charts); * @param Chart|Chart[] $charts Chart instance or array of Chart instance * @param string|string[]|null $elementsID HTML element ID or array of HTML elements IDs. Can be null * - * @return string - * * @throws GoogleChartsException */ - public function fullCharts($charts, $elementsID = null); + public function fullCharts($charts, $elementsID = null): string; /** * Returns a string to load Google libraries. * * @param string[] $packages List of packages to load - * - * @return string */ - public function loadLibraries(array $packages); + public function loadLibraries(array $packages): string; /** * Returns a string for the beginning of the callback. - * - * @param string $name Name of callback - * - * @return string */ - public function startCallback($name); + public function startCallback(string $name): string; /** * Returns a string for the end of the callback. - * - * @return string */ - public function endCallback(); + public function endCallback(): string; /** * Sets the language used by Google for charts. * - * @param string $language - * * @return $this */ - public function setLanguage($language); + public function setLanguage(string $language): ChartOutputInterface; } diff --git a/Output/DataOutputInterface.php b/Output/DataOutputInterface.php index 0b3fc21..7b34d5b 100644 --- a/Output/DataOutputInterface.php +++ b/Output/DataOutputInterface.php @@ -13,11 +13,7 @@ interface DataOutputInterface /** * Returns a string to draw data. * - * @param string $dataName Variable name who will contain the data - * - * @return string - * * @throws GoogleChartsException */ - public function draw(Data $data, $dataName); + public function draw(Data $data, string $dataName): string; } diff --git a/Output/DateOutputInterface.php b/Output/DateOutputInterface.php index 3c707f9..d512b93 100644 --- a/Output/DateOutputInterface.php +++ b/Output/DateOutputInterface.php @@ -9,8 +9,6 @@ interface DateOutputInterface { /** * Returns a string to draw a DateTimeInterface object. - * - * @return string */ - public function draw(\DateTimeInterface $date); + public function draw(\DateTimeInterface $date): string; } diff --git a/Output/EventsOutputInterface.php b/Output/EventsOutputInterface.php index 8a26e1c..c487bcb 100644 --- a/Output/EventsOutputInterface.php +++ b/Output/EventsOutputInterface.php @@ -9,10 +9,6 @@ interface EventsOutputInterface { /** * Returns a string to draw events of a chart. - * - * @param string $chartName - * - * @return string */ - public function draw(Events $events, $chartName); + public function draw(Events $events, string $chartName): string; } diff --git a/Output/Javascript/ChartOutput.php b/Output/Javascript/ChartOutput.php index c9bc609..5a55e5e 100644 --- a/Output/Javascript/ChartOutput.php +++ b/Output/Javascript/ChartOutput.php @@ -24,13 +24,9 @@ class ChartOutput extends AbstractChartOutput /** @var EventsOutputInterface */ private $eventsOutput; - /** - * @param string $version - * @param string $language - */ public function __construct( - $version, - $language, + string $version, + string $language, OptionsOutputInterface $optionsOutput, DataOutputInterface $dataOutput, EventsOutputInterface $eventsOutput @@ -42,7 +38,7 @@ public function __construct( $this->eventsOutput = $eventsOutput; } - public function startChart(Chart $chart) + public function startChart(Chart $chart): string { if (null === $chart->getElementID()) { throw new GoogleChartsException('Container is not defined.'); @@ -66,7 +62,7 @@ public function startChart(Chart $chart) return $js; } - public function endChart(Chart $chart) + public function endChart(Chart $chart): string { if ('visualization' == $chart->getLibrary()) { $options = $chart->getOptionsName(); @@ -80,7 +76,7 @@ public function endChart(Chart $chart) '.draw('.$chart->getDataName().', '.$options.');'; } - public function startCharts($charts, $elementsID = null) + public function startCharts($charts, $elementsID = null): string { if ($charts instanceof Chart) { $charts = [$charts]; @@ -131,7 +127,7 @@ public function startCharts($charts, $elementsID = null) return $js; } - public function endCharts($charts) + public function endCharts($charts): string { if ($charts instanceof Chart) { $js = $this->endChart($charts).$this->endCallback(); @@ -151,12 +147,12 @@ public function endCharts($charts) return $js; } - public function fullCharts($charts, $elementsID = null) + public function fullCharts($charts, $elementsID = null): string { return $this->startCharts($charts, $elementsID).$this->endCharts($charts); } - public function loadLibraries(array $packages) + public function loadLibraries(array $packages): string { array_walk($packages, function (&$item) { $item = "'".$item."'"; @@ -169,12 +165,12 @@ public function loadLibraries(array $packages) return "google.charts.load($load);"; } - public function startCallback($name) + public function startCallback(string $name): string { return "google.charts.setOnLoadCallback($name); function $name() {"; } - public function endCallback() + public function endCallback(): string { return '}'; } diff --git a/Output/Javascript/DataOutput.php b/Output/Javascript/DataOutput.php index 7543de8..f5f25e0 100644 --- a/Output/Javascript/DataOutput.php +++ b/Output/Javascript/DataOutput.php @@ -15,18 +15,12 @@ class DataOutput implements DataOutputInterface /** @var DateOutputInterface */ private $dateOutput; - /** - * DataOutput constructor. - */ public function __construct(DateOutputInterface $dateOutput) { $this->dateOutput = $dateOutput; } - /** - * {@inheritdoc} - */ - public function draw(Data $data, $dataName) + public function draw(Data $data, string $dataName): string { $arrayToDataTable = $data->getArrayToDataTable(); diff --git a/Output/Javascript/DateOutput.php b/Output/Javascript/DateOutput.php index f36ac52..9a473c2 100644 --- a/Output/Javascript/DateOutput.php +++ b/Output/Javascript/DateOutput.php @@ -9,7 +9,7 @@ */ class DateOutput implements DateOutputInterface { - public function draw(\DateTimeInterface $date) + public function draw(\DateTimeInterface $date): string { return 'new Date('.$date->format('Y').', '.((int) $date->format('n') - 1).', '.$date->format('j').', '. $date->format('H').', '.$date->format('i').', '.$date->format('s').')'; diff --git a/Output/Javascript/EventsOutput.php b/Output/Javascript/EventsOutput.php index ceb17cf..05ab93b 100644 --- a/Output/Javascript/EventsOutput.php +++ b/Output/Javascript/EventsOutput.php @@ -7,10 +7,7 @@ class EventsOutput implements EventsOutputInterface { - /** - * {@inheritdoc} - */ - public function draw(Events $events, $chartName) + public function draw(Events $events, string $chartName): string { $js = ''; diff --git a/Output/Javascript/OptionsOutput.php b/Output/Javascript/OptionsOutput.php index d7c57a7..0cc7886 100644 --- a/Output/Javascript/OptionsOutput.php +++ b/Output/Javascript/OptionsOutput.php @@ -19,7 +19,7 @@ public function __construct(DateOutputInterface $dateOutput) $this->dateOutput = $dateOutput; } - public function draw(ChartOptionsInterface $options, $optionsName) + public function draw(ChartOptionsInterface $options, string $optionsName): string { $this->removeRecursivelyNullValue($options); diff --git a/Output/OptionsOutputInterface.php b/Output/OptionsOutputInterface.php index ce0e2b9..563aa04 100644 --- a/Output/OptionsOutputInterface.php +++ b/Output/OptionsOutputInterface.php @@ -13,19 +13,15 @@ interface OptionsOutputInterface * Removes recursively array elements that have a null value. * * @param ChartOptionsInterface|array $options ChartOptions instance or an array of options passed by reference - * - * @return void */ - public function removeRecursivelyNullValue(&$options); + public function removeRecursivelyNullValue(&$options): void; /** * Removes recursively array elements that have an empty array. * * @param array $options Array of options passed by reference - * - * @return void */ - public function removeRecursivelyEmptyArray(&$options); + public function removeRecursivelyEmptyArray(array &$options): void; /** * Renames recursively array keys to remove prefixes and suffixes "\x00". They come from conversion of class with @@ -35,16 +31,12 @@ public function removeRecursivelyEmptyArray(&$options); * * @return array Array of options with new keys */ - public function renameRecursivelyKeys($options); + public function renameRecursivelyKeys(array $options): array; /** * Returns a string to draw options. Multilevel of options are possible. A level of option can be a class of option, * 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 string $optionsName Variable name who will contain the options - * - * @return string */ - public function draw(ChartOptionsInterface $options, $optionsName); + public function draw(ChartOptionsInterface $options, string $optionsName): string; } diff --git a/README.md b/README.md index 1b9d4fe..f399d81 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ * [Diff charts](Resources/doc/diff_charts.md) * [Events](Resources/doc/events.md) * [Google Charts documentation](https://developers.google.com/chart/interactive/docs/) +* [How to contribute](Resources/doc/contribute.md) ## Examples diff --git a/Resources/doc/contribute.md b/Resources/doc/contribute.md new file mode 100644 index 0000000..6a10f3e --- /dev/null +++ b/Resources/doc/contribute.md @@ -0,0 +1,18 @@ +# How to contribute + +Before opening a pull request, be sure to follow the steps below. + +## Step 1 : check and correct the code using PHPStan +```bash +./vendor/bin/phpstan analyse --level max +``` + +## Step 2 : run tests using PHPUnit and check all tests are OK +```bash +./vendor/bin/phpunit +``` + +## Step 3 : check and correct coding standards using PHP CS Fixer +```bash +./vendor/bin/php-cs-fixer fix --diff -vv +``` diff --git a/Tests/GoogleCharts/Charts/AnnotationChartTest.php b/Tests/GoogleCharts/Charts/AnnotationChartTest.php index 5a12217..8e04f4a 100644 --- a/Tests/GoogleCharts/Charts/AnnotationChartTest.php +++ b/Tests/GoogleCharts/Charts/AnnotationChartTest.php @@ -10,11 +10,12 @@ use CMEN\GoogleChartsBundle\Output\Javascript\EventsOutput; use CMEN\GoogleChartsBundle\Output\Javascript\OptionsOutput; use DateTime; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class AnnotationChartTest extends \PHPUnit_Framework_TestCase +class AnnotationChartTest extends TestCase { /** @var ChartOutputInterface */ private $chartOutput; diff --git a/Tests/GoogleCharts/Charts/ColumnChartTest.php b/Tests/GoogleCharts/Charts/ColumnChartTest.php index 091092d..d6a3373 100644 --- a/Tests/GoogleCharts/Charts/ColumnChartTest.php +++ b/Tests/GoogleCharts/Charts/ColumnChartTest.php @@ -11,11 +11,12 @@ use CMEN\GoogleChartsBundle\Output\Javascript\DateOutput; use CMEN\GoogleChartsBundle\Output\Javascript\EventsOutput; use CMEN\GoogleChartsBundle\Output\Javascript\OptionsOutput; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class ColumnChartTest extends \PHPUnit_Framework_TestCase +class ColumnChartTest extends TestCase { /** @var ChartOutputInterface */ private $chartOutput; diff --git a/Tests/GoogleCharts/Charts/GanttChartTest.php b/Tests/GoogleCharts/Charts/GanttChartTest.php index 5eef458..b9b9d03 100644 --- a/Tests/GoogleCharts/Charts/GanttChartTest.php +++ b/Tests/GoogleCharts/Charts/GanttChartTest.php @@ -10,11 +10,12 @@ use CMEN\GoogleChartsBundle\Output\Javascript\EventsOutput; use CMEN\GoogleChartsBundle\Output\Javascript\OptionsOutput; use DateTime; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class GanttChartTest extends \PHPUnit_Framework_TestCase +class GanttChartTest extends TestCase { /** @var ChartOutputInterface */ private $chartOutput; diff --git a/Tests/GoogleCharts/Charts/LineChartTest.php b/Tests/GoogleCharts/Charts/LineChartTest.php index 6cece9f..3a5f2e5 100644 --- a/Tests/GoogleCharts/Charts/LineChartTest.php +++ b/Tests/GoogleCharts/Charts/LineChartTest.php @@ -11,18 +11,16 @@ use CMEN\GoogleChartsBundle\Output\Javascript\DateOutput; use CMEN\GoogleChartsBundle\Output\Javascript\EventsOutput; use CMEN\GoogleChartsBundle\Output\Javascript\OptionsOutput; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class LineChartTest extends \PHPUnit_Framework_TestCase +class LineChartTest extends TestCase { /** @var ChartOutputInterface */ private $chartOutput; - /** - * {@inheritdoc} - */ protected function setUp() { $dateOutput = new DateOutput(); @@ -361,6 +359,6 @@ public function testJavascriptOutput() /** @noinspection PhpUnhandledExceptionInspection */ $js = $this->chartOutput->fullCharts($chart); - $this->assertContains('{"animation":{"startup":false,"duration":0,"easing":"linear"}, "annotations":{"boxStyle":{"rx":10,"ry":10,"gradient":{"color1":"#fbf6a7","color2":"#33b679","x1":"0%","y1":"0%","x2":"100%","y2":"100%","useObjectBoundingBoxUnits":true},"stroke":"#888","strokeWidth":1},"datum":{"stem":{"length":12,"color":"black"},"style":"point"},"domain":{"stem":{"length":5,"color":"black"},"style":"point"},"highContrast":true,"stem":{"length":5,"color":"black"},"style":"point","textStyle":{"auraColor":"#d799ae","color":"#871b47","fontName":"Times-Roman","fontSize":18,"bold":true,"italic":true,"opacity":0.8}}, "crosshair":{"focused":{"color":"#3bc","opacity":0.8},"selected":{"color":"#3bc","opacity":0.8},"trigger":"both","color":"green","opacity":1,"orientation":"both"}, "explorer":{"actions":["dragToPan","rightClickToReset"],"axis":"vertical","keepInBounds":false,"maxZoomIn":0.25,"maxZoomOut":4,"zoomDelta":1.5}, "hAxis":{"allowContainerBoundaryTextCufoff":false,"slantedText":false,"slantedTextAngle":30,"maxAlternation":2,"maxTextLines":5,"minTextSpacing":5,"showTextEvery":1,"baseline":5,"baselineColor":"black","direction":1,"format":"decimal","logScale":false,"scaleType":"log","maxValue":100,"minValue":1,"ticks":[5,10,15,20],"gridlines":{"count":5,"units":{"years":{"format":"yyyy"},"months":{"format":"M"},"days":{"format":"d"},"hours":{"format":"H"},"minutes":{"format":"i"},"seconds":{"format":"s"},"milliseconds":{"format":"u"}},"color":"#CCC"},"minorGridlines":{"count":0,"units":{"years":{"format":"yyyy"},"months":{"format":"M"},"days":{"format":"d"},"hours":{"format":"H"},"minutes":{"format":"i"},"seconds":{"format":"s"},"milliseconds":{"format":"u"}},"color":"black"},"textPosition":"out","textStyle":{"color":"black","fontName":"Times-Roman","fontSize":12,"bold":true,"italic":true},"titleTextStyle":{"color":"black","fontName":"Arial","fontSize":18,"bold":true,"italic":true},"viewWindow":{"max":100,"min":1},"viewWindowMode":"pretty","title":"title"}, "legend":{"maxLines":1,"alignment":"start","position":"right","textStyle":{"color":"black","fontName":"Arial","fontSize":10,"bold":false,"italic":false}}, "tooltip":{"ignoreBounds":false,"showColorCode":false,"textStyle":{"color":"black","fontName":"Arial","fontSize":18,"bold":true,"italic":true},"isHtml":false,"trigger":"focus"}, "vAxis":{"baseline":5,"baselineColor":"black","direction":1,"format":"decimal","gridlines":{"count":5,"units":{"years":{"format":"yyyy"},"months":{"format":"M"},"days":{"format":"d"},"hours":{"format":"H"},"minutes":{"format":"i"},"seconds":{"format":"s"},"milliseconds":{"format":"u"}},"color":"#CCC"},"minorGridlines":{"count":0,"units":{"years":{"format":"yyyy"},"months":{"format":"M"},"days":{"format":"d"},"hours":{"format":"H"},"minutes":{"format":"i"},"seconds":{"format":"s"},"milliseconds":{"format":"u"}},"color":"black"},"logScale":false,"scaleType":"log","textPosition":"out","textStyle":{"color":"black","fontName":"Times-Roman","fontSize":12,"bold":true,"italic":true},"ticks":[5,10,15,20],"titleTextStyle":{"color":"black","fontName":"Arial","fontSize":18,"bold":true,"italic":true},"maxValue":100,"minValue":1,"viewWindowMode":"pretty","viewWindow":{"max":100,"min":1},"title":"title"}, "backgroundColor":{"stroke":"#666","strokeWidth":0,"fill":"white"}, "chartArea":{"backgroundColor":{"stroke":"black","strokeWidth":1},"height":"auto","left":"auto","top":"auto","width":"auto"}, "titleTextStyle":{"color":"black","fontName":"Arial","fontSize":18,"bold":true,"italic":true}, "forceIFrame":false, "height":500, "width":500, "enableInteractivity":true, "colors":["red","#004411"], "fontName":"Arial", "fontSize":14, "title":"title", "axisTitlesPosition":"out", "series":{"0":{"color":"black","visibleInLegend":false},"3":{"color":"red","visibleInLegend":false}}, "theme":"maximized", "titlePosition":"out", "aggregationTarget":"auto", "lineDashStyle":[5,1,3], "lineWidth":2, "pointShape":"circle", "pointSize":0, "pointsVisible":true, "curveType":"none", "dataOpacity":1, "focusTarget":"datum", "interpolateNulls":false, "orientation":"horizontal", "reverseCategories":false, "selectionMode":"single"};', $js); + $this->assertStringContainsString('{"animation":{"startup":false,"duration":0,"easing":"linear"}, "annotations":{"boxStyle":{"rx":10,"ry":10,"gradient":{"color1":"#fbf6a7","color2":"#33b679","x1":"0%","y1":"0%","x2":"100%","y2":"100%","useObjectBoundingBoxUnits":true},"stroke":"#888","strokeWidth":1},"datum":{"stem":{"length":12,"color":"black"},"style":"point"},"domain":{"stem":{"length":5,"color":"black"},"style":"point"},"highContrast":true,"stem":{"length":5,"color":"black"},"style":"point","textStyle":{"auraColor":"#d799ae","color":"#871b47","fontName":"Times-Roman","fontSize":18,"bold":true,"italic":true,"opacity":0.8}}, "crosshair":{"focused":{"color":"#3bc","opacity":0.8},"selected":{"color":"#3bc","opacity":0.8},"trigger":"both","color":"green","opacity":1,"orientation":"both"}, "explorer":{"actions":["dragToPan","rightClickToReset"],"axis":"vertical","keepInBounds":false,"maxZoomIn":0.25,"maxZoomOut":4,"zoomDelta":1.5}, "hAxis":{"allowContainerBoundaryTextCufoff":false,"slantedText":false,"slantedTextAngle":30,"maxAlternation":2,"maxTextLines":5,"minTextSpacing":5,"showTextEvery":1,"baseline":5,"baselineColor":"black","direction":1,"format":"decimal","logScale":false,"scaleType":"log","maxValue":100,"minValue":1,"ticks":[5,10,15,20],"gridlines":{"count":5,"units":{"years":{"format":"yyyy"},"months":{"format":"M"},"days":{"format":"d"},"hours":{"format":"H"},"minutes":{"format":"i"},"seconds":{"format":"s"},"milliseconds":{"format":"u"}},"color":"#CCC"},"minorGridlines":{"count":0,"units":{"years":{"format":"yyyy"},"months":{"format":"M"},"days":{"format":"d"},"hours":{"format":"H"},"minutes":{"format":"i"},"seconds":{"format":"s"},"milliseconds":{"format":"u"}},"color":"black"},"textPosition":"out","textStyle":{"color":"black","fontName":"Times-Roman","fontSize":12,"bold":true,"italic":true},"titleTextStyle":{"color":"black","fontName":"Arial","fontSize":18,"bold":true,"italic":true},"viewWindow":{"max":100,"min":1},"viewWindowMode":"pretty","title":"title"}, "legend":{"maxLines":1,"alignment":"start","position":"right","textStyle":{"color":"black","fontName":"Arial","fontSize":10,"bold":false,"italic":false}}, "tooltip":{"ignoreBounds":false,"showColorCode":false,"textStyle":{"color":"black","fontName":"Arial","fontSize":18,"bold":true,"italic":true},"isHtml":false,"trigger":"focus"}, "vAxis":{"baseline":5,"baselineColor":"black","direction":1,"format":"decimal","gridlines":{"count":5,"units":{"years":{"format":"yyyy"},"months":{"format":"M"},"days":{"format":"d"},"hours":{"format":"H"},"minutes":{"format":"i"},"seconds":{"format":"s"},"milliseconds":{"format":"u"}},"color":"#CCC"},"minorGridlines":{"count":0,"units":{"years":{"format":"yyyy"},"months":{"format":"M"},"days":{"format":"d"},"hours":{"format":"H"},"minutes":{"format":"i"},"seconds":{"format":"s"},"milliseconds":{"format":"u"}},"color":"black"},"logScale":false,"scaleType":"log","textPosition":"out","textStyle":{"color":"black","fontName":"Times-Roman","fontSize":12,"bold":true,"italic":true},"ticks":[5,10,15,20],"titleTextStyle":{"color":"black","fontName":"Arial","fontSize":18,"bold":true,"italic":true},"maxValue":100,"minValue":1,"viewWindowMode":"pretty","viewWindow":{"max":100,"min":1},"title":"title"}, "backgroundColor":{"stroke":"#666","strokeWidth":0,"fill":"white"}, "chartArea":{"backgroundColor":{"stroke":"black","strokeWidth":1},"height":"auto","left":"auto","top":"auto","width":"auto"}, "titleTextStyle":{"color":"black","fontName":"Arial","fontSize":18,"bold":true,"italic":true}, "forceIFrame":false, "height":500, "width":500, "enableInteractivity":true, "colors":["red","#004411"], "fontName":"Arial", "fontSize":14, "title":"title", "axisTitlesPosition":"out", "series":{"0":{"color":"black","visibleInLegend":false},"3":{"color":"red","visibleInLegend":false}}, "theme":"maximized", "titlePosition":"out", "aggregationTarget":"auto", "lineDashStyle":[5,1,3], "lineWidth":2, "pointShape":"circle", "pointSize":0, "pointsVisible":true, "curveType":"none", "dataOpacity":1, "focusTarget":"datum", "interpolateNulls":false, "orientation":"horizontal", "reverseCategories":false, "selectionMode":"single"};', $js); } } diff --git a/Tests/GoogleCharts/EventsTest.php b/Tests/GoogleCharts/EventsTest.php index 6d7db3a..0059664 100644 --- a/Tests/GoogleCharts/EventsTest.php +++ b/Tests/GoogleCharts/EventsTest.php @@ -2,35 +2,35 @@ namespace CMEN\GoogleChartsBundle\Tests\GoogleCharts; +use CMEN\GoogleChartsBundle\Exception\GoogleChartsException; use CMEN\GoogleChartsBundle\GoogleCharts\Charts\ComboChart; use CMEN\GoogleChartsBundle\GoogleCharts\Charts\Map; use CMEN\GoogleChartsBundle\GoogleCharts\Charts\TreeMapChart; use CMEN\GoogleChartsBundle\GoogleCharts\Events; use CMEN\GoogleChartsBundle\GoogleCharts\EventType; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class EventsTest extends \PHPUnit_Framework_TestCase +class EventsTest extends TestCase { - /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage badEventType event is not available for this type of chart. - */ public function testAddListenerWithBadEventType() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('badEventType event is not available for this type of chart.'); + $map = new Map(); $events = new Events($map); $events->addListener('badEventType', 'functionName'); } - /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage regionClick event is not available for this type of chart. - */ public function testAddListenerWithEventTypeNotAvailableForTypeOfChart() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('regionClick event is not available for this type of chart.'); + $comboChart = new ComboChart(); $events = new Events($comboChart); diff --git a/Tests/GoogleCharts/ListenerTest.php b/Tests/GoogleCharts/ListenerTest.php index d0d5995..3eeb013 100644 --- a/Tests/GoogleCharts/ListenerTest.php +++ b/Tests/GoogleCharts/ListenerTest.php @@ -2,20 +2,21 @@ namespace CMEN\GoogleChartsBundle\Tests\GoogleCharts; +use CMEN\GoogleChartsBundle\Exception\GoogleChartsException; use CMEN\GoogleChartsBundle\GoogleCharts\EventType; use CMEN\GoogleChartsBundle\GoogleCharts\Listener; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class ListenerTest extends \PHPUnit_Framework_TestCase +class ListenerTest extends TestCase { - /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage badType is not a valid type of event. - */ public function testBadType() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('badType is not a valid type of event.'); + new Listener('badType', 'functionName'); } diff --git a/Tests/GoogleCharts/Options/AnnotationChart/AnnotationChartOptionsTest.php b/Tests/GoogleCharts/Options/AnnotationChart/AnnotationChartOptionsTest.php index 5bcc31a..ccd64e7 100644 --- a/Tests/GoogleCharts/Options/AnnotationChart/AnnotationChartOptionsTest.php +++ b/Tests/GoogleCharts/Options/AnnotationChart/AnnotationChartOptionsTest.php @@ -3,11 +3,12 @@ namespace CMEN\GoogleChartsBundle\Tests\GoogleCharts\Options\AnnotationChart; use CMEN\GoogleChartsBundle\GoogleCharts\Options\AnnotationChart\AnnotationChartOptions; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class AnnotationChartOptionsTest extends \PHPUnit_Framework_TestCase +class AnnotationChartOptionsTest extends TestCase { public function testNumberOptions() { diff --git a/Tests/GoogleCharts/Options/ColumnChart/ColumnChartOptionsTest.php b/Tests/GoogleCharts/Options/ColumnChart/ColumnChartOptionsTest.php index 1fc06c8..0790a55 100644 --- a/Tests/GoogleCharts/Options/ColumnChart/ColumnChartOptionsTest.php +++ b/Tests/GoogleCharts/Options/ColumnChart/ColumnChartOptionsTest.php @@ -3,11 +3,12 @@ namespace CMEN\GoogleChartsBundle\Tests\GoogleCharts\Options\ColumnChart; use CMEN\GoogleChartsBundle\GoogleCharts\Options\ColumnChart\ColumnChartOptions; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class ColumnChartOptionsTest extends \PHPUnit_Framework_TestCase +class ColumnChartOptionsTest extends TestCase { public function testNumberOptions() { diff --git a/Tests/GoogleCharts/Options/GanttChart/GanttChartOptionsTest.php b/Tests/GoogleCharts/Options/GanttChart/GanttChartOptionsTest.php index 97479fa..d376ae3 100644 --- a/Tests/GoogleCharts/Options/GanttChart/GanttChartOptionsTest.php +++ b/Tests/GoogleCharts/Options/GanttChart/GanttChartOptionsTest.php @@ -3,11 +3,12 @@ namespace CMEN\GoogleChartsBundle\Tests\GoogleCharts\Options\GanttChart; use CMEN\GoogleChartsBundle\GoogleCharts\Options\GanttChart\GanttChartOptions; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class GanttChartOptionsTest extends \PHPUnit_Framework_TestCase +class GanttChartOptionsTest extends TestCase { public function testNumberOptions() { diff --git a/Tests/GoogleCharts/Options/LineChart/LineChartOptionsTest.php b/Tests/GoogleCharts/Options/LineChart/LineChartOptionsTest.php index d77fb7a..756077e 100644 --- a/Tests/GoogleCharts/Options/LineChart/LineChartOptionsTest.php +++ b/Tests/GoogleCharts/Options/LineChart/LineChartOptionsTest.php @@ -3,11 +3,12 @@ namespace CMEN\GoogleChartsBundle\Tests\GoogleCharts\Options\LineChart; use CMEN\GoogleChartsBundle\GoogleCharts\Options\LineChart\LineChartOptions; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class LineChartOptionsTest extends \PHPUnit_Framework_TestCase +class LineChartOptionsTest extends TestCase { public function testNumberOptions() { diff --git a/Tests/Output/Javascript/ChartOutputTest.php b/Tests/Output/Javascript/ChartOutputTest.php index 994b47d..6fefd01 100644 --- a/Tests/Output/Javascript/ChartOutputTest.php +++ b/Tests/Output/Javascript/ChartOutputTest.php @@ -2,17 +2,19 @@ namespace CMEN\GoogleChartsBundle\Tests\Output\Javascript; +use CMEN\GoogleChartsBundle\Exception\GoogleChartsException; use CMEN\GoogleChartsBundle\GoogleCharts\Charts\ColumnChart; use CMEN\GoogleChartsBundle\Output\ChartOutputInterface; use CMEN\GoogleChartsBundle\Output\DataOutputInterface; use CMEN\GoogleChartsBundle\Output\EventsOutputInterface; use CMEN\GoogleChartsBundle\Output\Javascript\ChartOutput; use CMEN\GoogleChartsBundle\Output\OptionsOutputInterface; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class ChartOutputTest extends \PHPUnit_Framework_TestCase +class ChartOutputTest extends TestCase { /** @var ChartOutputInterface */ private $chartOutput; @@ -26,18 +28,17 @@ protected function setUp() $dataOutput = $this->createMock(DataOutputInterface::class); $eventsOutput = $this->createMock(EventsOutputInterface::class); - /* @noinspection PhpParamsInspection */ $this->chartOutput = new ChartOutput('current', 'en', $optionsOutput, $dataOutput, $eventsOutput); } /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage Container is not defined. - * - * @throws \CMEN\GoogleChartsBundle\Exception\GoogleChartsException + * @throws GoogleChartsException */ public function testContainerIsNotDefined() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('Container is not defined.'); + $chart = new ColumnChart(); $chart->getOptions()->setTitle('title'); $chart->getData()->setArrayToDataTable([ @@ -58,25 +59,25 @@ public function testContainerIsNotDefined() } /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage An instance of Chart or an array of Chart is expected. - * - * @throws \CMEN\GoogleChartsBundle\Exception\GoogleChartsException + * @throws GoogleChartsException */ public function testParamChartsBadType() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('An instance of Chart or an array of Chart is expected.'); + /* @noinspection PhpParamsInspection */ $this->chartOutput->startCharts('xxxx'); } /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage An array of Chart is expected. - * - * @throws \CMEN\GoogleChartsBundle\Exception\GoogleChartsException + * @throws GoogleChartsException */ public function testParamChartsBadTypeForMultipleCharts() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('An array of Chart is expected.'); + $charts = [new ColumnChart(), new ColumnChart(), 'xxx']; $elementsID = ['div1', 'div2', 'div3']; @@ -84,24 +85,24 @@ public function testParamChartsBadTypeForMultipleCharts() } /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage A string is expected for HTML element ID. - * - * @throws \CMEN\GoogleChartsBundle\Exception\GoogleChartsException + * @throws GoogleChartsException */ public function testParamElementsIDBadTypeForOneChart() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('A string is expected for HTML element ID.'); + $this->chartOutput->startCharts(new ColumnChart(), 66); } /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage A string is expected for HTML element ID. - * - * @throws \CMEN\GoogleChartsBundle\Exception\GoogleChartsException + * @throws GoogleChartsException */ public function testParamElementsIDBadTypeForMultipleCharts() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('A string is expected for HTML element ID.'); + $charts = [new ColumnChart(), new ColumnChart(), new ColumnChart()]; $elementsID = ['div1', 123, 'div3']; @@ -109,13 +110,13 @@ public function testParamElementsIDBadTypeForMultipleCharts() } /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage An array of string is expected for HTML elements IDs. - * - * @throws \CMEN\GoogleChartsBundle\Exception\GoogleChartsException + * @throws GoogleChartsException */ public function testParamElementsIDNotArrayForMultipleCharts() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('An array of string is expected for HTML elements IDs.'); + $charts = [new ColumnChart(), new ColumnChart(), new ColumnChart()]; $elementsID = 'div1'; @@ -123,13 +124,13 @@ public function testParamElementsIDNotArrayForMultipleCharts() } /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage Array charts and array HTML elements ID do not have the same number of element. - * - * @throws \CMEN\GoogleChartsBundle\Exception\GoogleChartsException + * @throws GoogleChartsException */ public function testParamElementsIDBadCountForMultipleCharts() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('Array charts and array HTML elements ID do not have the same number of element.'); + $charts = [new ColumnChart(), new ColumnChart(), new ColumnChart()]; $elementsID = ['div1', 'div2']; diff --git a/Tests/Output/Javascript/DataOutputTest.php b/Tests/Output/Javascript/DataOutputTest.php index ba8f03e..9140455 100644 --- a/Tests/Output/Javascript/DataOutputTest.php +++ b/Tests/Output/Javascript/DataOutputTest.php @@ -2,23 +2,25 @@ namespace CMEN\GoogleChartsBundle\Tests\Output\Javascript; +use CMEN\GoogleChartsBundle\Exception\GoogleChartsException; use CMEN\GoogleChartsBundle\GoogleCharts\Data; use CMEN\GoogleChartsBundle\Output\Javascript\DataOutput; use CMEN\GoogleChartsBundle\Output\Javascript\DateOutput; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class DataOutputTest extends \PHPUnit_Framework_TestCase +class DataOutputTest extends TestCase { /** - * @expectedException \CMEN\GoogleChartsBundle\Exception\GoogleChartsException - * @expectedExceptionMessage There is no data for chart. Use method setArrayToDataTable() to provide data. - * - * @throws \CMEN\GoogleChartsBundle\Exception\GoogleChartsException + * @throws GoogleChartsException */ public function testEmptyData() { + $this->expectException(GoogleChartsException::class); + $this->expectExceptionMessage('There is no data for chart. Use method setArrayToDataTable() to provide data.'); + $data = new Data(); $dataOutput = new DataOutput(new DateOutput()); diff --git a/Tests/Output/Javascript/DateOutputTest.php b/Tests/Output/Javascript/DateOutputTest.php index f86242b..0ea5fa2 100644 --- a/Tests/Output/Javascript/DateOutputTest.php +++ b/Tests/Output/Javascript/DateOutputTest.php @@ -3,11 +3,12 @@ namespace CMEN\GoogleChartsBundle\Tests\Output\Javascript; use CMEN\GoogleChartsBundle\Output\Javascript\DateOutput; +use PHPUnit\Framework\TestCase; /** * @author Christophe Meneses */ -class DateOutputTest extends \PHPUnit_Framework_TestCase +class DateOutputTest extends TestCase { public function testDraw() { diff --git a/Twig/GoogleChartsExtension.php b/Twig/GoogleChartsExtension.php index 94a23c7..f742ea1 100644 --- a/Twig/GoogleChartsExtension.php +++ b/Twig/GoogleChartsExtension.php @@ -38,11 +38,9 @@ public function getFunctions() * @param Chart|Chart[] $charts Chart instance or array of Chart instance * @param string|string[]|null $elementsID HTML element ID or array of HTML elements IDs. Can be null * - * @return string - * * @throws GoogleChartsException */ - public function gcStart($charts, $elementsID = null) + public function gcStart($charts, $elementsID = null): string { return $this->chartOutput->startCharts($charts, $elementsID); } @@ -52,11 +50,9 @@ public function gcStart($charts, $elementsID = null) * * @param Chart|Chart[] $charts Chart instance or array of Chart instance * - * @return string - * * @throws GoogleChartsException */ - public function gcEnd($charts) + public function gcEnd($charts): string { return $this->chartOutput->endCharts($charts); } @@ -67,25 +63,17 @@ public function gcEnd($charts) * @param Chart|Chart[] $charts Chart instance or array of Chart instance * @param string|string[]|null $elementsID HTML element ID or array of HTML elements IDs. Can be null * - * @return string - * * @throws GoogleChartsException */ - public function gcDraw($charts, $elementsID = null) + public function gcDraw($charts, $elementsID = null): string { return $this->chartOutput->fullCharts($charts, $elementsID); } /** * Add an event to a chart. - * - * @param Chart $chart A Chart instance - * @param string $type Type of event - * @param string $functionName Name of Javascript function - * - * @return void */ - public function gcEvent(Chart $chart, $type, $functionName) + public function gcEvent(Chart $chart, string $type, string $functionName): void { $chart->getEvents()->addListener($type, $functionName); } @@ -94,12 +82,8 @@ public function gcEvent(Chart $chart, $type, $functionName) * Set the locale. Must be called before drawing charts. * * @see https://developers.google.com/chart/interactive/docs/basic_load_libs#loadwithlocale - * - * @param string $language Locale, for example : "fr" - * - * @return void */ - public function gcLanguage($language) + public function gcLanguage(string $language): void { $this->chartOutput->setLanguage($language); } diff --git a/composer.json b/composer.json index cb6e65a..d8c3151 100644 --- a/composer.json +++ b/composer.json @@ -10,15 +10,15 @@ } ], "require": { - "php": "^5.6 || ^7.0", + "php": ">=7.1.3", "ext-json": "*", - "symfony/framework-bundle": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "twig/twig": "^1.42 || ^2.12 || ^3.0" + "symfony/framework-bundle": "^4.0 || ^5.0", + "twig/twig": "^1.41 || ^2.10 || ^3.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.16", - "phpstan/phpstan": "^0.12.0", - "phpunit/phpunit": "^5.7" + "phpstan/phpstan": "^0.12.55", + "phpunit/phpunit": "^7.5" }, "autoload": { "psr-4": { "CMEN\\GoogleChartsBundle\\": "" }