Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Extended Php Laravel Package

open-southeners/extended-php

Extended PHP helpers for modern apps: adds convenient functions, utilities, and small enhancements that complement core PHP to reduce boilerplate and speed up everyday development. Lightweight, easy to drop into existing projects.

View on GitHub
Deep Wiki
Context7

description: List of functions that works for PHP classes.

Classes helpers

class_namespace

Gets the namespace from class or object.

$class = App\Http\Controllers\MyController::class;

\OpenSoutheners\ExtendedPhp\Classes\class_namespace($class);
// 'App\Http\Controllers'

class_implement

Similarly than PHP's class_implements but finding a specific interface implemented on the object or class given.

class MyClass implements MyInterface {}

\OpenSoutheners\ExtendedPhp\Classes\class_implement(MyClass::class, MyInterface::class);
// true

class_use

Similarly than PHP's class_uses but finding a specific trait used on the object or class given.

class MyClass implements MyInterface {}

\OpenSoutheners\ExtendedPhp\Classes\class_use(MyClass::class, MyTrait::class);
// false

call

{% hint style="info" %} This is specially useful to get types using PHP generics types. Otherwise PHP's array callable or call_user_func_array should be used instead. {% endhint %}

Call to the specified public method from class string or object with optional given arguments array.

class MyClass implements MyInterface
{
    public static function myStaticMethod(string $name)
    {
        return "greetings {$name}!";
    }

    public function myMethod(string $name)
    {
        return "hello {$name}!";
    }
}

\OpenSoutheners\ExtendedPhp\Classes\call(MyClass::class, 'myStaticMethod', ['user'], true);
// 'greetings user!'

\OpenSoutheners\ExtendedPhp\Classes\call(MyClass::class, 'myMethod', ['world']);
// 'hello world!'

call_static

Shortcut for `call` function used for call public static methods only.

class MyClass implements MyInterface
{
    public static function myStaticMethod(string $name)
    {
        return "greetings {$name}!";
    }
}

\OpenSoutheners\ExtendedPhp\Classes\call_static(MyClass::class, 'myStaticMethod', ['user']);
// 'greetings user!'

class_from

Gets class string from object or class. Similarly to PHP's get_class but this one handles whenever string is sent.

$class = App\Http\Controllers\MyController::class;
$classInstance = new $class;

\OpenSoutheners\ExtendedPhp\Classes\class_from($class);
// 'App\Http\Controllers\MyController'

\OpenSoutheners\ExtendedPhp\Classes\class_from($classInstance);
// 'App\Http\Controllers\MyController'
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky