New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const array causing "value definition is empty"error #774

Closed
dylangrech92 opened this Issue Jan 18, 2017 · 6 comments

Comments

Projects
None yet
8 participants
@dylangrech92

dylangrech92 commented Jan 18, 2017

As mentioned in #576 having a constant of type array causes the generator to break. This issue has not been resolved yet.

Example:

<?php

class MyClass{
    const SAMPLE = '1,2,3'; // OK!
    const MY_CONSTANT = array(1, 2, 3); // Generator breaks
}
@michallohnisky

This comment has been minimized.

Show comment
Hide comment
@michallohnisky

michallohnisky commented Mar 24, 2017

+1

2 similar comments
@Blizqery

This comment has been minimized.

Show comment
Hide comment
@Blizqery

Blizqery commented Mar 24, 2017

+1

@jankal

This comment has been minimized.

Show comment
Hide comment
@jankal

jankal Mar 24, 2017

Contributor

+1

Contributor

jankal commented Mar 24, 2017

+1

@ek9 ek9 added the PHP 7 label Mar 27, 2017

@ek9 ek9 added this to the 5.0 milestone Mar 27, 2017

@ek9 ek9 referenced this issue Apr 4, 2017

Closed

PHP 7 support #635

@TomasVotruba TomasVotruba removed this from the 5.x milestone Apr 12, 2017

@mcdanci

This comment has been minimized.

Show comment
Hide comment
@mcdanci

mcdanci Apr 13, 2017

+1, while using ApiGen version 4.1.0, it reports Value definition is empty.

With code as the follow.

namespace Common\Model;

abstract class RelationModel extends \Think\Model\RelationModel
{
    const DESC = 'DESC';
    const ORDER_CREATED_TIME = ['createdtime' => self::DESC];
}

mcdanci commented Apr 13, 2017

+1, while using ApiGen version 4.1.0, it reports Value definition is empty.

With code as the follow.

namespace Common\Model;

abstract class RelationModel extends \Think\Model\RelationModel
{
    const DESC = 'DESC';
    const ORDER_CREATED_TIME = ['createdtime' => self::DESC];
}
@joshbruce

This comment has been minimized.

Show comment
Hide comment
@joshbruce

joshbruce commented Apr 14, 2017

+1

@TomasVotruba

This comment has been minimized.

Show comment
Hide comment
@TomasVotruba

TomasVotruba Jun 1, 2017

Contributor

@mcdanci Thanks for the report. It fails on

foreach ($this->betterClassReflection->getConstants() as $name => $value) {

// Roave\BetterReflection\Reflection\ReflectionClass $betterClassReflection
$betterClassReflection->getConstants();

Please report that in https://github.com/Roave/BetterReflection/issues, as we can't do anything about that here.

Contributor

TomasVotruba commented Jun 1, 2017

@mcdanci Thanks for the report. It fails on

foreach ($this->betterClassReflection->getConstants() as $name => $value) {

// Roave\BetterReflection\Reflection\ReflectionClass $betterClassReflection
$betterClassReflection->getConstants();

Please report that in https://github.com/Roave/BetterReflection/issues, as we can't do anything about that here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment