This commit is contained in:
2024-07-03 14:41:15 +03:00
commit ec69208f05
1892 changed files with 181728 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<?php
namespace Illuminate\Contracts\Auth\Access;
interface Authorizable
{
/**
* Determine if the entity has a given ability.
*
* @param iterable|string $abilities
* @param array|mixed $arguments
* @return bool
*/
public function can($abilities, $arguments = []);
}

View File

@ -0,0 +1,150 @@
<?php
namespace Illuminate\Contracts\Auth\Access;
interface Gate
{
/**
* Determine if a given ability has been defined.
*
* @param string $ability
* @return bool
*/
public function has($ability);
/**
* Define a new ability.
*
* @param string $ability
* @param callable|string $callback
* @return $this
*/
public function define($ability, $callback);
/**
* Define abilities for a resource.
*
* @param string $name
* @param string $class
* @param array|null $abilities
* @return $this
*/
public function resource($name, $class, array $abilities = null);
/**
* Define a policy class for a given class type.
*
* @param string $class
* @param string $policy
* @return $this
*/
public function policy($class, $policy);
/**
* Register a callback to run before all Gate checks.
*
* @param callable $callback
* @return $this
*/
public function before(callable $callback);
/**
* Register a callback to run after all Gate checks.
*
* @param callable $callback
* @return $this
*/
public function after(callable $callback);
/**
* Determine if the given ability should be granted for the current user.
*
* @param string $ability
* @param array|mixed $arguments
* @return bool
*/
public function allows($ability, $arguments = []);
/**
* Determine if the given ability should be denied for the current user.
*
* @param string $ability
* @param array|mixed $arguments
* @return bool
*/
public function denies($ability, $arguments = []);
/**
* Determine if all of the given abilities should be granted for the current user.
*
* @param iterable|string $abilities
* @param array|mixed $arguments
* @return bool
*/
public function check($abilities, $arguments = []);
/**
* Determine if any one of the given abilities should be granted for the current user.
*
* @param iterable|string $abilities
* @param array|mixed $arguments
* @return bool
*/
public function any($abilities, $arguments = []);
/**
* Determine if the given ability should be granted for the current user.
*
* @param string $ability
* @param array|mixed $arguments
* @return \Illuminate\Auth\Access\Response
*
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function authorize($ability, $arguments = []);
/**
* Inspect the user for the given ability.
*
* @param string $ability
* @param array|mixed $arguments
* @return \Illuminate\Auth\Access\Response
*/
public function inspect($ability, $arguments = []);
/**
* Get the raw result from the authorization callback.
*
* @param string $ability
* @param array|mixed $arguments
* @return mixed
*
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function raw($ability, $arguments = []);
/**
* Get a policy instance for a given class.
*
* @param object|string $class
* @return mixed
*
* @throws \InvalidArgumentException
*/
public function getPolicyFor($class);
/**
* Get a guard instance for the given user.
*
* @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user
* @return static
*/
public function forUser($user);
/**
* Get all of the defined abilities.
*
* @return array
*/
public function abilities();
}

View File

@ -0,0 +1,49 @@
<?php
namespace Illuminate\Contracts\Auth;
interface Authenticatable
{
/**
* Get the name of the unique identifier for the user.
*
* @return string
*/
public function getAuthIdentifierName();
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier();
/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword();
/**
* Get the token value for the "remember me" session.
*
* @return string
*/
public function getRememberToken();
/**
* Set the token value for the "remember me" session.
*
* @param string $value
* @return void
*/
public function setRememberToken($value);
/**
* Get the column name for the "remember me" token.
*
* @return string
*/
public function getRememberTokenName();
}

View File

@ -0,0 +1,21 @@
<?php
namespace Illuminate\Contracts\Auth;
interface CanResetPassword
{
/**
* Get the e-mail address where password reset links are sent.
*
* @return string
*/
public function getEmailForPasswordReset();
/**
* Send the password reset notification.
*
* @param string $token
* @return void
*/
public function sendPasswordResetNotification($token);
}

View File

@ -0,0 +1,22 @@
<?php
namespace Illuminate\Contracts\Auth;
interface Factory
{
/**
* Get a guard instance by name.
*
* @param string|null $name
* @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard
*/
public function guard($name = null);
/**
* Set the default guard the factory should serve.
*
* @param string $name
* @return void
*/
public function shouldUse($name);
}

View File

@ -0,0 +1,50 @@
<?php
namespace Illuminate\Contracts\Auth;
interface Guard
{
/**
* Determine if the current user is authenticated.
*
* @return bool
*/
public function check();
/**
* Determine if the current user is a guest.
*
* @return bool
*/
public function guest();
/**
* Get the currently authenticated user.
*
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function user();
/**
* Get the ID for the currently authenticated user.
*
* @return int|string|null
*/
public function id();
/**
* Validate a user's credentials.
*
* @param array $credentials
* @return bool
*/
public function validate(array $credentials = []);
/**
* Set the current user.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @return void
*/
public function setUser(Authenticatable $user);
}

View File

@ -0,0 +1,8 @@
<?php
namespace Illuminate\Contracts\Auth\Middleware;
interface AuthenticatesRequests
{
//
}

View File

@ -0,0 +1,34 @@
<?php
namespace Illuminate\Contracts\Auth;
interface MustVerifyEmail
{
/**
* Determine if the user has verified their email address.
*
* @return bool
*/
public function hasVerifiedEmail();
/**
* Mark the given user's email as verified.
*
* @return bool
*/
public function markEmailAsVerified();
/**
* Send the email verification notification.
*
* @return void
*/
public function sendEmailVerificationNotification();
/**
* Get the email address that should be used for verification.
*
* @return string
*/
public function getEmailForVerification();
}

View File

@ -0,0 +1,60 @@
<?php
namespace Illuminate\Contracts\Auth;
use Closure;
interface PasswordBroker
{
/**
* Constant representing a successfully sent reminder.
*
* @var string
*/
const RESET_LINK_SENT = 'passwords.sent';
/**
* Constant representing a successfully reset password.
*
* @var string
*/
const PASSWORD_RESET = 'passwords.reset';
/**
* Constant representing the user not found response.
*
* @var string
*/
const INVALID_USER = 'passwords.user';
/**
* Constant representing an invalid token.
*
* @var string
*/
const INVALID_TOKEN = 'passwords.token';
/**
* Constant representing a throttled reset attempt.
*
* @var string
*/
const RESET_THROTTLED = 'passwords.throttled';
/**
* Send a password reset link to a user.
*
* @param array $credentials
* @return string
*/
public function sendResetLink(array $credentials);
/**
* Reset the password for the given token.
*
* @param array $credentials
* @param \Closure $callback
* @return mixed
*/
public function reset(array $credentials, Closure $callback);
}

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Auth;
interface PasswordBrokerFactory
{
/**
* Get a password broker instance by name.
*
* @param string|null $name
* @return mixed
*/
public function broker($name = null);
}

View File

@ -0,0 +1,63 @@
<?php
namespace Illuminate\Contracts\Auth;
interface StatefulGuard extends Guard
{
/**
* Attempt to authenticate a user using the given credentials.
*
* @param array $credentials
* @param bool $remember
* @return bool
*/
public function attempt(array $credentials = [], $remember = false);
/**
* Log a user into the application without sessions or cookies.
*
* @param array $credentials
* @return bool
*/
public function once(array $credentials = []);
/**
* Log a user into the application.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param bool $remember
* @return void
*/
public function login(Authenticatable $user, $remember = false);
/**
* Log the given user ID into the application.
*
* @param mixed $id
* @param bool $remember
* @return \Illuminate\Contracts\Auth\Authenticatable
*/
public function loginUsingId($id, $remember = false);
/**
* Log the given user ID into the application without sessions or cookies.
*
* @param mixed $id
* @return \Illuminate\Contracts\Auth\Authenticatable|bool
*/
public function onceUsingId($id);
/**
* Determine if the user was authenticated via "remember me" cookie.
*
* @return bool
*/
public function viaRemember();
/**
* Log the user out of the application.
*
* @return void
*/
public function logout();
}

View File

@ -0,0 +1,24 @@
<?php
namespace Illuminate\Contracts\Auth;
interface SupportsBasicAuth
{
/**
* Attempt to authenticate using HTTP Basic Auth.
*
* @param string $field
* @param array $extraConditions
* @return \Symfony\Component\HttpFoundation\Response|null
*/
public function basic($field = 'email', $extraConditions = []);
/**
* Perform a stateless HTTP Basic login attempt.
*
* @param string $field
* @param array $extraConditions
* @return \Symfony\Component\HttpFoundation\Response|null
*/
public function onceBasic($field = 'email', $extraConditions = []);
}

View File

