prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
hp
namespace Illuminate\Support\Defer;
use Illuminate\Support\Str;
class DeferredCallback
{
/**
* Create a new deferred callback instance.
*
* @param callable $callback
*/
public function __construct(public $callback, public ?string $name = null, public bool $always = false)
{
... | *
* @param bool $always
* @return $this
*/
public function always(bool $always = true): static
{
$this->always = $always;
return $this;
}
/**
* Invoke the deferred callback.
*
* @return | $this
*/
public function name(string $name): static
{
$this->name = $name;
return $this;
}
/**
* Indicate that the deferred callback should run even on unsuccessful requests and jobs.
| {
"filepath": "src/Illuminate/Support/Defer/DeferredCallback.php",
"language": "php",
"file_size": 1106,
"cut_index": 515,
"middle_length": 229
} |
pace Illuminate\Support\Facades;
/**
* @method static \Illuminate\Cache\RateLimiter for(\UnitEnum|string $name, \Closure $callback)
* @method static \Closure|null limiter(\UnitEnum|string $name)
* @method static mixed attempt(string $key, int $maxAttempts, \Closure $callback, \DateTimeInterface|\DateInterval|int $d... |
* @method static mixed attempts(string $key)
* @method static bool resetAttempts(string $key)
* @method static int remaining(string $key, int $maxAttempts)
* @method static int retriesLeft(string $key, int $maxAttempts)
* @method static void clear(st | od static int increment(string $key, \DateTimeInterface|\DateInterval|int $decaySeconds = 60, int $amount = 1)
* @method static int decrement(string $key, \DateTimeInterface|\DateInterval|int $decaySeconds = 60, int $amount = 1) | {
"filepath": "src/Illuminate/Support/Facades/RateLimiter.php",
"language": "php",
"file_size": 1416,
"cut_index": 524,
"middle_length": 229
} |
tion;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Support\Traits\ReflectsClosures;
use PHPUnit\Framework\Assert as PHPUnit;
class NotificationFake implements Fake, NotificationDispatcher, NotificationFactory
{
use Macroable, ReflectsClosures;
/**
* All of the notif... | otification was sent on-demand based on a truth-test callback.
*
* @param string|\Closure $notification
* @param callable|null $callback
* @return void
*
* @throws \Exception
*/
public function assertSentOnDemand( |
public $locale;
/**
* Indicates if notifications should be serialized and restored when pushed to the queue.
*
* @var bool
*/
protected $serializeAndRestore = false;
/**
* Assert if a n | {
"filepath": "src/Illuminate/Support/Testing/Fakes/NotificationFake.php",
"language": "php",
"file_size": 12126,
"cut_index": 921,
"middle_length": 229
} |
hp
namespace Illuminate\Support\Queue\Concerns;
use Illuminate\Container\Container;
use Illuminate\Queue\QueueRoutes;
trait ResolvesQueueRoutes
{
/**
* Resolve the default connection name for a given queueable instance.
*
* @param object $queueable
* @return string|null
*/
public f... |
* Get the queue routes manager instance.
*
* @return \Illuminate\Queue\QueueRoutes
*/
protected function queueRoutes()
{
$container = Container::getInstance();
return $container->bound('queue.routes')
| able instance.
*
* @param object $queueable
* @return string|null
*/
public function resolveQueueFromQueueRoute($queueable)
{
return $this->queueRoutes()->getQueue($queueable);
}
/** | {
"filepath": "src/Illuminate/Support/Queue/Concerns/ResolvesQueueRoutes.php",
"language": "php",
"file_size": 1077,
"cut_index": 515,
"middle_length": 229
} |
ble;
use League\Flysystem\FilesystemAdapter as FlysystemAdapter;
use League\Flysystem\FilesystemOperator;
class AwsS3V3Adapter extends FilesystemAdapter
{
use Conditionable;
/**
* The AWS S3 client.
*
* @var \Aws\S3\S3Client
*/
protected $client;
/**
* Create a new AwsS3V3Fil... | :__construct($driver, $adapter, $config);
$this->client = $client;
}
/**
* Get the URL for the file at the given path.
*
* @param string $path
* @return string
*
* @throws \RuntimeException
*/
publ | param \Aws\S3\S3Client $client
*/
public function __construct(FilesystemOperator $driver, FlysystemAdapter $adapter, array $config, S3Client $client)
{
$config['directory_separator'] = '/';
parent: | {
"filepath": "src/Illuminate/Filesystem/AwsS3V3Adapter.php",
"language": "php",
"file_size": 4285,
"cut_index": 614,
"middle_length": 229
} |
apter;
use League\Flysystem\StorageAttributes;
use League\Flysystem\UnableToCopyFile;
use League\Flysystem\UnableToCreateDirectory;
use League\Flysystem\UnableToDeleteDirectory;
use League\Flysystem\UnableToDeleteFile;
use League\Flysystem\UnableToMoveFile;
use League\Flysystem\UnableToProvideChecksum;
use League\Flysy... | r implements CloudFilesystemContract
{
use Conditionable;
use Macroable {
__call as macroCall;
}
/**
* The Flysystem filesystem implementation.
*
* @var \League\Flysystem\FilesystemOperator
*/
protected $dri | HPUnit\Framework\Assert as PHPUnit;
use Psr\Http\Message\StreamInterface;
use RuntimeException;
use Symfony\Component\HttpFoundation\StreamedResponse;
/**
* @mixin \League\Flysystem\FilesystemOperator
*/
class FilesystemAdapte | {
"filepath": "src/Illuminate/Filesystem/FilesystemAdapter.php",
"language": "php",
"file_size": 29604,
"cut_index": 1331,
"middle_length": 229
} |
ysystem\Filesystem as Flysystem;
use League\Flysystem\FilesystemAdapter as FlysystemAdapter;
use League\Flysystem\Ftp\FtpAdapter;
use League\Flysystem\Ftp\FtpConnectionOptions;
use League\Flysystem\Local\LocalFilesystemAdapter as LocalAdapter;
use League\Flysystem\PathPrefixing\PathPrefixedAdapter;
use League\Flysystem... | \FilesystemAdapter
*/
class FilesystemManager implements FactoryContract
{
use RebindsCallbacksToSelf;
/**
* The application instance.
*
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;
/**
| tyConverter;
use League\Flysystem\Visibility;
use ReflectionException;
use RuntimeException;
use function Illuminate\Support\enum_value;
/**
* @mixin \Illuminate\Contracts\Filesystem\Filesystem
* @mixin \Illuminate\Filesystem | {
"filepath": "src/Illuminate/Filesystem/FilesystemManager.php",
"language": "php",
"file_size": 13198,
"cut_index": 921,
"middle_length": 229
} |
ass LockableFile
{
/**
* The file resource.
*
* @var resource
*/
protected $handle;
/**
* The file path.
*
* @var string
*/
protected $path;
/**
* Indicates if the file is locked.
*
* @var bool
*/
protected $isLocked = false;
/**... | d function ensureDirectoryExists($path)
{
if (! file_exists(dirname($path))) {
@mkdir(dirname($path), 0777, true);
}
}
/**
* Create the file resource.
*
* @param string $path
* @param string | $this->ensureDirectoryExists($path);
$this->createResource($path, $mode);
}
/**
* Create the file's directory if necessary.
*
* @param string $path
* @return void
*/
protecte | {
"filepath": "src/Illuminate/Filesystem/LockableFile.php",
"language": "php",
"file_size": 3582,
"cut_index": 614,
"middle_length": 229
} |
te\Filesystem;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use League\Flysystem\PathTraversalDetected;
class ServeFile
{
/**
* Create a new invokable controller to serve files.
*/
public function __construct(
protected string $disk,
protected array $config,
... | 'Cache-Control' => 'no-store, no-cache, must-revalidate, max-age=0',
'Content-Security-Policy' => "default-src 'none'; style-src 'unsafe-inline'; sandbox",
];
return tap(
Storage::dis | ort_unless(
$this->hasValidSignature($request),
$this->isProduction ? 404 : 403
);
try {
abort_unless(Storage::disk($this->disk)->exists($path), 404);
$headers = [
| {
"filepath": "src/Illuminate/Filesystem/ServeFile.php",
"language": "php",
"file_size": 1762,
"cut_index": 537,
"middle_length": 229
} |
te\Session;
use Illuminate\Contracts\Cache\Repository as CacheContract;
use SessionHandlerInterface;
class CacheBasedSessionHandler implements SessionHandlerInterface
{
/**
* The cache repository instance.
*
* @var \Illuminate\Contracts\Cache\Repository
*/
protected $cache;
/**
*... | /**
* {@inheritdoc}
*
* @return bool
*/
public function open($savePath, $sessionName): bool
{
return true;
}
/**
* {@inheritdoc}
*
* @return bool
*/
public function close(): bool
{
| \Illuminate\Contracts\Cache\Repository $cache
* @param int $minutes
*/
public function __construct(CacheContract $cache, $minutes)
{
$this->cache = $cache;
$this->minutes = $minutes;
}
| {
"filepath": "src/Illuminate/Session/CacheBasedSessionHandler.php",
"language": "php",
"file_size": 1926,
"cut_index": 537,
"middle_length": 229
} |
;
use Illuminate\Support\Arr;
use Illuminate\Support\Carbon;
use Illuminate\Support\InteractsWithTime;
use SessionHandlerInterface;
class DatabaseSessionHandler implements ExistenceAwareInterface, SessionHandlerInterface
{
use InteractsWithTime;
/**
* The database connection instance.
*
* @var ... | otected $container;
/**
* The existence state of the session.
*
* @var bool
*/
protected $exists;
/**
* Create a new database session handler instance.
*
* @param \Illuminate\Database\ConnectionInterface $ | * The number of minutes the session should be valid.
*
* @var int
*/
protected $minutes;
/**
* The container instance.
*
* @var \Illuminate\Contracts\Container\Container|null
*/
pr | {
"filepath": "src/Illuminate/Session/DatabaseSessionHandler.php",
"language": "php",
"file_size": 7159,
"cut_index": 716,
"middle_length": 229
} |
e\Filesystem\Filesystem;
use Illuminate\Support\Carbon;
use SessionHandlerInterface;
use Symfony\Component\Finder\Finder;
class FileSessionHandler implements SessionHandlerInterface
{
/**
* The filesystem instance.
*
* @var \Illuminate\Filesystem\Filesystem
*/
protected $files;
/**
... | c function __construct(Filesystem $files, $path, $minutes)
{
$this->path = $path;
$this->files = $files;
$this->minutes = $minutes;
}
/**
* {@inheritdoc}
*
* @return bool
*/
public function open( | */
protected $minutes;
/**
* Create a new file driven handler instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @param string $path
* @param int $minutes
*/
publi | {
"filepath": "src/Illuminate/Session/FileSessionHandler.php",
"language": "php",
"file_size": 2556,
"cut_index": 563,
"middle_length": 229
} |
ass NullSessionHandler implements SessionHandlerInterface
{
/**
* {@inheritdoc}
*
* @return bool
*/
public function open($savePath, $sessionName): bool
{
return true;
}
/**
* {@inheritdoc}
*
* @return bool
*/
public function close(): bool
{
... | function write($sessionId, $data): bool
{
return true;
}
/**
* {@inheritdoc}
*
* @return bool
*/
public function destroy($sessionId): bool
{
return true;
}
/**
* {@inheritdoc}
*
| tdoc}
*
* @return bool
*/
public | {
"filepath": "src/Illuminate/Session/NullSessionHandler.php",
"language": "php",
"file_size": 986,
"cut_index": 582,
"middle_length": 52
} |
The session name.
*
* @var string
*/
protected $name;
/**
* The session attributes.
*
* @var array
*/
protected $attributes = [];
/**
* The session handler implementation.
*
* @var \SessionHandlerInterface
*/
protected $handler;
/**
... | alization
*/
public function __construct($name, SessionHandlerInterface $handler, $id = null, $serialization = 'php')
{
$this->setId($id);
$this->name = $name;
$this->handler = $handler;
$this->serialization = $ | */
protected $started = false;
/**
* Create a new session instance.
*
* @param string $name
* @param \SessionHandlerInterface $handler
* @param string|null $id
* @param string $seri | {
"filepath": "src/Illuminate/Session/Store.php",
"language": "php",
"file_size": 19258,
"cut_index": 1331,
"middle_length": 229
} |
te\Session\Console;
use Illuminate\Console\MigrationGeneratorCommand;
use Symfony\Component\Console\Attribute\AsCommand;
use function Illuminate\Filesystem\join_paths;
#[AsCommand(name: 'make:session-table', aliases: ['session:table'])]
class SessionTableCommand extends MigrationGeneratorCommand
{
/**
* The... | ation table name.
*
* @return string
*/
protected function migrationTableName()
{
return 'sessions';
}
/**
* Get the path to the migration stub file.
*
* @return string
*/
protected function m | ected $aliases = ['session:table'];
/**
* The console command description.
*
* @var string
*/
protected $description = 'Create a migration for the session database table';
/**
* Get the migr | {
"filepath": "src/Illuminate/Session/Console/SessionTableCommand.php",
"language": "php",
"file_size": 1696,
"cut_index": 537,
"middle_length": 229
} |
Closure;
use Illuminate\Bus\BatchRepository;
use Illuminate\Bus\PendingBatch;
use Illuminate\Bus\UpdatedBatchJobCounts;
use Illuminate\Support\Str;
class BatchRepositoryFake implements BatchRepository
{
/**
* The batches stored in the repository.
*
* @var \Illuminate\Bus\Batch[]
*/
protect... | nction find(string $batchId)
{
return $this->batches[$batchId] ?? null;
}
/**
* Store a new pending batch.
*
* @param \Illuminate\Bus\PendingBatch $batch
* @return \Illuminate\Bus\Batch
*/
public function | get($limit, $before)
{
return $this->batches;
}
/**
* Retrieve information about an existing batch.
*
* @param string $batchId
* @return \Illuminate\Bus\Batch|null
*/
public fu | {
"filepath": "src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php",
"language": "php",
"file_size": 3665,
"cut_index": 614,
"middle_length": 229
} |
Support\Collection;
use Illuminate\Support\Str;
use Illuminate\View\Compilers\ComponentTagCompiler;
use function Illuminate\Support\enum_value;
class DynamicComponent extends Component
{
/**
* The name of the component.
*
* @var string
*/
public $component;
/**
* The component ta... | {
$this->component = (string) enum_value($component);
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
$te | ay
*/
protected static $componentClasses = [];
/**
* Create a new component instance.
*
* @param \BackedEnum|string $component
*/
public function __construct(BackedEnum|string $component)
| {
"filepath": "src/Illuminate/View/DynamicComponent.php",
"language": "php",
"file_size": 4832,
"cut_index": 614,
"middle_length": 229
} |
method static \Illuminate\Contracts\View\View make(string $view, \Illuminate\Contracts\Support\Arrayable|array $data = [], array $mergeData = [])
* @method static \Illuminate\Contracts\View\View first(array $views, \Illuminate\Contracts\Support\Arrayable|array $data = [], array $mergeData = [])
* @method static strin... | w)
* @method static \Illuminate\Contracts\View\Engine getEngineFromPath(string $path)
* @method static mixed share(array|string $key, mixed $value = null)
* @method static void incrementRender()
* @method static void decrementRender()
* @method static | , \Illuminate\Contracts\Support\Arrayable|array $data = [], array $mergeData = [])
* @method static string renderEach(string $view, array $data, string $iterator, string $empty = 'raw|')
* @method static bool exists(string $vie | {
"filepath": "src/Illuminate/Support/Facades/View.php",
"language": "php",
"file_size": 5631,
"cut_index": 716,
"middle_length": 229
} |
namespace Illuminate\Filesystem;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Storage;
use League\Flysystem\PathTraversalDetected;
class ReceiveFile
{
/**
* Create a new invokable controller to receive files.
*/
public function __construct(
prote... | k)->put($path, $request->getContent());
return response()->noContent();
} catch (PathTraversalDetected) {
abort(404);
}
}
/**
* Determine if the request has a valid signature if applicable.
*/
| voke(Request $request, string $path): Response
{
abort_unless(
$this->hasValidSignature($request),
$this->isProduction ? 404 : 403
);
try {
Storage::disk($this->dis | {
"filepath": "src/Illuminate/Filesystem/ReceiveFile.php",
"language": "php",
"file_size": 1164,
"cut_index": 518,
"middle_length": 229
} |
e\Contracts\Cookie\QueueingFactory as CookieJar;
use Illuminate\Support\InteractsWithTime;
use SessionHandlerInterface;
use Symfony\Component\HttpFoundation\Request;
class CookieSessionHandler implements SessionHandlerInterface
{
use InteractsWithTime;
/**
* The cookie jar instance.
*
* @var \I... | @var bool
*/
protected $expireOnClose;
/**
* Create a new cookie driven handler instance.
*
* @param \Illuminate\Contracts\Cookie\QueueingFactory $cookie
* @param int $minutes
* @param bool $expireOnClose
| est;
/**
* The number of minutes the session should be valid.
*
* @var int
*/
protected $minutes;
/**
* Indicates whether the session should be expired when the browser closes.
*
* | {
"filepath": "src/Illuminate/Session/CookieSessionHandler.php",
"language": "php",
"file_size": 2933,
"cut_index": 563,
"middle_length": 229
} |
te\Session;
use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Contracts\Encryption\Encrypter as EncrypterContract;
use SessionHandlerInterface;
class EncryptedStore extends Store
{
/**
* The encrypter instance.
*
* @var \Illuminate\Contracts\Encryption\Encrypter
*/
prote... | zation = 'php')
{
$this->encrypter = $encrypter;
parent::__construct($name, $handler, $id, $serialization);
}
/**
* Prepare the raw string data from the session for unserialization.
*
* @param string $data
| ption\Encrypter $encrypter
* @param string|null $id
* @param string $serialization
*/
public function __construct($name, SessionHandlerInterface $handler, EncrypterContract $encrypter, $id = null, $seriali | {
"filepath": "src/Illuminate/Session/EncryptedStore.php",
"language": "php",
"file_size": 1752,
"cut_index": 537,
"middle_length": 229
} |
sion;
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
class SymfonySessionDecorator implements SessionInterface
{
/**
* The underlying Laravel session store.
... | rt();
}
/**
* {@inheritdoc}
*/
public function getId(): string
{
return $this->store->getId();
}
/**
* {@inheritdoc}
*/
public function setId(string $id): void
{
$this->store->setId($id) | ion\Session $store
*/
public function __construct(Session $store)
{
$this->store = $store;
}
/**
* {@inheritdoc}
*/
public function start(): bool
{
return $this->store->sta | {
"filepath": "src/Illuminate/Session/SymfonySessionDecorator.php",
"language": "php",
"file_size": 3658,
"cut_index": 614,
"middle_length": 229
} |
c string fullUrlWithoutQuery(array|string $keys)
* @method static string path()
* @method static string decodedPath()
* @method static string|null segment(int $index, string|null $default = null)
* @method static array segments()
* @method static bool is(mixed ...$patterns)
* @method static bool routeIs(mixed ...... | static array getAcceptableContentTypes()
* @method static \Illuminate\Http\Request merge(array $input)
* @method static \Illuminate\Http\Request mergeIfMissing(array $input)
* @method static \Illuminate\Http\Request replace(array $input)
* @method stat | ic bool ajax()
* @method static bool pjax()
* @method static bool prefetch()
* @method static bool secure()
* @method static string|null ip()
* @method static array ips()
* @method static string|null userAgent()
* @method | {
"filepath": "src/Illuminate/Support/Facades/Request.php",
"language": "php",
"file_size": 12101,
"cut_index": 921,
"middle_length": 229
} |
original encoded json.
*
* @var \Illuminate\Contracts\Support\Jsonable|\JsonSerializable|array|string
*/
public $json;
/**
* The decoded json contents.
*
* @var array|null
*/
protected $decoded;
/**
* Create a new assertable JSON string instance.
*
* @... | seif (is_array($jsonable)) {
$this->decoded = $jsonable;
} else {
$this->decoded = json_decode($jsonable, true);
}
}
/**
* Validate and return the decoded response JSON.
*
* @param string|nul | jsonable instanceof JsonSerializable) {
$this->decoded = $jsonable->jsonSerialize();
} elseif ($jsonable instanceof Jsonable) {
$this->decoded = json_decode($jsonable->toJson(), true);
} el | {
"filepath": "src/Illuminate/Testing/AssertableJsonString.php",
"language": "php",
"file_size": 11612,
"cut_index": 921,
"middle_length": 229
} |
te\Contracts\Container\Container
*/
protected $container;
/**
* The options resolver callback.
*
* @var \Closure|null
*/
protected $optionsResolver;
/**
* The token resolver callback.
*
* @var \Closure|null
*/
protected $tokenResolver;
/**
* A... | atabaseBeforeMigratingCallbacks = [];
/**
* All of the registered "setUp" test database callbacks.
*
* @var array
*/
protected $setUpTestDatabaseCallbacks = [];
/**
* All of the registered "tearDown" process callbacks | *
* @var array
*/
protected $setUpTestCaseCallbacks = [];
/**
* All of the registered "setUp" test database callbacks prior to the migrations.
*
* @var array
*/
protected $setUpTestD | {
"filepath": "src/Illuminate/Testing/ParallelTesting.php",
"language": "php",
"file_size": 7988,
"cut_index": 716,
"middle_length": 229
} |
yInput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Question\ChoiceQuestion;
class PendingCommand
{
use Conditionable, Macroable, Tappable;
/**
* The test being run.
*
* @var \Illuminate\Foundation\Testin... | *
* @var int
*/
protected $expectedExitCode;
/**
* The unexpected exit code.
*
* @var int
*/
protected $unexpectedExitCode;
/**
* Determine if the command has executed.
*
* @var bool
*/
| and to run.
*
* @var string
*/
protected $command;
/**
* The parameters to pass to the command.
*
* @var array
*/
protected $parameters;
/**
* The expected exit code.
| {
"filepath": "src/Illuminate/Testing/PendingCommand.php",
"language": "php",
"file_size": 18820,
"cut_index": 1331,
"middle_length": 229
} |
for the request.
*
* @var \Illuminate\Support\Collection
*/
public $exceptions;
/**
* The streamed content of the response.
*
* @var string
*/
protected $streamedContent;
/**
* Create a new test response instance.
*
* @param TResponse $response
... | Http\Request|null $request
* @return static<R>
*/
public static function fromBaseResponse($response, $request = null)
{
return new static($response, $request);
}
/**
* Assert that the response has a successful statu | = $request;
$this->exceptions = new Collection;
}
/**
* Create a new TestResponse from another response.
*
* @template R of TResponse
*
* @param R $response
* @param \Illuminate\ | {
"filepath": "src/Illuminate/Testing/TestResponse.php",
"language": "php",
"file_size": 58361,
"cut_index": 2151,
"middle_length": 229
} |
port\Traits\Macroable;
use Illuminate\Testing\Assert as PHPUnit;
use Illuminate\Testing\Constraints\SeeInHtml;
use Illuminate\Testing\Constraints\SeeInOrder;
use Illuminate\View\View;
use Stringable;
class TestView implements Stringable
{
use Macroable;
/**
* The original view.
*
* @var \Illumi... | se view has a given piece of bound data.
*
* @param string|array $key
* @param mixed $value
* @return $this
*/
public function assertViewHas($key, $value = null)
{
if (is_array($key)) {
return $this- | ce.
*
* @param \Illuminate\View\View $view
*/
public function __construct(View $view)
{
$this->view = $view;
$this->rendered = $view->render();
}
/**
* Assert that the respon | {
"filepath": "src/Illuminate/Testing/TestView.php",
"language": "php",
"file_size": 7039,
"cut_index": 716,
"middle_length": 229
} |
te\Testing\Constraints;
use Illuminate\Database\Connection;
use PHPUnit\Framework\Constraint\Constraint;
use ReflectionClass;
class CountInDatabase extends Constraint
{
/**
* The database connection.
*
* @var \Illuminate\Database\Connection
*/
protected $database;
/**
* The expec... | $expectedCount
*/
public function __construct(Connection $database, int $expectedCount)
{
$this->expectedCount = $expectedCount;
$this->database = $database;
}
/**
* Check if the expected and actual count are eq | checked against the expected count.
*
* @var int
*/
protected $actualCount;
/**
* Create a new constraint instance.
*
* @param \Illuminate\Database\Connection $database
* @param int | {
"filepath": "src/Illuminate/Testing/Constraints/CountInDatabase.php",
"language": "php",
"file_size": 1885,
"cut_index": 537,
"middle_length": 229
} |
use Illuminate\Database\Connection;
use PHPUnit\Framework\Constraint\Constraint;
class HasInDatabase extends Constraint
{
/**
* Number of records that will be shown in the console in case of failure.
*
* @var int
*/
protected $show = 3;
/**
* The database connection.
*
*... | uct(Connection $database, array $data)
{
$this->data = $data;
$this->database = $database;
}
/**
* Check if the data is found in the given table.
*
* @param string $table
* @return bool
*/
public | ixed>
*/
protected $data;
/**
* Create a new constraint instance.
*
* @param \Illuminate\Database\Connection $database
* @param array<string, mixed> $data
*/
public function __constr | {
"filepath": "src/Illuminate/Testing/Constraints/HasInDatabase.php",
"language": "php",
"file_size": 3249,
"cut_index": 614,
"middle_length": 229
} |
bool
*/
public function missing($path)
{
return ! $this->exists($path);
}
/**
* Get the contents of a file.
*
* @param string $path
* @param bool $lock
* @return string
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
pub... | n array
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public function json($path, $flags = 0, $lock = false)
{
return json_decode($this->get($path, $lock), true, 512, $flags);
}
/**
* Get | eNotFoundException("File does not exist at path {$path}.");
}
/**
* Get the contents of a file as decoded JSON.
*
* @param string $path
* @param int $flags
* @param bool $lock
* @retur | {
"filepath": "src/Illuminate/Filesystem/Filesystem.php",
"language": "php",
"file_size": 20343,
"cut_index": 1331,
"middle_length": 229
} |
RuntimeException;
class LocalFilesystemAdapter extends FilesystemAdapter
{
use Conditionable;
/**
* The name of the filesystem disk.
*
* @var string
*/
protected $disk;
/**
* Indicates if signed URLs should serve corresponding files.
*
* @var bool
*/
prote... | ls && $this->urlGeneratorResolver instanceof Closure
);
}
/**
* Determine if temporary upload URLs can be generated.
*
* @return bool
*/
public function providesTemporaryUploadUrls()
{
return $this->temp | /**
* Determine if temporary URLs can be generated.
*
* @return bool
*/
public function providesTemporaryUrls()
{
return $this->temporaryUrlCallback || (
$this->shouldServeSignedUr | {
"filepath": "src/Illuminate/Filesystem/LocalFilesystemAdapter.php",
"language": "php",
"file_size": 4003,
"cut_index": 614,
"middle_length": 229
} |
ate\Http\Request;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use InvalidArgumentException;
class FilesystemServiceProvider extends ServiceProvider
{
/**
* Bootstrap the filesystem.
*
* @return void
*/
public function boot()
{
$this->serveFiles(... | return new Filesystem;
});
}
/**
* Register the driver based filesystem.
*
* @return void
*/
protected function registerFlysystem()
{
$this->registerManager();
$this->app->singleton(' | erFlysystem();
}
/**
* Register the native filesystem implementation.
*
* @return void
*/
protected function registerNativeFilesystem()
{
$this->app->singleton('files', function () {
| {
"filepath": "src/Illuminate/Filesystem/FilesystemServiceProvider.php",
"language": "php",
"file_size": 4191,
"cut_index": 614,
"middle_length": 229
} |
e\Support\InteractsWithTime;
use SessionHandlerInterface;
class ArraySessionHandler implements SessionHandlerInterface
{
use InteractsWithTime;
/**
* The array of stored values.
*
* @var array
*/
protected $storage = [];
/**
* The number of minutes the session should be valid... | @inheritdoc}
*
* @return bool
*/
public function close(): bool
{
return true;
}
/**
* {@inheritdoc}
*
* @return string|false
*/
public function read($sessionId): string|false
{
if | ($minutes)
{
$this->minutes = $minutes;
}
/**
* {@inheritdoc}
*
* @return bool
*/
public function open($savePath, $sessionName): bool
{
return true;
}
/**
* { | {
"filepath": "src/Illuminate/Session/ArraySessionHandler.php",
"language": "php",
"file_size": 2611,
"cut_index": 563,
"middle_length": 229
} |
pace Illuminate\Session;
use Illuminate\Contracts\Cache\Factory as CacheFactory;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\Support\ServiceProvider;
class SessionServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public fu... | *
* @return void
*/
protected function registerSessionManager()
{
$this->app->singleton('session', function ($app) {
return new SessionManager($app);
});
}
/**
* Register the session driver insta | rn new StartSession($app->make(SessionManager::class), function () use ($app) {
return $app->make(CacheFactory::class);
});
});
}
/**
* Register the session manager instance.
| {
"filepath": "src/Illuminate/Session/SessionServiceProvider.php",
"language": "php",
"file_size": 1489,
"cut_index": 524,
"middle_length": 229
} |
te\Auth\AuthenticationException;
use Illuminate\Contracts\Auth\Factory as AuthFactory;
use Illuminate\Contracts\Session\Middleware\AuthenticatesSessions;
use Illuminate\Http\Request;
class AuthenticateSession implements AuthenticatesSessions
{
/**
* The authentication factory implementation.
*
* @va... | $this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
| */
protected static $redirectToCallback;
/**
* Create a new middleware instance.
*
* @param \Illuminate\Contracts\Auth\Factory $auth
*/
public function __construct(AuthFactory $auth)
{
| {
"filepath": "src/Illuminate/Session/Middleware/AuthenticateSession.php",
"language": "php",
"file_size": 4992,
"cut_index": 614,
"middle_length": 229
} |
?php
namespace Illuminate\Testing;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;
use Illuminate\Testing\Concerns\TestCaches;
use Illuminate\Testing\Concerns\TestDatabases;
use Illuminate\Testing\Concerns\TestViews;
class ParallelTestingServiceProvider extends ServicePro... | rovider.
*
* @return void
*/
public function register()
{
if ($this->app->runningInConsole()) {
$this->app->singleton(ParallelTesting::class, function () {
return new ParallelTesting($this->app);
| tion boot()
{
if ($this->app->runningInConsole()) {
$this->bootTestCache();
$this->bootTestDatabase();
$this->bootTestViews();
}
}
/**
* Register the service p | {
"filepath": "src/Illuminate/Testing/ParallelTestingServiceProvider.php",
"language": "php",
"file_size": 1031,
"cut_index": 513,
"middle_length": 229
} |
;
use PHPUnit\Framework\ExpectationFailedException;
use ReflectionProperty;
/**
* @internal
*
* @mixin Assert
*/
class TestResponseAssert
{
/**
* Create a new TestResponse assertion helper.
*/
private function __construct(protected TestResponse $response)
{
//
}
/**
* Cr... | */
public function __call($name, $arguments)
{
try {
Assert::$name(...$arguments);
} catch (ExpectationFailedException $e) {
throw $this->injectResponseContext($e);
}
}
/**
* Pass sta | method calls to the Assert class and decorate the exception message.
*
* @param string $name
* @param array $arguments
* @return void
*
* @throws \PHPUnit\Framework\ExpectationFailedException
| {
"filepath": "src/Illuminate/Testing/TestResponseAssert.php",
"language": "php",
"file_size": 4953,
"cut_index": 614,
"middle_length": 229
} |
nstraint;
use SebastianBergmann\Comparator\ComparisonFailure;
use SebastianBergmann\Exporter\Exporter;
use Traversable;
class ArraySubset extends Constraint
{
/**
* @var iterable
*/
protected $subset;
/**
* @var bool
*/
protected $strict;
/**
* Create a new array subset c... | e. null is returned otherwise.
*
* If $returnResult is true, the result of the evaluation is returned as
* a boolean value instead: true in case of success, false in case of a
* failure.
*
* @param mixed $other
* @param | rict = $strict;
$this->subset = $subset;
}
/**
* Evaluates the constraint for parameter $other.
*
* If $returnResult is set to false (the default), an exception is thrown
* in case of a failur | {
"filepath": "src/Illuminate/Testing/Constraints/ArraySubset.php",
"language": "php",
"file_size": 3671,
"cut_index": 614,
"middle_length": 229
} |
se PHPUnit\Framework\Constraint\Constraint;
use ReflectionClass;
class SeeInHtml extends Constraint
{
/**
* The string under validation.
*
* @var string
*/
protected $content;
/**
* Indicates the values must appear in order.
*
* @var bool
*/
protected $ordered;
... | $this->content = $content;
$this->ordered = $ordered;
$this->negate = $negate;
}
/**
* Determine if the rule passes validation.
*
* @param array $values
*/
public function matches($values): bool
| var string
*/
protected $failedValue;
/**
* Create a new constraint instance.
*
* @param string $content
*/
public function __construct($content, $ordered = false, $negate = false)
{
| {
"filepath": "src/Illuminate/Testing/Constraints/SeeInHtml.php",
"language": "php",
"file_size": 3006,
"cut_index": 563,
"middle_length": 229
} |
te\Testing\Constraints;
use PHPUnit\Framework\Constraint\Constraint;
use ReflectionClass;
class SeeInOrder extends Constraint
{
/**
* The string under validation.
*
* @var string
*/
protected $content;
/**
* The last value that failed to pass validation.
*
* @var string... | tml_entity_decode($this->content, ENT_QUOTES, 'UTF-8');
$position = 0;
foreach ($values as $value) {
if (empty($value)) {
continue;
}
$decodedValue = html_entity_decode($value, ENT_QUOT | his->content = $content;
}
/**
* Determine if the rule passes validation.
*
* @param array $values
* @return bool
*/
public function matches($values): bool
{
$decodedContent = h | {
"filepath": "src/Illuminate/Testing/Constraints/SeeInOrder.php",
"language": "php",
"file_size": 1928,
"cut_index": 537,
"middle_length": 229
} |
ting;
use Illuminate\Testing\ParallelConsoleOutput;
use PHPUnit\TextUI\Configuration\PhpHandler;
use RuntimeException;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\OutputInterface;
trait RunsInParallel
{
/**
* The application resolver callback.
*
* @var \C... | le\Output\OutputInterface
*/
protected $output;
/**
* The original test runner.
*
* @var \ParaTest\Runners\PHPUnit\RunnerInterface|\ParaTest\RunnerInterface
*/
protected $runner;
/**
* Creates a new test runn | /**
* The original test runner options.
*
* @var \ParaTest\Runners\PHPUnit\Options|\ParaTest\Options
*/
protected $options;
/**
* The output instance.
*
* @var \Symfony\Component\Conso | {
"filepath": "src/Illuminate/Testing/Concerns/RunsInParallel.php",
"language": "php",
"file_size": 5119,
"cut_index": 716,
"middle_length": 229
} |
namespace Illuminate\Testing\Concerns;
use Illuminate\Support\Facades\ParallelTesting;
trait TestCaches
{
/**
* The original cache prefix prior to appending the token.
*
* @var string|null
*/
protected static $originalCachePrefix = null;
/**
* Boot test cache for parallel testin... | function parallelSafeCachePrefix()
{
self::$originalCachePrefix ??= $this->app['config']->get('cache.prefix', '');
return self::$originalCachePrefix.'test_'.ParallelTesting::token().'_';
}
/**
* Switch to the given cache | ) {
return;
}
$this->switchToCachePrefix($this->parallelSafeCachePrefix());
});
}
/**
* Get the test cache prefix.
*
* @return string
*/
protected | {
"filepath": "src/Illuminate/Testing/Concerns/TestCaches.php",
"language": "php",
"file_size": 1203,
"cut_index": 518,
"middle_length": 229
} |
\Exceptions;
use PHPUnit\Framework\Exception;
class InvalidArgumentException extends Exception
{
/**
* Creates a new exception for an invalid argument.
*
* @param int $argument
* @param string $type
* @return static
*/
public static function create(int $argument, string $type... | eturn new static(
sprintf(
'Argument #%d of %s() must be %s %s',
$argument,
$function,
in_array(lcfirst($type)[0], ['a', 'e', 'i', 'o', 'u'], true) ? 'an' : 'a',
$t | lass'], $stack[1]['function']);
}
r | {
"filepath": "src/Illuminate/Testing/Exceptions/InvalidArgumentException.php",
"language": "php",
"file_size": 892,
"cut_index": 547,
"middle_length": 52
} |
use Illuminate\Support\Arr;
use Illuminate\Support\Traits\Conditionable;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Support\Traits\Tappable;
use Illuminate\Testing\AssertableJsonString;
use PHPUnit\Framework\Assert as PHPUnit;
class AssertableJson implements Arrayable
{
use Concerns\Has,
Conce... | *
* @param array $props
* @param string|null $path
*/
protected function __construct(array $props, ?string $path = null)
{
$this->path = $path;
$this->props = $props;
}
/**
* Compose the absolute "d | * @var array
*/
private $props;
/**
* The "dot" path to the current scope.
*
* @var string|null
*/
private $path;
/**
* Create a new fluent, assertable JSON data instance.
| {
"filepath": "src/Illuminate/Testing/Fluent/AssertableJson.php",
"language": "php",
"file_size": 4263,
"cut_index": 614,
"middle_length": 229
} |
\Support\Facades\DB;
use Illuminate\Support\Facades\ParallelTesting;
use Illuminate\Support\Facades\Schema;
trait TestDatabases
{
/**
* Indicates if the test database schema is up to date.
*
* @var bool
*/
protected static $schemaIsUpToDate = false;
/**
* The root database name pr... | atabases')) {
Schema::dropDatabaseIfExists(
$this->testDatabase($database)
);
}
});
});
ParallelTesting::setUpTestCase(function ($testCase) {
| */
protected function bootTestDatabase()
{
ParallelTesting::setUpProcess(function () {
$this->whenNotUsingInMemoryDatabase(function ($database) {
if (ParallelTesting::option('recreate_d | {
"filepath": "src/Illuminate/Testing/Concerns/TestDatabases.php",
"language": "php",
"file_size": 5778,
"cut_index": 716,
"middle_length": 229
} |
uminate\Support\enum_value;
trait Matching
{
/**
* Asserts that the property matches the expected value.
*
* @param string $key
* @param mixed|\Closure $expected
* @return $this
*/
public function where(string $key, $expected): static
{
$this->has($key);
$... | Array()
: enum_value($expected);
$this->ensureSorted($expected);
$this->ensureSorted($actual);
PHPUnit::assertSame(
$expected,
$actual,
sprintf('Property [%s] does not match the expe | sprintf('Property [%s] was marked as invalid using a closure.', $this->dotPath($key))
);
return $this;
}
$expected = $expected instanceof Arrayable
? $expected->to | {
"filepath": "src/Illuminate/Testing/Fluent/Concerns/Matching.php",
"language": "php",
"file_size": 7066,
"cut_index": 716,
"middle_length": 229
} |
osed to the component.
*
* @var array
*/
protected $except = [];
/**
* The component alias name.
*
* @var string
*/
public $componentName;
/**
* The component attributes.
*
* @var \Illuminate\View\ComponentAttributeBag
*/
public $attributes;
... | /
protected static $bladeViewCache = [];
/**
* The cache of public property names, keyed by class.
*
* @var array
*/
protected static $propertyCache = [];
/**
* The cache of public method names, keyed by class.
| ack.
*
* @var (\Closure(string, array): Component)|null
*/
protected static $componentsResolver;
/**
* The cache of blade view names, keyed by contents.
*
* @var array<string, string>
* | {
"filepath": "src/Illuminate/View/Component.php",
"language": "php",
"file_size": 12937,
"cut_index": 921,
"middle_length": 229
} |
ontracts\Support\Htmlable;
use InvalidArgumentException;
use Stringable;
class ComponentSlot implements Htmlable, Stringable
{
/**
* The slot attribute bag.
*
* @var \Illuminate\View\ComponentAttributeBag
*/
public $attributes;
/**
* The slot contents.
*
* @var string
... | y $attributes
* @return $this
*/
public function withAttributes(array $attributes)
{
$this->attributes = new ComponentAttributeBag($attributes);
return $this;
}
/**
* Get the slot's HTML string.
*
| ntents = '', $attributes = [])
{
$this->contents = $contents;
$this->withAttributes($attributes);
}
/**
* Set the extra attributes that the slot should make available.
*
* @param arra | {
"filepath": "src/Illuminate/View/ComponentSlot.php",
"language": "php",
"file_size": 2286,
"cut_index": 563,
"middle_length": 229
} |
**
* Call a custom driver creator.
*
* @param string $driver
* @return \Illuminate\Session\Store
*/
protected function callCustomCreator($driver)
{
return $this->buildSession(parent::callCustomCreator($driver));
}
/**
* Create an instance of the "null" session dr... | his->config->get('session.lifetime')
));
}
/**
* Create an instance of the "cookie" session driver.
*
* @return \Illuminate\Session\Store
*/
protected function createCookieDriver()
{
return $this->buildS | Create an instance of the "array" session driver.
*
* @return \Illuminate\Session\Store
*/
protected function createArrayDriver()
{
return $this->buildSession(new ArraySessionHandler(
$t | {
"filepath": "src/Illuminate/Session/SessionManager.php",
"language": "php",
"file_size": 7314,
"cut_index": 716,
"middle_length": 229
} |
pace Illuminate\Testing;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Symfony\Component\Console\Output\ConsoleOutput;
class ParallelConsoleOutput extends ConsoleOutput
{
/**
* The original output instance.
*
* @var \Symfony\Component\Console\Output\OutputInterface
*/
... | truct(
$output->getVerbosity(),
$output->isDecorated(),
$output->getFormatter(),
);
$this->output = $output;
}
/**
* Writes a message to the output.
*
* @param string|iterable $ | ,
];
/**
* Create a new Parallel ConsoleOutput instance.
*
* @param \Symfony\Component\Console\Output\OutputInterface $output
*/
public function __construct($output)
{
parent::__cons | {
"filepath": "src/Illuminate/Testing/ParallelConsoleOutput.php",
"language": "php",
"file_size": 1405,
"cut_index": 524,
"middle_length": 229
} |
se Illuminate\Database\Connection;
use PHPUnit\Framework\Constraint\Constraint;
class NotSoftDeletedInDatabase extends Constraint
{
/**
* Number of records that will be shown in the console in case of failure.
*
* @var int
*/
protected $show = 3;
/**
* The database connection.
... | *
* @param \Illuminate\Database\Connection $database
* @param array $data
* @param string $deletedAtColumn
*/
public function __construct(Connection $database, array $data, string $deletedAtColumn)
{
$this->dat |
*/
protected $data;
/**
* The name of the column that indicates soft deletion has occurred.
*
* @var string
*/
protected $deletedAtColumn;
/**
* Create a new constraint instance.
| {
"filepath": "src/Illuminate/Testing/Constraints/NotSoftDeletedInDatabase.php",
"language": "php",
"file_size": 2702,
"cut_index": 563,
"middle_length": 229
} |
rn $this
*/
public function assertOk()
{
return $this->assertStatus(200);
}
/**
* Assert that the response has a 201 "Created" status code.
*
* @return $this
*/
public function assertCreated()
{
return $this->assertStatus(201);
}
/**
* Asse... | ;
PHPUnit::assertEmpty($this->getContent(), 'Response content is not empty.');
return $this;
}
/**
* Assert that the response has a 301 "Moved Permanently" status code.
*
* @return $this
*/
public function | * Assert that the response has the given status code and no content.
*
* @param int $status
* @return $this
*/
public function assertNoContent($status = 204)
{
$this->assertStatus($status) | {
"filepath": "src/Illuminate/Testing/Concerns/AssertsStatusCodes.php",
"language": "php",
"file_size": 5528,
"cut_index": 716,
"middle_length": 229
} |
size.
*
* @param string|int $key
* @param int|null $length
* @return $this
*/
public function count($key, ?int $length = null): static
{
if (is_null($length)) {
$path = $this->dotPath();
PHPUnit::assertCount(
$key,
$th... | y))
);
return $this;
}
/**
* Assert that the prop size is between a given minimum and maximum.
*
* @param int|string $min
* @param int|string $max
* @return $this
*/
public function countBetwe | ze.')
);
return $this;
}
PHPUnit::assertCount(
$length,
$this->prop($key),
sprintf('Property [%s] does not have the expected size.', $this->dotPath($ke | {
"filepath": "src/Illuminate/Testing/Fluent/Concerns/Has.php",
"language": "php",
"file_size": 6101,
"cut_index": 716,
"middle_length": 229
} |
pace Illuminate\Testing\Fluent\Concerns;
use Illuminate\Support\Str;
use PHPUnit\Framework\Assert as PHPUnit;
trait Interaction
{
/**
* The list of interacted properties.
*
* @var array
*/
protected $interacted = [];
/**
* Marks the property as interacted.
*
* @param s... | nit::assertSame(
[],
array_diff(array_keys($this->prop()), $this->interacted),
$this->path
? sprintf('Unexpected properties were found in scope [%s].', $this->path)
: 'Unexpected propertie | true)) {
$this->interacted[] = $prop;
}
}
/**
* Asserts that all properties have been interacted with.
*
* @return void
*/
public function interacted(): void
{
PHPU | {
"filepath": "src/Illuminate/Testing/Fluent/Concerns/Interaction.php",
"language": "php",
"file_size": 1476,
"cut_index": 524,
"middle_length": 229
} |
acroable;
use IteratorAggregate;
use JsonSerializable;
use Stringable;
use Traversable;
class ComponentAttributeBag implements Arrayable, ArrayAccess, IteratorAggregate, JsonSerializable, Htmlable, Stringable
{
use Conditionable, InteractsWithData, Macroable;
/**
* The raw array of attributes.
*
... | ull)
{
if (is_null($keys)) {
return $this->attributes;
}
return $this->only($keys)->toArray();
}
/**
* Get the first attribute's value.
*
* @param mixed $default
* @return mixed
* | struct(array $attributes = [])
{
$this->setAttributes($attributes);
}
/**
* Get all the attribute values.
*
* @param mixed $keys
* @return array
*/
public function all($keys = n | {
"filepath": "src/Illuminate/View/ComponentAttributeBag.php",
"language": "php",
"file_size": 12201,
"cut_index": 921,
"middle_length": 229
} |
namespace Illuminate\Testing;
use ArrayAccess;
use Illuminate\Testing\Constraints\ArraySubset;
use Illuminate\Testing\Exceptions\InvalidArgumentException;
use PHPUnit\Framework\Assert as PHPUnit;
/**
* @internal This class is not meant to be used or overwritten outside the framework itself.
*/
abstract class Asser... | et) || $subset instanceof ArrayAccess)) {
throw InvalidArgumentException::create(1, 'array or ArrayAccess');
}
if (! (is_array($array) || $array instanceof ArrayAccess)) {
throw InvalidArgumentException::create(2, ' | $checkForIdentity
* @param string $msg
* @return void
*/
public static function assertArraySubset($subset, $array, bool $checkForIdentity = false, string $msg = ''): void
{
if (! (is_array($subs | {
"filepath": "src/Illuminate/Testing/Assert.php",
"language": "php",
"file_size": 1170,
"cut_index": 518,
"middle_length": 229
} |
se Illuminate\Database\Connection;
use PHPUnit\Framework\Constraint\Constraint;
class SoftDeletedInDatabase extends Constraint
{
/**
* Number of records that will be shown in the console in case of failure.
*
* @var int
*/
protected $show = 3;
/**
* The database connection.
*... | *
* @param \Illuminate\Database\Connection $database
* @param array $data
* @param string $deletedAtColumn
*/
public function __construct(Connection $database, array $data, string $deletedAtColumn)
{
$this->data = | */
protected $data;
/**
* The name of the column that indicates soft deletion has occurred.
*
* @var string
*/
protected $deletedAtColumn;
/**
* Create a new constraint instance.
| {
"filepath": "src/Illuminate/Testing/Constraints/SoftDeletedInDatabase.php",
"language": "php",
"file_size": 2708,
"cut_index": 563,
"middle_length": 229
} |
namespace Illuminate\View;
class AnonymousComponent extends Component
{
/**
* The component view.
*
* @var string
*/
protected $view;
/**
* The component data.
*
* @var array
*/
protected $data = [];
/**
* Create a new anonymous component instance.
... | o the view.
*
* @return array
*/
public function data()
{
$this->attributes = $this->attributes ?: $this->newAttributeBag();
return array_merge(
($this->data['attributes'] ?? null)?->getAttributes() ?: [] | **
* Get the view / view contents that represent the component.
*
* @return string
*/
public function render()
{
return $this->view;
}
/**
* Get the data that should be supplied t | {
"filepath": "src/Illuminate/View/AnonymousComponent.php",
"language": "php",
"file_size": 1145,
"cut_index": 518,
"middle_length": 229
} |
inate\Testing\Constraints\SeeInOrder;
use Stringable;
class TestComponent implements Stringable
{
use Macroable {
__call as macroCall;
}
/**
* The original component.
*
* @var \Illuminate\View\Component
*/
public $component;
/**
* The rendered component contents.
... | rray of strings are contained within the rendered component.
*
* @param string|list<string> $value
* @param bool $escape
* @return $this
*/
public function assertSee($value, $escape = true)
{
$value = Arr::wrap( | luminate\View\View $view
*/
public function __construct($component, $view)
{
$this->component = $component;
$this->rendered = $view->render();
}
/**
* Assert that the given string or a | {
"filepath": "src/Illuminate/Testing/TestComponent.php",
"language": "php",
"file_size": 5716,
"cut_index": 716,
"middle_length": 229
} |
te\Testing\Concerns;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\ParallelTesting;
trait TestViews
{
/**
* The original compiled view path prior to appending the token.
*
* @var string|null
*/
protected static $originalCompiledViewPath = null;
/**
* Boot te... | ) {
$this->switchToCompiledViewPath($path);
}
});
ParallelTesting::tearDownProcess(function () {
if ($path = $this->parallelSafeCompiledViewPath()) {
File::deleteDirectory($path);
| ->parallelSafeCompiledViewPath()) {
File::ensureDirectoryExists($path);
}
});
ParallelTesting::setUpTestCase(function () {
if ($path = $this->parallelSafeCompiledViewPath() | {
"filepath": "src/Illuminate/Testing/Concerns/TestViews.php",
"language": "php",
"file_size": 2004,
"cut_index": 537,
"middle_length": 229
} |
* @var \Illuminate\Filesystem\Filesystem
*/
protected $files;
/**
* The array of active view paths.
*
* @var string[]
*/
protected $paths;
/**
* The array of views that have been located.
*
* @var array<string, string>
*/
protected $views = [];
... | ing[] $paths
* @param string[]|null $extensions
*/
public function __construct(Filesystem $files, array $paths, ?array $extensions = null)
{
$this->files = $files;
$this->paths = array_map($this->resolvePath(...), $path | * @var string[]
*/
protected $extensions = ['blade.php', 'php', 'css', 'html'];
/**
* Create a new file view loader instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @param str | {
"filepath": "src/Illuminate/View/FileViewFinder.php",
"language": "php",
"file_size": 7420,
"cut_index": 716,
"middle_length": 229
} |
r;
use Closure;
use Illuminate\Contracts\Support\DeferringDisplayableValue;
use Illuminate\Support\Enumerable;
use IteratorAggregate;
use Stringable;
use Traversable;
class InvokableComponentVariable implements DeferringDisplayableValue, IteratorAggregate, Stringable
{
/**
* The callable instance to resolve t... | */
public function resolveDisplayableValue()
{
return $this->__invoke();
}
/**
* Get an iterator instance for the variable.
*
* @return \ArrayIterator
*/
public function getIterator(): Traversable
{ | ction __construct(Closure $callable)
{
$this->callable = $callable;
}
/**
* Resolve the displayable value that the class is deferring.
*
* @return \Illuminate\Contracts\Support\Htmlable|string
| {
"filepath": "src/Illuminate/View/InvokableComponentVariable.php",
"language": "php",
"file_size": 2033,
"cut_index": 563,
"middle_length": 229
} |
\MessageBag;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Support\ViewErrorBag;
use Stringable;
use Throwable;
class View implements ArrayAccess, Htmlable, Stringable, ViewContract
{
use Macroable {
__call as macroCall;
}
/**
* The view factory instance.... | e view file.
*
* @var string
*/
protected $path;
/**
* Create a new view instance.
*
* @param \Illuminate\View\Factory $factory
* @param \Illuminate\Contracts\View\Engine $engine
* @param string $view
| ed $engine;
/**
* The name of the view.
*
* @var string
*/
protected $view;
/**
* The array of view data.
*
* @var array
*/
protected $data;
/**
* The path to th | {
"filepath": "src/Illuminate/View/View.php",
"language": "php",
"file_size": 11579,
"cut_index": 921,
"middle_length": 229
} |
pace Illuminate\View;
interface ViewFinderInterface
{
/**
* Hint path delimiter value.
*
* @var string
*/
const HINT_PATH_DELIMITER = '::';
/**
* Get the fully-qualified location of the view.
*
* @param string $view
* @return string
*/
public function fin... | o the finder.
*
* @param string $namespace
* @param string|array $hints
* @return void
*/
public function prependNamespace($namespace, $hints);
/**
* Replace the namespace hints for the given namespace.
*
| mespace hint to the finder.
*
* @param string $namespace
* @param string|array $hints
* @return void
*/
public function addNamespace($namespace, $hints);
/**
* Prepend a namespace hint t | {
"filepath": "src/Illuminate/View/ViewFinderInterface.php",
"language": "php",
"file_size": 1451,
"cut_index": 524,
"middle_length": 229
} |
nate\Database\RecordsNotFoundException;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Support\Str;
use Illuminate\View\Compilers\CompilerInterface;
use Illuminate\View\ViewException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Throwable;
cl... | ng, true>
*/
protected $compiledOrNotExpired = [];
/**
* Create a new compiler engine instance.
*
* @param \Illuminate\View\Compilers\CompilerInterface $compiler
* @param \Illuminate\Filesystem\Filesystem|null $files
| * A stack of the last compiled templates.
*
* @var array
*/
protected $lastCompiled = [];
/**
* The view paths that were compiled or are not expired, keyed by the path.
*
* @var array<stri | {
"filepath": "src/Illuminate/View/Engines/CompilerEngine.php",
"language": "php",
"file_size": 4284,
"cut_index": 614,
"middle_length": 229
} |
te\View\Engines;
use Illuminate\Contracts\View\Engine;
use Illuminate\Filesystem\Filesystem;
use Throwable;
class PhpEngine implements Engine
{
/**
* The filesystem instance.
*
* @var \Illuminate\Filesystem\Filesystem
*/
protected $files;
/**
* Create a new file engine instance.
... | }
/**
* Get the evaluated contents of the view at the given path.
*
* @param string $path
* @param array $data
* @return string
*/
protected function evaluatePath($path, $data)
{
$obLevel = ob_get_ | aluated contents of the view.
*
* @param string $path
* @param array $data
* @return string
*/
public function get($path, array $data = [])
{
return $this->evaluatePath($path, $data);
| {
"filepath": "src/Illuminate/View/Engines/PhpEngine.php",
"language": "php",
"file_size": 1861,
"cut_index": 537,
"middle_length": 229
} |
* The component class namespaces.
*
* @var array
*/
protected $namespaces = [];
/**
* The "bind:" attributes that have been compiled for the current component.
*
* @var array
*/
protected $boundAttributes = [];
/**
* Create a new component tag compiler.
*
... | }
/**
* Compile the component and slot tags within the given string.
*
* @param string $value
* @return string
*/
public function compile(string $value)
{
$value = $this->compileSlots($value);
retu | , array $namespaces = [], ?BladeCompiler $blade = null)
{
$this->aliases = $aliases;
$this->namespaces = $namespaces;
$this->blade = $blade ?: new BladeCompiler(new Filesystem, sys_get_temp_dir());
| {
"filepath": "src/Illuminate/View/Compilers/ComponentTagCompiler.php",
"language": "php",
"file_size": 26804,
"cut_index": 1331,
"middle_length": 229
} |
;
trait CompilesAuthorizations
{
/**
* Compile the can statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileCan($expression)
{
return "<?php if (app(\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->check{$expression}): ... | * @return string
*/
protected function compileCanany($expression)
{
return "<?php if (app(\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->any{$expression}): ?>";
}
/**
* Compile the else-can statements into valid | n)
{
return "<?php if (app(\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->denies{$expression}): ?>";
}
/**
* Compile the canany statements into valid PHP.
*
* @param string $expression
| {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesAuthorizations.php",
"language": "php",
"file_size": 2502,
"cut_index": 563,
"middle_length": 229
} |
ion compileAuth($guard = null)
{
$guard = is_null($guard) ? '()' : $guard;
return "<?php if(auth()->guard{$guard}->check()): ?>";
}
/**
* Compile the else-auth statements into valid PHP.
*
* @param string|null $guard
* @return string
*/
protected function com... | ram string $environments
* @return string
*/
protected function compileEnv($environments)
{
return "<?php if(app()->environment{$environments}): ?>";
}
/**
* Compile the end-env statements into valid PHP.
*
| th statements into valid PHP.
*
* @return string
*/
protected function compileEndAuth()
{
return '<?php endif; ?>';
}
/**
* Compile the env statements into valid PHP.
*
* @pa | {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php",
"language": "php",
"file_size": 9950,
"cut_index": 921,
"middle_length": 229
} |
trait CompilesEchos
{
/**
* Custom rendering callbacks for stringable objects.
*
* @var array
*/
protected $echoHandlers = [];
/**
* Add a handler to be executed before echoing a given class.
*
* @param string|callable $class
* @param callable|null $handler
... | leEchos($value)
{
foreach ($this->getEchoMethods() as $method) {
$value = $this->$method($value);
}
return $value;
}
/**
* Get the echo methods in the proper order for compilation.
*
* @retur | e($class), $class];
}
$this->echoHandlers[$class] = $handler;
}
/**
* Compile Blade echos into valid PHP.
*
* @param string $value
* @return string
*/
public function compi | {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesEchos.php",
"language": "php",
"file_size": 4624,
"cut_index": 614,
"middle_length": 229
} |
ct
{
use Macroable,
Concerns\ManagesComponents,
Concerns\ManagesEvents,
Concerns\ManagesFragments,
Concerns\ManagesLayouts,
Concerns\ManagesLoops,
Concerns\ManagesStacks,
Concerns\ManagesTranslations;
/**
* The engine implementation.
*
* @v... | \Contracts\Container\Container
*/
protected $container;
/**
* Data that should be available to all templates.
*
* @var array
*/
protected $shared = [];
/**
* The extension to engine bindings.
*
* @v | rotected $finder;
/**
* The event dispatcher instance.
*
* @var \Illuminate\Contracts\Events\Dispatcher
*/
protected $events;
/**
* The IoC container instance.
*
* @var \Illuminate | {
"filepath": "src/Illuminate/View/Factory.php",
"language": "php",
"file_size": 15666,
"cut_index": 921,
"middle_length": 229
} |
use Illuminate\Database\Eloquent\Attributes\UseResourceCollection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Resources\Json\ResourceCollection;
use LogicException;
use ReflectionClass;
trait TransformsToResourceCollection
{
/**
* Create a new resource collection instance for the given resour... | return $resourceClass::collection($this);
}
/**
* Guess the resource collection for the items.
*
* @return \Illuminate\Http\Resources\Json\ResourceCollection
*
* @throws \Throwable
*/
protected function guessReso | s \Throwable
*/
public function toResourceCollection(?string $resourceClass = null): ResourceCollection
{
if ($resourceClass === null) {
return $this->guessResourceCollection();
}
| {
"filepath": "src/Illuminate/Collections/Traits/TransformsToResourceCollection.php",
"language": "php",
"file_size": 4008,
"cut_index": 614,
"middle_length": 229
} |
eption;
trait CompilesLoops
{
/**
* Counter to keep track of nested forelse statements.
*
* @var int
*/
protected $forElseCounter = 0;
/**
* Compile the for-else statements into valid PHP.
*
* @param string|null $expression
* @return string
*
* @throws \... | $iteration = trim($matches[2]);
$initLoop = "\$__currentLoopData = {$iteratee}; \$__env->addLoop(\$__currentLoopData);";
$iterateLoop = '$__env->incrementLoopIndices(); $loop = $__env->getLastLoop();';
return "<?php {$empty} = tr | \( *(.+) +as +(.+)\)$/is', $expression ?? '', $matches);
if ($matches === []) {
throw new ViewCompilationException('Malformed @forelse statement.');
}
$iteratee = trim($matches[1]);
| {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesLoops.php",
"language": "php",
"file_size": 4919,
"cut_index": 614,
"middle_length": 229
} |
;
use Illuminate\Support\Str;
trait CompilesStacks
{
/**
* Compile the stack statements into the content.
*
* @param string $expression
* @return string
*/
protected function compileStack($expression)
{
return "<?php echo \$__env->yieldPushContent{$expression}; ?>";
... | PushOnce($expression)
{
$parts = explode(',', $this->stripParentheses($expression), 2);
[$stack, $id] = [$parts[0], $parts[1] ?? ''];
$id = trim($id) ?: "'".(string) Str::uuid()."'";
return '<?php if (! $__env->hasRen | return "<?php \$__env->startPush{$expression}; ?>";
}
/**
* Compile the push-once statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compile | {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesStacks.php",
"language": "php",
"file_size": 2793,
"cut_index": 563,
"middle_length": 229
} |
?php
namespace Illuminate\View\Compilers\Concerns;
trait CompilesTranslations
{
/**
* Compile the lang statements into valid PHP.
*
* @param string|null $expression
* @return string
*/
protected function compileLang($expression)
{
if (is_null($expression)) {
... | $__env->renderTranslation(); ?>';
}
/**
* Compile the choice statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileChoice($expression)
{
return "<?php ech | hp echo app('translator')->get{$expression}; ?>";
}
/**
* Compile the end-lang statements into valid PHP.
*
* @return string
*/
protected function compileEndlang()
{
return '<?php echo | {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesTranslations.php",
"language": "php",
"file_size": 1053,
"cut_index": 513,
"middle_length": 229
} |
onents
{
/**
* The components being rendered.
*
* @var array
*/
protected $componentStack = [];
/**
* The original data passed to the component.
*
* @var array
*/
protected $componentData = [];
/**
* The component data for the component that is currentl... | \View\View|\Illuminate\Contracts\Support\Htmlable|\Closure|string $view
* @param array $data
* @return void
*/
public function startComponent($view, array $data = [])
{
if (ob_start()) {
$this->componentStack[] | $slots = [];
/**
* The names of the slots being rendered.
*
* @var array
*/
protected $slotStack = [];
/**
* Start a component rendering process.
*
* @param \Illuminate\Contracts | {
"filepath": "src/Illuminate/View/Concerns/ManagesComponents.php",
"language": "php",
"file_size": 5512,
"cut_index": 716,
"middle_length": 229
} |
te\View\Concerns;
use InvalidArgumentException;
trait ManagesFragments
{
/**
* All of the captured, rendered fragments.
*
* @var array
*/
protected $fragments = [];
/**
* The stack of in-progress fragment renders.
*
* @var array
*/
protected $fragmentStack = []... | unction stopFragment()
{
if (empty($this->fragmentStack)) {
throw new InvalidArgumentException('Cannot end a fragment without first starting one.');
}
$last = array_pop($this->fragmentStack);
$this->fragmen | _start()) {
$this->fragmentStack[] = $fragment;
}
}
/**
* Stop injecting content into a fragment.
*
* @return string
*
* @throws \InvalidArgumentException
*/
public f | {
"filepath": "src/Illuminate/View/Concerns/ManagesFragments.php",
"language": "php",
"file_size": 1744,
"cut_index": 537,
"middle_length": 229
} |
uminate\Support\Arr;
use Illuminate\Support\LazyCollection;
trait ManagesLoops
{
/**
* The stack of in-progress loops.
*
* @var array
*/
protected $loopsStack = [];
/**
* Add new loop to the stack.
*
* @param \Countable|array $data
* @return void
*/
publi... | set($length) ? $length == 1 : null,
'odd' => false,
'even' => true,
'depth' => count($this->loopsStack) + 1,
'parent' => $parent ? (object) $parent : null,
];
}
/**
* Increment the top l | opsStack);
$this->loopsStack[] = [
'iteration' => 0,
'index' => 0,
'remaining' => $length ?? null,
'count' => $length,
'first' => true,
'last' => is | {
"filepath": "src/Illuminate/View/Concerns/ManagesLoops.php",
"language": "php",
"file_size": 2299,
"cut_index": 563,
"middle_length": 229
} |
**
* All of the finished, captured push sections.
*
* @var array
*/
protected $pushes = [];
/**
* All of the finished, captured prepend sections.
*
* @var array
*/
protected $prepends = [];
/**
* The stack of in-progress push sections.
*
* @var ar... | >extendPush($section, $content);
}
}
/**
* Stop injecting content into a push section.
*
* @return string
*
* @throws \InvalidArgumentException
*/
public function stopPush()
{
if (empty($this-> | id
*/
public function startPush($section, $content = '')
{
if ($content === '') {
if (ob_start()) {
$this->pushStack[] = $section;
}
} else {
$this- | {
"filepath": "src/Illuminate/View/Concerns/ManagesStacks.php",
"language": "php",
"file_size": 4507,
"cut_index": 614,
"middle_length": 229
} |
\ComponentAttributeBag;
trait CompilesComponents
{
/**
* The component name hash stack.
*
* @var array
*/
protected static $componentHashStack = [];
/**
* Compile the component statements into valid PHP.
*
* @param string $expression
* @return string
*/
p... | :'.trim($alias, '\'"') : $component
);
if (Str::contains($component, ['::class', '\\'])) {
return static::compileClassComponentOpening($component, $alias, $data, $hash);
}
return "<?php \$__env->startComponent{ | '), 3)) + ['', '', '']
: [trim($expression, '()'), '', ''];
$component = trim($component, '\'"');
$hash = static::newComponentHash(
$component === AnonymousComponent::class ? $component.' | {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesComponents.php",
"language": "php",
"file_size": 6606,
"cut_index": 716,
"middle_length": 229
} |
;
trait CompilesIncludes
{
/**
* Compile the each statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileEach($expression)
{
return "<?php echo \$__env->renderEach{$expression}; ?>";
}
/**
* Compile the include... | lid PHP.
*
* @param string $expression
* @return string
*/
protected function compileIncludeIf($expression)
{
$expression = $this->stripParentheses($expression);
return "<?php if (\$__env->exists({$expression} | arentheses($expression);
return "<?php echo \$__env->make({$expression}, array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>";
}
/**
* Compile the include-if statements into va | {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesIncludes.php",
"language": "php",
"file_size": 2746,
"cut_index": 563,
"middle_length": 229
} |
use ErrorException;
use Illuminate\Container\Container;
use Illuminate\Support\Reflector;
class ViewException extends ErrorException
{
/**
* Report the exception.
*
* @return bool|null
*/
public function report()
{
$exception = $this->getPrevious();
if (Reflector::isCal... | uminate\Http\Request $request
* @return \Illuminate\Http\Response|null
*/
public function render($request)
{
$exception = $this->getPrevious();
if ($exception && method_exists($exception, 'render')) {
return | on into an HTTP response.
*
* @param \Ill | {
"filepath": "src/Illuminate/View/ViewException.php",
"language": "php",
"file_size": 903,
"cut_index": 547,
"middle_length": 52
} |
pace Illuminate\View\Engines;
use Closure;
use InvalidArgumentException;
class EngineResolver
{
/**
* The array of engine resolvers.
*
* @var array
*/
protected $resolvers = [];
/**
* The resolved engine instances.
*
* @var array
*/
protected $resolved = [];
... | .
*
* @param string $engine
* @return \Illuminate\Contracts\View\Engine
*
* @throws \InvalidArgumentException
*/
public function resolve($engine)
{
if (isset($this->resolved[$engine])) {
return $t | r
* @return void
*/
public function register($engine, Closure $resolver)
{
$this->forget($engine);
$this->resolvers[$engine] = $resolver;
}
/**
* Resolve an engine instance by name | {
"filepath": "src/Illuminate/View/Engines/EngineResolver.php",
"language": "php",
"file_size": 1474,
"cut_index": 524,
"middle_length": 229
} |
te\View\Compilers\Concerns;
use Illuminate\Foundation\Vite;
trait CompilesHelpers
{
/**
* Compile the CSRF statements into valid PHP.
*
* @return string
*/
protected function compileCsrf()
{
return '<?php echo csrf_field(); ?>';
}
/**
* Compile the "dd" statements... | }
/**
* Compile the method statements into valid PHP.
*
* @param string $method
* @return string
*/
protected function compileMethod($method)
{
return "<?php echo method_field{$method}; ?>";
}
/**
| /**
* Compile the "dump" statements into valid PHP.
*
* @param string $arguments
* @return string
*/
protected function compileDump($arguments)
{
return "<?php dump{$arguments}; ?>";
| {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php",
"language": "php",
"file_size": 1924,
"cut_index": 537,
"middle_length": 229
} |
use Illuminate\Support\Str;
use InvalidArgumentException;
abstract class Compiler
{
/**
* The filesystem instance.
*
* @var \Illuminate\Filesystem\Filesystem
*/
protected $files;
/**
* The cache path for the compiled views.
*
* @var string
*/
protected $cachePa... | view cache timestamps should be checked.
*
* @var bool
*/
protected $shouldCheckTimestamps;
/**
* Create a new compiler instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @param string $cachePath | ld be cached.
*
* @var bool
*/
protected $shouldCache;
/**
* The compiled view file extension.
*
* @var string
*/
protected $compiledExtension = 'php';
/**
* Indicates if | {
"filepath": "src/Illuminate/View/Compilers/Compiler.php",
"language": "php",
"file_size": 3648,
"cut_index": 614,
"middle_length": 229
} |
static<int, int>
*/
public static function range($from, $to, $step = 1, ...$args)
{
return new static(range($from, $to, $step), ...$args);
}
/**
* Get all of the items in the collection.
*
* @return array<TKey, TValue>
*/
public function all()
{
return $... | nction median($key = null)
{
$values = (isset($key) ? $this->pluck($key) : $this)
->reject(fn ($item) => is_null($item))
->sort()->values();
$count = $values->count();
if ($count === 0) {
re | zy()
{
return new LazyCollection($this->items);
}
/**
* Get the median of a given key.
*
* @param string|array<array-key, string>|null $key
* @return float|int|null
*/
public fu | {
"filepath": "src/Illuminate/Collections/Collection.php",
"language": "php",
"file_size": 55672,
"cut_index": 2151,
"middle_length": 229
} |
te\Support;
/**
* @template TKey of array-key
*
* @template-covariant TValue
*
* @mixin \Illuminate\Support\Enumerable<TKey, TValue>
* @mixin TValue
*/
class HigherOrderCollectionProxy
{
/**
* The collection being operated on.
*
* @var \Illuminate\Support\Enumerable<TKey, TValue>
*/
... | llection;
}
/**
* Proxy accessing an attribute onto the collection items.
*
* @param string $key
* @return mixed
*/
public function __get($key)
{
return $this->collection->{$this->method}(function ($value | luminate\Support\Enumerable<TKey, TValue> $collection
* @param string $method
*/
public function __construct(Enumerable $collection, $method)
{
$this->method = $method;
$this->collection = $co | {
"filepath": "src/Illuminate/Collections/HigherOrderCollectionProxy.php",
"language": "php",
"file_size": 1602,
"cut_index": 537,
"middle_length": 229
} |
y
* @template TValue
*
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>|null $value
* @return \Illuminate\Support\Collection<TKey, TValue>
*/
function collect($value = []): Collection
{
return new Collection($value);
}
}
if (! function... | object using "dot" notation.
*
* @param mixed $target
* @param string|array|int|null $key
* @return bool
*/
function data_has($target, $key): bool
{
if (is_null($key) || $key === []) {
return false; |
*/
function data_fill(&$target, $key, $value)
{
return data_set($target, $key, $value, false);
}
}
if (! function_exists('data_has')) {
/**
* Determine if a key / property exists on an array or | {
"filepath": "src/Illuminate/Collections/helpers.php",
"language": "php",
"file_size": 8232,
"cut_index": 716,
"middle_length": 229
} |
<?php
namespace Illuminate\View\Compilers\Concerns;
trait CompilesSessions
{
/**
* Compile the session statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileSession($expression)
{
$expression = $this->stripParentheses($exp... | return '<?php unset($value);
if (isset($__sessionPrevious) && !empty($__sessionPrevious)) { $value = array_pop($__sessionPrevious); }
if (isset($__sessionPrevious) && empty($__sessionPrevious)) { unset($__sessionPrevious); }
endif;
unset($__sessionArgs | essionArgs[0]); ?>';
}
/**
* Compile the endsession statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileEndsession($expression)
{
| {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesSessions.php",
"language": "php",
"file_size": 1013,
"cut_index": 512,
"middle_length": 229
} |
te\View\Compilers\Concerns;
trait CompilesUseStatements
{
/**
* Compile the use statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileUse($expression)
{
$expression = trim(preg_replace('/[()]/', '', $expression), " '\"");
... | : '';
}
// Split modifier and path...
if (str_starts_with($pathWithOptionalModifier, 'function ')) {
$modifierWithTrailingSpace = 'function ';
$path = explode(' ', $pathWithOptionalModifier, 2)[1] ? | $segments = explode(',', $expression);
$pathWithOptionalModifier = trim($segments[0], " '\"");
$aliasWithLeadingSpace = isset($segments[1])
? ' as '.trim($segments[1], " '\"")
| {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesUseStatements.php",
"language": "php",
"file_size": 1531,
"cut_index": 537,
"middle_length": 229
} |
ed sections.
*
* @var array
*/
protected $sections = [];
/**
* The stack of in-progress sections.
*
* @var array
*/
protected $sectionStack = [];
/**
* The parent placeholder for the request.
*
* @var mixed
*/
protected static $parentPlacehold... | f (ob_start()) {
$this->sectionStack[] = $section;
}
} else {
$this->extendSection($section, $content instanceof View ? $content : e($content));
}
}
/**
* Inject inline content into a se | o a section.
*
* @param string $section
* @param string|null $content
* @return void
*/
public function startSection($section, $content = null)
{
if ($content === null) {
i | {
"filepath": "src/Illuminate/View/Concerns/ManagesLayouts.php",
"language": "php",
"file_size": 5917,
"cut_index": 716,
"middle_length": 229
} |
pace Illuminate\View\Middleware;
use Closure;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Support\ViewErrorBag;
class ShareErrorsFromSession
{
/**
* The view factory implementation.
*
* @var \Illuminate\Contracts\View\Factory
*/
protected $view;
/**
* Cre... | // If the current session has an "errors" variable bound to it, we will share
// its value with all view instances so the views can easily access errors
// without having to bind. An empty bag is set when there aren't errors.
$th | }
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
| {
"filepath": "src/Illuminate/View/Middleware/ShareErrorsFromSession.php",
"language": "php",
"file_size": 1406,
"cut_index": 524,
"middle_length": 229
} |
mpile the error statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileError($expression)
{
$expression = $this->stripParentheses($expression);
return '<?php $__errorArgs = ['.$expression.'];
$__bag = $errors->getBag($__error... | * @param string $expression
* @return string
*/
protected function compileEnderror($expression)
{
return '<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__ | le the enderror statements into valid PHP.
*
| {
"filepath": "src/Illuminate/View/Compilers/Concerns/CompilesErrors.php",
"language": "php",
"file_size": 933,
"cut_index": 606,
"middle_length": 52
} |
Illuminate\View\Engines\EngineResolver;
use Illuminate\View\Engines\FileEngine;
use Illuminate\View\Engines\PhpEngine;
class ViewServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->registerFactory... | // Next we need to grab the engine resolver instance that will be used by the
// environment. The resolver will be used by an environment to get each of
// the various engine implementations such as plain PHP or Blade engine.
| onent::flushCache();
});
}
/**
* Register the view environment.
*
* @return void
*/
public function registerFactory()
{
$this->app->singleton('view', function ($app) {
| {
"filepath": "src/Illuminate/View/ViewServiceProvider.php",
"language": "php",
"file_size": 5470,
"cut_index": 716,
"middle_length": 229
} |
Concerns\CompilesFragments,
Concerns\CompilesHelpers,
Concerns\CompilesIncludes,
Concerns\CompilesInjections,
Concerns\CompilesJson,
Concerns\CompilesJs,
Concerns\CompilesLayouts,
Concerns\CompilesLoops,
Concerns\CompilesRawPhp,
Concerns\C... | ;
/**
* All custom "condition" handlers.
*
* @var array
*/
protected $conditions = [];
/**
* The registered string preparation callbacks.
*
* @var array
*/
protected $prepareStringsForCompilationUsi | /**
* All of the registered extensions.
*
* @var array
*/
protected $extensions = [];
/**
* All custom "directive" handlers.
*
* @var array
*/
protected $customDirectives = [] | {
"filepath": "src/Illuminate/View/Compilers/BladeCompiler.php",
"language": "php",
"file_size": 28570,
"cut_index": 1331,
"middle_length": 229
} |
e
* @return static<array-key, TWrapValue>
*/
public static function wrap($value);
/**
* Get the underlying items from the given collection if applicable.
*
* @template TUnwrapKey of array-key
* @template TUnwrapValue
*
* @param array<TUnwrapKey, TUnwrapValue>|static<TUn... | od.
*
* @param (callable(TValue): float|int)|string|null $callback
* @return float|int|null
*/
public function average($callback = null);
/**
* Get the median of a given key.
*
* @param string|array<array-key, | * @return static
*/
public static function empty();
/**
* Get all items in the enumerable.
*
* @return array<TKey, TValue>
*/
public function all();
/**
* Alias for the "avg" meth | {
"filepath": "src/Illuminate/Collections/Enumerable.php",
"language": "php",
"file_size": 39264,
"cut_index": 2151,
"middle_length": 229
} |
d, pass a generator function.'
);
} else {
$this->source = $this->getArrayableItems($source);
}
}
/**
* Create a new instance of the collection.
*
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>|(Closure(): \Generator... | e<TMakeKey, TMakeValue>|iterable<TMakeKey, TMakeValue>|(Closure(): \Generator<TMakeKey, TMakeValue, mixed, void>)|self<TMakeKey, TMakeValue>|array<TMakeKey, TMakeValue>|null $items
* @return static<TMakeKey, TMakeValue>
*/
public static func | items);
}
/**
* Create a new collection instance if the value isn't one already.
*
* @template TMakeKey of array-key
* @template TMakeValue
*
* @param \Illuminate\Contracts\Support\Arrayabl | {
"filepath": "src/Illuminate/Collections/LazyCollection.php",
"language": "php",
"file_size": 51731,
"cut_index": 2151,
"middle_length": 229
} |
* @return array
*/
public static function add($array, $key, $value)
{
if (is_null(static::get($array, $key))) {
static::set($array, $key, $value);
}
return $array;
}
/**
* Get an array item from an array using "dot" notation.
*
* @throws \Invali... | n $value;
}
/**
* Get a boolean item from an array using "dot" notation.
*
* @throws \InvalidArgumentException
*/
public static function boolean(ArrayAccess|array $array, string|int|null $key, ?bool $default = null): bool
| t);
if (! is_array($value)) {
throw new InvalidArgumentException(
sprintf('Array value for key [%s] must be an array, %s found.', $key, gettype($value))
);
}
retur | {
"filepath": "src/Illuminate/Collections/Arr.php",
"language": "php",
"file_size": 35814,
"cut_index": 2151,
"middle_length": 229
} |
Contracts\Queue\QueueableCollection;
use Illuminate\Contracts\Queue\QueueableEntity;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Database\Eloquent\Relations\Concerns\AsPivot;
use Illuminate\Database\Eloquent\Relations\Pivot;
use Illuminate\Support\Collection;
trait SerializesAndRe... | $value->getQueueableIds(),
$withRelations ? $value->getQueueableRelations() : [],
$value->getQueueableConnection()
))->useCollectionClass(
($collectionClass = get_class($value)) !== E | protected function getSerializedPropertyValue($value, $withRelations = true)
{
if ($value instanceof QueueableCollection) {
return (new ModelIdentifier(
$value->getQueueableClass(),
| {
"filepath": "src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php",
"language": "php",
"file_size": 3988,
"cut_index": 614,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.