Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
This package has been abandoned. Use laminas/laminas-code instead.
Generated on May 17, 2024 via composer

zendframework/zend-code 3.4.1

Extensions to the PHP Reflection API, static code scanning, and code generation
Package summary
Share
2
issues
2
high severity
meta
2
1
license
2
BSD-3-Clause
Package created
7 Feb 2013
Version published
10 Dec 2019
Maintainers
1
Total deps
2
Direct deps
1
License
BSD-3-Clause

Issues

2

2 high severity issues

high
via: zendframework/zend-code@3.4.1
via: zendframework/zend-eventmanager@3.2.1
Collapse
Expand

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
2 Packages, Including:
zendframework/zend-code@3.4.1
zendframework/zend-eventmanager@3.2.1
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

1
All Dependencies CSV
β“˜ This is a list of zendframework/zend-code 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
zendframework/zend-eventmanager3.2.145.97 kBBSD-3-Clause
prod
1

Visualizations

Frequently Asked Questions

What does zendframework/zend-code do?

Zendframework/zend-code is a powerful tool that extends the PHP Reflection API, providing the capabilities of static code scanning and code generation. This package offers an object-oriented interface to generate arbitrary code to either create new code pieces or to update the existing ones. While it's primarily used for generating PHP code, developers can extend the base class to generate codes for other tasks such as JavaScript, configuration files, apache vhosts, and more.

How do you use zendframework/zend-code?

To use the zendframework/zend-code, you need first to install it via composer:

composer require zendframework/zend-code

Here's an example of how to generate a PHP Class using zend-code:

use Zend\Code\Generator\ClassGenerator;
use Zend\Code\Generator\MethodGenerator;

$generator = new ClassGenerator();
$generator->setName('MyClass')
    ->addMethodFromGenerator(MethodGenerator::fromArray([
        'name' => 'sayHello',
        'body' => 'return "Hello!";'
    ]));

echo $generator->generate();

This script will output:

class MyClass
{
    public function sayHello()
    {
        return "Hello!";
    }
}

Where are the zendframework/zend-code docs?

The complete documentation for zendframework/zend-code can be found at Zend Code Documentation. If you're migrating from version 2 to version 3, there's a dedicated section for that in the documentation which can be accessed at Zend Code Migration Documentation. For any issues or queries, navigate to the GitHub issue page of zendframework/zend-code.