@ -0,0 +1,49 @@
<?php
namespace Illuminate\Contracts\Auth;
interface UserProvider
{
/**
* Retrieve a user by their unique identifier.
*
* @param mixed $identifier
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveById($identifier);
/**
* Retrieve a user by their unique identifier and "remember me" token.
*
* @param mixed $identifier
* @param string $token
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveByToken($identifier, $token);
/**
* Update the "remember me" token for the given user in storage.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param string $token
* @return void
*/
public function updateRememberToken(Authenticatable $user, $token);
/**
* Retrieve a user by the given credentials.
*
* @param array $credentials
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveByCredentials(array $credentials);
/**
* Validate a user against the given credentials.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param array $credentials
* @return bool
*/
public function validateCredentials(Authenticatable $user, array $credentials);
}

View File

@ -0,0 +1,33 @@
<?php
namespace Illuminate\Contracts\Broadcasting;
interface Broadcaster
{
/**
* Authenticate the incoming request for a given channel.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public function auth($request);
/**
* Return the valid authentication response.
*
* @param \Illuminate\Http\Request $request
* @param mixed $result
* @return mixed
*/
public function validAuthenticationResponse($request, $result);
/**
* Broadcast the given event.
*
* @param array $channels
* @param string $event
* @param array $payload
* @return void
*/
public function broadcast(array $channels, $event, array $payload = []);
}

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Broadcasting;
interface Factory
{
/**
* Get a broadcaster implementation by name.
*
* @param string|null $name
* @return \Illuminate\Contracts\Broadcasting\Broadcaster
*/
public function connection($name = null);
}

View File

@ -0,0 +1,13 @@
<?php
namespace Illuminate\Contracts\Broadcasting;
interface ShouldBroadcast
{
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]
*/
public function broadcastOn();
}

View File

@ -0,0 +1,8 @@
<?php
namespace Illuminate\Contracts\Broadcasting;
interface ShouldBroadcastNow extends ShouldBroadcast
{
//
}

View File

@ -0,0 +1,55 @@
<?php
namespace Illuminate\Contracts\Bus;
interface Dispatcher
{
/**
* Dispatch a command to its appropriate handler.
*
* @param mixed $command
* @return mixed
*/
public function dispatch($command);
/**
* Dispatch a command to its appropriate handler in the current process.
*
* @param mixed $command
* @param mixed $handler
* @return mixed
*/
public function dispatchNow($command, $handler = null);
/**
* Determine if the given command has a handler.
*
* @param mixed $command
* @return bool
*/
public function hasCommandHandler($command);
/**
* Retrieve the handler for a command.
*
* @param mixed $command
* @return bool|mixed
*/
public function getCommandHandler($command);
/**
* Set the pipes commands should be piped through before dispatching.
*
* @param array $pipes
* @return $this
*/
public function pipeThrough(array $pipes);
/**
* Map a command to a handler.
*
* @param array $map
* @return $this
*/
public function map(array $map);
}

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Bus;
interface QueueingDispatcher extends Dispatcher
{
/**
* Dispatch a command to its appropriate handler behind a queue.
*
* @param mixed $command
* @return mixed
*/
public function dispatchToQueue($command);
}

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Cache;
interface Factory
{
/**
* Get a cache store instance by name.
*
* @param string|null $name
* @return \Illuminate\Contracts\Cache\Repository
*/
public function store($name = null);
}

View File

@ -0,0 +1,44 @@
<?php
namespace Illuminate\Contracts\Cache;
interface Lock
{
/**
* Attempt to acquire the lock.
*
* @param callable|null $callback
* @return mixed
*/
public function get($callback = null);
/**
* Attempt to acquire the lock for the given number of seconds.
*
* @param int $seconds
* @param callable|null $callback
* @return bool
*/
public function block($seconds, $callback = null);
/**
* Release the lock.
*
* @return bool
*/
public function release();
/**
* Returns the current owner of the lock.
*
* @return string
*/
public function owner();
/**
* Releases this lock in disregard of ownership.
*
* @return void
*/
public function forceRelease();
}

View File

@ -0,0 +1,25 @@
<?php
namespace Illuminate\Contracts\Cache;
interface LockProvider
{
/**
* Get a lock instance.
*
* @param string $name
* @param int $seconds
* @param string|null $owner
* @return \Illuminate\Contracts\Cache\Lock
*/
public function lock($name, $seconds = 0, $owner = null);
/**
* Restore a lock instance using the owner identifier.
*
* @param string $name
* @param string $owner
* @return \Illuminate\Contracts\Cache\Lock
*/
public function restoreLock($name, $owner);
}

View File

@ -0,0 +1,10 @@
<?php
namespace Illuminate\Contracts\Cache;
use Exception;
class LockTimeoutException extends Exception
{
//
}

View File

@ -0,0 +1,108 @@
<?php
namespace Illuminate\Contracts\Cache;
use Closure;
use Psr\SimpleCache\CacheInterface;
interface Repository extends CacheInterface
{
/**
* Retrieve an item from the cache and delete it.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
public function pull($key, $default = null);
/**
* Store an item in the cache.
*
* @param string $key
* @param mixed $value
* @param \DateTimeInterface|\DateInterval|int|null $ttl
* @return bool
*/
public function put($key, $value, $ttl = null);
/**
* Store an item in the cache if the key does not exist.
*
* @param string $key
* @param mixed $value
* @param \DateTimeInterface|\DateInterval|int|null $ttl
* @return bool
*/
public function add($key, $value, $ttl = null);
/**
* Increment the value of an item in the cache.
*
* @param string $key
* @param mixed $value
* @return int|bool
*/
public function increment($key, $value = 1);
/**
* Decrement the value of an item in the cache.
*
* @param string $key
* @param mixed $value
* @return int|bool
*/
public function decrement($key, $value = 1);
/**
* Store an item in the cache indefinitely.
*
* @param string $key
* @param mixed $value
* @return bool
*/
public function forever($key, $value);
/**
* Get an item from the cache, or execute the given Closure and store the result.
*
* @param string $key
* @param \DateTimeInterface|\DateInterval|int|null $ttl
* @param \Closure $callback
* @return mixed
*/
public function remember($key, $ttl, Closure $callback);
/**
* Get an item from the cache, or execute the given Closure and store the result forever.
*
* @param string $key
* @param \Closure $callback
* @return mixed
*/
public function sear($key, Closure $callback);
/**
* Get an item from the cache, or execute the given Closure and store the result forever.
*
* @param string $key
* @param \Closure $callback
* @return mixed
*/
public function rememberForever($key, Closure $callback);
/**
* Remove an item from the cache.
*
* @param string $key
* @return bool
*/
public function forget($key);
/**
* Get the cache store implementation.
*
* @return \Illuminate\Contracts\Cache\Store
*/
public function getStore();
}

View File

@ -0,0 +1,92 @@
<?php
namespace Illuminate\Contracts\Cache;
interface Store
{
/**
* Retrieve an item from the cache by key.
*
* @param string|array $key
* @return mixed
*/
public function get($key);
/**
* Retrieve multiple items from the cache by key.
*
* Items not found in the cache will have a null value.
*
* @param array $keys
* @return array
*/
public function many(array $keys);
/**
* Store an item in the cache for a given number of seconds.
*
* @param string $key
* @param mixed $value
* @param int $seconds
* @return bool
*/
public function put($key, $value, $seconds);
/**
* Store multiple items in the cache for a given number of seconds.
*
* @param array $values
* @param int $seconds
* @return bool
*/
public function putMany(array $values, $seconds);
/**
* Increment the value of an item in the cache.
*
* @param string $key
* @param mixed $value
* @return int|bool
*/
public function increment($key, $value = 1);
/**
* Decrement the value of an item in the cache.
*
* @param string $key
* @param mixed $value
* @return int|bool
*/
public function decrement($key, $value = 1);
/**
* Store an item in the cache indefinitely.
*
* @param string $key
* @param mixed $value
* @return bool
*/
public function forever($key, $value);
/**
* Remove an item from the cache.
*
* @param string $key
* @return bool
*/
public function forget($key);
/**
* Remove all items from the cache.
*
* @return bool
*/
public function flush();
/**
* Get the cache key prefix.
*
* @return string
*/
public function getPrefix();
}

View File

@ -0,0 +1,57 @@
<?php
namespace Illuminate\Contracts\Config;
interface Repository
{
/**
* Determine if the given configuration value exists.
*
* @param string $key
* @return bool
*/
public function has($key);
/**
* Get the specified configuration value.
*
* @param array|string $key
* @param mixed $default
* @return mixed
*/
public function get($key, $default = null);
/**
* Get all of the configuration items for the application.
*
* @return array
*/
public function all();
/**
* Set a given configuration value.
*
* @param array|string $key
* @param mixed $value
* @return void
*/
public function set($key, $value = null);
/**
* Prepend a value onto an array configuration value.
*
* @param string $key
* @param mixed $value
* @return void
*/
public function prepend($key, $value);
/**
* Push a value onto an array configuration value.
*
* @param string $key
* @param mixed $value
* @return void
*/
public function push($key, $value);
}

View File

@ -0,0 +1,23 @@
<?php
namespace Illuminate\Contracts\Console;
interface Application
{
/**
* Run an Artisan console command by name.
*
* @param string $command
* @param array $parameters
* @param \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer
* @return int
*/
public function call($command, array $parameters = [], $outputBuffer = null);
/**
* Get the output from the last command.
*
* @return string
*/
public function output();
}

