Skip to content

Commit

Permalink
Merge pull request #222 from laminas/2.31.x-merge-up-into-3.0.x_6n8wir0l
Browse files Browse the repository at this point in the history
Merge release 2.31.0 into 3.0.x
  • Loading branch information
gsteel authored Oct 18, 2023
2 parents 6f4a849 + f54c7e7 commit 90a9f2a
Show file tree
Hide file tree
Showing 53 changed files with 600 additions and 454 deletions.
16 changes: 9 additions & 7 deletions bin/templatemap_generator.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php

$help = <<< EOH
$help = <<<'EOH'
Generate template maps.
Usage:
Expand Down Expand Up @@ -86,7 +86,7 @@
}

$basePath = $argv[1];
$files = ($argc < 3)
$files = $argc < 3
? findTemplateFilesInTemplatePath($basePath)
: array_slice($argv, 2);

Expand All @@ -99,14 +99,14 @@

$realPath = realpath($basePath);

$entries = array_map(function ($file) use ($basePath, $realPath) {
$entries = array_map(function (string $file) use ($basePath, $realPath) {
$file = str_replace('\\', '/', $file);

$template = (0 === strpos($file, $realPath))
$template = 0 === strpos($file, $realPath)
? substr($file, strlen($realPath))
: $file;

$template = (0 === strpos($template, $basePath))
$template = 0 === strpos($template, $basePath)
? substr($template, strlen($basePath))
: $template;

Expand All @@ -126,7 +126,8 @@
exit(0);

/**
* @psalm-return list<mixed>
* @param string $templatePath
* @return list<string>
*/
function findTemplateFilesInTemplatePath($templatePath): array
{
Expand All @@ -138,7 +139,8 @@ function findTemplateFilesInTemplatePath($templatePath): array

$files = [];
foreach ($rii as $file) {
if (strtolower($file->getExtension()) != 'phtml') {
assert($file instanceof SplFileInfo);
if (strtolower($file->getExtension()) !== 'phtml') {
continue;
}

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"psr/container": "^1 || ^2"
},
"require-dev": {
"laminas/laminas-authentication": "^2.13",
"laminas/laminas-authentication": "^2.15",
"laminas/laminas-coding-standard": "~2.5.0",
"laminas/laminas-feed": "^2.20",
"laminas/laminas-feed": "^2.21",
"laminas/laminas-filter": "^2.32",
"laminas/laminas-http": "^2.18",
"laminas/laminas-i18n": "^2.23",
Expand All @@ -52,9 +52,9 @@
"laminas/laminas-permissions-acl": "^2.15",
"laminas/laminas-router": "^3.11.1",
"laminas/laminas-uri": "^2.10",
"phpunit/phpunit": "^10.1.3",
"phpunit/phpunit": "^10.3.2",
"psalm/plugin-phpunit": "^0.18.4",
"vimeo/psalm": "^5.12"
"vimeo/psalm": "^5.15"
},
"conflict": {
"container-interop/container-interop": "<1.2",
Expand Down
Loading

0 comments on commit 90a9f2a

Please sign in to comment.