Skip to content

Commit 70fe33f

Browse files
authored
Merge branch 'master' into patch-1
2 parents cb1892c + f5198f5 commit 70fe33f

File tree

6 files changed

+383
-185
lines changed

6 files changed

+383
-185
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
github: mglaman # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
44
patreon: # Replace with a single Patreon username
5-
open_collective: # Replace with a single Open Collective username
5+
open_collective: phpstan-drupal
66
tidelift: "packagist/mglaman/drupal-check"
7-
ko_fi: mglaman
7+
ko_fi: #
88
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
99
liberapay: # Replace with a single Liberapay username
1010
issuehunt: # Replace with a single IssueHunt username

.github/workflows/php.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
tests:
11+
continue-on-error: ${{ matrix.experimental }}
12+
runs-on: "ubuntu-latest"
13+
name: "Tests | PHP ${{ matrix.php-version }} | Drupal ${{ matrix.drupal }}"
14+
strategy:
15+
matrix:
16+
experimental: [false]
17+
php-version:
18+
- "7.3"
19+
- "7.4"
20+
drupal:
21+
- "^8.9"
22+
- "^9.0"
23+
include:
24+
- php-version: "7.2"
25+
drupal: "~8.9"
26+
experimental: false
27+
- php-version: "8.0"
28+
drupal: "^9.0"
29+
experimental: true
30+
steps:
31+
- name: "Checkout"
32+
uses: "actions/checkout@v2"
33+
- name: "Install PHP"
34+
uses: "shivammathur/setup-php@v2"
35+
with:
36+
coverage: "none"
37+
php-version: "${{ matrix.php-version }}"
38+
tools: composer:v2
39+
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
40+
- name: Validate composer.json and composer.lock
41+
run: composer validate --strict
42+
- name: "Install dependencies"
43+
run: "composer install --no-progress --prefer-dist"
44+
- name: "PHPCS"
45+
run: "php vendor/bin/phpcs src"
46+
# - name: "PHPStan"
47+
# run: "php vendor/bin/phpstan analyze src"
48+
- name: Setup Drupal
49+
run: |
50+
COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:${{ matrix.drupal }} ~/drupal --no-interaction
51+
cd ~/drupal
52+
composer config minimum-stability dev
53+
composer config prefer-stable true
54+
composer config preferred-install dist
55+
composer config repositories.0 path $GITHUB_WORKSPACE
56+
composer config repositories.1 composer https://packages.drupal.org/8
57+
COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev:${{ matrix.drupal }} --with-all-dependencies
58+
- name: "Add phpspec/prophecy-phpunit"
59+
run: |
60+
cd ~/drupal
61+
COMPOSER_MEMORY_LIMIT=-1 composer require --dev phpspec/prophecy-phpunit:^2
62+
if: ${{ matrix.drupal == '^9.0' }}
63+
- name: "require drupal-check"
64+
run: |
65+
cd ~/drupal
66+
COMPOSER_MEMORY_LIMIT=-1 composer require mglaman/drupal-check *@dev
67+
- name: "Analyze core/install.php"
68+
run: |
69+
cd ~/drupal
70+
./vendor/bin/drupal-check web/core/install.php
71+
- name: "Analyze dynamic_page_cache"
72+
run: |
73+
cd ~/drupal
74+
./vendor/bin/drupal-check web/core/modules/dynamic_page_cache || if (($? == 255)); then false; else true; fi

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
# drupal-check [![Build Status](https://travis-ci.com/mglaman/drupal-check.svg?branch=master)](https://travis-ci.com/mglaman/drupal-check) [![CircleCI](https://circleci.com/gh/mglaman/drupal-check.svg?style=svg)](https://circleci.com/gh/mglaman/drupal-check) [![Latest release](https://img.shields.io/github/release/mglaman/drupal-check.svg)](https://github.com/mglaman/drupal-check/releases/latest)
1+
# drupal-check [![Build](https://github.com/mglaman/drupal-check/actions/workflows/php.yml/badge.svg)](https://github.com/mglaman/drupal-check/actions/workflows/php.yml) [![CircleCI](https://circleci.com/gh/mglaman/drupal-check.svg?style=svg)](https://circleci.com/gh/mglaman/drupal-check) [![Latest release](https://img.shields.io/github/release/mglaman/drupal-check.svg)](https://github.com/mglaman/drupal-check/releases/latest)
22

33
Built on [PHPStan](https://github.com/phpstan/phpstan), this static analysis tool will check for correctness (e.g. using a class that doesn't exist), deprecation errors, and more.
44

55
Why? While there are many static analysis tools out there, none of them run with the Drupal context in mind. This allows checking contrib modules for deprecation errors thrown by core.
66

77
Are you ready for Drupal 9? Check out our [Drupal 9 Readiness](https://github.com/mglaman/drupal-check/wiki/Drupal-9-Readiness) instructions for details on how this tool can help.
88

9+
## Sponsors
10+
11+
<a href="https://www.undpaul.de/"><img src="https://www.undpaul.de/themes/custom/undpaul3/logo.svg" alt="undpaul" width="250" /></a> <a href="https://www.intracto.com/"><img src="https://digidak.be/wp-content/uploads/2020/03/logo-intracto-base-positief-grijs-blauw@4x-rgb.png" alt="Intracto" width="225" /></a>
12+
13+
[Would you like to sponsor?](https://github.com/sponsors/mglaman)
14+
915
## Requirements
1016

1117
* PHP >=7.2

composer.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,26 @@
1010
}
1111
],
1212
"require": {
13-
"php": "~7.2",
13+
"php": "^7.2.5|^8.0",
1414
"composer/xdebug-handler": "^1.3",
1515
"jean85/pretty-package-versions": "^1.5.0 || ^2.0.1",
16-
"mglaman/phpstan-drupal": "^0.12.4",
16+
"mglaman/phpstan-drupal": "^0.12.8",
1717
"nette/neon": "^3.1",
18-
"phpstan/phpstan": "^0.12.26",
19-
"phpstan/phpstan-deprecation-rules": "^0.12",
2018
"symfony/console": "~3.2 || ~4.0",
2119
"symfony/process": "~3.2 || ~4.0",
2220
"webflo/drupal-finder": "^1.1"
2321
},
2422
"require-dev": {
23+
"phpstan/phpstan": "^0.12.81",
24+
"phpstan/phpstan-deprecation-rules": "^0.12.6",
25+
"phpstan/phpstan-strict-rules": "^0.12.9",
2526
"squizlabs/php_codesniffer": "^3.4"
2627
},
2728
"config": {
28-
"sort-packages": true
29+
"sort-packages": true,
30+
"platform": {
31+
"php": "7.2.5"
32+
}
2933
},
3034
"bin": [
3135
"drupal-check"
@@ -34,5 +38,10 @@
3438
"psr-4": {
3539
"DrupalCheck\\": "src"
3640
}
41+
},
42+
"extra": {
43+
"violinist": {
44+
"one_pull_request_per_package": 1
45+
}
3746
}
3847
}

0 commit comments

Comments
 (0)