View File

@ -0,0 +1,57 @@
<?php
namespace Illuminate\Contracts\Console;
interface Kernel
{
/**
* Handle an incoming console command.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface|null $output
* @return int
*/
public function handle($input, $output = null);
/**
* Run an Artisan console command by name.
*
* @param string $command
* @param array $parameters
* @param \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer
* @return int
*/
public function call($command, array $parameters = [], $outputBuffer = null);
/**
* Queue an Artisan console command by name.
*
* @param string $command
* @param array $parameters
* @return \Illuminate\Foundation\Bus\PendingDispatch
*/
public function queue($command, array $parameters = []);
/**
* Get all of the commands registered with the console.
*
* @return array
*/
public function all();
/**
* Get the output for the last run command.
*
* @return string
*/
public function output();
/**
* Terminate the application.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param int $status
* @return void
*/
public function terminate($input, $status);
}

View File

@ -0,0 +1,11 @@
<?php
namespace Illuminate\Contracts\Container;
use Exception;
use Psr\Container\ContainerExceptionInterface;
class BindingResolutionException extends Exception implements ContainerExceptionInterface
{
//
}

View File

@ -0,0 +1,183 @@
<?php
namespace Illuminate\Contracts\Container;
use Closure;
use Psr\Container\ContainerInterface;
interface Container extends ContainerInterface
{
/**
* Determine if the given abstract type has been bound.
*
* @param string $abstract
* @return bool
*/
public function bound($abstract);
/**
* Alias a type to a different name.
*
* @param string $abstract
* @param string $alias
* @return void
*
* @throws \LogicException
*/
public function alias($abstract, $alias);
/**
* Assign a set of tags to a given binding.
*
* @param array|string $abstracts
* @param array|mixed ...$tags
* @return void
*/
public function tag($abstracts, $tags);
/**
* Resolve all of the bindings for a given tag.
*
* @param string $tag
* @return iterable
*/
public function tagged($tag);
/**
* Register a binding with the container.
*
* @param string $abstract
* @param \Closure|string|null $concrete
* @param bool $shared
* @return void
*/
public function bind($abstract, $concrete = null, $shared = false);
/**
* Register a binding if it hasn't already been registered.
*
* @param string $abstract
* @param \Closure|string|null $concrete
* @param bool $shared
* @return void
*/
public function bindIf($abstract, $concrete = null, $shared = false);
/**
* Register a shared binding in the container.
*
* @param string $abstract
* @param \Closure|string|null $concrete
* @return void
*/
public function singleton($abstract, $concrete = null);
/**
* Register a shared binding if it hasn't already been registered.
*
* @param string $abstract
* @param \Closure|string|null $concrete
* @return void
*/
public function singletonIf($abstract, $concrete = null);
/**
* "Extend" an abstract type in the container.
*
* @param string $abstract
* @param \Closure $closure
* @return void
*
* @throws \InvalidArgumentException
*/
public function extend($abstract, Closure $closure);
/**
* Register an existing instance as shared in the container.
*
* @param string $abstract
* @param mixed $instance
* @return mixed
*/
public function instance($abstract, $instance);
/**
* Add a contextual binding to the container.
*
* @param string $concrete
* @param string $abstract
* @param \Closure|string $implementation
* @return void
*/
public function addContextualBinding($concrete, $abstract, $implementation);
/**
* Define a contextual binding.
*
* @param string|array $concrete
* @return \Illuminate\Contracts\Container\ContextualBindingBuilder
*/
public function when($concrete);
/**
* Get a closure to resolve the given type from the container.
*
* @param string $abstract
* @return \Closure
*/
public function factory($abstract);
/**
* Flush the container of all bindings and resolved instances.
*
* @return void
*/
public function flush();
/**
* Resolve the given type from the container.
*
* @param string $abstract
* @param array $parameters
* @return mixed
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function make($abstract, array $parameters = []);
/**
* Call the given Closure / class@method and inject its dependencies.
*
* @param callable|string $callback
* @param array $parameters
* @param string|null $defaultMethod
* @return mixed
*/
public function call($callback, array $parameters = [], $defaultMethod = null);
/**
* Determine if the given abstract type has been resolved.
*
* @param string $abstract
* @return bool
*/
public function resolved($abstract);
/**
* Register a new resolving callback.
*
* @param \Closure|string $abstract
* @param \Closure|null $callback
* @return void
*/
public function resolving($abstract, Closure $callback = null);
/**
* Register a new after resolving callback.
*
* @param \Closure|string $abstract
* @param \Closure|null $callback
* @return void
*/
public function afterResolving($abstract, Closure $callback = null);
}

View File

@ -0,0 +1,22 @@
<?php
namespace Illuminate\Contracts\Container;
interface ContextualBindingBuilder
{
/**
* Define the abstract target that depends on the context.
*
* @param string $abstract
* @return $this
*/
public function needs($abstract);
/**
* Define the implementation for the contextual binding.
*
* @param \Closure|string $implementation
* @return void
*/
public function give($implementation);
}

View File

@ -0,0 +1,47 @@
<?php
namespace Illuminate\Contracts\Cookie;
interface Factory
{
/**
* Create a new cookie instance.
*
* @param string $name
* @param string $value
* @param int $minutes
* @param string|null $path
* @param string|null $domain
* @param bool|null $secure
* @param bool $httpOnly
* @param bool $raw
* @param string|null $sameSite
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null);
/**
* Create a cookie that lasts "forever" (five years).
*
* @param string $name
* @param string $value
* @param string|null $path
* @param string|null $domain
* @param bool|null $secure
* @param bool $httpOnly
* @param bool $raw
* @param string|null $sameSite
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function forever($name, $value, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null);
/**
* Expire the given cookie.
*
* @param string $name
* @param string|null $path
* @param string|null $domain
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function forget($name, $path = null, $domain = null);
}

View File

@ -0,0 +1,30 @@
<?php
namespace Illuminate\Contracts\Cookie;
interface QueueingFactory extends Factory
{
/**
* Queue a cookie to send with the next response.
*
* @param array $parameters
* @return void
*/
public function queue(...$parameters);
/**
* Remove a cookie from the queue.
*
* @param string $name
* @param string|null $path
* @return void
*/
public function unqueue($name, $path = null);
/**
* Get the cookies which have been queued for the next request.
*
* @return array
*/
public function getQueuedCookies();
}

View File

@ -0,0 +1,13 @@
<?php
namespace Illuminate\Contracts\Database\Eloquent;
interface Castable
{
/**
* Get the name of the caster class to use when casting from / to this cast target.
*
* @return string|\Illuminate\Contracts\Database\Eloquent\CastsAttributes|\Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes
*/
public static function castUsing();
}

View File

@ -0,0 +1,28 @@
<?php
namespace Illuminate\Contracts\Database\Eloquent;
interface CastsAttributes
{
/**
* Transform the attribute from the underlying model values.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $key
* @param mixed $value
* @param array $attributes
* @return mixed
*/
public function get($model, string $key, $value, array $attributes);
/**
* Transform the attribute to its underlying model values.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $key
* @param mixed $value
* @param array $attributes
* @return mixed
*/
public function set($model, string $key, $value, array $attributes);
}

View File

@ -0,0 +1,17 @@
<?php
namespace Illuminate\Contracts\Database\Eloquent;
interface CastsInboundAttributes
{
/**
* Transform the attribute to its underlying model values.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $key
* @param mixed $value
* @param array $attributes
* @return mixed
*/
public function set($model, string $key, $value, array $attributes);
}

View File

@ -0,0 +1,8 @@
<?php
namespace Illuminate\Contracts\Database\Events;
interface MigrationEvent
{
//
}

View File

@ -0,0 +1,53 @@
<?php
namespace Illuminate\Contracts\Database;
class ModelIdentifier
{
/**
* The class name of the model.
*
* @var string
*/
public $class;
/**
* The unique identifier of the model.
*
* This may be either a single ID or an array of IDs.
*
* @var mixed
*/
public $id;
/**
* The relationships loaded on the model.
*
* @var array
*/
public $relations;
/**
* The connection name of the model.
*
* @var string|null
*/
public $connection;
/**
* Create a new model identifier.
*
* @param string $class
* @param mixed $id
* @param array $relations
* @param mixed $connection
* @return void
*/
public function __construct($class, $id, array $relations, $connection)
{
$this->id = $id;
$this->class = $class;
$this->relations = $relations;
$this->connection = $connection;
}
}

View File

@ -0,0 +1,46 @@
<?php
namespace Illuminate\Contracts\Debug;
use Throwable;
interface ExceptionHandler
{
/**
* Report or log an exception.
*
* @param \Throwable $e
* @return void
*
* @throws \Throwable
*/
public function report(Throwable $e);
/**
* Determine if the exception should be reported.
*
* @param \Throwable $e
* @return bool
*/
public function shouldReport(Throwable $e);
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $e
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Throwable
*/
public function render($request, Throwable $e);
/**
* Render an exception to the console.
*
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param \Throwable $e
* @return void
*/
public function renderForConsole($output, Throwable $e);
}

