PHPackages                             eduluz1976/action - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. eduluz1976/action

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

eduluz1976/action
=================

Dynamic action (method/function) execution wrapper.

0.1.1(7y ago)0741Apache-2.0PHP

Since Nov 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/eduluz1976/action)[ Packagist](https://packagist.org/packages/eduluz1976/action)[ RSS](/packages/eduluz1976-action/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (4)Used By (1)

Action
======

[](#action)

Introduction
------------

[](#introduction)

This class intends to make programatic and dynamic functions calls.

How to use
----------

[](#how-to-use)

To use the `Action` class, just use the `factory` method, to build a new object, passing the parameters to use on this function. At the end, just execute the instance's `exec` method, passing optionally the additional parameters.

The URI patterns you can use are:

TypeExampleSimple function'mySampleFunction()'Class method'\\namespace\\MyClass::functionName()'REST call\*'POST;[https://user!password@my\_domain.com:8081/api/v99/xpto?v1=1&amp;v2=2#xpto](https://user!password@my_domain.com:8081/api/v99/xpto?v1=1&v2=2#xpto)'- Not implemented yet

### Simple function

[](#simple-function)

Make a call to a *global* function.

#### Example

[](#example)

```
function multiply($x,$y) {
    return $x * $y;
}

$action = Action::factory('multiply()');

$response = $action->exec(2,5);

// result = 10
```

### Class method

[](#class-method)

Instantiate a class object, and execute the assigned method.

#### Constructor

[](#constructor)

If your class have a constructor method, and require any parameter, you can suply it on 3rd parameter of `factory` method:

```
$action = Action::factory('MyClass::myFunction()',[],['constructor'=>[1,'string',false]]);
```

On above the case, the values `1`, `'string'` and `false` will be applied on `MyClass` constructor.

#### Examples

[](#examples)

```
class MyClass {

    public function myFunction($id, $fieldName) {
        // ...
        return [
            'id' => $id,
            'field_name'=> $fieldName
        ];
    }

}

$action = Action::factory('MyClass::myFunction()', [1, 'name']);

$response = $action->exec();

print_r($response);

```

Will display:

```
Array
(
    [id] => 1
    [field_name] => name
)

```

### URL call

[](#url-call)

The class `ActionURLCallTest` perform remote URL calls, and return the contents parsed.

#### Example

[](#example-1)

Let's suppose you want to make a call to an endpoint:

```
$url = 'post;https://username:password@my.hostname:9090/path?arg=value#anchor';

$action = Action::factory($url);

$response = $action->exec();
```

Testing
-------

[](#testing)

To perform tests, just run `vendor/bin/phpunit` from root project folder.

But to run the **integration tests**, is necessary start the local server to do it. On this case, just execute the script on ~/bin/run\_integration\_tests.sh , and in other terminal window, run `phpunit`.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~89 days

Total

2

Last Release

2645d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6ea4b7ddfe19505d192b80f7408e47afe62588fd2aad95e916952d0d2eca385?d=identicon)[eduluz1976](/maintainers/eduluz1976)

---

Top Contributors

[![eduluz1976](https://avatars.githubusercontent.com/u/7094068?v=4)](https://github.com/eduluz1976 "eduluz1976 (24 commits)")

---

Tags

metaprogrammingphp-libraryphp7

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eduluz1976-action/health.svg)

```
[![Health](https://phpackages.com/badges/eduluz1976-action/health.svg)](https://phpackages.com/packages/eduluz1976-action)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
