PHP Classes

File: src/Traits/HandlesExtensionMethods.php

Recommend this page to a friend!
  Classes of Axel Pardemann   PHP Objects Extensions   src/Traits/HandlesExtensionMethods.php  
File: src/Traits/HandlesExtensionMethods.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Objects Extensions
Add functions to objects using another class
Author: By
Last change: Improve code quality
Refactor extension registry

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Add static extension methods

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Move resolvers' namespace

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Major refactor for better code maintainability

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources

Fix meta files

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources

wip

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources

wip

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources

wip

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources

Refactor resolver

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources

Refactor HandlesExtensionMethods trait

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources

wip

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources

wip

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Allow the guard_extensions field to be bypassed

In the previous implementation if the guard_extensions field was set to true, all extension methods were guarded and there was no way to specifically not guard some extensions.

Now the default param value is null and if a boolean is given, the value trumps the global field.
Improve handling of methods

- Added a new guard param when registering guarded methods.
- Removed the guarded_extensions array (now the guarded status is placed in the same extensions method array)
- Added a new guard_extensions static field to allow guarding all registered extension methods
Move ExtesionMethodLoader to its own namespace

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Fix issue with getExtensionMethods method

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Cleanup code

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Make static::$extensions declaration unneeded

We no longer need to declare an empty static $extensions property in Extensible objects, it is handled automatically.
Fix style

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Fix typos

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Allow to register multiple names for extension method

# Provide links to any relevant tickets, articles or other resources
Also allow to unregister multiple names in batch
Add guarded extension methods

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Add missing key types for array in docblocks

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Refactor HandlesExtensionMethods::registerExtensionMethod

Defer extension loading responsibility to the ExtensionMethodLoader class
Declare some classes and methods as final

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Add missing parenthesis

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Remove not needed parenthesis

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Add missing typehints and change docblocks to generics syntax

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Add strict_type declarations

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Add missing methods to Extensible contract

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Add docblocks headers

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Rename ClassNotExtensionMethod exception

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Fix parent extension method call

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Make child objects inherit parent's registered extension methods

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Docblock and style fixes

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Improve exception messages.

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
Date: 12 hours ago
Size: 962 bytes

You need to be a registered user and login to get this file.

Login Immediately with your account on: