Conversation
a1fa945 to
6a0ca80
Compare
862e276 to
5d0a630
Compare
ba3d8fe to
143e27b
Compare
b76f569 to
2adc875
Compare
| $a[$rdf] = $parser->getSimpleIndex(0); | ||
| } elseif ( | ||
| is_array($a[$rdf]) | ||
| and isset($a[$rdf][0]) |
There was a problem hiding this comment.
I'd long since forgotten and existed in PHP...!
| * @param ObjectType $type | ||
| */ | ||
| private function get_subjects_where($p, $o, $type) | ||
| private function get_subjects_where(string $p, $o, string $type): array |
There was a problem hiding this comment.
Why does the docblock type it as a TriplePredicate but in the function it types it as a string ?
There was a problem hiding this comment.
Types like TriplePredicate, ObjectValue are PHPStan type aliases, defined here:
tripod-php/src/classes/ExtendedGraph.php
Lines 12 to 17 in 2adc875
(though language servers in PHPStorm, Intelephense in VSCode, etc. also interpret them and provide completions based on them)
I'm using TriplePredicate for consistency, even though it translates to just string. This helps make a better sense of what's inside the object, which is especially visible here:
tripod-php/src/classes/ExtendedGraph.php
Line 19 in 2adc875
I think this enhances the reading experience as you can quickly find where predicates are referenced, such as here:
tripod-php/src/classes/ExtendedGraph.php
Lines 954 to 956 in 2adc875
So you know it's not just an array being returned, it's an array of predicates.
| * @param 'literal'|'resource' $type | ||
| */ | ||
| private function add_to_sequence($s, $o, $type = 'resource') | ||
| private function add_to_sequence(string $s, $o, string $type = 'resource'): void |
There was a problem hiding this comment.
Same question as above, but TripleSubject vs. string
phpstan.neon
Outdated
| @@ -0,0 +1,17 @@ | |||
| parameters: | |||
| level: 5 | |||
astilla
left a comment
There was a problem hiding this comment.
Well...it's massive... 🤣
Looks like some good automated updates.
I've left a couple of questions I wasn't sure about a difference in typing between docblock and function param definition.
Other than than it looks sane but being so big I've somewhat skimmed it.
8462d75 to
e40d121
Compare
e40d121 to
29a2458
Compare
todo: use ObjectId->getTimestamp()Used
rector.php