File tree Expand file tree Collapse file tree 6 files changed +8
-48
lines changed Expand file tree Collapse file tree 6 files changed +8
-48
lines changed Original file line number Diff line number Diff line change 3333class LicenseFactory
3434{
3535 public function __construct (
36- private readonly LicenseIdentifiers $ licenseIdentifiers = new LicenseIdentifiers (),
37- private readonly SpdxLicenses $ spdxLicenses = new SpdxLicenses ()
36+ public readonly LicenseIdentifiers $ licenseIdentifiers = new LicenseIdentifiers (),
37+ public readonly SpdxLicenses $ spdxLicenses = new SpdxLicenses ()
3838 ) {
3939 }
4040
41- public function getLicenseIdentifiers (): LicenseIdentifiers
42- {
43- return $ this ->licenseIdentifiers ;
44- }
45-
46- public function getSpdxLicenses (): SpdxLicenses
47- {
48- return $ this ->spdxLicenses ;
49- }
50-
5141 public function makeFromString (string $ license ): SpdxLicense |LicenseExpression |NamedLicense
5242 {
5343 try {
Original file line number Diff line number Diff line change @@ -38,9 +38,9 @@ class NormalizerFactory
3838{
3939 public const FORMAT = Format::XML ;
4040
41- private readonly Spec $ spec ;
41+ public readonly Spec $ spec ;
4242
43- private readonly DOMDocument $ document ;
43+ public readonly DOMDocument $ document ;
4444
4545 /**
4646 * @throws DomainException when the spec does not support XML format
@@ -55,16 +55,6 @@ public function __construct(Spec $spec)
5555
5656 // intention: all factory methods return an instance of "_BaseNormalizer"
5757
58- public function getSpec (): Spec
59- {
60- return $ this ->spec ;
61- }
62-
63- public function getDocument (): DOMDocument
64- {
65- return $ this ->document ;
66- }
67-
6858 public function makeForBom (): Normalizers \BomNormalizer
6959 {
7060 return new Normalizers \BomNormalizer ($ this );
Original file line number Diff line number Diff line change 3333 */
3434abstract class _BaseNormalizer
3535{
36- private readonly NormalizerFactory $ normalizerFactory ;
36+ public readonly NormalizerFactory $ normalizerFactory ;
3737
3838 public function __construct (NormalizerFactory $ normalizerFactory )
3939 {
4040 $ this ->normalizerFactory = $ normalizerFactory ;
4141 }
4242
43- public function getNormalizerFactory (): NormalizerFactory
44- {
45- return $ this ->normalizerFactory ;
46- }
47-
4843 // intention to implement a "public function normalize" that accepts an object, and returns a normalized object
4944}
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class NormalizerFactory
3737{
3838 public const FORMAT = Format::JSON ;
3939
40- private readonly Spec $ spec ;
40+ public readonly Spec $ spec ;
4141
4242 /**
4343 * @throws DomainException when the spec does not support JSON format
@@ -49,11 +49,6 @@ public function __construct(Spec $spec)
4949 : throw new DomainException ('Unsupported format " ' .self ::FORMAT ->name .'" for spec ' .$ spec ->getVersion ()->name );
5050 }
5151
52- public function getSpec (): Spec
53- {
54- return $ this ->spec ;
55- }
56-
5752 // intention: all factory methods return an instance of "_BaseNormalizer"
5853
5954 public function makeForBom (): Normalizers \BomNormalizer
Original file line number Diff line number Diff line change 3333 */
3434abstract class _BaseNormalizer
3535{
36- private readonly NormalizerFactory $ normalizerFactory ;
36+ public readonly NormalizerFactory $ normalizerFactory ;
3737
3838 public function __construct (NormalizerFactory $ normalizerFactory )
3939 {
4040 $ this ->normalizerFactory = $ normalizerFactory ;
4141 }
4242
43- public function getNormalizerFactory (): NormalizerFactory
44- {
45- return $ this ->normalizerFactory ;
46- }
47-
4843 // intention to implement a "public function normalize" that accepts an object, and returns a normalized object
4944}
Original file line number Diff line number Diff line change 3030 */
3131abstract class BaseValidator implements Validator
3232{
33- private readonly Spec $ spec ;
33+ public readonly Spec $ spec ;
3434
3535 public function __construct (Spec $ spec )
3636 {
3737 $ this ->spec = $ spec ;
3838 }
3939
40- public function getSpec (): Spec
41- {
42- return $ this ->spec ;
43- }
44-
4540 /**
4641 * @throws Exceptions\FailedLoadingSchemaException when schema file unknown or not readable
4742 */
You can’t perform that action at this time.
0 commit comments