Skip to content

Commit d1cb522

Browse files
Update all dependencies (major) (#396)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Alex Skrypnyk <[email protected]>
1 parent fee42e6 commit d1cb522

File tree

8 files changed

+42
-44
lines changed

8 files changed

+42
-44
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
"drupal/coder": "^8.3.28",
3434
"dvdoug/behat-code-coverage": "^5.3.2.1",
3535
"ergebnis/composer-normalize": "^2.47",
36-
"mglaman/phpstan-drupal": "^1.3.7",
36+
"mglaman/phpstan-drupal": "^2.0.0",
3737
"php-parallel-lint/php-parallel-lint": "^1.4",
3838
"phpcompatibility/php-compatibility": "^9.3.5",
3939
"phpspec/prophecy-phpunit": "^2.3",
4040
"phpstan/extension-installer": "^1.4.3",
41-
"phpstan/phpstan": "^1.12.25",
41+
"phpstan/phpstan": "^2.0.0",
4242
"phpunit/phpunit": "^11",
43-
"rector/rector": "^1.2"
43+
"rector/rector": "^2.0"
4444
},
4545
"autoload": {
4646
"psr-4": {

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ services:
6969
- "3306"
7070

7171
chrome:
72-
image: selenium/standalone-chromium:135.0
72+
image: selenium/standalone-chromium:136.0
7373
ports:
7474
- "7900:7900" # Access Chrome using noVNC at http://behat-steps.docker.amazee.io:7900/?autoconnect=1&password=secret
7575
expose:

docs.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,8 @@ function parse_class_comment(string $trait_name, string $comment): array {
241241
}
242242

243243
$comment = preg_replace('#^/\*\*|^\s*\*\/$#m', '', $comment);
244-
$lines = array_values(
245-
array_map(static fn($l): string => ltrim($l, " *\t"), explode(PHP_EOL, (string) $comment))
246-
);
244+
$lines = explode(PHP_EOL, (string) $comment);
245+
$lines = array_map(static fn($l): string => ltrim($l, " *\t"), $lines);
247246

248247
// Remove first and last empty lines.
249248
if (count($lines) > 1 && empty($lines[0])) {

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ parameters:
1818
- vendor/*
1919
- node_modules/*
2020
- tests/behat/bootstrap/BehatCliContext.php
21+
- tests/behat/bootstrap/BehatCliTrait.php
2122

2223
scanFiles:
2324
- vendor/behat/behat/bin/behat
@@ -40,3 +41,6 @@ parameters:
4041
- '#.*Cannot call method.*getCurrentUrl\(\).*#'
4142
paths:
4243
- tests/phpunit/*
44+
45+
# @see https://github.com/mglaman/phpstan-drupal/issues/825
46+
- '#Call to method Drupal\\Core\\Entity\\Query\\QueryInterface::accessCheck\(\) with false will always evaluate to true.#'

src/Drupal/ContentTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ public function contentChangeModerationStateWithTitle(string $content_type, stri
169169
ksort($nids);
170170

171171
$nid = end($nids);
172-
/** @var \Drupal\node\Entity\Node $node */
173172
$node = Node::load($nid);
174173

175174
if (!$node instanceof NodeInterface) {

src/Drupal/FileTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected function fileCreateEntity(\StdClass $stub): FileInterface {
106106
throw new \RuntimeException('"path" property is required');
107107
}
108108

109-
$path = ltrim($stub->path, '/');
109+
$path = ltrim((string) $stub->path, '/');
110110

111111
// Get fixture file path.
112112
if (!empty($this->getMinkParameter('files_path'))) {
@@ -123,7 +123,7 @@ protected function fileCreateEntity(\StdClass $stub): FileInterface {
123123
$destination = 'public://' . basename($path);
124124
if (!empty($stub->uri)) {
125125
$destination = $stub->uri;
126-
$directory = dirname($destination);
126+
$directory = dirname((string) $destination);
127127
$dir = \Drupal::service('file_system')->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY + FileSystemInterface::MODIFY_PERMISSIONS);
128128
if (!$dir) {
129129
throw new \RuntimeException('Unable to prepare directory ' . $directory);

src/KeyboardTrait.php

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -125,40 +125,38 @@ public function keyboardPressKeyOnElementSingle(string $char, ?string $selector)
125125
];
126126

127127
// Convert provided character sequence to special keys.
128-
if (is_string($char)) {
129-
if (strlen($char) < 1) {
130-
throw new \Exception('keyPress($char) was invoked but the $char parameter was empty.');
128+
if (strlen($char) < 1) {
129+
throw new \Exception('keyPress($char) was invoked but the $char parameter was empty.');
130+
}
131+
// Consider provided characters string longer then 1 to be a keyboard key.
132+
elseif (strlen($char) > 1) {
133+
if (!array_key_exists(strtolower($char), $keys)) {
134+
throw new \RuntimeException(sprintf('Unsupported key "%s" provided', $char));
131135
}
132-
// Consider provided characters string longer then 1 to be a keyboard key.
133-
elseif (strlen($char) > 1) {
134-
if (!array_key_exists(strtolower($char), $keys)) {
135-
throw new \RuntimeException(sprintf('Unsupported key "%s" provided', $char));
136-
}
137-
138-
// Special case for tab key triggered in window without target element
139-
// focused: Syn (JS library that provides synthetic events) can tab only
140-
// from another element that can receive focus, so we inject such
141-
// element as a very first element after opening <body> tag. This
142-
// element is visually hidden, but compatible with screen readers. Then
143-
// we trigger key on this element to make sure that an element that
144-
// supposed to get the very first focus from tab index actually gets it.
145-
// Note that injecting element and triggering key press on it does not
146-
// make it focused itself.
147-
if (is_null($selector) && $char === 'tab') {
148-
$selector = '#injected-focusable';
149-
150-
$script = <<<JS
151-
(function() {
152-
if (document.querySelectorAll('body #injected-focusable').length === 0) {
153-
document.querySelector('body').insertAdjacentHTML('afterbegin', '<a id="injected-focusable" style="position: absolute;width: 1px;height: 1px;margin: -1px;padding: 0;overflow: hidden;clip: rect(0,0,0,0);border: 0;"></a>');
154-
}
155-
})();
156-
JS;
157-
$this->getSession()->getDriver()->evaluateScript($script);
158-
}
159-
160-
$char = $keys[strtolower($char)];
136+
137+
// Special case for tab key triggered in window without target element
138+
// focused: Syn (JS library that provides synthetic events) can tab only
139+
// from another element that can receive focus, so we inject such
140+
// element as a very first element after opening <body> tag. This
141+
// element is visually hidden, but compatible with screen readers. Then
142+
// we trigger key on this element to make sure that an element that
143+
// supposed to get the very first focus from tab index actually gets it.
144+
// Note that injecting element and triggering key press on it does not
145+
// make it focused itself.
146+
if (is_null($selector) && $char === 'tab') {
147+
$selector = '#injected-focusable';
148+
149+
$script = <<<JS
150+
(function() {
151+
if (document.querySelectorAll('body #injected-focusable').length === 0) {
152+
document.querySelector('body').insertAdjacentHTML('afterbegin', '<a id="injected-focusable" style="position: absolute;width: 1px;height: 1px;margin: -1px;padding: 0;overflow: hidden;clip: rect(0,0,0,0);border: 0;"></a>');
153+
}
154+
})();
155+
JS;
156+
$this->getSession()->getDriver()->evaluateScript($script);
161157
}
158+
159+
$char = $keys[strtolower($char)];
162160
}
163161

164162
$selector = $selector ?: 'html';

tests/behat/bootstrap/BehatCliContext.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
* Behat test suite context.
3636
*
3737
* @author Konstantin Kudryashov <[email protected]>
38-
*
39-
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
4038
*/
4139
class BehatCliContext implements Context
4240
{

0 commit comments

Comments
 (0)