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 Tests\Project; | |
| use RecursiveCallbackFilterIterator; | |
| use RecursiveDirectoryIterator; | |
| use RecursiveIteratorIterator; | |
| use SplFileInfo; | |
| use Tests\Constraints; | |
| use Tests\TestCase; |
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 | |
| use Illuminate\Support\Facades\Gate; | |
| use RuntimeException; | |
| /** | |
| * @template M | |
| */ | |
| trait HasRouteBoundModel | |
| { |
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
| <scheme name="Light - Minimal Color" version="142" parent_scheme="Default"> | |
| <option name="FONT_SCALE" value="1.0" /> | |
| <metaInfo> | |
| <property name="created">2022-04-18T10:59:54</property> | |
| <property name="ide">PhpStorm</property> | |
| <property name="ideVersion">2022.1.0.0</property> | |
| <property name="modified">2022-04-18T11:00:13</property> | |
| <property name="originalScheme">Light - Minimal Color</property> | |
| </metaInfo> | |
| <console-font> |
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 | |
| class MonthlyPlan | |
| { | |
| public int $length = 1; | |
| public string $unit = 'month'; | |
| public function normalizeBillingPeriod(Subscription $subscription, Carbon $charge_at): array | |
| { | |
| // First, we'll naively compute the end of the billing period (assuming the timing is 100% accurate) |
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
| File 1: | |
| REMOVE: LegacyRecord::each(function($record) { | |
| ADD: LegacyRecord::with('new_record')->each(function($record) { | |
| $identity = ['legacy_id' => $record->id]; | |
| $values = $this->transformLegacyRecord($record); | |
| REMOVE: NewRecord::updateOrCreate($identity, $values); | |
| ADD: $new_record = $record->new_record ?? NewRecord::make($identity); | |
| ADD: $new_record->fill($this->transformLegacyRecord($record)); |
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\Support; | |
| use Closure; | |
| use Illuminate\Support\Facades\App; | |
| use Illuminate\Support\Str; | |
| use Illuminate\Testing\Assert; | |
| trait ShouldBeMocked |
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
| root = true | |
| [*] | |
| charset = utf-8 | |
| end_of_line = lf | |
| insert_final_newline = true | |
| indent_style = space | |
| indent_size = 4 | |
| trim_trailing_whitespace = true |
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 | |
| class ArticleController | |
| { | |
| public function show(Request $request, Article $article) | |
| { | |
| // Set up a response and add last modified and/or ETag data | |
| $response = response() | |
| ->setLastModified($article->updated_at) | |
| ->setEtag(md5($article->body), true); |
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 | |
| $data = [ | |
| 'a2' => null, | |
| 'a3' => '', | |
| 'a4' => [], | |
| 'b2' => null, | |
| 'b3' => '', | |
| 'b4' => [], | |
| 'c2' => null, |
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 | |
| Str::macro('spellOutNumbers', static function($value, $locale = 'en_us') { | |
| $separatorFormatter = new \NumberFormatter($locale, \NumberFormatter::DECIMAL); | |
| $groupingSeparator = preg_quote($separatorFormatter->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL), '/'); | |
| $decimalSeparator = preg_quote($separatorFormatter->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL), '/'); | |
| $spellOutFormatter = new \NumberFormatter($locale, \NumberFormatter::SPELLOUT); | |
| return preg_replace_callback( |