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

FPDI: class names not replaced in sibling dependencies #128

Open
BrianHenryIE opened this issue Mar 24, 2021 · 2 comments
Open

FPDI: class names not replaced in sibling dependencies #128

BrianHenryIE opened this issue Mar 24, 2021 · 2 comments

Comments

@BrianHenryIE
Copy link
Contributor

BrianHenryIE commented Mar 24, 2021

FPDI, whose class extends FPDF, does not declare the FDPF library as a requirement in its composer.json. Its official documentation says to require both libraries alongside each other like below.

{
  "require": {
    "setasign/fpdf": "1.8",
    "setasign/fpdi": "2.3"
  },
  "require-dev": {
    "coenjacobs/mozart": "dev-master#3b1243ca8505fa6436569800dc34269178930f39"
  },
  "extra": {
    "mozart": {
      "dep_namespace": "Mozart\\PSR_04\\",
      "dep_directory": "/Mozart/PSR_04/",
      "classmap_prefix": "Mozart_",
      "classmap_directory": "/Mozart/Classes/",
      "delete_vendor_directories": false
    }
  }
}

Expected Mozart/PSR_04/setasign/Fpdi/FpdfTpl.php (line 18) to extend \Mozart_FPDF but it still just extends \FPDF.

While the correct place to fix this would normally be in the FPDI repo, I'm posting here in the hope there is a way to define a package inside my own composer.json in a way that Mozart would handle this. The lack of FPDF requirement is by design in FPDI:

FPDI is ... in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined.

Changing to the following results in FPDF being installed to vendor, but not processed by Mozart.

{
  "repositories": [
    {
      "type": "package",
      "package": {
        "name": "setasign/fpdi",
        "require": {
          "setasign/fpdf": "1.8"
        },
        "version": "2.3",
        "source": {
          "url": "https://github.com/Setasign/FPDI",
          "type": "git",
          "reference": "master"
        }
      }
    }
  ],
  "require": {
    "setasign/fpdi": "*"
  },
...
@noplanman
Copy link

I'm running into a similar problem with symfony/css-selector and symfony/dom-crawler.

Is there a way to process all siblings?

@BrianHenryIE Did you find a solution for this?

@BrianHenryIE
Copy link
Contributor Author

@noplanman I forked Mozart, it's a little different but probably resolves your issue: http://github.com/brianhenryie/strauss

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

2 participants