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 3, 2024 via composer

nette/php-generator v4.1.2

🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.3 features.
Package summary
Share
2
issues
2
high severity
license
2
1
license
2
(BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only)
Package created
20 Mar 2014
Version published
29 Oct 2023
Maintainers
1
Total deps
2
Direct deps
1
License
BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only

Issues

2

2 high severity issues

high
Recommendation: Validate that the license expression complies with your license policy
via: nette/php-generator@v4.1.2
Recommendation: Validate that the license expression complies with your license policy
via: nette/utils@v4.0.4
Collapse
Expand

Licenses

(BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only)

Expression
2 Packages, Including:
nette/php-generator@v4.1.2
nette/utils@v4.0.4
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 nette/php-generator 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
nette/utilsv4.0.461.98 kB(BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only)
prod
1

Visualizations

Frequently Asked Questions

What does nette/php-generator do?

Nette PHP Generator is a convenient tool for developers, helping you generate neat and precise PHP code with ease. It supports the latest PHP features such as enums, attributes, and existing classes modification, among others. With the ability to structure the code for classes, functions, PHP files, and more according to the developer's guidelines, this PHP code generator is highly efficient and mature. The library outputs stable and PSR-12 compliant code, making it a widely used tool for developers.

How do you use nette/php-generator?

To use Nette PHP Generator, you need to install it by using the following command:

composer require nette/php-generator

After the installation, you can utilize its functionalities in your PHP code. Here's a sample code usage:

$class = new Nette\PhpGenerator\ClassType('Demo');
$class->setFinal()
	->setExtends(ParentClass::class)
	->addImplement(Countable::class)
	->addComment("Description of class.\nSecond line\n")
	->addComment('@property-read Nette\Forms\Form $form');
echo $class;

This will generate the following PHP code:

/**
 * Description of class.
 * Second line
 *
 * @property-read Nette\Forms\Form $form
 */
final class Demo extends ParentClass implements Countable
{
}

Additional functionalities such as creating enums, setting up printers, defining types, adding attributes, and many more can be explored as well in reference to the documentation.

Where are the nette/php-generator docs?

The documentation for nette/php-generator is available on the library's website at https://doc.nette.org/php-generator. The documentation covers all topics related to the PHP generator such as classes, interfaces, traits, enums, anonymous classes, global functions, closures, arrow functions, method and function signature, printers, and PSR compliance, types, literals, attributes, and many more. Through the documentation, developers can find all the information they need to utilize the PHP generator most efficiently.