View File

@ -0,0 +1,10 @@
<?php
namespace Illuminate\Contracts\Encryption;
use RuntimeException;
class DecryptException extends RuntimeException
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace Illuminate\Contracts\Encryption;
use RuntimeException;
class EncryptException extends RuntimeException
{
//
}

View File

@ -0,0 +1,28 @@
<?php
namespace Illuminate\Contracts\Encryption;
interface Encrypter
{
/**
* Encrypt the given value.
*
* @param mixed $value
* @param bool $serialize
* @return string
*
* @throws \Illuminate\Contracts\Encryption\EncryptException
*/
public function encrypt($value, $serialize = true);
/**
* Decrypt the given value.
*
* @param string $payload
* @param bool $unserialize
* @return mixed
*
* @throws \Illuminate\Contracts\Encryption\DecryptException
*/
public function decrypt($payload, $unserialize = true);
}

View File

@ -0,0 +1,82 @@
<?php
namespace Illuminate\Contracts\Events;
interface Dispatcher
{
/**
* Register an event listener with the dispatcher.
*
* @param string|array $events
* @param \Closure|string $listener
* @return void
*/
public function listen($events, $listener);
/**
* Determine if a given event has listeners.
*
* @param string $eventName
* @return bool
*/
public function hasListeners($eventName);
/**
* Register an event subscriber with the dispatcher.
*
* @param object|string $subscriber
* @return void
*/
public function subscribe($subscriber);
/**
* Dispatch an event until the first non-null response is returned.
*
* @param string|object $event
* @param mixed $payload
* @return array|null
*/
public function until($event, $payload = []);
/**
* Dispatch an event and call the listeners.
*
* @param string|object $event
* @param mixed $payload
* @param bool $halt
* @return array|null
*/
public function dispatch($event, $payload = [], $halt = false);
/**
* Register an event and payload to be fired later.
*
* @param string $event
* @param array $payload
* @return void
*/
public function push($event, $payload = []);
/**
* Flush a set of pushed events.
*
* @param string $event
* @return void
*/
public function flush($event);
/**
* Remove a set of listeners from the dispatcher.
*
* @param string $event
* @return void
*/
public function forget($event);
/**
* Forget all of the queued listeners.
*
* @return void
*/
public function forgetPushed();
}

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Filesystem;
interface Cloud extends Filesystem
{
/**
* Get the URL for the file at the given path.
*
* @param string $path
* @return string
*/
public function url($path);
}

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Filesystem;
interface Factory
{
/**
* Get a filesystem implementation.
*
* @param string|null $name
* @return \Illuminate\Contracts\Filesystem\Filesystem
*/
public function disk($name = null);
}

View File

@ -0,0 +1,10 @@
<?php
namespace Illuminate\Contracts\Filesystem;
use Exception;
class FileExistsException extends Exception
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace Illuminate\Contracts\Filesystem;
use Exception;
class FileNotFoundException extends Exception
{
//
}

View File

@ -0,0 +1,198 @@
<?php
namespace Illuminate\Contracts\Filesystem;
interface Filesystem
{
/**
* The public visibility setting.
*
* @var string
*/
const VISIBILITY_PUBLIC = 'public';
/**
* The private visibility setting.
*
* @var string
*/
const VISIBILITY_PRIVATE = 'private';
/**
* Determine if a file exists.
*
* @param string $path
* @return bool
*/
public function exists($path);
/**
* Get the contents of a file.
*
* @param string $path
* @return string
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public function get($path);
/**
* Get a resource to read the file.
*
* @param string $path
* @return resource|null The path resource or null on failure.
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public function readStream($path);
/**
* Write the contents of a file.
*
* @param string $path
* @param string|resource $contents
* @param mixed $options
* @return bool
*/
public function put($path, $contents, $options = []);
/**
* Write a new file using a stream.
*
* @param string $path
* @param resource $resource
* @param array $options
* @return bool
*
* @throws \InvalidArgumentException If $resource is not a file handle.
* @throws \Illuminate\Contracts\Filesystem\FileExistsException
*/
public function writeStream($path, $resource, array $options = []);
/**
* Get the visibility for the given path.
*
* @param string $path
* @return string
*/
public function getVisibility($path);
/**
* Set the visibility for the given path.
*
* @param string $path
* @param string $visibility
* @return bool
*/
public function setVisibility($path, $visibility);
/**
* Prepend to a file.
*
* @param string $path
* @param string $data
* @return bool
*/
public function prepend($path, $data);
/**
* Append to a file.
*
* @param string $path
* @param string $data
* @return bool
*/
public function append($path, $data);
/**
* Delete the file at a given path.
*
* @param string|array $paths
* @return bool
*/
public function delete($paths);
/**
* Copy a file to a new location.
*
* @param string $from
* @param string $to
* @return bool
*/
public function copy($from, $to);
/**
* Move a file to a new location.
*
* @param string $from
* @param string $to
* @return bool
*/
public function move($from, $to);
/**
* Get the file size of a given file.
*
* @param string $path
* @return int
*/
public function size($path);
/**
* Get the file's last modification time.
*
* @param string $path
* @return int
*/
public function lastModified($path);
/**
* Get an array of all files in a directory.
*
* @param string|null $directory
* @param bool $recursive
* @return array
*/
public function files($directory = null, $recursive = false);
/**
* Get all of the files from the given directory (recursive).
*
* @param string|null $directory
* @return array
*/
public function allFiles($directory = null);
/**
* Get all of the directories within a given directory.
*
* @param string|null $directory
* @param bool $recursive
* @return array
*/
public function directories($directory = null, $recursive = false);
/**
* Get all (recursive) of the directories within a given directory.
*
* @param string|null $directory
* @return array
*/
public function allDirectories($directory = null);
/**
* Create a directory.
*
* @param string $path
* @return bool
*/
public function makeDirectory($path);
/**
* Recursively delete a directory.
*
* @param string $directory
* @return bool
*/
public function deleteDirectory($directory);
}

View File

@ -0,0 +1,215 @@
<?php
namespace Illuminate\Contracts\Foundation;
use Illuminate\Contracts\Container\Container;
interface Application extends Container
{
/**
* Get the version number of the application.
*
* @return string
*/
public function version();
/**
* Get the base path of the Laravel installation.
*
* @param string $path
* @return string
*/
public function basePath($path = '');
/**
* Get the path to the bootstrap directory.
*
* @param string $path Optionally, a path to append to the bootstrap path
* @return string
*/
public function bootstrapPath($path = '');
/**
* Get the path to the application configuration files.
*
* @param string $path Optionally, a path to append to the config path
* @return string
*/
public function configPath($path = '');
/**
* Get the path to the database directory.
*
* @param string $path Optionally, a path to append to the database path
* @return string
*/
public function databasePath($path = '');
/**
* Get the path to the resources directory.
*
* @param string $path
* @return string
*/
public function resourcePath($path = '');
/**
* Get the path to the storage directory.
*
* @return string
*/
public function storagePath();
/**
* Get or check the current application environment.
*
* @param string|array $environments
* @return string|bool
*/
public function environment(...$environments);
/**
* Determine if the application is running in the console.
*
* @return bool
*/
public function runningInConsole();
/**
* Determine if the application is running unit tests.
*
* @return bool
*/
public function runningUnitTests();
/**
* Determine if the application is currently down for maintenance.
*
* @return bool
*/
public function isDownForMaintenance();
/**
* Register all of the configured providers.
*
* @return void
*/
public function registerConfiguredProviders();
/**
* Register a service provider with the application.
*
* @param \Illuminate\Support\ServiceProvider|string $provider
* @param bool $force
* @return \Illuminate\Support\ServiceProvider
*/
public function register($provider, $force = false);
/**
* Register a deferred provider and service.
*
* @param string $provider
* @param string|null $service
* @return void
*/
public function registerDeferredProvider($provider, $service = null);
/**
* Resolve a service provider instance from the class name.
*
* @param string $provider
* @return \Illuminate\Support\ServiceProvider
*/
public function resolveProvider($provider);
/**
* Boot the application's service providers.
*
* @return void
*/
public function boot();
/**
* Register a new boot listener.
*
* @param callable $callback
* @return void
*/
public function booting($callback);
/**
* Register a new "booted" listener.
*
* @param callable $callback
* @return void
*/
public function booted($callback);
/**
* Run the given array of bootstrap classes.
*
* @param array $bootstrappers
* @return void
*/
public function bootstrapWith(array $bootstrappers);
/**
* Get the current application locale.
*
* @return string
*/
public function getLocale();
/**
* Get the application namespace.
*
* @return string
*
* @throws \RuntimeException
*/
public function getNamespace();
/**
* Get the registered service provider instances if any exist.
*
* @param \Illuminate\Support\ServiceProvider|string $provider
* @return array
*/
public function getProviders($provider);
/**
* Determine if the application has been bootstrapped before.
*
* @return bool
*/
public function hasBeenBootstrapped();
/**
* Load and boot all of the remaining deferred providers.
*
* @return void
*/
public function loadDeferredProviders();
/**
* Set the current application locale.
*
* @param string $locale
* @return void
*/
public function setLocale($locale);
/**
* Determine if middleware has been disabled for the application.
*
* @return bool
*/
public function shouldSkipMiddleware();
/**
* Terminate the application.
*
* @return void
*/
public function terminate();
}

