f2 api client#2
Conversation
af50995 to
317d224
Compare
95d30fd to
93e95c1
Compare
| $this->closed = 'true' === (string) $sxe->Closed; | ||
| $this->journalPlan = JournalPlan::fromSimpleXMLElement($sxe->JournalPlan); | ||
| $this->processInstruction = ProcessInstruction::fromSimpleXMLElement($sxe->ProcessInstruction); | ||
| $this->deadline = $this->createDateTime($sxe->Deadline); |
There was a problem hiding this comment.
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.
| "symfony/options-resolver": "^6.4 || ^7.4 || ^8.1" | ||
| }, | ||
| "require-dev": { | ||
| "php": "^8.3", |
There was a problem hiding this comment.
Does this not belong in require rather than require-dev?
| #[Option(description: 'Path to to cache directory. If not specified, no requests will be cached.')] | ||
| ?string $cacheDirectory = null, |
There was a problem hiding this comment.
From what i can see leaving out --cache-directory ends up with FilesystemAdapter just using a default directory? I.e. it is still cached?
There was a problem hiding this comment.
Good point. The behaviour actually depends on the context the console command is run in …
If the command run like shown in the documentation, e.g. like docker compose run --quiet --rm phpfpm php bin/f2-api-client getServiceIndex, then no caching will be in effect since the container is removed after completing the command. In this case, setting the cache directory path to a path on the host will enable caching between calls.
Running the command in a running docker compose setup, will make the cache always active.
I've updated the description to make a little more sense in da58440
| protected function getAccessToken(): array | ||
| { | ||
| $cache = $this->getCache(); | ||
| $cacheKey = sha1(__METHOD__); |
There was a problem hiding this comment.
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.
Co-authored-by: Jeppe Kuhlmann Andersen <78410897+jekuaitk@users.noreply.github.com>
F2 API client for PHP