Skip to content

Commit 76531da

Browse files
committed
cleanup: Remove code not in use + cs fixes
1 parent 425b9f2 commit 76531da

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

src/Fields/Field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static function makeFieldObject(Record $record, $tag, $pcre=false)
4343

4444
public static function makeFieldObjects(Record $record, $tag, $pcre=false)
4545
{
46-
return array_map(function($field) {
46+
return array_map(function ($field) {
4747
return new self($field);
4848
}, $record->getFields($tag, $pcre));
4949
}

src/Fields/Subject.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class Subject extends Field implements FieldInterface
3535
// 7: Source specified in subfield $2
3636
);
3737

38-
public static function get(Record $record) {
38+
public static function get(Record $record)
39+
{
3940
return parent::makeFieldObjects($record, '6..', true);
4041
}
4142

src/Record.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@
1414
class Record
1515
{
1616
protected $record;
17-
protected $factory;
1817

1918
/**
2019
* Record constructor.
2120
* @param File_MARC_Record $record
22-
* @param Factory|null $factory
2321
*/
24-
public function __construct(File_MARC_Record $record, Factory $factory = null)
22+
public function __construct(File_MARC_Record $record)
2523
{
2624
$this->record = $record;
27-
$this->factory = $factory ?: new Factory();
2825
}
2926

27+
/*************************************************************************
28+
* Data loading
29+
*************************************************************************/
30+
3031
/**
3132
* Returns the first record found in the file $filename, or null if no records found.
3233
*
@@ -62,7 +63,20 @@ public static function fromString($data)
6263
}
6364

6465
/*************************************************************************
65-
* Determine if record is a bibliographic, authority or holdings record
66+
* Query
67+
*************************************************************************/
68+
69+
/**
70+
* @param string $spec The MARCspec string
71+
* @return QueryResult
72+
*/
73+
public function query($spec)
74+
{
75+
return new QueryResult(new File_MARC_Reference($spec, $this->record));
76+
}
77+
78+
/*************************************************************************
79+
* Helper methods for LDR
6680
*************************************************************************/
6781

6882
/**
@@ -129,7 +143,7 @@ public function getCatalogingForm()
129143
/**
130144
* Get the value of the 001 field as a `ControlField` object.
131145
*
132-
* @return Title
146+
* @return ControlField
133147
*/
134148
public function getId()
135149
{
@@ -178,20 +192,6 @@ public function getSubjects($vocabulary = null, $tag = null)
178192
* Support methods
179193
*************************************************************************/
180194

181-
protected function makeField($model, \File_MARC_Field $field)
182-
{
183-
return $this->factory->makeField($model, $field);
184-
}
185-
186-
/**
187-
* @param string $spec The MARCspec string
188-
* @return QueryResult
189-
*/
190-
public function query($spec)
191-
{
192-
return new QueryResult(new File_MARC_Reference($spec, $this->record));
193-
}
194-
195195
public function __call($name, $args)
196196
{
197197
return call_user_func_array(array($this->record, $name), $args);

0 commit comments

Comments
 (0)