Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ jobs:
run: |
mkdir -p "$GITHUB_WORKSPACE/bin"
go build -C go-src -o "$GITHUB_WORKSPACE/bin/publiccode-parser" \
github.com/italia/publiccode-parser-go/v4/publiccode-parser
github.com/italia/publiccode-parser-go/v5/publiccode-parser

- run: echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH

- run: |
VERSION=$(go list -C go-src -m -f '{{.Version}}' github.com/italia/publiccode-parser-go/v4)
VERSION=$(go list -C go-src -m -f '{{.Version}}' github.com/italia/publiccode-parser-go/v5)
git clone --depth 1 --branch $VERSION https://github.com/italia/publiccode-parser-go.git /tmp/publiccode-parser-go
mv /tmp/publiccode-parser-go/testdata/* tests/fixtures/testdata/

Expand Down
2 changes: 1 addition & 1 deletion go-src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module publiccode-parser-wrapper

go 1.24.5

require github.com/italia/publiccode-parser-go/v4 v4.3.7
require github.com/italia/publiccode-parser-go/v5 v5.1.1

require (
github.com/Jeffail/gabs v1.4.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go-src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ github.com/go-playground/validator/v10 v10.18.0 h1:BvolUXjp4zuvkZ5YN5t7ebzbhlUtP
github.com/go-playground/validator/v10 v10.18.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/italia/httpclient-lib-go v0.0.2 h1:4bJLywTVd7qHPdKxJXvvhlXp436JTC4KA6dLhIl5a6c=
github.com/italia/httpclient-lib-go v0.0.2/go.mod h1:b0/D3ULsBw8X+zEl7j/kSZmiMlUdj+agppneOvSq6eA=
github.com/italia/publiccode-parser-go/v4 v4.3.7 h1:TaqjbA1Cu1OFsxf8K18k3WSUi19pnpyQF0FD7DGIXxo=
github.com/italia/publiccode-parser-go/v4 v4.3.7/go.mod h1:a6Hh7o2TeSZcJkEjHdXU7A/kyHyJDVhnCPO6sT81lbo=
github.com/italia/publiccode-parser-go/v5 v5.1.0 h1:gBfi+2JjuKsSjwmSkdDFbuZRqh1xZUm2DPXH4TXrs/Y=
github.com/italia/publiccode-parser-go/v5 v5.1.0/go.mod h1:xndoanQHcweEnJlubntvOHlT/cvde0eFDF59O5PwuCg=
github.com/italia/publiccode-parser-go/v5 v5.1.1 h1:XVuWXNohNJfSvvXO3OjBoKJU09UELEtRXFpkSwOttvg=
github.com/italia/publiccode-parser-go/v5 v5.1.1/go.mod h1:xndoanQHcweEnJlubntvOHlT/cvde0eFDF59O5PwuCg=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
Expand Down
2 changes: 1 addition & 1 deletion go-src/publiccode-parser-wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"strings"
"unsafe"

"github.com/italia/publiccode-parser-go/v4"
"github.com/italia/publiccode-parser-go/v5"
)

//export NewParser
Expand Down
14 changes: 12 additions & 2 deletions src/PublicCodeV0.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public function getRepoOwner(): ?string
return $this->data['legal']['repoOwner'] ?? null;
}

public function getCategories(): array
public function getCategories(): ?array
{
return $this->data['categories'];
return $this->data['categories'] ?? null;
}

public function getRoadmap(): ?string
Expand All @@ -124,6 +124,16 @@ public function getReleaseDate(): ?\DateTimeInterface
return new \DateTime($this->data['releaseDate']);
}

public function getOrganisationName(): ?string
{
return $this->data['organisation']['name'] ?? null;
}

public function getOrganisationUri(): ?string
{
return $this->data['organisation']['uri'] ?? null;
}

public function getDevelopmentStatus(): string
{
return $this->data['developmentStatus'];
Expand Down
1 change: 1 addition & 0 deletions tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function testPublicCodeAccessors(): void
$this->assertEquals('community', $maintenance['type']);

$categories = $publicCode->getCategories();
$this->assertNotNull($categories);
$this->assertContains('cloud-management', $categories);
}

Expand Down
Loading