repo
stringlengths
7
63
file_url
stringlengths
81
284
file_path
stringlengths
5
200
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:02:33
2026-01-05 05:24:06
truncated
bool
2 classes
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/ServiceBase.php
src/ServiceBase.php
<?php namespace BenSampo\Embed; use BenSampo\Embed\ValueObjects\Ratio; use BenSampo\Embed\ValueObjects\Url; use Illuminate\Contracts\View\View; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Str; abstract class ServiceBase implements ServiceContract { protected Url $url; protected ?Ratio $aspe...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/Exceptions/ServiceNotFoundException.php
src/Exceptions/ServiceNotFoundException.php
<?php namespace BenSampo\Embed\Exceptions; use Exception; class ServiceNotFoundException extends Exception { public function __construct(string $url) { parent::__construct("Could not find an embed service to use for the url '$url'."); } }
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/Rules/EmbeddableUrl.php
src/Rules/EmbeddableUrl.php
<?php namespace BenSampo\Embed\Rules; use BenSampo\Embed\ServiceFactory; use BenSampo\Embed\ValueObjects\Url; use Illuminate\Contracts\Validation\Rule; use BenSampo\Embed\Exceptions\ServiceNotFoundException; use BenSampo\Embed\Services\Fallback; class EmbeddableUrl implements Rule { protected array $allowedServi...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/ViewComponents/StylesViewComponent.php
src/ViewComponents/StylesViewComponent.php
<?php namespace BenSampo\Embed\ViewComponents; use Illuminate\View\Component; use Illuminate\Contracts\View\View; class StylesViewComponent extends Component { public function render(): View { return view('embed::components.styles'); } }
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/ViewComponents/EmbedViewComponent.php
src/ViewComponents/EmbedViewComponent.php
<?php namespace BenSampo\Embed\ViewComponents; use Illuminate\View\Component; use BenSampo\Embed\ServiceFactory; use BenSampo\Embed\ServiceContract; use BenSampo\Embed\ValueObjects\Url; use BenSampo\Embed\ValueObjects\Ratio; use BenSampo\Embed\Exceptions\ServiceNotFoundException; class EmbedViewComponent extends Com...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/ViewComponents/ResponsiveWrapperViewComponent.php
src/ViewComponents/ResponsiveWrapperViewComponent.php
<?php namespace BenSampo\Embed\ViewComponents; use Illuminate\View\Component; use Illuminate\Contracts\View\View; use BenSampo\Embed\ValueObjects\Ratio; class ResponsiveWrapperViewComponent extends Component { public Ratio $aspectRatio; public function __construct(Ratio $aspectRatio) { $this->as...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/Services/Fallback.php
src/Services/Fallback.php
<?php namespace BenSampo\Embed\Services; use BenSampo\Embed\ServiceBase; use BenSampo\Embed\ValueObjects\Url; class Fallback extends ServiceBase { public static function detect(Url $url): bool { return false; } protected function viewData(): array { return [ 'url' => ...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/Services/Slideshare.php
src/Services/Slideshare.php
<?php namespace BenSampo\Embed\Services; use DOMDocument; use Illuminate\Support\Str; use BenSampo\Embed\ServiceBase; use BenSampo\Embed\ValueObjects\Url; use Illuminate\Support\Facades\Http; class Slideshare extends ServiceBase { public static function detect(Url $url): bool { return Str::startsWith...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/Services/YouTube.php
src/Services/YouTube.php
<?php namespace BenSampo\Embed\Services; use BenSampo\Embed\ServiceBase; use BenSampo\Embed\ValueObjects\Url; class YouTube extends ServiceBase { public static function detect(Url $url): bool { return (new self($url))->videoId() !== null; } protected function viewData(): array { ...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/Services/GoogleMaps.php
src/Services/GoogleMaps.php
<?php namespace BenSampo\Embed\Services; use Illuminate\Support\Str; use BenSampo\Embed\ServiceBase; use BenSampo\Embed\ValueObjects\Url; class GoogleMaps extends ServiceBase { public static function detect(Url $url): bool { return Str::startsWith($url, [ 'https://www.google.com/maps/embe...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/Services/Dailymotion.php
src/Services/Dailymotion.php
<?php namespace BenSampo\Embed\Services; use BenSampo\Embed\ServiceBase; use BenSampo\Embed\ValueObjects\Url; class Dailymotion extends ServiceBase { public static function detect(Url $url): bool { return (new self($url))->videoId() !== null; } protected function viewData(): array { ...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/Services/Vimeo.php
src/Services/Vimeo.php
<?php namespace BenSampo\Embed\Services; use BenSampo\Embed\ServiceBase; use BenSampo\Embed\ValueObjects\Url; class Vimeo extends ServiceBase { public static function detect(Url $url): bool { return (new self($url))->parseUrl() !== null; } protected function viewData(): array { r...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/Services/Miro.php
src/Services/Miro.php
<?php namespace BenSampo\Embed\Services; use DOMDocument; use Illuminate\Support\Str; use BenSampo\Embed\ServiceBase; use BenSampo\Embed\ValueObjects\Url; use Illuminate\Support\Facades\Http; class Miro extends ServiceBase { public static function detect(Url $url): bool { return Str::startsWith($url,...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/ValueObjects/Url.php
src/ValueObjects/Url.php
<?php namespace BenSampo\Embed\ValueObjects; use Illuminate\Support\Str; use InvalidArgumentException; class Url { protected string $url; public function __construct(string $url) { if (! Str::startsWith($url, ['http://', 'https://'])) { $url = 'https://' . $url; }; i...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/src/ValueObjects/Ratio.php
src/ValueObjects/Ratio.php
<?php namespace BenSampo\Embed\ValueObjects; use InvalidArgumentException; class Ratio { public int $width; public int $height; public function __construct(string $ratio) { [$this->width, $this->height] = $this->parseRatioString($ratio); } public function asPercentage() { ...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/ServiceBaseTest.php
tests/ServiceBaseTest.php
<?php namespace BenSampo\Embed\Tests; use BenSampo\Embed\ServiceContract; use Illuminate\Contracts\View\View; use BenSampo\Embed\ValueObjects\Url; use BenSampo\Embed\ValueObjects\Ratio; use BenSampo\Embed\Tests\Fixtures\Services\Dummy; use BenSampo\Embed\Tests\Cases\ApplicationTestCase; use BenSampo\Embed\Tests\Fixtu...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/ServiceFactoryTest.php
tests/ServiceFactoryTest.php
<?php namespace BenSampo\Embed\Tests; use BenSampo\Embed\ServiceFactory; use BenSampo\Embed\ValueObjects\Url; use BenSampo\Embed\Services\Fallback; use BenSampo\Embed\Tests\Fixtures\Services\Dummy; use BenSampo\Embed\Tests\Cases\ApplicationTestCase; use BenSampo\Embed\Tests\Fixtures\Services\DummyTwo; use BenSampo\Em...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Fixtures/Services/DummyTwo.php
tests/Fixtures/Services/DummyTwo.php
<?php namespace BenSampo\Embed\Tests\Fixtures\Services; use Illuminate\Support\Str; use BenSampo\Embed\ServiceBase; use BenSampo\Embed\ValueObjects\Url; class DummyTwo extends ServiceBase { public static function detect(Url $url): bool { return Str::contains($url, 'https://dummy-two.com'); } }
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Fixtures/Services/Dummy.php
tests/Fixtures/Services/Dummy.php
<?php namespace BenSampo\Embed\Tests\Fixtures\Services; use Illuminate\Support\Str; use BenSampo\Embed\ServiceBase; use BenSampo\Embed\ValueObjects\Url; class Dummy extends ServiceBase { public static function detect(Url $url): bool { return Str::contains($url, 'https://dummy.com'); } protec...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Fixtures/resources/views/services/dummy.blade.php
tests/Fixtures/resources/views/services/dummy.blade.php
Dummy service
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Fixtures/resources/views/services/dummy-two.blade.php
tests/Fixtures/resources/views/services/dummy-two.blade.php
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Fakes/ServiceFactoryFake.php
tests/Fakes/ServiceFactoryFake.php
<?php namespace BenSampo\Embed\Tests\Fakes; use BenSampo\Embed\ServiceFactory; class ServiceFactoryFake extends ServiceFactory { protected $serviceClassesPath = __DIR__ . '/../Fixtures/Services'; protected $serviceClassesNamespace = "BenSampo\Embed\Tests\Fixtures\Services\\"; }
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Rules/EmbeddableUrlTest.php
tests/Rules/EmbeddableUrlTest.php
<?php namespace BenSampo\Embed\Tests\Rules; use BenSampo\Embed\Services\Miro; use BenSampo\Embed\Services\Vimeo; use BenSampo\Embed\Services\YouTube; use BenSampo\Embed\Rules\EmbeddableUrl; use Illuminate\Support\Facades\Validator; use BenSampo\Embed\Tests\Cases\ApplicationTestCase; class EmbeddableUrlTest extends A...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/ViewComponents/EmbedViewComponentTest.php
tests/ViewComponents/EmbedViewComponentTest.php
<?php namespace BenSampo\Embed\Tests\ViewComponents; use BenSampo\Embed\ServiceFactory; use BenSampo\Embed\Tests\Cases\ApplicationTestCase; use BenSampo\Embed\ViewComponents\EmbedViewComponent; class EmbedViewComponentTest extends ApplicationTestCase { public function test_it_can_render_a_view_for_a_service() ...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Services/MiroTest.php
tests/Services/MiroTest.php
<?php namespace BenSampo\Embed\Tests\Services; use BenSampo\Embed\Services\Miro; use BenSampo\Embed\Tests\Cases\ServiceTestCase; class MiroTest extends ServiceTestCase { public function setup(): void { $this->markTestSkipped('Miro seems to be unstable'); parent::setUp(); } /** ...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Services/YouTubeTest.php
tests/Services/YouTubeTest.php
<?php namespace BenSampo\Embed\Tests\Services; use BenSampo\Embed\Services\YouTube; use BenSampo\Embed\Tests\Cases\ServiceTestCase; class YouTubeTest extends ServiceTestCase { protected function serviceClass(): string { return YouTube::class; } protected function expectedViewName(): stri...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Services/GoogleMapsTest.php
tests/Services/GoogleMapsTest.php
<?php namespace BenSampo\Embed\Tests\Services; use BenSampo\Embed\Services\GoogleMaps; use BenSampo\Embed\Tests\Cases\ServiceTestCase; class GoogleMapsTest extends ServiceTestCase { protected function serviceClass(): string { return GoogleMaps::class; } protected function expectedViewName():...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Services/SlideshareTest.php
tests/Services/SlideshareTest.php
<?php namespace BenSampo\Embed\Tests\Services; use BenSampo\Embed\Services\Slideshare; use BenSampo\Embed\Tests\Cases\ServiceTestCase; class SlideshareTest extends ServiceTestCase { protected function serviceClass(): string { return Slideshare::class; } protected function expectedViewName():...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Services/VimeoTest.php
tests/Services/VimeoTest.php
<?php namespace BenSampo\Embed\Tests\Services; use BenSampo\Embed\Services\Vimeo; use BenSampo\Embed\Tests\Cases\ServiceTestCase; class VimeoTest extends ServiceTestCase { protected function serviceClass(): string { return Vimeo::class; } protected function expectedViewName(): string ...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Services/FallbackTest.php
tests/Services/FallbackTest.php
<?php namespace BenSampo\Embed\Tests\Services; use BenSampo\Embed\Services\Fallback; use BenSampo\Embed\Tests\Cases\ServiceTestCase; class FallbackTest extends ServiceTestCase { public function test_it_detects_appropriate_urls() { // This inherited test is irrelevant for the fallback. $this->...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Services/DailymotionTest.php
tests/Services/DailymotionTest.php
<?php namespace BenSampo\Embed\Tests\Services; use BenSampo\Embed\Services\Dailymotion; use BenSampo\Embed\Tests\Cases\ServiceTestCase; class DailymotionTest extends ServiceTestCase { protected function serviceClass(): string { return Dailymotion::class; } protected function expectedView...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/ValueObjects/UrlTest.php
tests/ValueObjects/UrlTest.php
<?php namespace BenSampo\Embed\Tests\ValueObjects; use PHPUnit\Framework\TestCase; use BenSampo\Embed\ValueObjects\Url; use InvalidArgumentException; class UrlTest extends TestCase { public function test_it_accepts_a_valid_url() { $this->assertInstanceOf(Url::class, new Url('https://sampo.co.uk')); ...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/ValueObjects/RatioTest.php
tests/ValueObjects/RatioTest.php
<?php namespace BenSampo\Embed\Tests\ValueObjects; use PHPUnit\Framework\TestCase; use BenSampo\Embed\ValueObjects\Ratio; use InvalidArgumentException; class RatioTest extends TestCase { public function test_it_accepts_a_valid_ratio() { $this->assertInstanceOf(Ratio::class, new Ratio('16:9')); ...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Cases/ApplicationTestCase.php
tests/Cases/ApplicationTestCase.php
<?php namespace BenSampo\Embed\Tests\Cases; use Orchestra\Testbench\TestCase; use BenSampo\Embed\EmbedServiceProvider; class ApplicationTestCase extends TestCase { protected function getPackageProviders($app) { return [ EmbedServiceProvider::class, ]; } protected function...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/tests/Cases/ServiceTestCase.php
tests/Cases/ServiceTestCase.php
<?php namespace BenSampo\Embed\Tests\Cases; use BenSampo\Embed\ServiceContract; use BenSampo\Embed\ValueObjects\Url; abstract class ServiceTestCase extends ApplicationTestCase { abstract protected function serviceClass(): string; abstract protected function expectedViewName(): string; abstract prot...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/resources/views/services/slideshare.blade.php
resources/views/services/slideshare.blade.php
<x-embed-responsive-wrapper :aspect-ratio="$aspectRatio"> <iframe aria-label="{{ $label }}" src="{{ $iframeUrl }}" frameborder="0" allow="autoplay; fullscreen" allowfullscreen ></iframe> </x-embed-responsive-wrapper>
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/resources/views/services/miro.blade.php
resources/views/services/miro.blade.php
<x-embed-responsive-wrapper :aspect-ratio="$aspectRatio"> <iframe aria-label="{{ $label }}" src="{{ $iframeUrl }}" frameborder="0" allow="autoplay; fullscreen" allowfullscreen ></iframe> </x-embed-responsive-wrapper>
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/resources/views/services/dailymotion.blade.php
resources/views/services/dailymotion.blade.php
<x-embed-responsive-wrapper :aspect-ratio="$aspectRatio"> <iframe aria-label="{{ $label }}" frameborder="0" type="text/html" src="https://www.dailymotion.com/embed/video/{{ $videoId }}" allowfullscreen ></iframe> </x-embed-responsive-wrapper>
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/resources/views/services/vimeo.blade.php
resources/views/services/vimeo.blade.php
<x-embed-responsive-wrapper :aspect-ratio="$aspectRatio"> <iframe aria-label="{{ $label }}" src="https://player.vimeo.com/video/{{ $videoId }}@if($videoHash)?h={{ $videoHash}}@endif" frameborder="0" allow="autoplay; fullscreen" allowfullscreen ></ifra...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/resources/views/services/youtube.blade.php
resources/views/services/youtube.blade.php
<x-embed-responsive-wrapper :aspect-ratio="$aspectRatio"> <iframe aria-label="foo {{ $label }}" src="https://www.youtube-nocookie.com/embed/{{ $videoId }}" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen ></iframe> </x...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/resources/views/services/googlemaps.blade.php
resources/views/services/googlemaps.blade.php
<x-embed-responsive-wrapper :aspect-ratio="$aspectRatio"> <iframe aria-label="{{ $label }}" src="{{ $iframeUrl }}" frameborder="0" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade" ></iframe> </x-embed-responsive...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/resources/views/services/fallback.blade.php
resources/views/services/fallback.blade.php
<x-embed-responsive-wrapper :aspect-ratio="$aspectRatio"> <div class="laravel-embed__fallback"> <p> Sorry, we were unable to embed<br /> <strong>{{ $url }}</strong> </p> </div> </x-embed-responsive-wrapper>
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/resources/views/components/responsive-wrapper.blade.php
resources/views/components/responsive-wrapper.blade.php
<div class="laravel-embed__responsive-wrapper" style="padding-bottom: {{ $aspectRatio->asPercentage() }}%" > {{ $slot }} </div>
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
BenSampo/laravel-embed
https://github.com/BenSampo/laravel-embed/blob/6692360e65a2f024900a56a564ca23da6ef3d145/resources/views/components/styles.blade.php
resources/views/components/styles.blade.php
<style> .laravel-embed__responsive-wrapper { position: relative; height: 0; overflow: hidden; max-width: 100%; } .laravel-embed__fallback { background: rgba(0, 0, 0, 0.15); color: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; } .laravel-embed__fallback, .laravel-embe...
php
MIT
6692360e65a2f024900a56a564ca23da6ef3d145
2026-01-05T04:40:24.357530Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/src/Describe.php
src/Describe.php
<?php namespace Zerotoprod\DataModel; use Attribute; /** * Pass an associative array to the constructor to describe the behavior of a property when it is resolved. * * Property example: * ``` * use Zerotoprod\DataModel\DataModel; * use Zerotoprod\DataModel\Describe; * * class User * { * use DataModel; ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/src/DuplicateDescribeAttributeException.php
src/DuplicateDescribeAttributeException.php
<?php namespace Zerotoprod\DataModel; use RuntimeException; /** * Thrown when a duplicate Describe attribute references the same property. * * @link https://github.com/zero-to-prod/data-model * @see https://github.com/zero-to-prod/data-model-helper * @see https://github.com/zero-to-prod/data-model-factory * ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/src/PropertyRequiredException.php
src/PropertyRequiredException.php
<?php namespace Zerotoprod\DataModel; use RuntimeException; /** * Thrown when a property is required. * * @link https://github.com/zero-to-prod/data-model * @see https://github.com/zero-to-prod/data-model-helper * @see https://github.com/zero-to-prod/data-model-factory * @see https://github.com/zero-to-prod...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/src/DataModel.php
src/DataModel.php
<?php namespace Zerotoprod\DataModel; use ReflectionAttribute; use ReflectionClass; use ReflectionException; use ReflectionUnionType; use UnitEnum; /** * Enables classes to instantiate themselves from arrays or objects, auto-populating properties based on type hints and attributes. * Supports primitives, custom cl...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/src/InvalidValue.php
src/InvalidValue.php
<?php namespace Zerotoprod\DataModel; use RuntimeException; /** * Thrown when a property is required. * * @link https://github.com/zero-to-prod/data-model * @see https://github.com/zero-to-prod/data-model-helper * @see https://github.com/zero-to-prod/data-model-factory * @see https://github.com/zero-to-prod...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/TestCase.php
tests/TestCase.php
<?php namespace Tests; use PHPUnit\Framework\TestCase as BaseTestCase; abstract class TestCase extends BaseTestCase { // }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/functions.php
tests/functions.php
<?php if (!function_exists('parse')) { function parse($value, $context): string { return $value.'bar'; } function uppercase(mixed $value, array $context) { return strtoupper($value); } function parse_without_context($value): string { return $value.'bar'; } ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/Cast/BaseClass.php
tests/Unit/Metadata/Cast/BaseClass.php
<?php namespace Tests\Unit\Metadata\Cast; use DateTimeImmutable; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; #[Describe([ 'cast' => [ DateTimeImmutable::class => [Helpers::class, 'dateTimeImmutable'], 'string' => [Helpers::class, 'setString'], ] ])] class BaseClass ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/Cast/Helpers.php
tests/Unit/Metadata/Cast/Helpers.php
<?php namespace Tests\Unit\Metadata\Cast; use DateTimeImmutable; class Helpers { public static function dateTimeImmutable($value): DateTimeImmutable { return new DateTimeImmutable($value); } public static function setString(): string { return 'bar'; } }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/Cast/MetadataTest.php
tests/Unit/Metadata/Cast/MetadataTest.php
<?php namespace Tests\Unit\Metadata\Cast; use DateTimeImmutable; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class MetadataTest extends TestCase { #[Test] public function from(): void { $BaseClass = BaseClass::from([ BaseClass::DateTimeImmutable => '2015-10-04 17:24:43.0000...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/MissingAsNullProperty/User.php
tests/Unit/Metadata/MissingAsNullProperty/User.php
<?php namespace Tests\Unit\Metadata\MissingAsNullProperty; use Zerotoprod\DataModel\Describe; //#[Describe(['nullable' => true])] class User { use \Zerotoprod\DataModel\DataModel; #[Describe(['nullable' => true])] public ?string $name; #[Describe(['default' => ''])] public string $last_name; ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/MissingAsNullProperty/MissingAsNullTest.php
tests/Unit/Metadata/MissingAsNullProperty/MissingAsNullTest.php
<?php namespace Tests\Unit\Metadata\MissingAsNullProperty; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class MissingAsNullTest extends TestCase { #[Test] public function from(): void { $User = User::from(); $this->assertNull($User->name); $this->assertEmpty($User->last...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/MissingAsNull/User.php
tests/Unit/Metadata/MissingAsNull/User.php
<?php namespace Tests\Unit\Metadata\MissingAsNull; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; #[Describe(['nullable' => true])] class User { use DataModel; public ?string $name; #[Describe(['nullable' => true])] public ?int $age; }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/MissingAsNull/MissingAsNullTest.php
tests/Unit/Metadata/MissingAsNull/MissingAsNullTest.php
<?php namespace Tests\Unit\Metadata\MissingAsNull; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class MissingAsNullTest extends TestCase { #[Test] public function from(): void { $User = User::from(); $this->assertNull($User->name); $this->assertNull($User->age); } }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/CastOverride/BaseClass.php
tests/Unit/Metadata/CastOverride/BaseClass.php
<?php namespace Tests\Unit\Metadata\CastOverride; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; #[Describe(describe_override)] class BaseClass { use DataModel; public const name = 'name'; #[Describe(['cast' => [Helpers::class, 'setFooString']])] public string $name; }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/CastOverride/Helpers.php
tests/Unit/Metadata/CastOverride/Helpers.php
<?php namespace Tests\Unit\Metadata\CastOverride; class Helpers { public static function setBarString(): string { return 'bar'; } public static function setFooString(): string { return 'foo'; } }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/CastOverride/MetadataTest.php
tests/Unit/Metadata/CastOverride/MetadataTest.php
<?php namespace Tests\Unit\Metadata\CastOverride; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class MetadataTest extends TestCase { #[Test] public function foo(): void { define('describe_override', [ 'cast' => [ 'string' => [Helpers::class, 'setBarString'], ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/CastFromConst/BaseClass.php
tests/Unit/Metadata/CastFromConst/BaseClass.php
<?php namespace Tests\Unit\Metadata\CastFromConst; use DateTimeImmutable; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; #[Describe(describe)] class BaseClass { use DataModel; public const DateTimeImmutable = 'DateTimeImmutable'; public const name = 'name'; public DateTimeIm...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/CastFromConst/Helpers.php
tests/Unit/Metadata/CastFromConst/Helpers.php
<?php namespace Tests\Unit\Metadata\CastFromConst; use DateMalformedStringException; use DateTimeImmutable; class Helpers { /** * @throws DateMalformedStringException */ public static function dateTimeImmutable($value): DateTimeImmutable { return new DateTimeImmutable($value); } ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Metadata/CastFromConst/MetadataTest.php
tests/Unit/Metadata/CastFromConst/MetadataTest.php
<?php namespace Tests\Unit\Metadata\CastFromConst; use DateTimeImmutable; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class MetadataTest extends TestCase { #[Test] public function from(): void { define('describe', [ 'cast' => [ DateTimeImmutable::class => [...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/TaggedMethodException/BaseClass.php
tests/Unit/Describe/TaggedMethodException/BaseClass.php
<?php namespace Tests\Unit\Describe\TaggedMethodException; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const override = 'override'; #[Describe(self::override)] public function altOverride(): string { return 'bar'; } ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/TaggedMethodException/TaggedMethodExceptionTest.php
tests/Unit/Describe/TaggedMethodException/TaggedMethodExceptionTest.php
<?php namespace Tests\Unit\Describe\TaggedMethodException; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; use Zerotoprod\DataModel\DuplicateDescribeAttributeException; class TaggedMethodExceptionTest extends TestCase { #[Test] public function taggedMethodException(): void { $this->expect...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Post/BaseClass.php
tests/Unit/Describe/Post/BaseClass.php
<?php namespace Tests\Unit\Describe\Post; use ReflectionAttribute; use ReflectionProperty; use RuntimeException; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const int = 'int'; #[Describe([ 'cast' => [self::class, 'increment'], ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Post/PostTest.php
tests/Unit/Describe/Post/PostTest.php
<?php namespace Tests\Unit\Describe\Post; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class PostTest extends TestCase { #[Test] public function from(): void { $this->expectExceptionMessage('Value too large.'); BaseClass::from([ BaseClass::int => 100, ]); ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/DefaultPost/DefaultTest.php
tests/Unit/Describe/DefaultPost/DefaultTest.php
<?php namespace Tests\Unit\Describe\DefaultPost; use PHPUnit\Framework\Attributes\Test; use RuntimeException; use Tests\TestCase; class DefaultTest extends TestCase { #[Test] public function from(): void { $this->expectException(RuntimeException::class); $this->expectExceptionMessage('James')...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/DefaultPost/User.php
tests/Unit/Describe/DefaultPost/User.php
<?php namespace Tests\Unit\Describe\DefaultPost; use RuntimeException; use Tests\Unit\Examples\ExtendsTrait\DataModel; use Zerotoprod\DataModel\Describe; class User { use DataModel; public string $age; #[Describe([ 'default' => 'James', 'post' => [self::class, 'post'] ])] public...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Required/BaseClass.php
tests/Unit/Describe/Required/BaseClass.php
<?php namespace Tests\Unit\Describe\Required; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const required = 'required'; public const required_no_value = 'required_no_value'; #[Describe(['required' => true])] public string $requir...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Required/IgnoresUnionsTest.php
tests/Unit/Describe/Required/IgnoresUnionsTest.php
<?php namespace Tests\Unit\Describe\Required; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; use Zerotoprod\DataModel\PropertyRequiredException; class IgnoresUnionsTest extends TestCase { #[Test] public function required_with_value(): void { $this->expectException(PropertyRequiredExcepti...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Class/BaseClass.php
tests/Unit/Describe/Class/BaseClass.php
<?php namespace Tests\Unit\Describe\Class; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const string = 'string'; #[Describe(['cast' => [Parser::class, 'parse']])] public string $string; }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Class/ClassTest.php
tests/Unit/Describe/Class/ClassTest.php
<?php namespace Tests\Unit\Describe\Class; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ClassTest extends TestCase { #[Test] public function from(): void { $BaseClass = BaseClass::from([ BaseClass::string => 'foo', ]); $this->assertEquals('bar', $BaseC...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Class/Parser.php
tests/Unit/Describe/Class/Parser.php
<?php namespace Tests\Unit\Describe\Class; class Parser { public static function parse($value): string { return 'bar'; } }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/HandlesArray/User.php
tests/Unit/Describe/HandlesArray/User.php
<?php namespace Tests\Unit\Describe\HandlesArray; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class User { use DataModel; public const url = 'url'; #[Describe([ 'cast' => [self::class, 'isUrl'], 'protocols' => ['http'] ])] public ?string $url; publ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/HandlesArray/IsUrlTest.php
tests/Unit/Describe/HandlesArray/IsUrlTest.php
<?php namespace Tests\Unit\Describe\HandlesArray; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class IsUrlTest extends TestCase { #[Test] public function valid_url(): void { $User = User::from([ User::url => 'https://example.com/', ]); self::assertEquals('ht...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/TaggedMethod/Bogus.php
tests/Unit/Describe/TaggedMethod/Bogus.php
<?php namespace Tests\Unit\Describe\TaggedMethod; use Attribute; #[Attribute] class Bogus { }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/TaggedMethod/BaseClass.php
tests/Unit/Describe/TaggedMethod/BaseClass.php
<?php namespace Tests\Unit\Describe\TaggedMethod; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const override = 'override'; public string $override; public function override(): string { return 'foo'; } #[Describe...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/TaggedMethod/TaggedMethodTest.php
tests/Unit/Describe/TaggedMethod/TaggedMethodTest.php
<?php namespace Tests\Unit\Describe\TaggedMethod; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class TaggedMethodTest extends TestCase { #[Test] public function taggedMethod(): void { $BaseClass = BaseClass::from([ BaseClass::override => 'foo', ]); $this->a...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/ClassDynamic/BaseClass.php
tests/Unit/Describe/ClassDynamic/BaseClass.php
<?php namespace Tests\Unit\Describe\ClassDynamic; use DateTime; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const string_from_class = 'string_from_class'; public const string_from_function = 'string_from_function'; public const DateT...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/ClassDynamic/Parser.php
tests/Unit/Describe/ClassDynamic/Parser.php
<?php namespace Tests\Unit\Describe\ClassDynamic; use DateTime; class Parser { public static function arbitrary($value, $context = null): string { return $context !== null ? $context['string'] ?? null.'bar' : 'bar'; } public static function parse($value, $context = null): string { ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/ClassDynamic/ClassDynamicTest.php
tests/Unit/Describe/ClassDynamic/ClassDynamicTest.php
<?php namespace Tests\Unit\Describe\ClassDynamic; use DateTime; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ClassDynamicTest extends TestCase { #[Test] public function fromDynamic(): void { $BaseClass = BaseClass::from([ BaseClass::string_from_class => 'foo', ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Nullable/Invalid/BaseClass.php
tests/Unit/Describe/Nullable/Invalid/BaseClass.php
<?php namespace Tests\Unit\Describe\Nullable\Invalid; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; #[Describe(['nullable' => []])] public string $invalid; }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Nullable/Invalid/ClassTest.php
tests/Unit/Describe/Nullable/Invalid/ClassTest.php
<?php namespace Tests\Unit\Describe\Nullable\Invalid; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; use Zerotoprod\DataModel\InvalidValue; class ClassTest extends TestCase { #[Test] public function from(): void { $this->expectException(InvalidValue::class); BaseClass::from(); ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Nullable/Boolean/BaseClass.php
tests/Unit/Describe/Nullable/Boolean/BaseClass.php
<?php namespace Tests\Unit\Describe\Nullable\Boolean; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const true = 'true'; public const false = 'false'; #[Describe(['nullable'])] public ?string $true; #[Describe(['nullable' => ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Nullable/Boolean/ClassTest.php
tests/Unit/Describe/Nullable/Boolean/ClassTest.php
<?php namespace Tests\Unit\Describe\Nullable\Boolean; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ClassTest extends TestCase { #[Test] public function from(): void { $BaseClass = BaseClass::from(); self::assertNull($BaseClass->true); self::assertFalse(isset($Base...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/MissingAsNull/Invalid/BaseClass.php
tests/Unit/Describe/MissingAsNull/Invalid/BaseClass.php
<?php namespace Tests\Unit\Describe\MissingAsNull\Invalid; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; #[Describe(['missing_as_null' => []])] public string $invalid; }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/MissingAsNull/Invalid/ClassTest.php
tests/Unit/Describe/MissingAsNull/Invalid/ClassTest.php
<?php namespace Tests\Unit\Describe\MissingAsNull\Invalid; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; use Zerotoprod\DataModel\InvalidValue; class ClassTest extends TestCase { #[Test] public function from(): void { $this->expectException(InvalidValue::class); BaseClass::from()...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/MissingAsNull/Boolean/BaseClass.php
tests/Unit/Describe/MissingAsNull/Boolean/BaseClass.php
<?php namespace Tests\Unit\Describe\MissingAsNull\Boolean; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const true = 'true'; public const false = 'false'; #[Describe(['missing_as_null'])] public ?string $true; #[Describe(['m...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/MissingAsNull/Boolean/ClassTest.php
tests/Unit/Describe/MissingAsNull/Boolean/ClassTest.php
<?php namespace Tests\Unit\Describe\MissingAsNull\Boolean; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ClassTest extends TestCase { #[Test] public function from(): void { $BaseClass = BaseClass::from(); self::assertNull($BaseClass->true); self::assertFalse(isset(...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Attribute/AttributeTest.php
tests/Unit/Describe/Attribute/AttributeTest.php
<?php namespace Tests\Unit\Describe\Attribute; use Tests\TestCase; use Zerotoprod\DataModel\Describe; use Zerotoprod\DataModel\InvalidValue; class AttributeTest extends TestCase { public function testRequiredPositive(): void { $d = new Describe(['required' => true]); $this->assertTrue($d->req...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Via/BaseClass.php
tests/Unit/Describe/Via/BaseClass.php
<?php namespace Tests\Unit\Describe\Via; use ReflectionAttribute; use ReflectionProperty; use RuntimeException; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const ChildClass = 'ChildClass'; public const ChildClass2 = 'ChildClass2'; #...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Via/ChildClass.php
tests/Unit/Describe/Via/ChildClass.php
<?php namespace Tests\Unit\Describe\Via; class ChildClass { public const int = 'int'; public function __construct(public int $int) { } public static function via(array $context): self { return new self($context[self::int]); } }
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Via/ViaTest.php
tests/Unit/Describe/Via/ViaTest.php
<?php namespace Tests\Unit\Describe\Via; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ViaTest extends TestCase { #[Test] public function from(): void { $BaseClass = BaseClass::from([ BaseClass::ChildClass => [ ChildClass::int => 1 ], ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Default/BaseClass.php
tests/Unit/Describe/Default/BaseClass.php
<?php namespace Tests\Unit\Describe\Default; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const string = 'string'; public const bool = 'bool'; #[Describe(['default' => '1'])] public string $string; #[Describe(['default' => f...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/Default/ClassTest.php
tests/Unit/Describe/Default/ClassTest.php
<?php namespace Tests\Unit\Describe\Default; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ClassTest extends TestCase { #[Test] public function from(): void { $BaseClass = BaseClass::from(); $this->assertEquals('1', $BaseClass->string); } #[Test] public function f...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/NotReadonly/BaseClass.php
tests/Unit/Describe/NotReadonly/BaseClass.php
<?php namespace Tests\Unit\Describe\NotReadonly; use DateTime; use Zerotoprod\DataModel\DataModel; use Zerotoprod\DataModel\Describe; class BaseClass { use DataModel; public const string_from_class = 'string_from_class'; public const string_from_function = 'string_from_function'; public const DateTi...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/NotReadonly/Parser.php
tests/Unit/Describe/NotReadonly/Parser.php
<?php namespace Tests\Unit\Describe\NotReadonly; use DateTime; class Parser { public static function arbitrary($value, $context = null): string { return $context !== null ? $context['string'] ?? null.'bar' : 'bar'; } public static function parse($value, $context = null): string { ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false
zero-to-prod/data-model
https://github.com/zero-to-prod/data-model/blob/af1a3958fdf2d4cccbab4b787d2c510d04cdd384/tests/Unit/Describe/NotReadonly/ClassDynamicTest.php
tests/Unit/Describe/NotReadonly/ClassDynamicTest.php
<?php namespace Tests\Unit\Describe\NotReadonly; use DateTime; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ClassDynamicTest extends TestCase { #[Test] public function fromDynamic(): void { $BaseClass = BaseClass::from([ BaseClass::string_from_class => 'foo', ...
php
MIT
af1a3958fdf2d4cccbab4b787d2c510d04cdd384
2026-01-05T04:40:32.643481Z
false