Skip to content

f2 api client#2

Open
rimi-itk wants to merge 29 commits into
mainfrom
f2-api-client
Open

f2 api client#2
rimi-itk wants to merge 29 commits into
mainfrom
f2-api-client

Conversation

@rimi-itk

@rimi-itk rimi-itk commented May 18, 2026

Copy link
Copy Markdown
Contributor

F2 API client for PHP

@rimi-itk rimi-itk force-pushed the f2-api-client branch 4 times, most recently from af50995 to 317d224 Compare May 19, 2026 12:58
@rimi-itk rimi-itk force-pushed the f2-api-client branch 2 times, most recently from 95d30fd to 93e95c1 Compare May 19, 2026 14:22
@rimi-itk rimi-itk marked this pull request as ready for review July 7, 2026 13:53
@rimi-itk rimi-itk requested a review from jekuaitk July 7, 2026 13:53
Comment thread src/Model/CaseFile.php
$this->closed = 'true' === (string) $sxe->Closed;
$this->journalPlan = JournalPlan::fromSimpleXMLElement($sxe->JournalPlan);
$this->processInstruction = ProcessInstruction::fromSimpleXMLElement($sxe->ProcessInstruction);
$this->deadline = $this->createDateTime($sxe->Deadline);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would deadline not be set to now if nothing is provided here?

public ?\DateTimeImmutable $deadline = null;

Makes me think it may be null.

The same would go for other uses of createDateTime.

Comment thread composer.json
"symfony/options-resolver": "^6.4 || ^7.4 || ^8.1"
},
"require-dev": {
"php": "^8.3",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not belong in require rather than require-dev?

Comment thread src/ApiClient.php
Comment on lines +182 to +186
$diff = new JsonDiff(
$caseFile->apiSerialize(),
$updatedCaseFile->apiSerialize(),
options: JsonDiff::SKIP_TEST_OPS,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not use computeDiff like matterUpdate and documentUpdate?

Suggested change
$diff = new JsonDiff(
$caseFile->apiSerialize(),
$updatedCaseFile->apiSerialize(),
options: JsonDiff::SKIP_TEST_OPS,
);
$diff = $this->computeDiff($caseFile, $updatedCaseFile);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And should it check the $diff for any changes before actually patching akin to matterUpdate and documentUpdate?

Comment on lines +30 to +31
#[Option(description: 'Path to to cache directory. If not specified, no requests will be cached.')]
?string $cacheDirectory = null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what i can see leaving out --cache-directory ends up with FilesystemAdapter just using a default directory? I.e. it is still cached?

Comment thread src/ApiClient.php
protected function getAccessToken(): array
{
$cache = $this->getCache();
$cacheKey = sha1(__METHOD__);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this involve credentials used? Looks me like a switch of credentials would not result in a new access token issued and cached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants