From 44e76d657425048ed3a41b240d767d6b1be0532a Mon Sep 17 00:00:00 2001 From: Susan Turkel Date: Thu, 16 Jul 2026 12:49:55 -0400 Subject: [PATCH 1/5] Update dependencies to match VuFind 11.1 release --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 1c6b3f0..84fb21f 100644 --- a/composer.json +++ b/composer.json @@ -33,13 +33,13 @@ "vufind-org/vufindcode": "^1.2" }, "require-dev": { - "friendsofphp/php-cs-fixer": "3.64.0", + "friendsofphp/php-cs-fixer": "3.95.15", "guzzlehttp/guzzle": "^7.8.1", "phpmd/phpmd": "2.15.0", - "phpstan/phpstan": "2.1.32", - "phpunit/phpunit": "11.5.50", - "phing/phing": "3.1.0", - "rector/rector": "2.2.7", + "phpstan/phpstan": "2.2.5", + "phpunit/phpunit": "11.5.56", + "phing/phing": "3.1.2", + "rector/rector": "2.5.7", "squizlabs/php_codesniffer": "4.0.1" } } From cbc646a7a73d9106f8b230353e7ffb46efa62b21 Mon Sep 17 00:00:00 2001 From: Susan Turkel Date: Thu, 16 Jul 2026 13:30:43 -0400 Subject: [PATCH 2/5] Added 'scripts' section to composer.json --- composer.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/composer.json b/composer.json index 84fb21f..51718c5 100644 --- a/composer.json +++ b/composer.json @@ -41,5 +41,9 @@ "phing/phing": "3.1.2", "rector/rector": "2.5.7", "squizlabs/php_codesniffer": "4.0.1" + }, + "scripts": { + "fix": "phing fix-php", + "qa": "phing qa-console" } } From 9a28d525770e3fd5a2038f2785a8bf1148d1d3e9 Mon Sep 17 00:00:00 2001 From: Susan Turkel Date: Thu, 16 Jul 2026 13:33:35 -0400 Subject: [PATCH 3/5] Updated section of tests/vufind.php-cs-fixer.php --- tests/vufind.php-cs-fixer.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/vufind.php-cs-fixer.php b/tests/vufind.php-cs-fixer.php index 361906b..0b5cadf 100644 --- a/tests/vufind.php-cs-fixer.php +++ b/tests/vufind.php-cs-fixer.php @@ -5,16 +5,16 @@ ->in(__DIR__ . '/../src'); $rules = [ - '@PHP81Migration' => true, - '@PHPUnit100Migration:risky' => true, + '@PHP8x2Migration' => true, '@PSR12' => true, 'align_multiline_comment' => true, 'binary_operator_spaces' => [ 'default' => 'single_space', - 'operators' => ['=' => null, '=>' => null], ], + 'blank_line_after_opening_tag' => false, 'cast_spaces' => ['space' => 'none'], 'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], + 'class_reference_name_casing' => true, 'concat_space' => ['spacing' => 'one'], 'ereg_to_preg' => true, 'get_class_to_class_keyword' => true, @@ -23,7 +23,6 @@ 'import_classes' => null, ], 'is_null' => true, - 'linebreak_after_opening_tag' => true, 'lowercase_cast' => true, 'magic_constant_casing' => true, 'modernize_strpos' => true, @@ -44,6 +43,7 @@ 'no_php4_constructor' => true, 'no_singleline_whitespace_before_semicolons' => true, 'no_spaces_around_offset' => true, + 'no_trailing_whitespace_in_comment' => false, // disabled for readability; we want < ?php // comment ? > not < ?php //comment? > 'no_unneeded_braces' => true, 'no_unneeded_control_parentheses' => true, 'no_unneeded_final_method' => true, @@ -57,11 +57,11 @@ 'sort_algorithm' => 'alpha', ], 'phpdoc_no_access' => true, - 'php_unit_method_casing' => true, 'pow_to_exponentiation' => true, 'single_line_after_imports' => true, 'single_quote' => true, 'standardize_not_equals' => true, + 'statement_indentation' => false, // disabled because it messes up indentation of php tags 'ternary_operator_spaces' => true, 'type_declaration_spaces' => true, ]; @@ -72,7 +72,7 @@ } $config = new PhpCsFixer\Config(); -return $config->setCacheFile($cacheDir . '/.code.cache') +return $config->setCacheFile($cacheDir . '/.template.cache') ->setRiskyAllowed(true) ->setRules($rules) ->setFinder($finder) From fa07c6c8fef2d24f0129bab1b8d853b594b03212 Mon Sep 17 00:00:00 2001 From: Susan Turkel Date: Thu, 16 Jul 2026 15:32:56 -0400 Subject: [PATCH 4/5] Fixed error in php-cs-fixer test and re-ran composer fix --- src/Lint/CodeData.php | 24 +++++------ src/MarcCollection.php | 10 ++--- src/MarcCollectionFile.php | 14 +++---- src/MarcLint.php | 10 ++--- src/MarcReader.php | 40 +++++++++---------- .../AbstractSerializationFile.php | 6 +-- src/Serialization/Iso2709.php | 20 +++++----- src/Serialization/MarcInJson.php | 24 +++++------ src/Serialization/MarcXml.php | 26 ++++++------ .../MessageCallbackInterface.php | 2 +- .../SerializationFileInterface.php | 10 ++--- src/Serialization/SerializationInterface.php | 10 ++--- tests/MarcCollectionFileTest.php | 24 +++++------ tests/MarcCollectionTest.php | 12 +++--- tests/MarcLintTest.php | 28 ++++++------- tests/MarcReaderTest.php | 38 +++++++++--------- tests/Serialization/Iso2709Test.php | 8 ++-- tests/Serialization/MarcXmlTest.php | 8 ++-- tests/vufind.php-cs-fixer.php | 10 +++-- 19 files changed, 163 insertions(+), 161 deletions(-) diff --git a/src/Lint/CodeData.php b/src/Lint/CodeData.php index 0e3ef87..ebbbdbf 100644 --- a/src/Lint/CodeData.php +++ b/src/Lint/CodeData.php @@ -1,7 +1,7 @@ and available for download at @@ -59,77 +59,77 @@ class CodeData { /** - * Valid Geographic Area Codes + * Valid Geographic Area Codes. * * @var array */ public $geogAreaCodes; /** - * Obsolete Geographic Area Codes + * Obsolete Geographic Area Codes. * * @var array */ public $obsoleteGeogAreaCodes; /** - * Valid Language Codes + * Valid Language Codes. * * @var array */ public $languageCodes; /** - * Obsolete Language Codes + * Obsolete Language Codes. * * @var array */ public $obsoleteLanguageCodes; /** - * Valid Country Codes + * Valid Country Codes. * * @var array */ public $countryCodes; /** - * Obsolete Country Codes + * Obsolete Country Codes. * * @var array */ public $obsoleteCountryCodes; /** - * Valid sources for fields 600-651 + * Valid sources for fields 600-651. * * @var array */ public $sources600_651; /** - * Obsolete sources for fields 600-651 + * Obsolete sources for fields 600-651. * * @var array */ public $obsoleteSources600_651; /** - * Valid sources for field 655 + * Valid sources for field 655. * * @var array */ public $sources655; /** - * Obsolete sources for field 655 + * Obsolete sources for field 655. * * @var array */ public $obsoleteSources655; /** - * Start function + * Start function. * * Initialize code arrays. * diff --git a/src/MarcCollection.php b/src/MarcCollection.php index 94dc311..d2ac5f5 100644 --- a/src/MarcCollection.php +++ b/src/MarcCollection.php @@ -41,7 +41,7 @@ class MarcCollection implements \Iterator { /** - * Supported serialization formats + * Supported serialization formats. * * @var array */ @@ -52,21 +52,21 @@ class MarcCollection implements \Iterator ]; /** - * Records in the collection + * Records in the collection. * * @var array */ protected $records = []; /** - * Iteration position + * Iteration position. * * @var int */ protected $position = 0; /** - * Constructor + * Constructor. * * @param string $data MARC record collection in MARCXML or ISO2709 format */ @@ -76,7 +76,7 @@ public function __construct(string $data = '') } /** - * Set MARC record data + * Set MARC record data. * * @param string $data MARC record in MARCXML or ISO2709 format * diff --git a/src/MarcCollectionFile.php b/src/MarcCollectionFile.php index 85a010b..3b82c6c 100644 --- a/src/MarcCollectionFile.php +++ b/src/MarcCollectionFile.php @@ -41,7 +41,7 @@ class MarcCollectionFile implements \Iterator { /** - * Supported serialization formats + * Supported serialization formats. * * @var array */ @@ -52,35 +52,35 @@ class MarcCollectionFile implements \Iterator ]; /** - * Serialized format stream + * Serialized format stream. * * @var Serialization\SerializationFileInterface */ protected $stream; /** - * Iteration position + * Iteration position. * * @var int */ protected $position = 0; /** - * Current record + * Current record. * * @var string */ protected $record = ''; /** - * Message callback + * Message callback. * * @var callable */ protected $messageCallback; /** - * Constructor + * Constructor. * * @param string $file MARC record collection file in MARCXML or * ISO2709 format @@ -95,7 +95,7 @@ public function __construct(string $file = '', ?callable $messageCallback = null } /** - * Set MARC record file + * Set MARC record file. * * @param string $file MARC record collection file in MARCXML or ISO2709 format * diff --git a/src/MarcLint.php b/src/MarcLint.php index 93ca37c..db9abc3 100644 --- a/src/MarcLint.php +++ b/src/MarcLint.php @@ -1,7 +1,7 @@ and available at http://search.cpan.org/~eijabb/ @@ -56,28 +56,28 @@ class MarcLint { /** - * Rules used for testing records + * Rules used for testing records. * * @var array */ protected $rules; /** - * A Lint\CodeData object for validating codes + * A Lint\CodeData object for validating codes. * * @var Lint\CodeData */ protected $data; /** - * Warnings generated during analysis + * Warnings generated during analysis. * * @var array */ protected $warnings = []; /** - * Start function + * Start function. * * Set up rules for testing MARC records. * diff --git a/src/MarcReader.php b/src/MarcReader.php index 7cad052..969f738 100644 --- a/src/MarcReader.php +++ b/src/MarcReader.php @@ -46,7 +46,7 @@ class MarcReader { /** - * Supported serialization formats + * Supported serialization formats. * * @var array */ @@ -57,7 +57,7 @@ class MarcReader ]; /** - * MARC leader + * MARC leader. * * @var string */ @@ -85,7 +85,7 @@ class MarcReader * ] * ] * ] - * ] + * ]. * * @var array * @see https://web.archive.org/web/20151112001548/http://dilettantes.code4lib.org/blog/2010/09/a-proposal-to-serialize-marc-in-json/ @@ -93,14 +93,14 @@ class MarcReader protected $data; /** - * Any warnings encountered when parsing a record + * Any warnings encountered when parsing a record. * * @var array */ protected $warnings; /** - * Constructor + * Constructor. * * @param string|array $data MARC record in one of the supported formats, or an * associative array with 'leader' and 'fields' in the internal format @@ -111,7 +111,7 @@ public function __construct($data) } /** - * Set MARC record data + * Set MARC record data. * * @param string|array $data MARC record in one of the supported formats, or an * associative array with 'leader' and 'fields' in the internal format @@ -156,7 +156,7 @@ public function setData($data): void } /** - * Serialize the record + * Serialize the record. * * @param string $format Format to return (e.g. 'ISO2709' or 'MARCXML') * @@ -173,7 +173,7 @@ public function toFormat(string $format): string } /** - * Return leader + * Return leader. * * @return string */ @@ -184,7 +184,7 @@ public function getLeader(): string /** * Return an associative array for a data field, a string for a control field or - * an empty array if field does not exist + * an empty array if field does not exist. * * @param string $fieldTag The MARC field tag to get * @param array $subfieldCodes The MARC subfield codes to get, or empty for all @@ -199,7 +199,7 @@ public function getField(string $fieldTag, ?array $subfieldCodes = null) /** * Return an associative array of fields for data fields or an array of values - * for control fields + * for control fields. * * @param string $fieldTag The MARC field tag to get * @param array $subfieldCodes The MARC subfield codes to get, or empty for all. @@ -303,7 +303,7 @@ public function getAllFields() /** * Return first subfield with the given code in the MARC field provided by - * getField or getFields + * getField or getFields. * * @param array $field Result from MarcReader::getFields * @param string $subfieldCode The MARC subfield code to get @@ -391,7 +391,7 @@ public function getFieldsSubfields( /** * Return an associative array for a linked field such as 880 (Alternate Graphic - * Representation) or an empty array if field does not exist + * Representation) or an empty array if field does not exist. * * @param string $fieldTag The MARC field that contains the linked fields * @param string $linkedFieldTag The linked MARC field tag to get @@ -419,7 +419,7 @@ public function getLinkedField( /** * Return an array of associative arrays for a linked field such as 880 - * (Alternate Graphic Representation) + * (Alternate Graphic Representation). * * @param string $fieldTag The MARC field that contains the linked fields * @param string $linkedFieldTag The linked MARC field tag to get @@ -506,7 +506,7 @@ public function getLinkedFieldsSubfields( } /** - * Get linked field data from subfield 6 + * Get linked field data from subfield 6. * * @param array $field Field * @@ -518,7 +518,7 @@ public function getFieldLink(array $field): array } /** - * Parse a linkage field + * Parse a linkage field. * * @param string $link Linkage field * @@ -603,7 +603,7 @@ public function getFilteredRecord(array $rules): MarcReader } /** - * Get filtering rules matching a field tag + * Get filtering rules matching a field tag. * * @param array $rules Filtering rules * @param string $tag Field tag @@ -625,7 +625,7 @@ protected function getFilteringRulesForTag(array $rules, string $tag): array } /** - * Filter subfields + * Filter subfields. * * @param array $rules Filtering rules * @param array $subfields Subfields @@ -656,7 +656,7 @@ protected function filterSubfields(array $rules, array $subfields): array } /** - * Get any warnings encountered when parsing a record + * Get any warnings encountered when parsing a record. * * @return array */ @@ -666,7 +666,7 @@ public function getWarnings(): array } /** - * Return fields by tag in internal format + * Return fields by tag in internal format. * * @param string $tag Field tag * @@ -685,7 +685,7 @@ protected function getInternalFields(string $tag): array } /** - * Return first subfield with the given code in the internal MARC field + * Return first subfield with the given code in the internal MARC field. * * @param array $field Internal MARC field * @param string $subfieldCode The MARC subfield code to get diff --git a/src/Serialization/AbstractSerializationFile.php b/src/Serialization/AbstractSerializationFile.php index 2024594..7ee6021 100644 --- a/src/Serialization/AbstractSerializationFile.php +++ b/src/Serialization/AbstractSerializationFile.php @@ -45,14 +45,14 @@ abstract class AbstractSerializationFile implements MessageCallbackInterface { /** - * Message callback + * Message callback. * * @var callable */ protected $messageCallback = null; /** - * Set message callback + * Set message callback. * * @param callable $callback Message callback * @@ -64,7 +64,7 @@ public function setMessageCallback(?callable $callback): void } /** - * Output a message + * Output a message. * * @param string $msg Message * @param int $level Error level (see diff --git a/src/Serialization/Iso2709.php b/src/Serialization/Iso2709.php index f3e2ea8..9d928fe 100644 --- a/src/Serialization/Iso2709.php +++ b/src/Serialization/Iso2709.php @@ -51,14 +51,14 @@ class Iso2709 extends AbstractSerializationFile implements SerializationInterfac public const MAX_LENGTH = 99999; /** - * Serialized record file handle + * Serialized record file handle. * * @var resource */ protected $file = null; /** - * Check if this class can parse the given MARC string + * Check if this class can parse the given MARC string. * * @param string $marc MARC * @@ -71,7 +71,7 @@ public static function canParse(string $marc): bool } /** - * Check if the serialization class can parse the given MARC collection string + * Check if the serialization class can parse the given MARC collection string. * * @param string $marc MARC * @@ -84,7 +84,7 @@ public static function canParseCollection(string $marc): bool } /** - * Check if the serialization class can parse the given MARC collection file + * Check if the serialization class can parse the given MARC collection file. * * @param string $file File name * @@ -105,7 +105,7 @@ public static function canParseCollectionFile(string $file): bool } /** - * Parse MARC collection from a string into an array + * Parse MARC collection from a string into an array. * * @param string $collection MARC record collection in the format supported by * the serialization class @@ -130,7 +130,7 @@ function ($record) { } /** - * Parse an ISO2709 string + * Parse an ISO2709 string. * * @param string $marc ISO2709 * @@ -201,7 +201,7 @@ public static function fromString(string $marc): array } /** - * Convert record to an ISO2709 string + * Convert record to an ISO2709 string. * * @param array $record Record data * @@ -257,7 +257,7 @@ public static function toString(array $record): string } /** - * Open a collection file + * Open a collection file. * * @param string $file File name * @@ -273,7 +273,7 @@ public function openCollectionFile(string $file): void } /** - * Rewind the collection file + * Rewind the collection file. * * @return void * @@ -288,7 +288,7 @@ public function rewind(): void } /** - * Get next record from the file or an empty string on EOF + * Get next record from the file or an empty string on EOF. * * @return string * diff --git a/src/Serialization/MarcInJson.php b/src/Serialization/MarcInJson.php index 6264f89..6961d6e 100644 --- a/src/Serialization/MarcInJson.php +++ b/src/Serialization/MarcInJson.php @@ -46,21 +46,21 @@ class MarcInJson extends AbstractSerializationFile implements SerializationInterface { /** - * Current file + * Current file. * * @var string */ protected $fileName = ''; /** - * JSON Reader for current file + * JSON Reader for current file. * * @var JsonReader */ protected $reader = null; /** - * Check if this class can parse the given MARC string + * Check if this class can parse the given MARC string. * * @param string $marc MARC * @@ -73,7 +73,7 @@ public static function canParse(string $marc): bool } /** - * Check if the serialization class can parse the given MARC collection string + * Check if the serialization class can parse the given MARC collection string. * * @param string $marc MARC * @@ -86,7 +86,7 @@ public static function canParseCollection(string $marc): bool } /** - * Check if the serialization class can parse the given MARC collection file + * Check if the serialization class can parse the given MARC collection file. * * @param string $file File name * @@ -107,7 +107,7 @@ public static function canParseCollectionFile(string $file): bool } /** - * Parse MARC collection from a string into an array + * Parse MARC collection from a string into an array. * * @param string $collection MARC record collection in the format supported by * the serialization class @@ -121,7 +121,7 @@ public static function collectionFromString(string $collection): array } /** - * Parse MARC-in-JSON + * Parse MARC-in-JSON. * * @param string $marc JSON * @@ -134,7 +134,7 @@ public static function fromString(string $marc): array } /** - * Convert record to ISO2709 string + * Convert record to ISO2709 string. * * @param array $record Record data * @@ -146,7 +146,7 @@ public static function toString(array $record): string } /** - * Open a collection file + * Open a collection file. * * @param string $file File name * @@ -164,7 +164,7 @@ public function openCollectionFile(string $file): void } /** - * Rewind the collection file + * Rewind the collection file. * * @return void * @@ -179,7 +179,7 @@ public function rewind(): void } /** - * Get next record from the file or an empty string on EOF + * Get next record from the file or an empty string on EOF. * * @return string * @@ -203,7 +203,7 @@ public function getNextRecord(): string } /** - * Convert a record array to a JSON string + * Convert a record array to a JSON string. * * @param array $record Record * diff --git a/src/Serialization/MarcXml.php b/src/Serialization/MarcXml.php index 96f64b7..3749d11 100644 --- a/src/Serialization/MarcXml.php +++ b/src/Serialization/MarcXml.php @@ -46,28 +46,28 @@ class MarcXml extends AbstractSerializationFile implements SerializationInterface { /** - * Current file + * Current file. * * @var string */ protected $fileName = ''; /** - * XML Reader for current file + * XML Reader for current file. * * @var \XMLReader */ protected $xml = null; /** - * Current XML element path + * Current XML element path. * * @var array */ protected $currentXmlPath = []; /** - * Check if this class can parse the given MARC string + * Check if this class can parse the given MARC string. * * @param string $marc MARC * @@ -80,7 +80,7 @@ public static function canParse(string $marc): bool } /** - * Check if the serialization class can parse the given MARC collection string + * Check if the serialization class can parse the given MARC collection string. * * @param string $marc MARC * @@ -93,7 +93,7 @@ public static function canParseCollection(string $marc): bool } /** - * Check if the serialization class can parse the given MARC collection file + * Check if the serialization class can parse the given MARC collection file. * * @param string $file File name * @@ -113,7 +113,7 @@ public static function canParseCollectionFile(string $file): bool } /** - * Parse MARC collection from a string into an array + * Parse MARC collection from a string into an array. * * @param string $collection MARC record collection in the format supported by * the serialization class @@ -132,7 +132,7 @@ public static function collectionFromString(string $collection): array } /** - * Parse MARCXML string + * Parse MARCXML string. * * @param string $marc MARCXML * @@ -172,7 +172,7 @@ public static function fromString(string $marc): array } /** - * Convert record to a MARCXML string + * Convert record to a MARCXML string. * * @param array $record Record data * @@ -243,7 +243,7 @@ public static function toString(array $record): string } /** - * Load XML into SimpleXMLElement + * Load XML into SimpleXMLElement. * * @param string $xml XML * @@ -288,7 +288,7 @@ protected static function loadXML(string $xml): \SimpleXMLElement } /** - * Open a collection file + * Open a collection file. * * @param string $file File name * @@ -308,7 +308,7 @@ public function openCollectionFile(string $file): void } /** - * Rewind the collection file + * Rewind the collection file. * * @return void * @@ -323,7 +323,7 @@ public function rewind(): void } /** - * Get next record from the file or an empty string on EOF + * Get next record from the file or an empty string on EOF. * * @return string * diff --git a/src/Serialization/MessageCallbackInterface.php b/src/Serialization/MessageCallbackInterface.php index b0b0ada..946fb95 100644 --- a/src/Serialization/MessageCallbackInterface.php +++ b/src/Serialization/MessageCallbackInterface.php @@ -41,7 +41,7 @@ interface MessageCallbackInterface { /** - * Set message callback + * Set message callback. * * @param callable $callback Message callback * diff --git a/src/Serialization/SerializationFileInterface.php b/src/Serialization/SerializationFileInterface.php index 2173346..00d3a02 100644 --- a/src/Serialization/SerializationFileInterface.php +++ b/src/Serialization/SerializationFileInterface.php @@ -41,7 +41,7 @@ interface SerializationFileInterface { /** - * Check if the serialization class can parse the given MARC collection file + * Check if the serialization class can parse the given MARC collection file. * * @param string $file File name * @@ -50,7 +50,7 @@ interface SerializationFileInterface public static function canParseCollectionFile(string $file): bool; /** - * Set message callback + * Set message callback. * * @param callable $callback Message callback * @@ -59,7 +59,7 @@ public static function canParseCollectionFile(string $file): bool; public function setMessageCallback(?callable $callback): void; /** - * Open a collection file + * Open a collection file. * * @param string $file File name * @@ -70,7 +70,7 @@ public function setMessageCallback(?callable $callback): void; public function openCollectionFile(string $file): void; /** - * Rewind the collection file + * Rewind the collection file. * * @return void * @@ -79,7 +79,7 @@ public function openCollectionFile(string $file): void; public function rewind(): void; /** - * Get next record from the file or an empty string on EOF + * Get next record from the file or an empty string on EOF. * * @return string * diff --git a/src/Serialization/SerializationInterface.php b/src/Serialization/SerializationInterface.php index 9b2828a..ce75967 100644 --- a/src/Serialization/SerializationInterface.php +++ b/src/Serialization/SerializationInterface.php @@ -41,7 +41,7 @@ interface SerializationInterface { /** - * Check if the serialization class can parse the given MARC string + * Check if the serialization class can parse the given MARC string. * * @param string $marc MARC * @@ -50,7 +50,7 @@ interface SerializationInterface public static function canParse(string $marc): bool; /** - * Check if the serialization class can parse the given MARC collection string + * Check if the serialization class can parse the given MARC collection string. * * @param string $marc MARC * @@ -59,7 +59,7 @@ public static function canParse(string $marc): bool; public static function canParseCollection(string $marc): bool; /** - * Parse MARC collection from a string into an array of MarcReader classes + * Parse MARC collection from a string into an array of MarcReader classes. * * @param string $collection MARC record collection in the format supported by * the serialization class @@ -70,7 +70,7 @@ public static function canParseCollection(string $marc): bool; public static function collectionFromString(string $collection): array; /** - * Parse MARC from a string + * Parse MARC from a string. * * @param string $marc MARC record in the format supported by the serialization * class @@ -82,7 +82,7 @@ public static function fromString(string $marc): array; /** * Convert record to a string representing the format supported by the - * serialization class + * serialization class. * * @param array $data Record data * diff --git a/tests/MarcCollectionFileTest.php b/tests/MarcCollectionFileTest.php index ae71416..83a0361 100644 --- a/tests/MarcCollectionFileTest.php +++ b/tests/MarcCollectionFileTest.php @@ -1,7 +1,7 @@ true, + '@PHPUnit10x0Migration:risky' => true, '@PSR12' => true, 'align_multiline_comment' => true, 'binary_operator_spaces' => [ 'default' => 'single_space', + 'operators' => ['=' => null, '=>' => null], ], - 'blank_line_after_opening_tag' => false, 'cast_spaces' => ['space' => 'none'], 'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], 'class_reference_name_casing' => true, @@ -23,6 +24,7 @@ 'import_classes' => null, ], 'is_null' => true, + 'linebreak_after_opening_tag' => true, 'lowercase_cast' => true, 'magic_constant_casing' => true, 'modernize_strpos' => true, @@ -43,7 +45,6 @@ 'no_php4_constructor' => true, 'no_singleline_whitespace_before_semicolons' => true, 'no_spaces_around_offset' => true, - 'no_trailing_whitespace_in_comment' => false, // disabled for readability; we want < ?php // comment ? > not < ?php //comment? > 'no_unneeded_braces' => true, 'no_unneeded_control_parentheses' => true, 'no_unneeded_final_method' => true, @@ -57,11 +58,12 @@ 'sort_algorithm' => 'alpha', ], 'phpdoc_no_access' => true, + 'phpdoc_summary' => true, + 'php_unit_method_casing' => true, 'pow_to_exponentiation' => true, 'single_line_after_imports' => true, 'single_quote' => true, 'standardize_not_equals' => true, - 'statement_indentation' => false, // disabled because it messes up indentation of php tags 'ternary_operator_spaces' => true, 'type_declaration_spaces' => true, ]; @@ -72,7 +74,7 @@ } $config = new PhpCsFixer\Config(); -return $config->setCacheFile($cacheDir . '/.template.cache') +return $config->setCacheFile($cacheDir . '/.code.cache') ->setRiskyAllowed(true) ->setRules($rules) ->setFinder($finder) From c21d933a3e5a9df571c384e72cc6dc0346c1cece Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Thu, 16 Jul 2026 15:38:07 -0400 Subject: [PATCH 5/5] Tweak punctuation --- src/MarcReader.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MarcReader.php b/src/MarcReader.php index 969f738..4e6806f 100644 --- a/src/MarcReader.php +++ b/src/MarcReader.php @@ -66,6 +66,7 @@ class MarcReader /** * MARC is stored in a multidimensional array resembling MARC-in-JSON * specification by Ross Singer: + * * [ * 'leader' => '...', * 'fields' => [ @@ -85,7 +86,7 @@ class MarcReader * ] * ] * ] - * ]. + * ] * * @var array * @see https://web.archive.org/web/20151112001548/http://dilettantes.code4lib.org/blog/2010/09/a-proposal-to-serialize-marc-in-json/