Skip to content

Commit

Permalink
Issue #3219325 by fgm, klelostec: support missing file info on functi…
Browse files Browse the repository at this point in the history
…ons.

- Also fix KV changes in D9.
- Also fix various D9.2 changes
- PHP 8 support
  • Loading branch information
fgm committed Jul 8, 2021
1 parent 40a495f commit 2639f99
Show file tree
Hide file tree
Showing 21 changed files with 389 additions and 166 deletions.
250 changes: 170 additions & 80 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,176 @@
filter:
paths:
- modules/mongodb/*
- modules/mongodb_watchdog/*
- example.settings.local.php
excluded_paths:
- '*.html.twig'
paths:
- modules/mongodb/*
- modules/mongodb_watchdog/*
- example.settings.local.php
excluded_paths:
- '*.html.twig'
checks:
php:
code_rating: true
duplication: true
fix_php_opening_tag: true
remove_php_closing_tag: true
one_class_per_file: true
side_effects_or_types: true
no_mixed_inline_html: true
require_braces_around_control_structures: true
php5_style_constructor: true
no_global_keyword: false
avoid_usage_of_logical_operators: true
psr2_class_declaration: false
no_underscore_prefix_in_properties: true
no_underscore_prefix_in_methods: true
blank_line_after_namespace_declaration: true
single_namespace_per_use: true
psr2_switch_declaration: false
psr2_control_structure_declaration: false
avoid_superglobals: false
security_vulnerabilities: true
no_exit: true
use_self_instead_of_fqcn: true
uppercase_constants: true
simplify_boolean_return: true
return_doc_comments: true
return_doc_comment_if_not_inferrable: true
remove_extra_empty_lines: true
properties_in_camelcaps: true
prefer_while_loop_over_for_loop: true
parameter_doc_comments: true
param_doc_comment_if_not_inferrable: true
optional_parameters_at_the_end: true
no_short_variable_names:
minimum: '3'
no_short_method_names:
minimum: ''
no_new_line_at_end_of_file: false
no_long_variable_names:
maximum: '20'
no_goto: true
newline_at_end_of_file: true
more_specific_types_in_doc_comments: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_line_ending: true
encourage_single_quotes: true
encourage_postdec_operator: true
coding_standard:
name: Drupal
classes_in_camel_caps: true
avoid_unnecessary_concatenation: true
avoid_perl_style_comments: true
avoid_multiple_statements_on_same_line: true
align_assignments: true
javascript: { }
php:
code_rating: true
duplication: true
fix_php_opening_tag: true
remove_php_closing_tag: true
one_class_per_file: true
side_effects_or_types: true
no_mixed_inline_html: true
require_braces_around_control_structures: true
php5_style_constructor: true
no_global_keyword: false
avoid_usage_of_logical_operators: true
psr2_class_declaration: false
no_underscore_prefix_in_properties: true
no_underscore_prefix_in_methods: true
blank_line_after_namespace_declaration: true
single_namespace_per_use: true
psr2_switch_declaration: false
psr2_control_structure_declaration: false
avoid_superglobals: false
security_vulnerabilities: true
no_exit: true
use_self_instead_of_fqcn: true
uppercase_constants: true
simplify_boolean_return: true
return_doc_comments: true
return_doc_comment_if_not_inferrable: true
remove_extra_empty_lines: true
properties_in_camelcaps: true
prefer_while_loop_over_for_loop: true
parameter_doc_comments: true
param_doc_comment_if_not_inferrable: true
optional_parameters_at_the_end: true
no_short_variable_names:
minimum: '3'
no_short_method_names:
minimum: ''
no_new_line_at_end_of_file: false
no_long_variable_names:
maximum: '20'
no_goto: true
newline_at_end_of_file: true
more_specific_types_in_doc_comments: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_line_ending: true
parameters_in_camelcaps: true
encourage_single_quotes: true
encourage_postdec_operator: true
coding_standard:
name: Drupal
classes_in_camel_caps: true
avoid_unnecessary_concatenation: true
avoid_perl_style_comments: true
avoid_multiple_statements_on_same_line: true
align_assignments: true
javascript: { }

coding_style:
php:
braces:
if:
else_on_new_line: true
try:
catch_on_new_line: true
finally_on_new_line: true
indentation:
general:
size: 2
spaces:
around_operators:
concatenation: true
php:
indentation:
general:
use_tabs: false
size: 2
switch:
indent_case: true
spaces:
general:
linefeed_character: newline
before_parentheses:
function_declaration: false
closure_definition: true
function_call: false
if: true
for: true
while: true
switch: true
catch: true
array_initializer: false
around_operators:
assignment: true
logical: true
equality: true
relational: true
bitwise: true
additive: true
multiplicative: true
shift: true
unary_additive: false
concatenation: true
negation: false
before_left_brace:
class: true
function: true
if: true
else: true
for: true
while: true
do: true
switch: true
try: true
catch: true
finally: true
before_keywords:
else: true
while: true
catch: true
finally: true
within:
brackets: false
array_initializer: false
grouping: false
function_call: false
function_declaration: false
if: false
for: false
while: false
switch: false
catch: false
type_cast: false
ternary_operator:
before_condition: true
after_condition: true
before_alternative: true
after_alternative: true
in_short_version: false
other:
before_comma: false
after_comma: true
before_semicolon: false
after_semicolon: true
after_type_cast: true
braces:
classes_functions:
class: undefined
function: undefined
closure: undefined
if:
opening: undefined
always: true
else_on_new_line: true
for:
opening: undefined
always: true
while:
opening: undefined
always: true
do_while:
opening: undefined
always: true
while_on_new_line: false
switch:
opening: undefined
try:
opening: undefined
catch_on_new_line: true
finally_on_new_line: true
upper_lower_casing:
keywords:
general: undefined
constants:
true_false_null: undefined

build:
nodes:
Expand All @@ -89,6 +180,5 @@ build:
- composer require --dev squizlabs/php_codesniffer:^3.5
tests:
override:
-
command: phpcs-run
- command: phpcs-run
use_website_config: false
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ language: php
sudo: true

php:
- 7.3
- 7.4
- 8.0

services:
- mongodb

matrix:
# allow_failures:
# - php: 8.0
allow_failures:
- php: 8.0
fast_finish: true

env:
Expand All @@ -28,7 +28,7 @@ env:
- PHPUNIT_OPTS="-c phpunit.xml -v --debug --coverage-clover=modules/contrib/$MODULE_NAME/$COVERAGE_FILE"

# Code coverage via coveralls.io
- COVERALLS="php-coveralls/php-coveralls:2.1.*"
- COVERALLS="php-coveralls/php-coveralls:^2"

cache:
directories:
Expand All @@ -44,7 +44,7 @@ before_install:
- sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc
- source $HOME/.bashrc
# Force Composer 1 until all plugins support Composer 2.
- composer self-update --1
- composer self-update --2

# Drush: 9.x prefers using a local version, so don't require it globally.

Expand Down Expand Up @@ -77,14 +77,14 @@ before_script:
- cd ../..

# download Drupal 9 core.
- wget -q -O - http://ftp.drupal.org/files/projects/drupal-9.1.x-dev.tar.gz | tar xz
- cd drupal-9.1.x-dev
- wget -q -O - https://ftp.drupal.org/files/projects/drupal-9.2.x-dev.tar.gz | tar xz
- cd drupal-9.2.x-dev
- mkdir -p modules/contrib
- mv ../fgm/mongodb modules/contrib

# install dependencies (for the module) and Coveralls (for coverage) as part of the root vendors. Get rid of PHPunit < 7 and locked dependencies.
- rm -fr composer.lock vendor
- composer require -v "drush/drush:^10" drupal/console "mongodb/mongodb:^1.4.0" "phpunit/phpunit:^7.5" $COVERALLS
- composer require -v "drush/drush:^10" drupal/console "mongodb/mongodb:^1.5.1" "phpunit/phpunit:^8.5" $COVERALLS
- composer show mongodb/mongodb

# create new site, stubbing sendmail path with true to prevent delivery errors and manually resolving drush path
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
INTRODUCTION
============

MongoDB integration for Drupal, version 8.x-2.0-dev.
MongoDB integration for Drupal 8.9.x and 9.x, version 8.x-2.0-dev.

[![Build Status](https://travis-ci.org/fgm/mongodb.svg?branch=8.x-2.x)](https://travis-ci.org/fgm/mongodb)
[![Coverage Status](https://coveralls.io/repos/github/fgm/mongodb/badge.svg?branch=8.x-2.x)](https://coveralls.io/github/fgm/mongodb?branch=8.x-2.x)
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
}
],
"conflict": {
"composer/composer": "2.*",
"drupal/console": "< 1.8",
"drupal/core": "< 8.9.0",
"drush/drush": "< 9.7"
},
"description": "Drupal 9.1 driver for MongoDB",
"description": "Drupal 9.2 driver for MongoDB",
"homepage": "https://www.drupal.org/project/mongodb",
"keywords": ["drupal", "mongodb"],
"license": "GPL-2.0-or-later",
Expand All @@ -39,8 +38,8 @@
"support": {
"docs": "https://github.com/fgm/mongodb/blob/8.x-2.x/README.md",
"email": "support@osinet.fr",
"irc": "irc://chat.freenode.net:6697/drupal-mongodb",
"issues": "https://www.drupal.org/project/issues/mongodb",
"slack": "https://drupal.slack.com/archives/CCF6CGPEC",
"issues": "https://www.drupal.org/project/issues/mongodb?text=&status=Open&priorities=All&categories=All&version=all_8.x-2.*&component=All",
"rss": "https://github.com/fgm/mongodb/commits/8.x-2.x.atom",
"source": "https://github.com/fgm/mongodb/tree/8.x-2.x"
},
Expand Down

0 comments on commit 2639f99

Please sign in to comment.