update: updating files with ported code
This commit is contained in:
parent
37cb76c673
commit
b0fcee9aac
17 changed files with 230 additions and 16 deletions
|
@ -1,3 +1,4 @@
|
|||
import 'lock.dart';
|
||||
abstract class LockProvider {
|
||||
/// Get a lock instance.
|
||||
///
|
||||
|
@ -14,7 +15,3 @@ abstract class LockProvider {
|
|||
/// @return Lock
|
||||
Lock restoreLock(String name, String owner);
|
||||
}
|
||||
|
||||
abstract class Lock {
|
||||
// Define the methods and properties that the Lock class should have
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:meta/meta.dart';
|
||||
|
||||
import 'contextual_binding_builder.dart';
|
||||
abstract class Container {
|
||||
/// Determine if the given abstract type has been bound.
|
||||
///
|
||||
|
@ -166,14 +165,6 @@ abstract class Container {
|
|||
void afterResolving(dynamic abstract, [Function? callback]);
|
||||
}
|
||||
|
||||
class ContextualBindingBuilder {
|
||||
// Implementation for ContextualBindingBuilder
|
||||
}
|
||||
|
||||
class BindingResolutionException implements Exception {
|
||||
// Implementation for BindingResolutionException
|
||||
}
|
||||
|
||||
class InvalidArgumentException implements Exception {
|
||||
// Implementation for InvalidArgumentException
|
||||
}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
import 'package:symfony_http_foundation/symfony_http_foundation.dart';
|
||||
|
||||
// TODO: Replace missing import with dart equivelant.
|
||||
|
||||
abstract class Factory {
|
||||
/// Create a new cookie instance.
|
||||
///
|
||||
/// @param String name
|
||||
/// @param String value
|
||||
/// @param int minutes
|
||||
/// @param String? path
|
||||
/// @param String? domain
|
||||
/// @param bool? secure
|
||||
/// @param bool httpOnly
|
||||
/// @param bool raw
|
||||
/// @param String? sameSite
|
||||
/// @return Cookie
|
||||
Cookie make(String name, String value, {int minutes = 0, String? path, String? domain, bool? secure, bool httpOnly = true, bool raw = false, String? sameSite});
|
||||
|
||||
/// Create a cookie that lasts "forever" (five years).
|
||||
///
|
||||
/// @param String name
|
||||
/// @param String value
|
||||
/// @param String? path
|
||||
/// @param String? domain
|
||||
/// @param bool? secure
|
||||
/// @param bool httpOnly
|
||||
/// @param bool raw
|
||||
/// @param String? sameSite
|
||||
/// @return Cookie
|
||||
Cookie forever(String name, String value, {String? path, String? domain, bool? secure, bool httpOnly = true, bool raw = false, String? sameSite});
|
||||
|
||||
/// Expire the given cookie.
|
||||
///
|
||||
/// @param String name
|
||||
/// @param String? path
|
||||
/// @param String? domain
|
||||
/// @return Cookie
|
||||
Cookie forget(String name, {String? path, String? domain});
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
import 'factory.dart';
|
||||
|
||||
abstract class QueueingFactory extends Factory {
|
||||
/// Queue a cookie to send with the next response.
|
||||
void queue(List<dynamic> parameters);
|
||||
|
||||
/// Remove a cookie from the queue.
|
||||
void unqueue(String name, [String? path]);
|
||||
|
||||
/// Get the cookies which have been queued for the next request.
|
||||
List<Map<String, dynamic>> getQueuedCookies();
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
import 'package:illuminate_database/eloquent/builder.dart';
|
||||
import 'package:illuminate_database/query/builder.dart' as BaseContract;
|
||||
|
||||
/// This interface is intentionally empty and exists to improve IDE support.
|
||||
///
|
||||
/// @mixin Illuminate\Database\Eloquent\Builder
|
||||
abstract class Builder implements BaseContract {
|
||||
// Intentionally left empty
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
abstract class Castable {
|
||||
/// Get the name of the caster class to use when casting from / to this cast target.
|
||||
///
|
||||
/// @param List arguments
|
||||
/// @return Type
|
||||
static Type castUsing(List arguments);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
import 'model.dart';
|
||||
|
||||
/// A generic type parameter for the get method.
|
||||
typedef TGet = dynamic;
|
||||
|
||||
/// A generic type parameter for the set method.
|
||||
typedef TSet = dynamic;
|
||||
|
||||
/// An abstract class representing a contract for casting attributes.
|
||||
abstract class CastsAttributes {
|
||||
/// Transforms the attribute from the underlying model values.
|
||||
///
|
||||
/// [model] - The model instance.
|
||||
/// [key] - The attribute key.
|
||||
/// [value] - The attribute value.
|
||||
/// [attributes] - The attributes array.
|
||||
///
|
||||
/// Returns the transformed attribute value.
|
||||
TGet? get(Model model, String key, dynamic value, Map<String, dynamic> attributes);
|
||||
|
||||
/// Transforms the attribute to its underlying model values.
|
||||
///
|
||||
/// [model] - The model instance.
|
||||
/// [key] - The attribute key.
|
||||
/// [value] - The attribute value to be set.
|
||||
/// [attributes] - The attributes array.
|
||||
///
|
||||
/// Returns the transformed attribute value.
|
||||
dynamic set(Model model, String key, TSet? value, Map<String, dynamic> attributes);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
import 'package:your_package/database/model.dart';
|
||||
|
||||
abstract class CastsInboundAttributes {
|
||||
/// Transform the attribute to its underlying model values.
|
||||
///
|
||||
/// @param Model model
|
||||
/// @param String key
|
||||
/// @param dynamic value
|
||||
/// @param Map<String, dynamic> attributes
|
||||
/// @return dynamic
|
||||
dynamic set(Model model, String key, dynamic value, Map<String, dynamic> attributes);
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
abstract class DeviatesCastableAttributes {
|
||||
/// Increment the attribute.
|
||||
///
|
||||
/// @param Model model
|
||||
/// @param String key
|
||||
/// @param dynamic value
|
||||
/// @param Map<String, dynamic> attributes
|
||||
/// @return dynamic
|
||||
dynamic increment(Model model, String key, dynamic value, Map<String, dynamic> attributes);
|
||||
|
||||
/// Decrement the attribute.
|
||||
///
|
||||
/// @param Model model
|
||||
/// @param String key
|
||||
/// @param dynamic value
|
||||
/// @param Map<String, dynamic> attributes
|
||||
/// @return dynamic
|
||||
dynamic decrement(Model model, String key, dynamic value, Map<String, dynamic> attributes);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
import 'package:your_package_name/eloquent/model.dart';
|
||||
|
||||
abstract class SerializesCastableAttributes {
|
||||
/// Serialize the attribute when converting the model to an array.
|
||||
///
|
||||
/// @param \Illuminate\Database\Eloquent\Model $model
|
||||
/// @param string $key
|
||||
/// @param mixed $value
|
||||
/// @param array $attributes
|
||||
/// @return mixed
|
||||
dynamic serialize(Model model, String key, dynamic value, Map<String, dynamic> attributes);
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
abstract class SupportsPartialRelations {
|
||||
/// Indicate that the relation is a single result of a larger one-to-many relationship.
|
||||
///
|
||||
/// [column] is the column to aggregate, defaults to 'id'.
|
||||
/// [aggregate] is the aggregate function, defaults to 'MAX'.
|
||||
/// [relation] is the relation name.
|
||||
///
|
||||
/// Returns the instance of the class.
|
||||
SupportsPartialRelations ofMany(
|
||||
String? column = 'id',
|
||||
dynamic aggregate = 'MAX',
|
||||
String? relation,
|
||||
);
|
||||
|
||||
/// Determine whether the relationship is a one-of-many relationship.
|
||||
///
|
||||
/// Returns a boolean value indicating whether the relationship is one-of-many.
|
||||
bool isOneOfMany();
|
||||
|
||||
/// Get the one of many inner join subselect query builder instance.
|
||||
///
|
||||
/// Returns an instance of the query builder or null.
|
||||
dynamic getOneOfManySubQuery();
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
abstract class MigrationEvent {
|
||||
// Add any common functionality or properties if needed
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
class ModelIdentifier {
|
||||
/// The class name of the model.
|
||||
final String className;
|
||||
|
||||
/// The unique identifier of the model.
|
||||
///
|
||||
/// This may be either a single ID or an array of IDs.
|
||||
final dynamic id;
|
||||
|
||||
/// The relationships loaded on the model.
|
||||
final List<dynamic> relations;
|
||||
|
||||
/// The connection name of the model.
|
||||
final String? connection;
|
||||
|
||||
/// The class name of the model collection.
|
||||
String? collectionClass;
|
||||
|
||||
/// Create a new model identifier.
|
||||
ModelIdentifier({
|
||||
required this.className,
|
||||
required this.id,
|
||||
required this.relations,
|
||||
this.connection,
|
||||
});
|
||||
|
||||
/// Specify the collection class that should be used when serializing / restoring collections.
|
||||
ModelIdentifier useCollectionClass(String? collectionClass) {
|
||||
this.collectionClass = collectionClass;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
//import 'package:laravel_framework/database/query/builder.dart';
|
||||
|
||||
/// This interface is intentionally empty and exists to improve IDE support.
|
||||
///
|
||||
/// @mixin Builder
|
||||
abstract class Builder {
|
||||
// This is intentionally left empty to match the PHP interface.
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
// lib/Illuminate/Contracts/Database/Query/ConditionExpression.dart
|
||||
|
||||
import 'expression.dart';
|
||||
|
||||
abstract class ConditionExpression implements Expression {
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
// File path: lib/Illuminate/Contracts/Database/Query/expression.dart
|
||||
|
||||
import 'package:your_project/Illuminate/Database/grammar.dart';
|
||||
|
||||
abstract class Expression {
|
||||
/// Get the value of the expression.
|
||||
///
|
||||
/// @param Grammar grammar
|
||||
/// @return String|int|double
|
||||
dynamic getValue(Grammar grammar);
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
name: vieofabric_framework
|
||||
description: The VieoFabric Framework
|
||||
name: fabric_framework
|
||||
description: The Fabric Framework
|
||||
version: 1.0.0
|
||||
homepage: https://vieo.dev/fabric
|
||||
documentation: https://vieo.dev/fabric/docs
|
||||
|
|
Loading…
Reference in a new issue