4

I have installed php-ds extension as shown here. But I am unable to Load the DS namespace in PhpStorm.

How can I do this?

1
  • 1
    You need stub files in order for PhpStorm to understand what DS offers (classes/functions/etc). Stub file is basically a PHP version of that -- just "declaration/documentation" part -- e.g. function declarations but with empty bodies. You can either make your own ... or find some existing ones (if somebody else did it already, of course). A bit more on stub files in general: 1) stackoverflow.com/a/15775431/783119 2) stackoverflow.com/a/30329412/783119 Commented May 2, 2017 at 11:19

1 Answer 1

10

You need stub files in order for PhpStorm to understand what DS (a PHP extension written in C) offers (classes/functions/etc).

Stub file is basically a PHP version of that -- just "declaration/documentation" part -- e.g. function declarations but with empty bodies. You can either make your own ... or find some existing ones (if somebody else did it already, of course).

A bit more on stub files in general:


So .. basically what you need is php-ds/polyfill -- "You should also include the polyfill in your project for compatibility and IDE integration" .

IDE will read such files and will understand what real DS extension has to offer/what it does (type of parameters/returns/etc).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.