Allow PHP-8.2 and up Compatibility instead of just PHP-8.4

This commit is contained in:
johnnyq
2026-06-12 17:06:10 -04:00
parent 2204bd52f4
commit d3a93652f3
220 changed files with 7198 additions and 2635 deletions

View File

@@ -7,7 +7,7 @@ interface Gate
/**
* Determine if a given ability has been defined.
*
* @param string $ability
* @param \UnitEnum|string $ability
* @return bool
*/
public function has($ability);

View File

@@ -16,7 +16,7 @@ interface ContextualBindingBuilder
* Define the implementation for the contextual binding.
*
* @param \Closure|string|array $implementation
* @return void
* @return $this
*/
public function give($implementation);
@@ -24,7 +24,7 @@ interface ContextualBindingBuilder
* Define tagged services to be used as the implementation for the contextual binding.
*
* @param string $tag
* @return void
* @return $this
*/
public function giveTagged($tag);
@@ -33,7 +33,7 @@ interface ContextualBindingBuilder
*
* @param string $key
* @param mixed $default
* @return void
* @return $this
*/
public function giveConfig($key, $default = null);
}

View File

@@ -21,7 +21,7 @@ interface Factory
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).
* Create a cookie that lasts "forever" (400 days).
*
* @param string $name
* @param string $value

View File

@@ -9,7 +9,7 @@ interface SupportsPartialRelations
*
* @param string|null $column
* @param string|\Closure|null $aggregate
* @param string $relation
* @param string|null $relation
* @return $this
*/
public function ofMany($column = 'id', $aggregate = 'MAX', $relation = null);

View File

@@ -2,12 +2,19 @@
namespace Illuminate\Contracts\Database;
use Illuminate\Database\Eloquent\Relations\Relation;
class ModelIdentifier
{
/**
* Use the Relation morphMap for a Model's name when serializing.
*/
protected static bool $useMorphMap = false;
/**
* The class name of the model.
*
* @var class-string<\Illuminate\Database\Eloquent\Model>
* @var class-string<\Illuminate\Database\Eloquent\Model>|string|null
*/
public $class;
@@ -44,15 +51,19 @@ class ModelIdentifier
/**
* Create a new model identifier.
*
* @param class-string<\Illuminate\Database\Eloquent\Model> $class
* @param class-string<\Illuminate\Database\Eloquent\Model>|null $class
* @param mixed $id
* @param array $relations
* @param mixed $connection
*/
public function __construct($class, $id, array $relations, $connection)
{
$this->id = $id;
if ($class !== null && self::$useMorphMap) {
$class = Relation::getMorphAlias($class);
}
$this->class = $class;
$this->id = $id;
$this->relations = $relations;
$this->connection = $connection;
}
@@ -69,4 +80,26 @@ class ModelIdentifier
return $this;
}
/**
* Get the fully-qualified class name of the Model.
*
* @return class-string<\Illuminate\Database\Eloquent\Model>|null
*/
public function getClass(): ?string
{
if (self::$useMorphMap && $this->class !== null) {
return Relation::getMorphedModel($this->class) ?? $this->class;
}
return $this->class;
}
/**
* Indicate whether to use the relational morph-map when serializing Models.
*/
public static function useMorphMap(bool $useMorphMap = true): void
{
static::$useMorphMap = $useMorphMap;
}
}

View File

@@ -0,0 +1,59 @@
<?php
namespace Illuminate\Contracts\JsonSchema;
use Closure;
interface JsonSchema
{
/**
* Create a new object schema instance.
*
* @param (Closure(JsonSchema): array<string, \Illuminate\JsonSchema\Types\Type>)|array<string, \Illuminate\JsonSchema\Types\Type> $properties
* @return \Illuminate\JsonSchema\Types\ObjectType
*/
public function object(Closure|array $properties = []);
/**
* Create a new array property instance.
*
* @return \Illuminate\JsonSchema\Types\ArrayType
*/
public function array();
/**
* Create a new string property instance.
*
* @return \Illuminate\JsonSchema\Types\StringType
*/
public function string();
/**
* Create a new integer property instance.
*
* @return \Illuminate\JsonSchema\Types\IntegerType
*/
public function integer();
/**
* Create a new number property instance.
*
* @return \Illuminate\JsonSchema\Types\NumberType
*/
public function number();
/**
* Create a new boolean property instance.
*
* @return \Illuminate\JsonSchema\Types\BooleanType
*/
public function boolean();
/**
* Create a new multi-type union instance.
*
* @param array<int, string> $types
* @return \Illuminate\JsonSchema\Types\UnionType
*/
public function union(array $types);
}

View File

@@ -61,4 +61,12 @@ interface InvokedProcess
* @return \Illuminate\Process\ProcessResult
*/
public function wait(?callable $output = null);
/**
* Wait until the given callback returns true.
*
* @param callable|null $output
* @return \Illuminate\Process\ProcessResult
*/
public function waitUntil(?callable $output = null);
}