Closed viccherubini closed 9 years ago
Always run composer self-update
before you do anything else. What PHP Version are you on? This shouldn't happen, you shouldn't need to rename any files, PSR-4 doesn't require the filename to be anything specific.
I'm using the latest version of Composer. And I tested on PHP 5.5.20 on OSX and PHP 5.6.5 on Ubuntu 12.04 64bit.
This is very weird. I can reproduce it but it doesn't make sense. It should work. Need to investigate. Maybe it's even a composer bug which I would normally strongly doubt.
I have read a bit about psr-4 and it seems like the library is slightly in the wrong. I believe the rename is the correct thing to do. This is the most clear article I have found on the subject: http://www.sitepoint.com/battle-autoloaders-psr-0-vs-psr-4/
My knowledge of the PSR's is pretty limited but I think the class name and file name need to match.
I guess I was wrong about psr-4. Only strange that it worked for me so far that way. I'll try to find some time to find out why.
@leftnode @markushausammann I will try to get a PR up for this this week if you don't beat me to it.
PR up!
@leftnode Can you try Version 1.1.0 and let me know if you run into the same problems?
@janxious you'll need to tag a release before that, just in case.
Derp. That is done, and also added one for 1.0.1.
May have to do a new release, this one is missing a few things:
PHP Notice: Undefined variable: config in /Users/vic/Development/utilities/docs/vendor/expectedbehavior/php-docraptor/src/HttpClient.php on line 46
PHP Fatal error: Call to a member function getReportUserAgent() on a non-object in /Users/vic/Development/utilities/docs/vendor/expectedbehavior/php-docraptor/src/HttpClient.php on line 46
Updated the call to $config
on line 46 to be $this->config
and updated the call to userAgent()
on line 47 to be $this->userAgent()
(both in HttpClient.php
). Everything else worked from there.
Was running into issues where our tests are not actually testing the HTTPClient
directly. There is a new version 1.1.1 that should resolve the issue. I have also deleted the 1.1.0 tag since that was no good.
Just pulled in 1.1.1
and was able to build a document correctly. Thanks!
:+1: Good to hear! I really appreciate your patience, and I am sorry for taking so much of your time.
Hah, no problem at all - glad it got worked out.
I'm using Composer version
1.0-dev 69210d5bc130f8cc9f96f99582a041254d7b9833 2015-05-25 13:29:26
and theApiWrapper
class can not be found using the autoloader.First, I downloaded Composer from getcomposer.org and then ran the following command:
This created a
composer.json
file that looks like this:I copied the sample code from the README into this file:
When running this, I get the following error:
If I go into the
vendor/expectedbehavior/php-docraptor/src/
directory and renameDocRaptor.php
toApiWrapper.php
it works fine.Am I missing something with my Composer file, or does PSR-4 expect the class and file to have the same name?