This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271117 - Allow adding vendor to php include path
Summary: Allow adding vendor to php include path
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Composer (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-18 08:43 UTC by twifty
Modified: 2017-07-18 09:01 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description twifty 2017-07-18 08:43:43 UTC
A typical php project may be layed out as:

'project'
   'src/'
   'tests/'
   'nbproject/'
   '.git/'
   'vendor/'
   'conposer.json'

When netbeans is configured with '/project/src' as the source directory, all files within the vendor directory are excluded from the include path. This effectively renders the autocomplete useless for vendor code.

The IDE will not allow us to add '/vendor' to the include path. It complains with "already part of project".

This can be fixed by setting the source to '/project' but this has its own problems. Often code within '/vendor' has errors (PHPUnit and php-cs-fixer for example). These errors mark the whole project as having errors. Also code within '/project/tests' will be displayed in the autocomplete, which is not what we want.
Comment 1 twifty 2017-07-18 09:01:32 UTC
A workaround is to manually add the vendor directory to the 'nbproject/project.properties' file.

Here is an example:

auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_create_2e_tests=false
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_enabled=false
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_path=bootstrap.php
auxiliary.org-netbeans-modules-php-phpunit.configuration_2e_enabled=true
auxiliary.org-netbeans-modules-php-phpunit.configuration_2e_path=phpunit.xml
auxiliary.org-netbeans-modules-php-phpunit.customSuite_2e_enabled=false
auxiliary.org-netbeans-modules-php-phpunit.customSuite_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.phpUnit_2e_enabled=false
auxiliary.org-netbeans-modules-php-phpunit.phpUnit_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.test_2e_groups_2e_ask=false
auxiliary.org-netbeans-modules-php-phpunit.test_2e_run_2e_all=false
auxiliary.org-netbeans-modules-php-phpunit.test_2e_run_2e_phpunit_2e_only=false
code.analysis.excludes=
file.reference.HuddlerBundle-tests=tests
file.reference.vendor=vendor
ignore.path=
include.path=\
    ${php.global.include.path}:\
    ${file.reference.vendor}
php.version=PHP_70
source.encoding=UTF-8
src.dir=src
tags.asp=false
tags.short=false
test.src.dir=${file.reference.HuddlerBundle-tests}
testing.providers=PhpUnit
web.root=.