Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
Php 8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoc72 committed Dec 22, 2020
1 parent 071c400 commit 23847e1
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/coverage_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
php-version: 7.4
extensions: mbstring, dom, json, libxml, xml, xmlwriter
coverage: xdebug
- name: Install dependencies
Expand All @@ -24,4 +24,3 @@ jobs:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: "composer coverage:clover"

4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
php-version: 7.4
extensions: mbstring, dom, json, libxml, xml, xmlwriter
coverage: none
- name: Download phpDocumentor
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.2', '7.3', '7.4']
php-versions: ['7.2', '7.3', '7.4', '8.0']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Set autocrlf on windows
Expand All @@ -34,5 +34,7 @@ jobs:
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
- name: Check coding standanrd
run: composer cs
env:
PHP_CS_FIXER_IGNORE_ENV: 1
- name: Test with phpunit
run: composer test
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
},
"require-dev" : {
"phpunit/phpunit": "^8.3",
"vimeo/psalm": "^3.8",
"susina/coding-standard": "^1.0"
"susina/coding-standard": "^1.0",
"psalm/phar": "^4.3"
},
"scripts": {
"analytics": "psalm",
"analytics": "vendor/bin/psalm.phar",
"check": [
"@test",
"@analytics",
Expand Down
1 change: 0 additions & 1 deletion psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<MissingReturnType errorLevel="info" />
<MissingPropertyType errorLevel="info" />
<InvalidDocblock errorLevel="info" />
<MisplacedRequiredParam errorLevel="info" />

<PropertyNotSetInConstructor errorLevel="info" />
<MissingConstructor errorLevel="info" />
Expand Down
2 changes: 0 additions & 2 deletions src/Config/GeneratorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ class GeneratorConfig

/**
* Creates a new configuration for code generator.
*
* @param array $options
*/
public function __construct(?array $options = null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Generator/Builder/AbstractBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ protected function generate(AbstractModel $model): void

protected function ensureBlankLine(): void
{
if (!$this->writer->endsWith("\n\n") && (strlen($this->writer->rtrim()->getContent()) > 0) &&
!$this->writer->endsWith("{\n")) {
if (!$this->writer->endsWith("\n\n") && (strlen($this->writer->rtrim()->getContent()) > 0)
&& !$this->writer->endsWith("{\n")) {
$this->writer->writeln();
}
}
Expand Down

0 comments on commit 23847e1

Please sign in to comment.