Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
🎨 travis, phpunit, php-cs-fixer
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Meilick <[email protected]>
  • Loading branch information
bnomei committed May 16, 2021
1 parent ac1336a commit a69b7aa
Show file tree
Hide file tree
Showing 30 changed files with 3,833 additions and 4,617 deletions.
11 changes: 8 additions & 3 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<?php


$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('content')
->exclude('kirby')
->exclude('node_modules')
//->exclude('site/plugins')
->exclude('src')
->exclude('vendor')
->in(__DIR__)
;

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
])
->setFinder($finder)
;
;
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: php
php: 7.2
php: 7.3
matrix:
fast_finish: true
install: composer install --no-interaction
Expand Down
2 changes: 1 addition & 1 deletion classes/Bnomei/Srcset.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function imageKirbytagFromData(array $data = []): string
$text = kirby()->kirbytags($text, $data);
if (!A::get($data, 'figure')) {
// <figure> </figure> and <figure class="" ...> </figure>
$text = preg_replace('/<(\/?)(figure[^>]*)>/', '', $text);
$text = preg_replace('/<(\/?)(figure[^>]*)>/', '', $text);
}
return $text;
}
Expand Down
10 changes: 6 additions & 4 deletions classes/Kirby/Editor/SrcsetBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
use Throwable;

$foundEditor = false;
foreach([realpath(__DIR__ . '/../../../../'), realpath(__DIR__ . '/../../../tests/site/plugins/')] as $dir) {
if (is_dir( $dir . '/editor')) {
foreach(['Block', 'Blocks'] as $lib) {
foreach ([realpath(__DIR__ . '/../../../../'), realpath(__DIR__ . '/../../../tests/site/plugins/')] as $dir) {
if (is_dir($dir . '/editor')) {
foreach (['Block', 'Blocks'] as $lib) {
if (! class_exists("Kirby\Editor\{$lib}")) {
load([
"Kirby\\Editor\\{$lib}" => $dir . "/editor/lib/{$lib}.php",
Expand All @@ -20,7 +20,9 @@
}

if (! $foundEditor) {
class Block {}
class Block
{
}
}

// TODO: no coverage since no real tests
Expand Down
11 changes: 5 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bnomei/kirby3-srcset",
"type": "kirby-plugin",
"version": "3.3.11",
"version": "3.3.12",
"license": "MIT",
"description": "Kirby 3 Plugin for creating lazyloading image srcset",
"authors": [
Expand Down Expand Up @@ -41,20 +41,19 @@
},
"require": {
"php": ">=7.2.0",
"getkirby/composer-installer": "^1.1"
"getkirby/composer-installer": "^1.2"
},
"require-dev": {
"phpunit/phpunit": "^8.3",
"getkirby/cms": "^3.2",
"getkirby/cms": "^3.5",
"php-coveralls/php-coveralls": "^2.1",
"nunomaduro/phpinsights": "^1.8"
"phpunit/phpunit": "^9.5"
},
"scripts": {
"analyze": "phpstan analyse classes",
"insights": "./vendor/bin/phpinsights -v",
"fix": "php-cs-fixer fix",
"test": [
"mkdir -p tests/logs",
"@putenv XDEBUG_MODE=coverage",
"phpunit --configuration ./phpunit.xml"
],
"dist": [
Expand Down
Loading

0 comments on commit a69b7aa

Please sign in to comment.