View File

@ -0,0 +1,27 @@
<?php
namespace Illuminate\Contracts\Foundation;
interface CachesConfiguration
{
/**
* Determine if the application configuration is cached.
*
* @return bool
*/
public function configurationIsCached();
/**
* Get the path to the configuration cache file.
*
* @return string
*/
public function getCachedConfigPath();
/**
* Get the path to the cached services.php file.
*
* @return string
*/
public function getCachedServicesPath();
}

View File

@ -0,0 +1,20 @@
<?php
namespace Illuminate\Contracts\Foundation;
interface CachesRoutes
{
/**
* Determine if the application routes are cached.
*
* @return bool
*/
public function routesAreCached();
/**
* Get the path to the routes cache file.
*
* @return string
*/
public function getCachedRoutesPath();
}

View File

@ -0,0 +1,42 @@
<?php
namespace Illuminate\Contracts\Hashing;
interface Hasher
{
/**
* Get information about the given hashed value.
*
* @param string $hashedValue
* @return array
*/
public function info($hashedValue);
/**
* Hash the given value.
*
* @param string $value
* @param array $options
* @return string
*/
public function make($value, array $options = []);
/**
* Check the given plain value against a hash.
*
* @param string $value
* @param string $hashedValue
* @param array $options
* @return bool
*/
public function check($value, $hashedValue, array $options = []);
/**
* Check if the given hash has been hashed using the given options.
*
* @param string $hashedValue
* @param array $options
* @return bool
*/
public function needsRehash($hashedValue, array $options = []);
}

View File

@ -0,0 +1,37 @@
<?php
namespace Illuminate\Contracts\Http;
interface Kernel
{
/**
* Bootstrap the application for HTTP requests.
*
* @return void
*/
public function bootstrap();
/**
* Handle an incoming HTTP request.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function handle($request);
/**
* Perform any final actions for the request lifecycle.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* @param \Symfony\Component\HttpFoundation\Response $response
* @return void
*/
public function terminate($request, $response);
/**
* Get the Laravel application instance.
*
* @return \Illuminate\Contracts\Foundation\Application
*/
public function getApplication();
}

21
vendor/illuminate/contracts/LICENSE.md vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Taylor Otwell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Mail;
interface Factory
{
/**
* Get a mailer instance by name.
*
* @param string|null $name
* @return \Illuminate\Mail\Mailer
*/
public function mailer($name = null);
}

View File

@ -0,0 +1,25 @@
<?php
namespace Illuminate\Contracts\Mail;
interface MailQueue
{
/**
* Queue a new e-mail message for sending.
*
* @param \Illuminate\Contracts\Mail\Mailable|string|array $view
* @param string|null $queue
* @return mixed
*/
public function queue($view, $queue = null);
/**
* Queue a new e-mail message for sending after (n) seconds.
*
* @param \DateTimeInterface|\DateInterval|int $delay
* @param \Illuminate\Contracts\Mail\Mailable|string|array $view
* @param string|null $queue
* @return mixed
*/
public function later($delay, $view, $queue = null);
}

View File

@ -0,0 +1,76 @@
<?php
namespace Illuminate\Contracts\Mail;
use Illuminate\Contracts\Queue\Factory as Queue;
interface Mailable
{
/**
* Send the message using the given mailer.
*
* @param \Illuminate\Contracts\Mail\Factory|\Illuminate\Contracts\Mail\Mailer $mailer
* @return void
*/
public function send($mailer);
/**
* Queue the given message.
*
* @param \Illuminate\Contracts\Queue\Factory $queue
* @return mixed
*/
public function queue(Queue $queue);
/**
* Deliver the queued message after the given delay.
*
* @param \DateTimeInterface|\DateInterval|int $delay
* @param \Illuminate\Contracts\Queue\Factory $queue
* @return mixed
*/
public function later($delay, Queue $queue);
/**
* Set the recipients of the message.
*
* @param object|array|string $address
* @param string|null $name
* @return self
*/
public function cc($address, $name = null);
/**
* Set the recipients of the message.
*
* @param object|array|string $address
* @param string|null $name
* @return $this
*/
public function bcc($address, $name = null);
/**
* Set the recipients of the message.
*
* @param object|array|string $address
* @param string|null $name
* @return $this
*/
public function to($address, $name = null);
/**
* Set the locale of the message.
*
* @param string $locale
* @return $this
*/
public function locale($locale);
/**
* Set the name of the mailer that should be used to send the message.
*
* @param string $mailer
* @return $this
*/
public function mailer($mailer);
}

View File

@ -0,0 +1,48 @@
<?php
namespace Illuminate\Contracts\Mail;
interface Mailer
{
/**
* Begin the process of mailing a mailable class instance.
*
* @param mixed $users
* @return \Illuminate\Mail\PendingMail
*/
public function to($users);
/**
* Begin the process of mailing a mailable class instance.
*
* @param mixed $users
* @return \Illuminate\Mail\PendingMail
*/
public function bcc($users);
/**
* Send a new message with only a raw text part.
*
* @param string $text
* @param mixed $callback
* @return void
*/
public function raw($text, $callback);
/**
* Send a new message using a view.
*
* @param \Illuminate\Contracts\Mail\Mailable|string|array $view
* @param array $data
* @param \Closure|string|null $callback
* @return void
*/
public function send($view, array $data = [], $callback = null);
/**
* Get the array of failed recipients.
*
* @return array
*/
public function failures();
}

View File

@ -0,0 +1,24 @@
<?php
namespace Illuminate\Contracts\Notifications;
interface Dispatcher
{
/**
* Send the given notification to the given notifiable entities.
*
* @param \Illuminate\Support\Collection|array|mixed $notifiables
* @param mixed $notification
* @return void
*/
public function send($notifiables, $notification);
/**
* Send the given notification immediately.
*
* @param \Illuminate\Support\Collection|array|mixed $notifiables
* @param mixed $notification
* @return void
*/
public function sendNow($notifiables, $notification);
}

View File

@ -0,0 +1,32 @@
<?php
namespace Illuminate\Contracts\Notifications;
interface Factory
{
/**
* Get a channel instance by name.
*
* @param string|null $name
* @return mixed
*/
public function channel($name = null);
/**
* Send the given notification to the given notifiable entities.
*
* @param \Illuminate\Support\Collection|array|mixed $notifiables
* @param mixed $notification
* @return void
*/
public function send($notifiables, $notification);
/**
* Send the given notification immediately.
*
* @param \Illuminate\Support\Collection|array|mixed $notifiables
* @param mixed $notification
* @return void
*/
public function sendNow($notifiables, $notification);
}

View File

@ -0,0 +1,29 @@
<?php
namespace Illuminate\Contracts\Pagination;
interface LengthAwarePaginator extends Paginator
{
/**
* Create a range of pagination URLs.
*
* @param int $start
* @param int $end
* @return array
*/
public function getUrlRange($start, $end);
/**
* Determine the total number of items in the data store.
*
* @return int
*/
public function total();
/**
* Get the page number of the last available page.
*
* @return int
*/
public function lastPage();
}

View File

@ -0,0 +1,124 @@
<?php
namespace Illuminate\Contracts\Pagination;
interface Paginator
{
/**
* Get the URL for a given page.
*
* @param int $page
* @return string
*/
public function url($page);
/**
* Add a set of query string values to the paginator.
*
* @param array|string $key
* @param string|null $value
* @return $this
*/
public function appends($key, $value = null);
/**
* Get / set the URL fragment to be appended to URLs.
*
* @param string|null $fragment
* @return $this|string
*/
public function fragment($fragment = null);
/**
* The URL for the next page, or null.
*
* @return string|null
*/
public function nextPageUrl();
/**
* Get the URL for the previous page, or null.
*
* @return string|null
*/
public function previousPageUrl();
/**
* Get all of the items being paginated.
*
* @return array
*/
public function items();
/**
* Get the "index" of the first item being paginated.
*
* @return int
*/
public function firstItem();
/**
* Get the "index" of the last item being paginated.
*
* @return int
*/
public function lastItem();
/**
* Determine how many items are being shown per page.
*
* @return int
*/
public function perPage();
/**
* Determine the current page being paginated.
*
* @return int
*/
public function currentPage();
/**
* Determine if there are enough items to split into multiple pages.
*
* @return bool
*/
public function hasPages();
/**
* Determine if there are more items in the data store.
*
* @return bool
*/
public function hasMorePages();
/**
* Get the base path for paginator generated URLs.
*
* @return string|null
*/
public function path();
/**
* Determine if the list of items is empty or not.
*
* @return bool
*/
public function isEmpty();
/**
* Determine if the list of items is not empty.
*
* @return bool
*/
public function isNotEmpty();
/**
* Render the paginator using a given view.
*
* @param string|null $view
* @param array $data
* @return string
*/
public function render($view = null, $data = []);
}

