Skip to content

Commit

Permalink
Fixing errors and such so Actions runs work (#2)
Browse files Browse the repository at this point in the history
* removing prefer-lowest for now, removing php 8 function for preg errors

* fixing phpstan error for php 8, adding php 7.1 to mix to see if we can keep that minimum

* removing php 7.1 from matrix and bumping minimum to 7.2

* bumping actions/cache version

* fixing wrong URL in badges
  • Loading branch information
jaydiablo authored Apr 16, 2021
1 parent 7fbec32 commit 49483db
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2', '7.3', '7.4', '8.0']
composer-args: ['', '--prefer-lowest']
composer-args: ['']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
Expand All @@ -29,7 +29,7 @@ jobs:
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2.1.4
uses: actions/cache@v2.1.5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php${{ matrix.php-versions }}-composer-${{ matrix.composer-args }}-${{ hashFiles('**/composer.json') }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Doctrine1 Bundle

[![Build](https://github.com/diablomedia/zf1-acl/workflows/Build/badge.svg?event=push)](https://github.com/diablomedia/zf1-acl/actions?query=workflow%3ABuild+event%3Apush)
[![Build](https://github.com/diablomedia/doctrine1-bundle/workflows/Build/badge.svg?event=push)](https://github.com/diablomedia/doctrine1-bundle/actions?query=workflow%3ABuild+event%3Apush)
[![Latest Stable Version](https://poser.pugx.org/diablomedia/doctrine1-bundle/v/stable)](https://packagist.org/packages/diablomedia/doctrine1-bundle)
[![Total Downloads](https://poser.pugx.org/diablomedia/doctrine1-bundle/downloads)](https://packagist.org/packages/diablomedia/doctrine1-bundle)
[![License](https://poser.pugx.org/diablomedia/doctrine1-bundle/license)](https://packagist.org/packages/diablomedia/doctrine1-bundle)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.1 || ^8.0",
"php": "^7.2 || ^8.0",
"doctrine/doctrine1": "^1.2.0",
"jdorn/sql-formatter": "^1.2.16",
"symfony/cache": "^4.3.3|^5.0",
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ parameters:
count: 1
path: src/DependencyInjection/Configuration.php

-
message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, array\\<Symfony\\\\Component\\\\VarDumper\\\\Cloner\\\\Data\\>\\|bool\\|float\\|int\\|string\\|null given\\.$#"
count: 4
path: src/Twig/Doctrine1Extension.php

-
message: "#^Strict comparison using \\=\\=\\= between string and false will always evaluate to false\\.$#"
count: 1
Expand Down
7 changes: 6 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ parameters:
level: 8
paths:
- src
ignoreErrors:
-
message: "#^Parameter \\#2 \\$(search|array) of function array_key_exists expects array, array\\<Symfony\\\\Component\\\\VarDumper\\\\Cloner\\\\Data\\>\\|bool\\|float\\|int\\|string\\|null given\\.$#"
count: 4
path: src/Twig/Doctrine1Extension.php
includes:
- phpstan-baseline.neon
- phpstan-baseline.neon
6 changes: 3 additions & 3 deletions src/Twig/Doctrine1Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ public function formatQuery(string $sql, bool $highlightOnly = false): string
$html = SqlFormatter::highlight($sql);
$html = preg_replace('/<pre class=".*">([^"]*+)<\/pre>/Us', '\1', $html);
if ($html === null) {
throw new \RuntimeException('Error replacing: ' . preg_last_error_msg());
throw new \RuntimeException('Error in preg_replace call');
}
} else {
$html = SqlFormatter::format($sql);
$html = preg_replace('/<pre class="(.*)">([^"]*+)<\/pre>/Us', '<div class="\1"><pre>\2</pre></div>', $html);
if ($html === null) {
throw new \RuntimeException('Error replacing: ' . preg_last_error_msg());
throw new \RuntimeException('Error in preg_replace call');
}
}

Expand Down Expand Up @@ -172,7 +172,7 @@ static function (array $matches) use ($parameters, &$i): string {
);

if ($query === null) {
throw new \RuntimeException('Error replacing: ' . preg_last_error_msg());
throw new \RuntimeException('Error in preg_replace_callback call');
}

return $query;
Expand Down

0 comments on commit 49483db

Please sign in to comment.