Download the PHP package wearegenuine/gnorm-twig without Composer
On this page you can find all versions of the php package wearegenuine/gnorm-twig. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wearegenuine/gnorm-twig
More information about wearegenuine/gnorm-twig
Files in wearegenuine/gnorm-twig
Package gnorm-twig
Short Description Supplemental library for compiling Gnorm Twig files.
License MIT
Informations about the package gnorm-twig
Gnorm Twig
Implements the Twig functionality used by Genuine's Gnorm framework.
Overview
Gnorm Twig is a supplemental library for compiling Gnorm Twig files, providing various Twig filter implementations and a compiler script.
Installation
To install the project, clone the repository and run the following command to install dependencies:
Dependencies
The project requires the following:
- PHP: ^7.4 || ^8.0
- ext-json: *
- twig/twig: ^2.15.3 || ^3.5.0
For development:
- phpcompatibility/php-compatibility: ^9.3
- phpstan/phpstan: ^1.9
- squizlabs/php_codesniffer: ^3.6
- phpunit/phpunit: ^9.5
Configuration
The project uses several configuration files:
.ddev/config.yaml
: Configuration for the development environment.composer.json
: Lists project dependencies and autoloading information.phpcs.xml.dist
: Configuration for PHP CodeSniffer.phpstan.neon.dist
: Configuration for PHPStan.phpunit.xml.dist
: Configuration for PHPUnit.
Usage
To compile Twig files, use the bin/compile.php
script. It requires a JSON-encoded configuration and a build flag:
Development
Coding Standards
The project follows PSR-12 coding standards. Use PHP CodeSniffer to check for compliance:
Static Analysis
Use PHPStan for static analysis:
Testing
The project uses PHPUnit for unit testing. To run the tests, use the following command:
Test files are located in the tests
directory and follow the naming convention *Test.php
.
Contributing
Contributions are welcome! Please follow the coding standards, ensure all tests pass, and add new tests for new functionality before submitting a pull request.
Additional Information
- The
GnormCompiler
class implements theCompilerInterface
and is responsible for compiling Twig files. It uses theGnormTwigConfiguration
class to decode JSON configurations. - The
FedExtensions
andDrupal
classes provide custom Twig extensions, filters, and functions. - The
FileSystemTraversal
class provides methods to traverse the file system to find specific directories or files. -
The
.gitignore
file includes common directories and files to be ignored, such as/vendor
,/node_modules
, and log files. - Unit tests have been added to ensure the reliability and correctness of the codebase.
For more detailed information on each component, refer to the respective source files in the src
directory and test files in the tests
directory.