Giter Club home page Giter Club logo

Comments (9)

Ocramius avatar Ocramius commented on July 29, 2024

@wiryonolau could you provide more details? What is happening exactly?

from laminas-form.

wiryonolau avatar wiryonolau commented on July 29, 2024

Hi we use this individually. Most of our project are still in 7.4. We using PHP-DI to load all dependency
before we only load view_helpers, so everything is normal.

We just start implement loading abstract factory similar to servicemanager
On loading the dependency it break on AttributeBuilder::__construct() since it always requested PHP8

from laminas-form.

Ocramius avatar Ocramius commented on July 29, 2024

Yes, but what is the exception (with trace), and what is the code (on your end) causing it?

from laminas-form.

wiryonolau avatar wiryonolau commented on July 29, 2024

On unittest only this error
PHP 8.0 or newer is required when using PHP attributes. You are running PHP 7.4.29.
Undefined index: FormAttributeBuilder

ERROR :
No entry or class found for 'FormAttributeBuilder' ( this is from PHP-DI )

from laminas-form.

Ocramius avatar Ocramius commented on July 29, 2024

Seems like you may want to report this on PHP-DI then, since the attributes are not used in this component, unless you explicitly use an attribute builder.

Closing here, since it's not a bug of laminas/laminas-form

from laminas-form.

wiryonolau avatar wiryonolau commented on July 29, 2024

Does __construct() not called by servicemanager ?

from laminas-form.

wiryonolau avatar wiryonolau commented on July 29, 2024
# ConfigProvider.php

<?php
public function getDependencyConfig(): array
    {
        return [
            'abstract_factories' => [
                FormAbstractServiceFactory::class,
            ],
            'aliases'            => [
                Annotation\AnnotationBuilder::class => 'FormAnnotationBuilder',
                Annotation\AttributeBuilder::class  => 'FormAttributeBuilder',
                FormElementManager::class           => 'FormElementManager',
            ],
            'factories'          => [
                'FormAnnotationBuilder' => Annotation\BuilderAbstractFactory::class,
                'FormAttributeBuilder'  => Annotation\BuilderAbstractFactory::class,
                'FormElementManager'    => FormElementManagerFactory::class,
            ],
        ];
    }

FormAttributeBuilder never get called in here ?

from laminas-form.

Ocramius avatar Ocramius commented on July 29, 2024

It gets fetched (via factory) if you want to use it directly - you'd still need to get it from a configured servicemanager.

from laminas-form.

wiryonolau avatar wiryonolau commented on July 29, 2024

Ok my problem is in my unittest, cause I checking all registered service for any error or circular dependency. Guess the FormAttributeBuilder get called by it.

Wish they create a specific Exception for detecting PHP Version 8, instead of just throwing a generic Exception

from laminas-form.

Related Issues (20)

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.