diff --git a/.scrutinizer.yml b/.scrutinizer.yml index d884d92..abc494b 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -8,7 +8,7 @@ build: postgresql: false redis: false rabbitmq: false - php: 7.1 + php: 7.3 tests: override: ['php-scrutinizer-run'] @@ -22,7 +22,7 @@ filter: # but treated as a dependency tools: - external_code_coverage: + external_code_coverage: timeout: 180 checks: diff --git a/.travis.yml b/.travis.yml index 76c40b2..6c54a50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +dist: focal language: php cache: @@ -35,7 +36,13 @@ jobs: include: - stage: Tests - php: 7.3 + php: 8 + env: COMPOSER_ARGS=--ignore-platform-reqs REMOVE_QA=yes + script: + - ./vendor/bin/phpunit --testsuite unit -v -c .travis/phpunit.xml + + - stage: Tests + php: 7.4 env: XDEBUG=yes INSTALL_FFMPEG=yes REMOVE_QA=yes script: - ./vendor/bin/phpunit -v -c .travis/phpunit.xml --coverage-clover=coverage.xml @@ -43,6 +50,12 @@ jobs: - php ocular.phar code-coverage:upload --format=php-clover coverage.xml - bash <(curl -s https://codecov.io/bash) + - stage: Tests + php: 7.3 + env: XDEBUG=false INSTALL_FFMPEG=yes REMOVE_QA=yes + script: + - ./vendor/bin/phpunit -v -c .travis/phpunit.xml --coverage-clover=coverage.xml + - stage: Tests php: 7.2 env: INSTALL_FFMPEG=yes DEPS=lowest REMOVE_QA=yes diff --git a/captainhook.json b/captainhook.json index d88b054..439698c 100644 --- a/captainhook.json +++ b/captainhook.json @@ -22,7 +22,7 @@ "enabled": true, "actions": [ { - "action": "composer cs-fix && composer phpstan", + "action": "composer cs-fix", "options": [] } ] diff --git a/composer.json b/composer.json index f56b2cb..a07b9a1 100644 --- a/composer.json +++ b/composer.json @@ -26,39 +26,39 @@ "bin/mediatools-cli.php" ], "require": { - "php": "^7.1", + "php": "^7.1 || ^8.0", "ext-json": "*", "ext-pcre": "*", "psr/container": "^1.0", "psr/http-message": "^1.0.1", "psr/log": "^1.0", "monolog/monolog": "^1.23", - "scriptfusion/byte-formatter": "^3.2", - "soluble/mediatools": "^2.0", - "symfony/console": "^4.3", + "scriptfusion/byte-formatter": "^3.3.0", + "soluble/mediatools": "^2.1", + "symfony/console": "^4.3 || ^v5.2.1", "symfony/cache": "^4.3", "symfony/finder": "^4.3", - "symfony/polyfill-mbstring": "^1.9", + "symfony/polyfill-mbstring": "^1.18", "zendframework/zend-servicemanager": "^3.4" }, "require-dev" : { "bamarni/composer-bin-plugin": "^1.2", - "captainhook/plugin-composer": "^4.0", + "captainhook/plugin-composer": "^5.2.3", "consistence/coding-standard": "^3.8", "fig/http-message-util": "^1.1.2", "friendsofphp/php-cs-fixer": "^2.14.2", "infection/infection": "^0.12", "mikey179/vfsstream": "^1.6", - "phpstan/phpstan": "^0.11.4", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpstan/phpstan-symfony": "^0.11.5", - "phpstan/phpstan-webmozart-assert": "^0.11.0", + "phpstan/phpstan": "^0.12.64", + "phpstan/phpstan-phpunit": "^0.12.17", + "phpstan/phpstan-strict-rules": "^0.12.7", + "phpstan/phpstan-symfony": "^0.11.6 || ^0.12.12", + "phpstan/phpstan-webmozart-assert": "^0.12.8", "phpunit/phpunit": "^7.5 || ^8.0", "roave/security-advisories": "dev-master", - "slevomat/coding-standard": "^5.0", + "slevomat/coding-standard": "^6.4.1", "squizlabs/php_codesniffer": "^3.4", - "vimeo/psalm": "^3.2.10" + "vimeo/psalm": "^3.15" }, "config": { "optimize-autoloader": true, diff --git a/mkdocs.yml b/mkdocs.yml index 9e0468b..672b786 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -28,15 +28,14 @@ theme: font: text: 'Lato' code: 'Roboto Mono' - logo: - icon: 'play_circle_outline' + logo: logo feature: tabs: false # Customization extra: social: - - type: 'github' + - icon: fontawesome/brands/github link: 'https://github.com/soluble-io/soluble-mediatools-cli' extra_css: @@ -50,26 +49,42 @@ extra_css: # Extensions markdown_extensions: - - markdown.extensions.admonition - - markdown.extensions.codehilite: - guess_lang: false - - markdown.extensions.def_list - - markdown.extensions.footnotes - - markdown.extensions.meta - - markdown.extensions.toc: + - admonition + - abbr + - attr_list + - def_list + - footnotes + - meta + - md_in_html + - toc: permalink: true - - pymdownx.arithmatex - - pymdownx.betterem -# smart_enable: all + - pymdownx.arithmatex: + generic: true + - pymdownx.betterem: + smart_enable: all - pymdownx.caret - pymdownx.critic - pymdownx.details - pymdownx.emoji: - emoji_generator: !!python/name:pymdownx.emoji.to_svg + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg + - pymdownx.highlight - pymdownx.inlinehilite - - pymdownx.magiclink + - pymdownx.keys + - pymdownx.magiclink: + repo_url_shorthand: true + user: squidfunk + repo: mkdocs-material - pymdownx.mark - pymdownx.smartsymbols - - pymdownx.superfences - - pymdownx.tasklist + - pymdownx.snippets: + check_paths: true + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.tabbed + - pymdownx.tasklist: + custom_checkbox: true - pymdownx.tilde diff --git a/phpstan.neon b/phpstan.neon index 282d313..ba58c70 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -9,6 +9,8 @@ parameters: - php - dist reportUnmatchedIgnoredErrors: false + checkMissingIterableValueType: false + ignoreErrors: # Wrong case for phpstan diff --git a/requirements.txt b/requirements.txt index 3f53093..c0c1b40 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,10 @@ # # Dependencies for documentation # -mkdocs>=1 -Pygments>=2.2 -pymdown-extensions>=4.11 -mkdocs-material>=4 +mkdocs>=1.1 +Pygments>=2.4 +markdown>=3.2 +pymdown-extensions>=7.0 +mkdocs-material>=6.2 +mkdocs-material-extensions>=1.0 diff --git a/src/Cli/Command/ConvertDirCommand.php b/src/Cli/Command/ConvertDirCommand.php index 927d53b..b06ce5e 100644 --- a/src/Cli/Command/ConvertDirCommand.php +++ b/src/Cli/Command/ConvertDirCommand.php @@ -92,6 +92,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($input->getOption('output') !== null) { $outputDir = $input->getOption('output'); + Assert::string($outputDir); Assert::directory($outputDir); Assert::writable($outputDir); } else { diff --git a/src/Cli/Command/ScanCommand.php b/src/Cli/Command/ScanCommand.php index c4e320b..5dedc95 100644 --- a/src/Cli/Command/ScanCommand.php +++ b/src/Cli/Command/ScanCommand.php @@ -117,6 +117,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } + /** + * @param OutputInterface $output + * @param array $rows + * @param int $totalSize + * @param array $columns + */ public static function renderMediaInTable(OutputInterface $output, array $rows, int $totalSize, array $columns = []): void { $sizeFormatter = new ByteFormatter();