mtarld / symbok-bundle Goto Github PK
View Code? Open in Web Editor NEWSymfony annotations bundle
License: MIT License
Symfony annotations bundle
License: MIT License
For now, each configuration field has to be specified.
It should work even if one field is not specified
Does this bundle support PHP 8? I was able to install it and use the basic functionality using --ignore-platform-reqs
, but it would be nice if the bundle could be specified to support PHP 8.
Add configuration in order to enable/disable class compilation caching depending on Symfony environment:
Something like:
cache:
env:
prod: true
dev: true
test: false
Add composer scripts to make development easier
Hi, i found a problem when using interfaces in the same namespace as model namespace given for symbook. Example:
App\DataForm\Domain\Model\FormTemplate -> implements FormTemplateInterface
App\DataForm\Domain\Model\FormTemplateInterface
with configuration:
symbok:
namespaces:
- 'App\DataForm\Domain\Model'
Treats interface as class instance even if it not annotated with symbok. I get exception:
Mtarld\SymbokBundle\Exception\CodeFindingException: No class found
vendor/mtarld/symbok-bundle/src/Finder/PhpCodeFinder.php:94
vendor/mtarld/symbok-bundle/src/Factory/ClassFactory.php:56
vendor/mtarld/symbok-bundle/src/Compiler/RuntimeClassCompiler.php:44
vendor/mtarld/symbok-bundle/src/Replacer/RuntimeClassReplacer.php:51
vendor/mtarld/symbok-bundle/src/Replacer/RuntimeClassReplacer.php:41
vendor/mtarld/symbok-bundle/src/Cache/RuntimeClassCache.php:31
vendor/symfony/config/ConfigCacheFactory.php:46
vendor/mtarld/symbok-bundle/src/Cache/RuntimeClassCache.php:32
vendor/mtarld/symbok-bundle/src/Autoload/Autoloader.php:67
vendor/symfony/error-handler/DebugClassLoader.php:347
var/cache/test/symbok/App/DataForm/Domain/Model/FormTemplate.php:15
vendor/mtarld/symbok-bundle/src/Autoload/Autoloader.php:68
vendor/symfony/error-handler/DebugClassLoader.php:347
tests/DataForm/Domain/Model/FormTemplateTest.php:15
If i remove FormTemplateInterface completly error is gone.
Hi,
I am confused if symbok-bundle does work with Fixtures classes or I did something wrong?
Hi,
Has this bundle been tested by anyone using static analysis tools like phan
and phpstan
?
I was just wondering because we use this and would hate to find out at a later stage that this bundle would break the analysis procedure.
Thanks in advance!
Add general configuration using config yaml symfony files.
Such as 'are properties nullable by default' or 'are setters fluent by default ?'
The Bundle breaks with symfony 4.4 because the AutoloadService tries to use Symfony\Component\Debug\DebugClassLoader
which was replaced by Symfony\Component\ErrorHandler\DebugClassLoader
in Symfony 4.4
I think the best way to fix this is to check for both for now until the old class is removed to provide backwards compatibility.
Warning: filemtime(): stat failed for /app/vendor/mtarld/symbok-bundle/Cache/PhpFileCache.php(34) : eval()'d code
This also happens when caching is disabled.
Example Docblock
/**
* Customer
*
* @RecordChangeLoggable
* @ApiResource
* @ORM\Table(name="customers", indexes={@ORM\Index(name="salesRepEmployeeNumber", columns={"salesRepEmployeeNumber"})})
* @ORM\Entity
*/
Stacktrace (json)
scratch_1.txt
I think its because it gets translated to this :
/**
* Customer
*
* @Surplex\PhpComponent\RecordChangeLoggerBundle\Components\Annotations\RecordChangeLoggable
* @ApiPlatform\Core\Annotation\ApiResource
* @Doctrine\ORM\Mapping\Table (name="customers", indexes={@ORM\Index (name="salesRepEmployeeNumber", columns={"salesRepEmployeeNumber"})})
* @Doctrine\ORM\Mapping\Entity
*/
The nested @ORM\Index
does not get replaced for the FQDN
I tried installing the newest dev version to solve the issues I encountered with Symfony4, unfortunately it seems to be not compatible with Vich\UploaderBundle.
My Entity has the Vich\UploaderBundle\Mapping\Annotation\Uploadable annotation on the class as is required by the other bundle but after installing symbok the annotation seems to be removed:
The class "App\Entity\Advertisement" is not uploadable. If you use annotations to configure VichUploaderBundle, you probably just forgot to add `@Vich\Uploadable` on top of your entity. If you don't use annotations, check that the configuration files are in the right place. In both cases, clearing the cache can also solve the issue.
My class looks like this:
/**
* @ORM\Entity(repositoryClass="App\Repository\AdvertisementRepository")
* @Data(fluent=true)
* @Vich\Uploadable()
*/
class Advertisement
{
...properties here
}
When we use global annotations from third party library such as @SuppressWarnings
from PHPMD,
this causes following error on compilation:
[Semantical Error] The annotation "@App\Entity\SuppressWarnings" in does not exist, or could not be auto-loaded.
It's because src/Parser/DocBlockParser/Formatter.php
is wrongly prepending Symbok's namespace.
Should be fixed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.