I am following the installation instructions here to install PHP RAML Parser
I run composer install and created the index.php below but it isn't working, I get an error:
Class 'Raml\ParseConfiguration' not found in /cygdrive/c/src/myapp/Raml/Parser.php on line 83
When I hover over the line use \Raml\Parser I get the PHPStorm warning message (Alias never used)
My index.php:
<?php
require ('Raml/Parser.php');
use \Raml\Parser; // Alias \Raml\Parser is never used
$parser = new \Raml\Parser();
Can anyone suggest what I've done wrong?
Provided that the file
Raml/Parser.phpcontains:You can either do this:
or this:
useimports a class/interface/trait into your current namespace and allows to use a shorter name instead of the fully qualified, backspaced name. It also allows to switch to a different class by only changing theusestatement, and not every name reference in the whole class, but this benefit is very small because using PHPStorm brings some powerful renaming abilities itself.