Fixin is under development to be a simple and flexible public framework that built from the ground for PHP 7.1+
Web:
http://www.fixinphp.com
GitHub:
https://github.com/fixin/Fixin
3. Owner-Managed Classes
• Constructor-based injection via options
__construct($resourceManager, array $options, string $name);
• No public dependency getters and setters
• Responsibility goes to the creator
• Class constants
• Prevents mistyping and hidden not-used options
4. Managed Class
• Abstract implementation of ManagedInterface
• Supports lazy-loading
• Supports options mapping
• Declares $options processing
6. Options Mapping
protected const THIS_SETS = [
self::DELAY => [Types::INT, Types::NULL],
self::NAME => [self::USING_SETTER, Types::NULL],
self::REPOSITORY => [self::LAZY_LOADING => RepositoryInterface::class]
]
• List of possible options and their allowed types
• Supports lazy-loading
• Supports custom setters
7. Resource Manager
• Holds shared Resources and preinitialized Prototypes
• Has configuration for the keys
• Supports creation by class name, Factory, and
Abstract Factory
• Request with undefined key interpreted as class name
8. Resource Manager
• Getting a Resource:
$manager->get(‘BaseJsonJson’, JsonInterface::class);
• Loads options from the configuration on initialization
• Returns a ResourceInterface
• Always returns the same instance for the given key
9. Resource Manager
• Cloning a Prototype:
$manager->clone(‘BaseJsonJson’, JsonInterface::class, [
JsonInterface::DECODING_MAX_DEPTH => 2
]);
• Loads options from the configuration on
preinitialization
• Returns a cloned instance for the given key with the
additional options
13. Namespace Fallback
• Referencing without top level
• The root namespace will be determined
• Defined root search order
• Zero configuration for class overriding
• Just put into the right folder
18. Cargo Handlers
• One required method
public function handle(CargoInterface $cargo): CargoInterface
{…}
19. Delivery System
• Application creates a Cargo
• Cargo goes through a Route
• Route builds up from Nodes
• A Hub might send to other handler
(Action Handler, Restful Handler, Route)
• Application unpacks the Cargo