This file contains hidden or 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 | |
| function validateApplicationTangled($user) { | |
| if($user->age>18) { | |
| if(($user->hasPreviousApplication && !$user->previousApplicationApproved) || !$user->hasPreviousApplication) { | |
| printf("Cool, application approved for user %s\n", $user->name); | |
| return true; | |
| } else { | |
| printf("Sorry, but the user %s has a previously approved application\n", $user->name); | |
| return false; | |
| } |
This file contains hidden or 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 | |
| function validateApplicationTangled($user) { | |
| if($user->age>18) { | |
| if(($user->hasPreviousApplication && !$user->previousApplicationApproved) || !$user->hasPreviousApplication) { | |
| printf("Cool, application approved for user %s\n", $user->name); | |
| return true; | |
| } else { | |
| printf("Sorry, but the user %s has a previously approved application\n", $user->name); | |
| return false; | |
| } |
This file contains hidden or 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 | |
| function validateApplicationUntangled($user) { | |
| if($user->age<18) { | |
| printf("Sorry, but the user %s is under 18\n", $user->name); | |
| return false; | |
| } | |
| if($user->hasPreviousApplication && $user->previousApplicationApproved) { | |
| printf("Sorry, but the user %s has a previously approved application\n", $user->name); | |
| return false; |
This file contains hidden or 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
| return sprintf( | |
| “The user %s %s has a balance of $%f.”, | |
| $firstName, | |
| $lastName, | |
| $balance | |
| ); | |
| return "The user " . $firstName . " has a balance of $" . $balance . "."; |
This file contains hidden or 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
| return sprintf("%0.3f",$number); | |
| return number_format($number, 3, '.', ''); |
This file contains hidden or 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
| return 'The number is ' + str(2) + '.' | |
| return 'The number is %s.' % 2 |
This file contains hidden or 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
| return $id ? "The item was updated." : "The item was created"; | |
| ######## | |
| $action = $id ? "updated" : "created"; | |
| return sprintf("The item was %s.", $action). |
This file contains hidden or 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
| class FizzRule: | |
| def matchesRule(self, number): | |
| return not (number % 3); | |
| def getReplacement(self): | |
| return "Fizz"; | |
| class BuzzRule: | |
| def matchesRule(self, number): | |
| return not (number % 5); |
This file contains hidden or 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
| class Rule: | |
| def matchesRule(self, number): | |
| pass | |
| def getReplacement(self): | |
| pass | |
| class FizzRule: | |
| def matchesRule(self, number): | |
| return not (number % 3); |
This file contains hidden or 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 | |
| namespace App\Forms; | |
| use Kris\LaravelFormBuilder\Form; | |
| use Yaml; | |
| use Carbon\Carbon; | |
| use App\Forms\Report\FormConfig; | |
| use App\Forms\Entities\EntityFormConfig; | |
| use App\Services\ReportServices\ReportStringProcessingTrait; |
OlderNewer