Giter Site home page Giter Site logo

symbok-bundle's Issues

PHP 8 support

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.

Interfaces skip

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.

Usage of static analysis tools

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

Add general configuration using config yaml symfony files.
Such as 'are properties nullable by default' or 'are setters fluent by default ?'

Bundle is not compatible with Symfony 4.4

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.

Compiling Fails on nested Annotations

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

Bundle version 2.x causes @Vich\Uploadable annotation on entity to be removed

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
}

Non-standard global annotations make compilation failing

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.