-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHP 8.1+ updates
- Loading branch information
Showing
159 changed files
with
2,100 additions
and
2,183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
assignees: | ||
- 'dcarbone' | ||
groups: | ||
github-actions: | ||
applies-to: version-updates | ||
patterns: | ||
- '*' | ||
|
||
- package-ecosystem: 'composer' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
assignees: | ||
- 'dcarbone' | ||
|
||
groups: | ||
composer: | ||
applies-to: version-updates | ||
patterns: | ||
- '*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Generator default configuration file | ||
* | ||
* Copyright 2017 Pim Koeman ([email protected]) | ||
* Copyright 2017-2022 Daniel Carbone ([email protected]) | ||
* Copyright 2017-2024 Daniel Carbone ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Download and generation script for all major FHIR versions | ||
* | ||
* Copyright 2017 Pim Koeman ([email protected]) | ||
* Copyright 2017-2022 Daniel Carbone ([email protected]) | ||
* Copyright 2017-2024 Daniel Carbone ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -21,16 +21,26 @@ | |
|
||
namespace PHPFHIRCLI; | ||
|
||
date_default_timezone_set('UTC'); | ||
|
||
// --- autoload setup | ||
const AUTOLOAD_CLASS_FILEPATH = __DIR__ . '/../vendor/autoload.php'; | ||
|
||
date_default_timezone_set('UTC'); | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
// ensure composer autoload class exists. | ||
if (!file_exists(AUTOLOAD_CLASS_FILEPATH)) { | ||
echo sprintf("Unable to locate composer autoload file expected at path: %s\n\n", AUTOLOAD_CLASS_FILEPATH); | ||
echo "Please run \"composer install\" from the root of the project directory\n\n"; | ||
exit(1); | ||
} | ||
|
||
require AUTOLOAD_CLASS_FILEPATH; | ||
|
||
// --- use statements | ||
|
||
use DCarbone\PHPFHIR\Builder; | ||
use DCarbone\PHPFHIR\Config; | ||
use DCarbone\PHPFHIR\Definition; | ||
use JetBrains\PhpStorm\NoReturn; | ||
use Monolog\Formatter\LineFormatter; | ||
use Monolog\Handler\StreamHandler; | ||
use Monolog\Logger; | ||
|
@@ -114,15 +124,15 @@ function missing_config_text(bool $return): string | |
/** | ||
* @param bool $err | ||
*/ | ||
function exit_with_help(bool $err = false): void | ||
#[NoReturn] function exit_with_help(bool $err = false): void | ||
{ | ||
global $config_location_def; | ||
$env_var = ENV_GENERATE_CONFIG_FILE; | ||
$out = <<<STRING | ||
PHP-FHIR: Tools for creating PHP classes from the HL7 FHIR Specification | ||
Copyright 2016-2022 Daniel Carbone ([email protected]) | ||
Copyright 2016-2024 Daniel Carbone ([email protected]) | ||
- Links: | ||
Source: https://github.com/dcarbone/php-fhir | ||
|
@@ -178,7 +188,7 @@ function ask(string $q): bool | |
foreach ($ins as $in) { | ||
$resp = stream_get_line($in, 25, "\n"); | ||
if (is_string($resp)) { | ||
return substr(strtolower($resp), 0, 1) === 'y'; | ||
return str_starts_with(strtolower($resp), 'y'); | ||
} | ||
return false; | ||
} | ||
|
@@ -210,7 +220,7 @@ function is_dir_empty(string $dir): bool | |
{ | ||
$res = glob($dir, GLOB_NOSORT); | ||
foreach ($res as $r) { | ||
if (0 === strpos($r, '.')) { | ||
if (str_starts_with($r, '.')) { | ||
continue; | ||
} | ||
return false; | ||
|
@@ -230,7 +240,7 @@ function is_dir_empty(string $dir): bool | |
} else { | ||
$next = trim($argv[$i + 1]); | ||
} | ||
if (false !== strpos($arg, '=')) { | ||
if (str_contains($arg, '=')) { | ||
list($arg, $next) = explode('=', $arg, 2); | ||
$found_equal = true; | ||
} | ||
|
@@ -326,6 +336,7 @@ function is_dir_empty(string $dir): bool | |
exit(1); | ||
} | ||
|
||
// determine if monolog is present, otherwise use null logger | ||
if (class_exists('\\Monolog\\Logger')) { | ||
$formatter = new LineFormatter(LineFormatter::SIMPLE_FORMAT); | ||
$handler = new StreamHandler('php://stdout', $log_level); | ||
|
@@ -436,7 +447,7 @@ function is_dir_empty(string $dir): bool | |
} | ||
|
||
if ($unzip) { | ||
if (class_exists('\\ZipArchive', true)) { | ||
if (class_exists('\\ZipArchive')) { | ||
echo "ext-zip found\n"; | ||
|
||
$zip = new \ZipArchive(); | ||
|
@@ -480,11 +491,11 @@ function is_dir_empty(string $dir): bool | |
|
||
$builder = new Builder($build_config, $definition); | ||
if ($only_library) { | ||
$builder->buildFHIRClasses(); | ||
$builder->renderFHIRClasses(); | ||
} elseif ($only_tests) { | ||
$builder->buildTestClasses(); | ||
$builder->renderTestClasses(); | ||
} else { | ||
$builder->build(); | ||
$builder->render(); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,9 @@ | |
"homepage": "https://github.com/dcarbone/php-fhir", | ||
"authors": [ | ||
{ | ||
"name": "Daniel Paul Carbone", | ||
"email": "[email protected]" | ||
"name": "Daniel Carbone", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/dcarbone" | ||
} | ||
], | ||
"keywords": [ | ||
|
@@ -18,19 +19,18 @@ | |
"php-fhir" | ||
], | ||
"require": { | ||
"php": "7.4.* || 8.*", | ||
"php": "^8.1", | ||
"ext-simplexml": "*", | ||
"ext-json": "*", | ||
"ext-libxml": "*", | ||
"ext-dom": "*", | ||
"myclabs/php-enum": "^1.8", | ||
"psr/log": "^1.1 || ^3.0" | ||
"psr/log": "^3.0" | ||
}, | ||
"require-dev": { | ||
"ext-curl": "*", | ||
"phpunit/phpunit": "^9.5", | ||
"brianium/paratest": "^v6.4", | ||
"monolog/monolog": "^2.8.0 || ^3.2.0" | ||
"phpunit/phpunit": "^11.0", | ||
"brianium/paratest": "^v7.4", | ||
"monolog/monolog": "^3.2.0" | ||
}, | ||
"replace": { | ||
"php-fhir/parser": "*", | ||
|
Oops, something went wrong.