diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index d00c597..257a784 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -8,10 +8,10 @@ on:
jobs:
tests:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-16.04
strategy:
matrix:
- php: ['7.1', '7.2', '7.3', '7.4']
+ php: ['7.0', '7.1', '7.2', '7.3', '7.4']
name: PHP ${{ matrix.php }} tests
steps:
- uses: actions/checkout@v2
diff --git a/.idea/mc-google-visualization.iml b/.idea/mc-google-visualization.iml
index d2e6df0..2c56724 100644
--- a/.idea/mc-google-visualization.iml
+++ b/.idea/mc-google-visualization.iml
@@ -28,6 +28,7 @@
+
diff --git a/.idea/php.xml b/.idea/php.xml
index d89811f..c622d21 100644
--- a/.idea/php.xml
+++ b/.idea/php.xml
@@ -57,6 +57,7 @@
+
diff --git a/.php_cs b/.php_cs
index 0edcd51..0e24561 100644
--- a/.php_cs
+++ b/.php_cs
@@ -1,19 +1,41 @@
name('.php_cs')
->exclude('vendor')
->in(__DIR__)
;
-return PhpCsFixer\Config::create()
+return Config::create()
->setRules([
- '@PSR1' => true,
- '@PSR2' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
- 'array_syntax' => ['syntax' => 'short'],
- 'php_unit_test_class_requires_covers' => false,
+ '@DoctrineAnnotation' => true,
+ '@PHP70Migration:risky' => true,
+ '@PHPUnit75Migration:risky' => true,
+ 'backtick_to_shell_exec' => true,
+ 'blank_line_before_statement' => [
+ 'statements' => ['declare', 'return', 'case'],
+ ],
+ 'comment_to_phpdoc' => false,
+ 'declare_equal_normalize' => ['space' => 'single'],
+ 'doctrine_annotation_array_assignment' => ['operator' => '='],
+ 'doctrine_annotation_spaces' => [
+ 'after_array_assignments_equals' => false,
+ 'before_array_assignments_equals' => false
+ ],
+ 'final_static_access' => true,
+ 'global_namespace_import' => true,
+ 'linebreak_after_opening_tag' => true,
+ 'mb_str_functions' => true,
'native_function_invocation' => false,
+ 'no_unset_on_property' => false,
+ 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
+ 'phpdoc_to_comment' => false,
+ 'self_static_accessor' => true,
])
->setFinder($finder)
;
\ No newline at end of file
diff --git a/composer.json b/composer.json
index 92355a7..caefc1d 100644
--- a/composer.json
+++ b/composer.json
@@ -24,12 +24,14 @@
"require": {
"php": "^7.0",
"ext-json": "*",
- "ext-pdo": "*"
+ "ext-pdo": "*",
+ "symfony/polyfill-php74": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0|^7.0",
"phpstan/phpstan": "^0.9|^0.10|^0.11",
- "phpstan/phpstan-phpunit": "^0.9|^0.10|^0.11"
+ "phpstan/phpstan-phpunit": "^0.9|^0.10|^0.11",
+ "phpstan/phpstan-strict-rules": "^0.9|^0.10|^0.11"
},
"autoload": {
"psr-4": {
diff --git a/examples/callback_fields.php b/examples/callback_fields.php
index 307ba8f..1c2d287 100644
--- a/examples/callback_fields.php
+++ b/examples/callback_fields.php
@@ -2,13 +2,16 @@
/** @noinspection PhpUnhandledExceptionInspection */
+declare(strict_types = 1);
+
use MC\Google\Visualization;
require_once __DIR__.'/../vendor/autoload.php';
/**
* @param mixed $row
- * @return string|null
+ *
+ * @return null|string
*/
function most_common($row)
{
@@ -60,13 +63,13 @@ function most_common($row)