Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PECL extension support and introduce newly refined main class "Aspect" #214

Merged
merged 28 commits into from
Jul 7, 2024

Commits on Jul 6, 2024

  1. PECL: Add Aspect, PeclDispatcher classes and related test

    This commit adds two new classes, Aspect and PeclDispatcher for handling aspect-oriented operations. These classes function as part of an aspect-oriented programming (AOP) framework that intercepts method calls. Corresponding tests are included to verify the successful weaving of aspects and method interception.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    61613c1 View commit details
    Browse the repository at this point in the history
  2. Add MethodInterceptorInterface

    This commit introduces the MethodInterceptorInterface. The interface defines the contract for method interceptors in the Ray.Aop framework. It includes an 'intercept' method which is invoked when an intercepted method is called.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    7e7a26f View commit details
    Browse the repository at this point in the history
  3. Add specification document for the Aspect class

    The new specification document details the functionality of the Aspect class used in Aspect Oriented Programming (AOP). It includes description of the class definition, constructors, public methods as well as use cases and crucial notes. This document will serve as a useful reference for developers working with AOP.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    d0cc366 View commit details
    Browse the repository at this point in the history
  4. Update Weaver and Aspect classes, add tests

    The Weaver class has been updated to check for existence of instance bindings and compile new classes. The Aspect class no longer checks for the 'ray_aop' extension and now creates bindings directly in the newInstance method. The test suite has been expanded to include tests for instance creation and binding behaviors in Weaver and Aspect classes.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    ee4fb17 View commit details
    Browse the repository at this point in the history
  5. Update PeclDispatcher interface

    The PeclDispatcher class's interface was updated from InterceptHandlerInterface to MethodInterceptorInterface. This update aligns the PeclDispatcher with the new structure and functionality proposed by the MethodInterceptorInterface.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    010dd03 View commit details
    Browse the repository at this point in the history
  6. Refactor Aspect class and update tests

    Revised how the Aspect class functions by separating class instantiation into two different private methods, based on finality and extension availability. The main constructor has been updated. For instance, the classDir member has been replaced with tmpDir, which defaults to system temp dire if not explicitly set. Some throw instructions were also inserted regarding extension requirements. The unit tests have been adapted to reflect these changes.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    213f32e View commit details
    Browse the repository at this point in the history
  7. Update README with new Aspect usage and interceptor details

    The README file is updated to reflect changes in the usage of the `Aspect` class for configuration. The revised examples present how to use `Aspect` for different scenarios. Additionally, more detailed explanations are provided on how interceptors work, including the order of execution and how to access various elements from the `MethodInvocation` object. The changes also include explanations of how to deal with annotations and PHP8 attributes.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    754d13c View commit details
    Browse the repository at this point in the history
  8. Update README.md with a clearer explanation and add link

    Refined the explanation about interceptors for better clarity in README.md. Specifically, updated the description of `invocation->proceed()` and its process. Also, added a hyperlink to the PECL extension for more comprehensive user understanding.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    32d6b03 View commit details
    Browse the repository at this point in the history
  9. Refactor README.ja.md for clarity and conciseness

    Significantly edited README.ja.md to make it more readable and user-friendly. This includes restructuring, removing duplicated or unnecessary content, adding helpful explanations, and improving the formatting for better readability. Made adjustments to the code snippets and annotations for the better understanding of the user.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    60abc0a View commit details
    Browse the repository at this point in the history
  10. Update code to improve psalm compatibility

    This commit includes several updates aiming to improve the compatibility with psalm-static analysis. Major updates include suppressing some psalm assertions producing false-positives, adding additional type checks and assertions, and refining the PHPDoc annotations for better type inference. Tests have also been adjusted accordingly.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    79d785e View commit details
    Browse the repository at this point in the history
  11. Soothe phpstan: Remove argument validation from PeclDispatcher

    The type hinting in the intercept method of the PeclDispatcher already ensures that the arguments are the correct type. Removing the explicit checks for is_object, is_string, and is_array simplifies the code. Additionally, a variable type declaration has been added to AspectTest in the test module. A new directory tests/AspectFake is also excluded from phpstan checks.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    52f6420 View commit details
    Browse the repository at this point in the history
  12. Soothe phpstan: Remove argument validation from PeclDispatcher

    The type hinting in the intercept method of the PeclDispatcher already ensures that the arguments are the correct type. Removing the explicit checks for is_object, is_string, and is_array simplifies the code. Additionally, a variable type declaration has been added to AspectTest in the test module. A new directory tests/AspectFake is also excluded from phpstan checks.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    d4a5849 View commit details
    Browse the repository at this point in the history
  13. Add method_intercept function for mock testing

    This commit introduces a new function, method_intercept, to the mock testing suite. The function takes a class, method, parameter array and object as parameters. It instantiates an instance of the passed class before calling its intercept method with the given parameters.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    931072b View commit details
    Browse the repository at this point in the history
  14. Move MethodInterceptorInterface to src-mock directory

    The MethodInterceptorInterface file has been relocated to the src-mock directory. Amendments were made in the composer.json to reflect this change and the references in the PeclDispatcher file were updated accordingly. This restructuring ensures better organization and clarity in the codebase.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    9f183d5 View commit details
    Browse the repository at this point in the history
  15. Update annotation format in AspectTest

    The annotation for 'runInSeparateProcess' has been corrected in AspectTest.php. The isolated process description remains the same, explaining it is required to avoid side effects from the aspect weaved classes.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    e586673 View commit details
    Browse the repository at this point in the history
  16. Add ray-di logo to README

    The logo has been included in the README.md file. This gives better visual representation and helps with branding for the project. It gets displayed at the top of the README file, improving the overall aesthetics.
    koriym committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    1d04a5f View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2024

  1. Move PeclDispatcher to src-php8 directory

    The PeclDispatcher file was deleted from the src directory and a similar file was added to the src-php8 directory. The main difference in the added file is the use of Ray\Aop\Exception\LogicException, replacing the generic LogicException.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    cec1481 View commit details
    Browse the repository at this point in the history
  2. Refactor AspectTest and remove PHP 8.1 requirement

    The AspectTest class has been refactored to change the running order of the tests and revises their contents. The requirement for PHP 8.1 has been removed to increase compatibility. The isolated process notice and @runInSeparateProcess annotation have also been removed as they are no longer necessary.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    01d8b8e View commit details
    Browse the repository at this point in the history
  3. Add composer-require-checker.json file

    This commit introduces a new composer-require-checker.json file. This file defines a whitelist of symbols that will not be checked for dependencies in our codebase. This includes basic types like null, bool, string, int, float, and few more, as well as 'method_intercept' and 'Ray\\Aop\\MethodInterceptorInterface'.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    1d64791 View commit details
    Browse the repository at this point in the history
  4. Add LogicException class

    This commit introduces a new LogicException class. It extends the base \LogicException class and resides within the Ray\Aop\Exception namespace.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    c9702d8 View commit details
    Browse the repository at this point in the history
  5. Refactor method_intercept function in Mock

    This commit simplifies the method_intercept function in the src-mock. The function parameters have been modified for efficiency, removing the object instantiation in favor of directly passing the MethodInterceptorInterface object.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    9d7dd23 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b0bb9ad View commit details
    Browse the repository at this point in the history
  7. Add continuous integration workflow for PECL extension

    This commit introduces a new GitHub Actions continuous integration workflow specifically for the Ray.Aop PECL extension. The workflow builds the extension, runs PHPUnit tests, checks for memory leaks with Valgrind, and performs various other checks across multiple PHP versions. The failed steps details are uploaded as artifacts for easier troubleshooting.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    0bcea46 View commit details
    Browse the repository at this point in the history
  8. Update PECL extension use in README files

    The PECL extension code usage examples in both the English and Japanese README files have been updated to be more descriptive. Furthermore, detailed installation instructions for the PECL extension, including the requirement of PHP 8.1 or higher, have been added.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    bbb90c7 View commit details
    Browse the repository at this point in the history
  9. Soothe SA: Add MethodInterceptorInterface usage in Aspect

    The code has been updated to import and assert the use of MethodInterceptorInterface on the dispatcher in Aspect.php. This ensures that the dispatcher instance conforms to the expected interface. It also introduces the use of array_keys to more effectively handle methods.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    4fbd354 View commit details
    Browse the repository at this point in the history
  10. Add namespace to MethodInterceptorInterface

    The namespace Ray\Aop was added to MethodInterceptorInterface.php for further class organization and better handling. This change will assist in specifying the full path of the interfaced class within directory structures.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    e17771f View commit details
    Browse the repository at this point in the history
  11. Add namespace to method_intercept.php and remove unused use statement

    The namespace Ray\Aop was added to the method_intercept.php file to align it with the rest of the project's structure. Additionally, an unused use statement referencing MethodInterceptorInterface was removed from Aspect.php to clean up the code.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    b485b95 View commit details
    Browse the repository at this point in the history
  12. Mark 'method_intercept' function for PHPStan and Psalm to ignore

    The 'method_intercept' function which is a PECL-created function is updated to be ignored by PHPStan and Psalm. This change addresses static analysis warnings from these tools, ensuring that they do not flag this part of the code. The update will bring more clarity to issues identified during codebase analysis.
    koriym committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    d844ceb View commit details
    Browse the repository at this point in the history