Skip to content

Commit

Permalink
Fixed Content Type Limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Jan 29, 2024
1 parent 8f7986b commit df851c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2690,11 +2690,6 @@ parameters:
count: 1
path: src/lib/Core/Debug/Shell/Shell.php

-
message: "#^Parameter \\#2 \\$callback of function array_filter expects callable\\(int\\|string\\)\\: mixed, Closure\\(string\\)\\: bool given\\.$#"
count: 1
path: src/lib/Core/Debug/Shell/Shell.php

-
message: "#^Method Ibexa\\\\Behat\\\\Core\\\\Log\\\\Failure\\\\AnalysisResult\\:\\:getJiraReference\\(\\) should return string but returns string\\|null\\.$#"
count: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private function parseCommonContentTypes(string $contentTypeName): string
{
$contentTypeName = strtolower($contentTypeName);

if (\in_array($contentTypeName, $this->contentTypeNameIdentifierMap, true)) {
if (\array_key_exists($contentTypeName, $this->contentTypeNameIdentifierMap)) {
return $this->contentTypeNameIdentifierMap[$contentTypeName];
}

Expand Down
7 changes: 5 additions & 2 deletions src/lib/Core/Debug/Shell/Shell.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ public function addBaseImports(): void
++$level;
}
$dir = dirname(__DIR__, $level);
$classess = array_keys(require $dir . '/vendor/composer/autoload_classmap.php');
$classes = array_map(
'strval',
array_keys(require $dir . '/vendor/composer/autoload_classmap.php')
);

$baseImports = array_filter($classess, static function (string $classFcqn) {
$baseImports = array_filter($classes, static function (string $classFcqn): bool {
return strpos($classFcqn, 'Ibexa\Behat\Browser\Element') === 0 ||
strpos($classFcqn, 'Ibexa\Behat\Browser\Locator') === 0;
});
Expand Down

0 comments on commit df851c1

Please sign in to comment.