Skip to content
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

The tag "@ 添加" does not seem to be wellformed, please check it for errors #526

Closed
hepeichun opened this issue Jan 21, 2021 · 10 comments
Closed

Comments

@hepeichun
Copy link

Bug report

Question Answer
Box version Box version 3.11.1@83567c4
PHP version PHP 7.4.13 (cli) (built: Dec 29 2020 17:12:50) ( NTS )
Platform with version Windows WSL2
Github Repo -
ERROR :

In StandardTagFactory.php line 188:
                                                                               
  The tag "@ 添加" does not seem to be wellformed, please check it for errors  
                                                                               

compile [-c|--config CONFIG] [--debug] [--no-parallel] [--no-restart] [--dev] [--no-config] [--with-docker] [-d|--working-dir WORKING-DIR]
box.json
{
 "main": "bin/ns.php",
 "output": "build/ns.phar",
 "directories": [
   "bin",
   "bootstrap",
   "brand",
   "commands",
   "config",
   "eventListener",
   "extend",
   "functions",
   "helper",
   "interfaces",
   "module",
   "public"
 ],
 "files-bin": [
   ".env.default"
 ],
 "finder": [
   {
     "notName": "/LICENSE|.*\\.md|.*\\.dist|composer\\.json|composer\\.lock/",
     "exclude": [
       "doc",
       "docs",
       "test",
       "test_old",
       "tests",
       "vendor-bin"
     ],
     "in": "vendor"
   },
   {
     "name": "composer.json",
     "in": "."
   }
 ],
 "compression": "NONE",
 "compactors": [
   "KevinGH\\Box\\Compactor\\Json",
   "KevinGH\\Box\\Compactor\\Php"
 ],
 "git": "git",
 "git-commit": "git_commit",
 "datetime": "datetime"
}
Output
$ vendor/bin/box compile
> 
   ____
  / __ )____  _  __
 / __  / __ \| |/_/
/ /_/ / /_/ />  <
/_____/\____/_/|_|


Box version 3.11.1@83567c4

// Loading the configuration file "/mnt/d/www/ns/box.json".

�  Building the PHAR "/mnt/d/www/ns/build/ns.phar"

? Setting replacement values
 + @git@: 0.0.3
 + @git_commit@: e31716f6e808c01accbfe15894cf646de991e632
 + @datetime@: 2021-01-21 08:02:46 UTC
? Registering compactors
 + KevinGH\Box\Compactor\Json
 + KevinGH\Box\Compactor\Php
? Adding main file: /mnt/d/www/ns/bin/ns.php
? Adding requirements checker
? Adding binary files
   > 1 file(s)
? Auto-discover files? No
? Exclude dev files? Yes
? Adding files

In StandardTagFactory.php line 188:
                                                                              
 The tag "@ 添加" does not seem to be wellformed, please check it for errors  
                                                                              

compile [-c|--config CONFIG] [--debug] [--no-parallel] [--no-restart] [--dev] [--no-config] [--with-docker] [-d|--working-dir WORKING-DIR]

@theofidry
Copy link
Member

theofidry commented Jan 21, 2021

Hi,

It's unfortunately a bit hard to tell from the stack trace alone, would it be possible to know what the code of this StandardTagFactory.php looks like before and after? You can extract your PHAR with extract or use --debug to have a dump of everything the code that is going to be bundled in the PHAR in a .box_dump directory

@Jeckerson
Copy link

Jeckerson commented Jan 25, 2021

Getting similar error:

The tag "@todo, injecting globals, initialize to null and check first?" does not seem to be wellformed, please check it for errors

The tag "@internal, use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait instead." does not seem to be wellformed, please check it for errors

This file is from phpdocumentor/reflection-docblock package

https://github.com/phpDocumentor/ReflectionDocBlock/blob/e3324ecbde7319b0bbcf0fd7ca4af19469c38da9/src/DocBlock/StandardTagFactory.php#L189

@hepeichun
Copy link
Author

Hi,

It's unfortunately a bit hard to tell from the stack trace alone, would it be possible to know what the code of this StandardTagFactory.php looks like before and after? You can extract your PHAR with extract or use --debug to have a dump of everything the code that is going to be bundled in the PHAR in a .box_dump directory

Sorry!
The Chinese New Year is approaching and we are very busy now.
I used the "humbug/box" version of "3.10.0" to solve this problem.
I will be free in a few days, and I will look for problems and post them.

@hepeichun
Copy link
Author

Getting similar error:

The tag "@todo, injecting globals, initialize to null and check first?" does not seem to be wellformed, please check it for errors

The tag "@internal, use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait instead." does not seem to be wellformed, please check it for errors

This file is from phpdocumentor/reflection-docblock package

https://github.com/phpDocumentor/ReflectionDocBlock/blob/e3324ecbde7319b0bbcf0fd7ca4af19469c38da9/src/DocBlock/StandardTagFactory.php#L189

Thank you for your help

@villfa
Copy link
Contributor

villfa commented Jan 26, 2021

@jdkysq according the error message there is a space after @. It is probably the root of your problem.

@villfa
Copy link
Contributor

villfa commented Jan 26, 2021

@Jeckerson your tags are also considered as malformed because of the trailing comma in their name. Remove them and it should be fine.

@Jeckerson
Copy link

Jeckerson commented Jan 26, 2021

@villfa yes, I already did it. But there are packages that also contains invalid tags, which means that with some specific packages inside composer.json it won't be possible to compile .phar file...

But I see that there is an open PR to fix/ignore that.

@theofidry
Copy link
Member

If possible it would be nicer to not bail on it and just ignore the (malformed) tag; after all it's only for a minor performance optimization

@hepeichun
Copy link
Author

@jdkysq according the error message there is a space after @. It is probably the root of your problem.

Thank you for your help.
I found this bug, it is in the third-party composer.
@theofidry

@hepeichun
Copy link
Author

To be precise, other people’s phpdocument is not standardized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants