This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is Aphyrs "Reversing the technical interview" in PHP. | |
// https://aphyr.com/posts/340-reversing-the-technical-interview | |
function cons($a, $b) { | |
return function ($x) use ($a, $b) { | |
return $x ? $a : $b; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This seems to be incredibly usefull when arrays are passed that should | |
// have elements with the same type. | |
foreach ($array as $key => $value) (function ($key, SomeClass $value) { | |
// We know the $value has SomeClass now and this still looks like an | |
// ordinary recursion. | |
})($key, $value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Result of analysis: | |
################################################################################ | |
WholeIliasCodebase cannot invoke triggerError | |
-> 5 Violations | |
################################################################################ | |
Services/Component/classes/class.ilClaimingPermissionHelper.php (180): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Straight forward translation of the dicto rules for ILIAS to php-dicto. The | |
* results look different than the original analysis, so this is not to be trusted. | |
* This rather is a proof of concept that php-dicto can process the ILIAS codebase. | |
*/ | |
use Lechimp\Dicto\Dicto as D; |