Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDST-785: Working with remote wrappers #27

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Code Linting
on:
pull_request:
Expand All @@ -7,9 +8,4 @@ on:

jobs:
Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Run CodeSniffer
uses: discoverygarden/CodeSniffer@v1
uses: discoverygarden/CodeSniffer/.github/workflows/lint.yml@v1
8 changes: 3 additions & 5 deletions src/Plugin/migrate/source/Foxml.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;

use Drupal\foxml\Utility\Fedora3\ObjectLowLevelAdapterInterface;
use Drupal\migrate\Plugin\migrate\source\SourcePluginBase;
use Drupal\migrate\Plugin\MigrationInterface;

use Drupal\migrate\Plugin\migrate\source\SourcePluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
Expand Down Expand Up @@ -38,7 +36,7 @@ public function __construct(
$plugin_id,
$plugin_definition,
MigrationInterface $migration,
ObjectLowLevelAdapterInterface $object_storage
ObjectLowLevelAdapterInterface $object_storage,
) {
$this->objectStorage = $object_storage;
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);
Expand All @@ -52,7 +50,7 @@ public static function create(
array $configuration,
$plugin_id,
$plugin_definition,
MigrationInterface $migration = NULL
?MigrationInterface $migration = NULL,
) {
// Allow a specific storage to be targeted.
$object_service_name = $configuration['object_service_name'] ?? 'foxml.parser.object_lowlevel_storage';
Expand Down
4 changes: 2 additions & 2 deletions src/StreamWrapper/Foxml.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ protected function getLocalPath($uri = NULL) {
$realpath = $this->fileSystem->realpath($path);
if (!$realpath) {

// This file does not yet exist.
$realpath = $this->fileSystem->realpath(dirname($path)) . '/' .
// This file does not yet exist, or $path references something remote.
$realpath = $this->fileSystem->dirname($path) . '/' .
$this->fileSystem->basename($path);
}

Expand Down
10 changes: 6 additions & 4 deletions src/Utility/Fedora3/Element/DigitalObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,12 @@ public function models() {
* @return string[]
* The collection parents of the given object.
*/
public function parents(array $predicates = [
'isMemberOf',
'isMemberOfCollection',
]) {
public function parents(
array $predicates = [
'isMemberOf',
'isMemberOfCollection',
],
) {
assert(count($predicates) > 0, 'Has at least one predicate for which to look.');
$map = function ($pred) {
return "self::fre:$pred";
Expand Down
2 changes: 1 addition & 1 deletion src/Utility/Fedora3/FoxmlParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class FoxmlParser extends AbstractParser {
public function __construct(
CacheBackendInterface $cache,
LowLevelAdapterInterface $datastream_storage,
LockBackendInterface $lock
LockBackendInterface $lock,
) {
$this->cache = $cache;
$this->datastreamStorage = $datastream_storage;
Expand Down
2 changes: 1 addition & 1 deletion src/Utility/Fedora3/ObjectLowLevelAdapterManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ObjectLowLevelAdapterManager extends AbstractLowLevelAdapterManager implem
* Constructor.
*/
public function __construct(
LoggerInterface $logger
LoggerInterface $logger,
) {
$this->logger = $logger;
}
Expand Down