open-code-modeling / php-filter
Common PHP filters for code generation
Installs: 1 001
Dependents: 4
Suggesters: 2
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 1
Requires
- php: ^7.4 || ^8.0
Requires (Dev)
- jangregor/phpstan-prophecy: ^0.8.0
- laminas/laminas-filter: ^2.9
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.5.0
- prooph/php-cs-fixer-config: ^v0.4.0
- psalm/plugin-phpunit: ^0.15.0
- roave/security-advisories: dev-master
- vimeo/psalm: ^4.4
Suggests
- laminas/laminas-filter: If you want to use the FilterFactory
This package is auto-updated.
Last update: 2024-12-06 19:34:08 UTC
README
Common PHP filters for code generation.
Installation
$ composer require open-code-modeling/php-filter --dev
If you want to use the FilterFactory
to get complete preconfigured filters install also laminas/laminas-filter
.
$ composer require laminas/laminas-filter
Usage
<?php use OpenCodeModeling\Filter; $filter = Filter\FilterFactory::classNameFilter(); ($filter)(' Add Building '); // AddBuilding $filter = Filter\FilterFactory::methodNameFilter(); ($filter)(' Add Building '); // addBuilding $filter = Filter\FilterFactory::propertyNameFilter(); ($filter)(' Add Building '); // addBuilding $filter = Filter\FilterFactory::constantNameFilter(); ($filter)(' Add Building '); // ADD_BUILDING $filter = Filter\FilterFactory::constantValueFilter(); ($filter)(' Add Building '); // add_building $filter = Filter\FilterFactory::namespaceToDirectoryFilter(); ($filter)('My\\App\\Service'); // My/App/Service $filter = Filter\FilterFactory::directoryToNamespaceFilter(); ($filter)('My/App/Service'); // My\\App\\Service