View File

@ -0,0 +1,15 @@
<?php
namespace Illuminate\Contracts\Pipeline;
interface Hub
{
/**
* Send an object through one of the available pipelines.
*
* @param mixed $object
* @param string|null $pipeline
* @return mixed
*/
public function pipe($object, $pipeline = null);
}

View File

@ -0,0 +1,40 @@
<?php
namespace Illuminate\Contracts\Pipeline;
use Closure;
interface Pipeline
{
/**
* Set the traveler object being sent on the pipeline.
*
* @param mixed $traveler
* @return $this
*/
public function send($traveler);
/**
* Set the stops of the pipeline.
*
* @param dynamic|array $stops
* @return $this
*/
public function through($stops);
/**
* Set the method to call on the stops.
*
* @param string $method
* @return $this
*/
public function via($method);
/**
* Run the pipeline with a final destination callback.
*
* @param \Closure $destination
* @return mixed
*/
public function then(Closure $destination);
}

View File

@ -0,0 +1,22 @@
<?php
namespace Illuminate\Contracts\Queue;
use InvalidArgumentException;
class EntityNotFoundException extends InvalidArgumentException
{
/**
* Create a new exception instance.
*
* @param string $type
* @param mixed $id
* @return void
*/
public function __construct($type, $id)
{
$id = (string) $id;
parent::__construct("Queueable entity [{$type}] not found for ID [{$id}].");
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace Illuminate\Contracts\Queue;
interface EntityResolver
{
/**
* Resolve the entity for the given ID.
*
* @param string $type
* @param mixed $id
* @return mixed
*/
public function resolve($type, $id);
}

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Queue;
interface Factory
{
/**
* Resolve a queue connection instance.
*
* @param string|null $name
* @return \Illuminate\Contracts\Queue\Queue
*/
public function connection($name = null);
}

View File

@ -0,0 +1,166 @@
<?php
namespace Illuminate\Contracts\Queue;
interface Job
{
/**
* Get the UUID of the job.
*
* @return string|null
*/
public function uuid();
/**
* Get the job identifier.
*
* @return string
*/
public function getJobId();
/**
* Get the decoded body of the job.
*
* @return array
*/
public function payload();
/**
* Fire the job.
*
* @return void
*/
public function fire();
/**
* Release the job back into the queue.
*
* Accepts a delay specified in seconds.
*
* @param int $delay
* @return void
*/
public function release($delay = 0);
/**
* Determine if the job was released back into the queue.
*
* @return bool
*/
public function isReleased();
/**
* Delete the job from the queue.
*
* @return void
*/
public function delete();
/**
* Determine if the job has been deleted.
*
* @return bool
*/
public function isDeleted();
/**
* Determine if the job has been deleted or released.
*
* @return bool
*/
public function isDeletedOrReleased();
/**
* Get the number of times the job has been attempted.
*
* @return int
*/
public function attempts();
/**
* Determine if the job has been marked as a failure.
*
* @return bool
*/
public function hasFailed();
/**
* Mark the job as "failed".
*
* @return void
*/
public function markAsFailed();
/**
* Delete the job, call the "failed" method, and raise the failed job event.
*
* @param \Throwable|null $e
* @return void
*/
public function fail($e = null);
/**
* Get the number of times to attempt a job.
*
* @return int|null
*/
public function maxTries();
/**
* Get the maximum number of exceptions allowed, regardless of attempts.
*
* @return int|null
*/
public function maxExceptions();
/**
* Get the number of seconds the job can run.
*
* @return int|null
*/
public function timeout();
/**
* Get the timestamp indicating when the job should timeout.
*
* @return int|null
*/
public function timeoutAt();
/**
* Get the name of the queued job class.
*
* @return string
*/
public function getName();
/**
* Get the resolved name of the queued job class.
*
* Resolves the name of "wrapped" jobs such as class-based handlers.
*
* @return string
*/
public function resolveName();
/**
* Get the name of the connection the job belongs to.
*
* @return string
*/
public function getConnectionName();
/**
* Get the name of the queue the job belongs to.
*
* @return string
*/
public function getQueue();
/**
* Get the raw body string for the job.
*
* @return string
*/
public function getRawBody();
}

View File

@ -0,0 +1,30 @@
<?php
namespace Illuminate\Contracts\Queue;
interface Monitor
{
/**
* Register a callback to be executed on every iteration through the queue loop.
*
* @param mixed $callback
* @return void
*/
public function looping($callback);
/**
* Register a callback to be executed when a job fails after the maximum amount of retries.
*
* @param mixed $callback
* @return void
*/
public function failing($callback);
/**
* Register a callback to be executed when a daemon queue is stopping.
*
* @param mixed $callback
* @return void
*/
public function stopping($callback);
}

View File

@ -0,0 +1,99 @@
<?php
namespace Illuminate\Contracts\Queue;
interface Queue
{
/**
* Get the size of the queue.
*
* @param string|null $queue
* @return int
*/
public function size($queue = null);
/**
* Push a new job onto the queue.
*
* @param string|object $job
* @param mixed $data
* @param string|null $queue
* @return mixed
*/
public function push($job, $data = '', $queue = null);
/**
* Push a new job onto the queue.
*
* @param string $queue
* @param string|object $job
* @param mixed $data
* @return mixed
*/
public function pushOn($queue, $job, $data = '');
/**
* Push a raw payload onto the queue.
*
* @param string $payload
* @param string|null $queue
* @param array $options
* @return mixed
*/
public function pushRaw($payload, $queue = null, array $options = []);
/**
* Push a new job onto the queue after a delay.
*
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string|object $job
* @param mixed $data
* @param string|null $queue
* @return mixed
*/
public function later($delay, $job, $data = '', $queue = null);
/**
* Push a new job onto the queue after a delay.
*
* @param string $queue
* @param \DateTimeInterface|\DateInterval|int $delay
* @param string|object $job
* @param mixed $data
* @return mixed
*/
public function laterOn($queue, $delay, $job, $data = '');
/**
* Push an array of jobs onto the queue.
*
* @param array $jobs
* @param mixed $data
* @param string|null $queue
* @return mixed
*/
public function bulk($jobs, $data = '', $queue = null);
/**
* Pop the next job off of the queue.
*
* @param string|null $queue
* @return \Illuminate\Contracts\Queue\Job|null
*/
public function pop($queue = null);
/**
* Get the connection name for the queue.
*
* @return string
*/
public function getConnectionName();
/**
* Set the connection name for the queue.
*
* @param string $name
* @return $this
*/
public function setConnectionName($name);
}

View File

@ -0,0 +1,34 @@
<?php
namespace Illuminate\Contracts\Queue;
interface QueueableCollection
{
/**
* Get the type of the entities being queued.
*
* @return string|null
*/
public function getQueueableClass();
/**
* Get the identifiers for all of the entities.
*
* @return array
*/
public function getQueueableIds();
/**
* Get the relationships of the entities being queued.
*
* @return array
*/
public function getQueueableRelations();
/**
* Get the connection of the entities being queued.
*
* @return string|null
*/
public function getQueueableConnection();
}

View File

@ -0,0 +1,27 @@
<?php
namespace Illuminate\Contracts\Queue;
interface QueueableEntity
{
/**
* Get the queueable identity for the entity.
*
* @return mixed
*/
public function getQueueableId();
/**
* Get the relationships for the entity.
*
* @return array
*/
public function getQueueableRelations();
/**
* Get the connection of the entity.
*
* @return string|null
*/
public function getQueueableConnection();
}

View File

@ -0,0 +1,8 @@
<?php
namespace Illuminate\Contracts\Queue;
interface ShouldQueue
{
//
}

View File

@ -0,0 +1,35 @@
<?php
namespace Illuminate\Contracts\Redis;
use Closure;
interface Connection
{
/**
* Subscribe to a set of given channels for messages.
*
* @param array|string $channels
* @param \Closure $callback
* @return void
*/
public function subscribe($channels, Closure $callback);
/**
* Subscribe to a set of given channels with wildcards.
*
* @param array|string $channels
* @param \Closure $callback
* @return void
*/
public function psubscribe($channels, Closure $callback);
/**
* Run a command against the Redis database.
*
* @param string $method
* @param array $parameters
* @return mixed
*/
public function command($method, array $parameters = []);
}

View File

@ -0,0 +1,25 @@
<?php
namespace Illuminate\Contracts\Redis;
interface Connector
{
/**
* Create a connection to a Redis cluster.
*
* @param array $config
* @param array $options
* @return \Illuminate\Redis\Connections\Connection
*/
public function connect(array $config, array $options);
/**
* Create a connection to a Redis instance.
*
* @param array $config
* @param array $clusterOptions
* @param array $options
* @return \Illuminate\Redis\Connections\Connection
*/
public function connectToCluster(array $config, array $clusterOptions, array $options);
}

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Redis;
interface Factory
{
/**
* Get a Redis connection by name.
*
* @param string|null $name
* @return \Illuminate\Redis\Connections\Connection
*/
public function connection($name = null);
}

View File

@ -0,0 +1,10 @@
<?php
namespace Illuminate\Contracts\Redis;
use Exception;
class LimiterTimeoutException extends Exception
{
//
}

View File

@ -0,0 +1,23 @@
<?php
namespace Illuminate\Contracts\Routing;
interface BindingRegistrar
{
/**
* Add a new route parameter binder.
*
* @param string $key
* @param string|callable $binder
* @return void
*/
public function bind($key, $binder);
/**
* Get the binding callback for a given binding.
*
* @param string $key
* @return \Closure
*/
public function getBindingCallback($key);
}

View File

@ -0,0 +1,105 @@
<?php
namespace Illuminate\Contracts\Routing;
interface Registrar
{
/**
* Register a new GET route with the router.
*
* @param string $uri
* @param array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function get($uri, $action);
/**
* Register a new POST route with the router.
*
* @param string $uri
* @param array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function post($uri, $action);
/**
* Register a new PUT route with the router.
*
* @param string $uri
* @param array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function put($uri, $action);
/**
* Register a new DELETE route with the router.
*
* @param string $uri
* @param array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function delete($uri, $action);
/**
* Register a new PATCH route with the router.
*
* @param string $uri
* @param array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function patch($uri, $action);
/**
* Register a new OPTIONS route with the router.
*
* @param string $uri
* @param array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function options($uri, $action);
/**
* Register a new route with the given verbs.
*
* @param array|string $methods
* @param string $uri
* @param array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function match($methods, $uri, $action);
/**
* Route a resource to a controller.
*
* @param string $name
* @param string $controller
* @param array $options
* @return \Illuminate\Routing\PendingResourceRegistration
*/
public function resource($name, $controller, array $options = []);
/**
* Create a route group with shared attributes.
*
* @param array $attributes
* @param \Closure|string $routes
* @return void
*/
public function group(array $attributes, $routes);
/**
* Substitute the route bindings onto the route.
*
* @param \Illuminate\Routing\Route $route
* @return \Illuminate\Routing\Route
*/
public function substituteBindings($route);
/**
* Substitute the implicit Eloquent model bindings for the route.
*
* @param \Illuminate\Routing\Route $route
* @return void
*/
public function substituteImplicitBindings($route);
}

View File

@ -0,0 +1,155 @@
<?php
namespace Illuminate\Contracts\Routing;
interface ResponseFactory
{
/**
* Create a new response instance.
*
* @param string $content
* @param int $status
* @param array $headers
* @return \Illuminate\Http\Response
*/
public function make($content = '', $status = 200, array $headers = []);
/**
* Create a new "no content" response.
*
* @param int $status
* @param array $headers
* @return \Illuminate\Http\Response
*/
public function noContent($status = 204, array $headers = []);
/**
* Create a new response for a given view.
*
* @param string|array $view
* @param array $data
* @param int $status
* @param array $headers
* @return \Illuminate\Http\Response
*/
public function view($view, $data = [], $status = 200, array $headers = []);
/**
* Create a new JSON response instance.
*
* @param mixed $data
* @param int $status
* @param array $headers
* @param int $options
* @return \Illuminate\Http\JsonResponse
*/
public function json($data = [], $status = 200, array $headers = [], $options = 0);
/**
* Create a new JSONP response instance.
*
* @param string $callback
* @param mixed $data
* @param int $status
* @param array $headers
* @param int $options
* @return \Illuminate\Http\JsonResponse
*/
public function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0);
/**
* Create a new streamed response instance.
*
* @param \Closure $callback
* @param int $status
* @param array $headers
* @return \Symfony\Component\HttpFoundation\StreamedResponse
*/
public function stream($callback, $status = 200, array $headers = []);
/**
* Create a new streamed response instance as a file download.
*
* @param \Closure $callback
* @param string|null $name
* @param array $headers
* @param string|null $disposition
* @return \Symfony\Component\HttpFoundation\StreamedResponse
*/
public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment');
/**
* Create a new file download response.
*
* @param \SplFileInfo|string $file
* @param string|null $name
* @param array $headers
* @param string|null $disposition
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
*/
public function download($file, $name = null, array $headers = [], $disposition = 'attachment');
/**
* Return the raw contents of a binary file.
*
* @param \SplFileInfo|string $file
* @param array $headers
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
*/
public function file($file, array $headers = []);
/**
* Create a new redirect response to the given path.
*
* @param string $path
* @param int $status
* @param array $headers
* @param bool|null $secure
* @return \Illuminate\Http\RedirectResponse
*/
public function redirectTo($path, $status = 302, $headers = [], $secure = null);
/**
* Create a new redirect response to a named route.
*
* @param string $route
* @param mixed $parameters
* @param int $status
* @param array $headers
* @return \Illuminate\Http\RedirectResponse
*/
public function redirectToRoute($route, $parameters = [], $status = 302, $headers = []);
/**
* Create a new redirect response to a controller action.
*
* @param string $action
* @param mixed $parameters
* @param int $status
* @param array $headers
* @return \Illuminate\Http\RedirectResponse
*/
public function redirectToAction($action, $parameters = [], $status = 302, $headers = []);
/**
* Create a new redirect response, while putting the current URL in the session.
*
* @param string $path
* @param int $status
* @param array $headers
* @param bool|null $secure
* @return \Illuminate\Http\RedirectResponse
*/
public function redirectGuest($path, $status = 302, $headers = [], $secure = null);
/**
* Create a new redirect response to the previously intended location.
*
* @param string $default
* @param int $status
* @param array $headers
* @param bool|null $secure
* @return \Illuminate\Http\RedirectResponse
*/
public function redirectToIntended($default = '/', $status = 302, $headers = [], $secure = null);
}

View File

@ -0,0 +1,79 @@
<?php
namespace Illuminate\Contracts\Routing;
interface UrlGenerator
{
/**
* Get the current URL for the request.
*
* @return string
*/
public function current();
/**
* Get the URL for the previous request.
*
* @param mixed $fallback
* @return string
*/
public function previous($fallback = false);
/**
* Generate an absolute URL to the given path.
*
* @param string $path
* @param mixed $extra
* @param bool|null $secure
* @return string
*/
public function to($path, $extra = [], $secure = null);
/**
* Generate a secure, absolute URL to the given path.
*
* @param string $path
* @param array $parameters
* @return string
*/
public function secure($path, $parameters = []);
/**
* Generate the URL to an application asset.
*
* @param string $path
* @param bool|null $secure
* @return string
*/
public function asset($path, $secure = null);
/**
* Get the URL to a named route.
*
* @param string $name
* @param mixed $parameters
* @param bool $absolute
* @return string
*
* @throws \InvalidArgumentException
*/
public function route($name, $parameters = [], $absolute = true);
/**
* Get the URL to a controller action.
*
* @param string|array $action
* @param mixed $parameters
* @param bool $absolute
* @return string
*/
public function action($action, $parameters = [], $absolute = true);
/**
* Set the root controller namespace.
*
* @param string $rootNamespace
* @return $this
*/
public function setRootControllerNamespace($rootNamespace);
}

View File

@ -0,0 +1,39 @@
<?php
namespace Illuminate\Contracts\Routing;
interface UrlRoutable
{
/**
* Get the value of the model's route key.
*
* @return mixed
*/
public function getRouteKey();
/**
* Get the route key for the model.
*
* @return string
*/
public function getRouteKeyName();
/**
* Retrieve the model for a bound value.
*
* @param mixed $value
* @param string|null $field
* @return \Illuminate\Database\Eloquent\Model|null
*/
public function resolveRouteBinding($value, $field = null);
/**
* Retrieve the child model for a bound value.
*
* @param string $childType
* @param mixed $value
* @param string|null $field
* @return \Illuminate\Database\Eloquent\Model|null
*/
public function resolveChildRouteBinding($childType, $value, $field);
}

View File

@ -0,0 +1,165 @@
<?php
namespace Illuminate\Contracts\Session;
interface Session
{
/**
* Get the name of the session.
*
* @return string
*/
public function getName();
/**
* Get the current session ID.
*
* @return string
*/
public function getId();
/**
* Set the session ID.
*
* @param string $id
* @return void
*/
public function setId($id);
/**
* Start the session, reading the data from a handler.
*
* @return bool
*/
public function start();
/**
* Save the session data to storage.
*
* @return void
*/
public function save();
/**
* Get all of the session data.
*
* @return array
*/
public function all();
/**
* Checks if a key exists.
*
* @param string|array $key
* @return bool
*/
public function exists($key);
/**
* Checks if a key is present and not null.
*
* @param string|array $key
* @return bool
*/
public function has($key);
/**
* Get an item from the session.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
public function get($key, $default = null);
/**
* Put a key / value pair or array of key / value pairs in the session.
*
* @param string|array $key
* @param mixed $value
* @return void
*/
public function put($key, $value = null);
/**
* Get the CSRF token value.
*
* @return string
*/
public function token();
/**
* Remove an item from the session, returning its value.
*
* @param string $key
* @return mixed
*/
public function remove($key);
/**
* Remove one or many items from the session.
*
* @param string|array $keys
* @return void
*/
public function forget($keys);
/**
* Remove all of the items from the session.
*
* @return void
*/
public function flush();
/**
* Generate a new session ID for the session.
*
* @param bool $destroy
* @return bool
*/
public function migrate($destroy = false);
/**
* Determine if the session has been started.
*
* @return bool
*/
public function isStarted();
/**
* Get the previous URL from the session.
*
* @return string|null
*/
public function previousUrl();
/**
* Set the "previous" URL in the session.
*
* @param string $url
* @return void
*/
public function setPreviousUrl($url);
/**
* Get the session handler instance.
*
* @return \SessionHandlerInterface
*/
public function getHandler();
/**
* Determine if the session handler needs a request.
*
* @return bool
*/
public function handlerNeedsRequest();
/**
* Set the request on the handler instance.
*
* @param \Illuminate\Http\Request $request
* @return void
*/
public function setRequestOnHandler($request);
}

View File

@ -0,0 +1,13 @@
<?php
namespace Illuminate\Contracts\Support;
interface Arrayable
{
/**
* Get the instance as an array.
*
* @return array
*/
public function toArray();
}

View File

@ -0,0 +1,13 @@
<?php
namespace Illuminate\Contracts\Support;
interface DeferrableProvider
{
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides();
}

View File

@ -0,0 +1,13 @@
<?php
namespace Illuminate\Contracts\Support;
interface DeferringDisplayableValue
{
/**
* Resolve the displayable value that the class is deferring.
*
* @return \Illuminate\Contracts\Support\Htmlable|string
*/
public function resolveDisplayableValue();
}

View File

@ -0,0 +1,13 @@
<?php
namespace Illuminate\Contracts\Support;
interface Htmlable
{
/**
* Get content as a string of HTML.
*
* @return string
*/
public function toHtml();
}

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Support;
interface Jsonable
{
/**
* Convert the object to its JSON representation.
*
* @param int $options
* @return string
*/
public function toJson($options = 0);
}

View File

@ -0,0 +1,107 @@
<?php
namespace Illuminate\Contracts\Support;
interface MessageBag extends Arrayable
{
/**
* Get the keys present in the message bag.
*
* @return array
*/
public function keys();
/**
* Add a message to the bag.
*
* @param string $key
* @param string $message
* @return $this
*/
public function add($key, $message);
/**
* Merge a new array of messages into the bag.
*
* @param \Illuminate\Contracts\Support\MessageProvider|array $messages
* @return $this
*/
public function merge($messages);
/**
* Determine if messages exist for a given key.
*
* @param string|array $key
* @return bool
*/
public function has($key);
/**
* Get the first message from the bag for a given key.
*
* @param string|null $key
* @param string|null $format
* @return string
*/
public function first($key = null, $format = null);
/**
* Get all of the messages from the bag for a given key.
*
* @param string $key
* @param string|null $format
* @return array
*/
public function get($key, $format = null);
/**
* Get all of the messages for every key in the bag.
*
* @param string|null $format
* @return array
*/
public function all($format = null);
/**
* Get the raw messages in the container.
*
* @return array
*/
public function getMessages();
/**
* Get the default message format.
*
* @return string
*/
public function getFormat();
/**
* Set the default message format.
*
* @param string $format
* @return $this
*/
public function setFormat($format = ':message');
/**
* Determine if the message bag has any messages.
*
* @return bool
*/
public function isEmpty();
/**
* Determine if the message bag has any messages.
*
* @return bool
*/
public function isNotEmpty();
/**
* Get the number of messages in the container.
*
* @return int
*/
public function count();
}

View File

@ -0,0 +1,13 @@
<?php
namespace Illuminate\Contracts\Support;
interface MessageProvider
{
/**
* Get the messages for the instance.
*
* @return \Illuminate\Contracts\Support\MessageBag
*/
public function getMessageBag();
}

View File

@ -0,0 +1,13 @@
<?php
namespace Illuminate\Contracts\Support;
interface Renderable
{
/**
* Get the evaluated contents of the object.
*
* @return string
*/
public function render();
}

View File

@ -0,0 +1,14 @@
<?php
namespace Illuminate\Contracts\Support;
interface Responsable
{
/**
* Create an HTTP response that represents the object.
*
* @param \Illuminate\Http\Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function toResponse($request);
}

View File

@ -0,0 +1,13 @@
<?php
namespace Illuminate\Contracts\Translation;
interface HasLocalePreference
{
/**
* Get the preferred locale of the entity.
*
* @return string|null
*/
public function preferredLocale();
}

View File

@ -0,0 +1,40 @@
<?php
namespace Illuminate\Contracts\Translation;
interface Loader
{
/**
* Load the messages for the given locale.
*
* @param string $locale
* @param string $group
* @param string|null $namespace
* @return array
*/
public function load($locale, $group, $namespace = null);
/**
* Add a new namespace to the loader.
*
* @param string $namespace
* @param string $hint
* @return void
*/
public function addNamespace($namespace, $hint);
/**
* Add a new JSON path to the loader.
*
* @param string $path
* @return void
*/
public function addJsonPath($path);
/**
* Get an array of all the registered namespaces.
*
* @return array
*/
public function namespaces();
}

View File

@ -0,0 +1,42 @@
<?php
namespace Illuminate\Contracts\Translation;
interface Translator
{
/**
* Get the translation for a given key.
*
* @param string $key
* @param array $replace
* @param string|null $locale
* @return mixed
*/
public function get($key, array $replace = [], $locale = null);
/**
* Get a translation according to an integer value.
*
* @param string $key
* @param \Countable|int|array $number
* @param array $replace
* @param string|null $locale
* @return string
*/
public function choice($key, $number, array $replace = [], $locale = null);
/**
* Get the default locale being used.
*
* @return string
*/
public function getLocale();
/**
* Set the default locale.
*
* @param string $locale
* @return void
*/
public function setLocale($locale);
}

View File

@ -0,0 +1,46 @@
<?php
namespace Illuminate\Contracts\Validation;
interface Factory
{
/**
* Create a new Validator instance.
*
* @param array $data
* @param array $rules
* @param array $messages
* @param array $customAttributes
* @return \Illuminate\Contracts\Validation\Validator
*/
public function make(array $data, array $rules, array $messages = [], array $customAttributes = []);
/**
* Register a custom validator extension.
*
* @param string $rule
* @param \Closure|string $extension
* @param string|null $message
* @return void
*/
public function extend($rule, $extension, $message = null);
/**
* Register a custom implicit validator extension.
*
* @param string $rule
* @param \Closure|string $extension
* @param string|null $message
* @return void
*/
public function extendImplicit($rule, $extension, $message = null);
/**
* Register a custom implicit validator message replacer.
*
* @param string $rule
* @param \Closure|string $replacer
* @return void
*/
public function replacer($rule, $replacer);
}

View File

@ -0,0 +1,8 @@
<?php
namespace Illuminate\Contracts\Validation;
interface ImplicitRule extends Rule
{
//
}

View File

@ -0,0 +1,22 @@
<?php
namespace Illuminate\Contracts\Validation;
interface Rule
{
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value);
/**
* Get the validation error message.
*
* @return string|array
*/
public function message();
}

