Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 9, 2024 via composer

laminas/laminas-code 4.13.0

Extensions to the PHP Reflection API, static code scanning, and code generation
Package summary
Share
0
issues
1
license
1
BSD-3-Clause
Package created
1 Jan 2020
Version published
18 Oct 2023
Maintainers
1
Total deps
1
Direct deps
0
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
laminas/laminas-code@4.13.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of laminas/laminas-code 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does laminas/laminas-code do?

laminas/laminas-code is a powerful PHP package that works as an extension to PHP Reflection API, allowing static code scanning and code generation. Designed for developers who require object-oriented interfaces to generate or update existing code, laminas/laminas-code provides an versatile tool to create new code across a variety of tasks including generating PHP code, JavaScript, configuration files, Apache vhosts, and more. With its intricate design and easy adaptability, laminas/laminas-code caters to diverse coding requirements for PHP projects.

How do you use laminas/laminas-code?

To use laminas/laminas-code, one must first install the package using Composer. The command composer require laminas/laminas-code accomplishes this. After installation, you can leverage the functionalities of laminas/laminas-code per your project needs. Although the package is mostly implemented to generate PHP code, you can extend the base class for other tasks. Here's a simple PHP code generation example with laminas/laminas-code:

use Laminas\Code\Generator\ClassGenerator;
use Laminas\Code\Generator\MethodGenerator;

$classGenerator = new ClassGenerator();
$classGenerator->setName('MyClass')
            ->setMethods([
                new MethodGenerator(
                    'myMethod',
                    ['myParameter' => 'string'],
                    MethodGenerator::FLAG_PUBLIC,
                    'echo "Hello, World!";'
                ),
            ]);

echo $classGenerator->generate();

This will generate:

class MyClass
{
    public function myMethod($myParameter)
    {
        echo "Hello, World!";
    }
}

Where are the laminas/laminas-code docs?

Laminas/laminas-code's extensive documentation is available at https://docs.laminas.dev/laminas-code/, providing comprehensive insight into usage examples, classes, methods, and other resources related to the use of this package. Whether you need detailed guidance on how to use this package or are looking for knowledge on migrating from version 2 to version 3, laminas/laminas-code's documentation serves as a handy guide in your coding journey.