Skip to content

Commit

Permalink
Fix Migration Class Warning Generation (#1877)
Browse files Browse the repository at this point in the history
* Reducing PHP Warnings

This bit of  code is being told to process not-files on PHP 7.4
AppKernels. So adding a quick check to make sure that the fd actually
points to a file before processing will make it so those error messages
aren't generated.
  • Loading branch information
ryanrath authored Jun 26, 2024
1 parent 3964cb3 commit 44d2c40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
4 changes: 2 additions & 2 deletions classes/OpenXdmod/Migration/ConfigFilesMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ protected function writeJsonConfigFile($name, array $data)
$file = implode(
DIRECTORY_SEPARATOR,
array(
$this->config->getBaseDir(),
CONFIG_DIR,
"$name.json"
)
);
Expand Down Expand Up @@ -249,7 +249,7 @@ protected function assertJsonConfigIsWritable($name)
$file = implode(
DIRECTORY_SEPARATOR,
array(
$this->config->getBaseDir(),
CONFIG_DIR,
"$name.json"
)
);
Expand Down
15 changes: 0 additions & 15 deletions classes/OpenXdmod/Migration/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ abstract class Migration
*/
protected $newVersion;

/**
* An empty default Configuration object.
*
* @var Configuration
*/
protected $config;

/**
* Logger object.
*
Expand All @@ -53,15 +46,7 @@ public function __construct($currentVersion, $newVersion)
$this->currentVersion = $currentVersion;
$this->newVersion = $newVersion;


$this->logger = Log::singleton('null');

$this->config = Configuration::factory(
".",
CONFIG_DIR,
$this->logger
);

}

/**
Expand Down

0 comments on commit 44d2c40

Please # to comment.