View File

@ -0,0 +1,13 @@
<?php
namespace Illuminate\Contracts\Validation;
interface ValidatesWhenResolved
{
/**
* Validate the given class instance.
*
* @return void
*/
public function validateResolved();
}

View File

@ -0,0 +1,65 @@
<?php
namespace Illuminate\Contracts\Validation;
use Illuminate\Contracts\Support\MessageProvider;
interface Validator extends MessageProvider
{
/**
* Run the validator's rules against its data.
*
* @return array
*
* @throws \Illuminate\Validation\ValidationException
*/
public function validate();
/**
* Get the attributes and values that were validated.
*
* @return array
*
* @throws \Illuminate\Validation\ValidationException
*/
public function validated();
/**
* Determine if the data fails the validation rules.
*
* @return bool
*/
public function fails();
/**
* Get the failed validation rules.
*
* @return array
*/
public function failed();
/**
* Add conditions to a given field based on a Closure.
*
* @param string|array $attribute
* @param string|array $rules
* @param callable $callback
* @return $this
*/
public function sometimes($attribute, $rules, callable $callback);
/**
* Add an after validation callback.
*
* @param callable|string $callback
* @return $this
*/
public function after($callback);
/**
* Get all of the validation error messages.
*
* @return \Illuminate\Support\MessageBag
*/
public function errors();
}

Some files were not shown because too many files have changed in this diff Show More