Giter VIP home page Giter VIP logo

Comments (4)

maglnet avatar maglnet commented on September 20, 2024

could you please provide your composer.json file?

  1. No, sadly not at the moment
  2. We need to scan all autoloaded files, but there may be a misconfigured autoload section, so I'd like to check the composer.json
  3. Afaik, not now, but files that are not required by your application or not in the autoload section should not be parsed. Test-Files, like listed in the output should be in autoload-dev and not be parsed.

from composerrequirechecker.

Levivb avatar Levivb commented on September 20, 2024

composer.json is as following:

{
  "name": "laravel-modules/boilerplate",
  "description": "",
  "license": "proprietary",
  "require": {
    "php": ">=7.2.0",
    "laravel-modules/core": "^4.0"
  },
  "require-dev": {
    "codedungeon/phpunit-result-printer": "^0.24.1",
    "internations/http-mock": "^0.12.1",
    "jakub-onderka/php-console-highlighter": "^0.3.2",
    "jakub-onderka/php-parallel-lint": "^1.0",
    "localheinz/composer-normalize": "^1.1",
    "maximum/code-sniffer-rules": "^2.0",
    "mockery/mockery": "^1.2",
    "phpunit/phpunit": "^7.5",
    "sensiolabs/security-checker": "^5.0"
  },
  "config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "sort-packages": true
  },
  "extra": {
    "laravel": {
      "providers": [
        ...
      ]
    }
  },
  "autoload": {
    "psr-4": {
      "Modules\\Boilerplate\\": ""
    }
  },
  "repositories": [
    {
      "type": "composer",
      "url": "[FILTERED]",
      "options": {
        "http": {
          "header": [
            "X-TOKEN: [FILTERED]"
          ]
        }
      }
    }
  ],
  "scripts": {
    "fix-style": "vendor/bin/phpcbf --standard=phpcs.xml",
    "lint": "vendor/bin/parallel-lint --exclude vendor . --colors",
    "security-checker": "vendor/bin/security-checker security:check composer.lock",
    "style": "vendor/bin/phpcs --standard=phpcs.xml"
  }
}

laravel-modules/core is a company package with the following composer.json:

{
  "name": "laravel-modules/core",
  "description": "",
  "license": "proprietary",
  "require": {
    "php": ">=7.2.0",
    "ext-json": "*",
    "ext-simplexml": "*",
    "dimsav/laravel-translatable": "^9.2",
    "doctrine/dbal": "^2.7",
    "guidocella/eloquent-insert-on-duplicate-key": "^2.2",
    "guzzlehttp/guzzle": "^6.3",
    "laracasts/utilities": "^3.0",
    "laravel/framework": "5.7.*",
    "laravel/horizon": "^3.0",
    "laravel/telescope": "^1.0",
    "maatwebsite/laravel-sidebar": "~2.1",
    "maximum/laravel-modules": "^3.3",
    "nanigans/single-table-inheritance": "^0.8.7",
    "owen-it/laravel-auditing": "^8.0",
    "predis/predis": "^1.1",
    "renatomarinho/laravel-page-speed": "^1.8",
    "rtconner/laravel-tagging": "^3.0",
    "sentry/sentry-laravel": "^0.11",
    "sofa/eloquence": "^5.6",
    "spatie/laravel-analytics": "^3.6",
    "stevenmaguire/laravel-middleware-csp": "~0.1",
    "tymon/jwt-auth": "0.5.*",
    "zizaco/entrust": "^1.9"
  },
  "require-dev": {
    "codedungeon/phpunit-result-printer": "^0.24.1",
    "internations/http-mock": "^0.12.1",
    "jakub-onderka/php-console-highlighter": "^0.3.2",
    "jakub-onderka/php-parallel-lint": "^1.0",
    "localheinz/composer-normalize": "^1.1",
    "maximum/code-sniffer-rules": "^2.0",
    "mockery/mockery": "^1.2",
    "phpunit/phpunit": "^7.5",
    "sensiolabs/security-checker": "^5.0"
  },
  "config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "sort-packages": true
  },
  "extra": {
    "laravel": {
      "providers": [
        ...
      ],
      "aliases": {
        ...
      }
    }
  },
  "autoload": {
    "psr-4": {
      "Modules\\Core\\": ""
    },
    "files": [
      "Helpers/global_functions.php"
    ]
  },
  "repositories": [
    {
      "type": "composer",
      "url": "[FILTERED]",
      "options": {
        "http": {
          "header": [
            "X-TOKEN: [FILTERED]"
          ]
        }
      }
    }
  ],
  "scripts": {
    "fix-style": "vendor/bin/phpcbf --standard=phpcs.xml",
    "lint": "vendor/bin/parallel-lint --exclude vendor . --colors",
    "security-checker": "vendor/bin/security-checker security:check composer.lock",
    "style": "vendor/bin/phpcs --standard=phpcs.xml"
  }
}

the package with the syntax error seems to be jakub-onderka/php-parallel-lint

from composerrequirechecker.

maglnet avatar maglnet commented on September 20, 2024

The "Problem" in this case are the autoload sections. They cause composer-require-checker to parse ALL files within the root directory.

There should be a subfolger with your php files, like "src" or whatever you like to call it, and your autoload-sections should only point to this directory.

  "autoload": {
    "psr-4": {
      "Modules\\Boilerplate\\": ""
    }
  },

and

  "autoload": {
    "psr-4": {
      "Modules\\Core\\": ""
    },
    "files": [
      "Helpers/global_functions.php"
    ]
  },

from composerrequirechecker.

Levivb avatar Levivb commented on September 20, 2024

Thanks for getting back to me. Due to a holiday I wasn't able to respond any sooner.

It seems you'r right, putting files in a src directory does fix the issue.

packages mentioned here are Modules loaded by nwidart/laravel-modules
It's gonna be a bit of a challenge to get those packages working in a sub-directory, since they contain some legacy code with hardcoded paths (I know, I know) and I'm also not sure how the laravel-modules package will respond to those changes. I'll put it on my backlog for now since it's quite a major overhaul

Thanks for helping me understand this one anywaay!

from composerrequirechecker.

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.